X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-usage.php;h=2b38b5b6b41ba266eef32215731b3a3b826578c1;hb=4111c233803817fc7c28d56cf3914f6478fa5c82;hp=3a17999e65bc0739a9662c7de7c5932bfa72b955;hpb=d18075f375db1b9db40773cdf80a5d6f2c36cd3a;p=mailer.git diff --git a/inc/modules/admin/what-usage.php b/inc/modules/admin/what-usage.php index 3a17999e65..2b38b5b6b4 100644 --- a/inc/modules/admin/what-usage.php +++ b/inc/modules/admin/what-usage.php @@ -32,19 +32,17 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // Add description as navigation point -ADD_DESCR("admin", basename(__FILE__)); +ADD_DESCR("admin", __FILE__); // Base directory (should be moved to database) $usage = "usage/"; -OPEN_TABLE("100%", "admin_content admin_content_align", ""); - if (!empty($_GET['image'])) { if ($_GET['type'] == "usage") { $file = sprintf("%s%susage.png", PATH, $usage); @@ -53,7 +51,7 @@ if (!empty($_GET['image'])) { $file = sprintf("%s%s%s_usage_%s.png", PATH, $usage, SQL_ESCAPE($_GET['type']), SQL_ESCAPE($_GET['image'])); } - if ((file_exists($file)) && (is_readable($file))) { + if (FILE_READABLE($file)) { $image = imagecreatefrompng($file); header("Content-type: image/png"); imagepng($image); @@ -61,7 +59,7 @@ if (!empty($_GET['image'])) { } exit(); } elseif (empty($_GET['usage'])) { - $file = PATH.$usage."index.html"; + $file = sprintf("%s%sindex.html", PATH, $usage); } else { $file = sprintf("%s%susage_%s.html", PATH, @@ -71,7 +69,7 @@ if (!empty($_GET['image'])) { } if (!empty($file)) { - if (file_exists($file) && is_readable($file)) { + if (FILE_READABLE($file)) { $tmpl_file = implode("", file($file)); $tmpl_file = addslashes($tmpl_file); $tmpl_file = "\$content=\"".$tmpl_file."\";"; @@ -97,6 +95,5 @@ if (!empty($file)) { } } -CLOSE_TABLE(); // ?>