]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-usage.php
Fixes for sponsor admin area
[mailer.git] / inc / modules / admin / what-usage.php
index 3a17999e65bc0739a9662c7de7c5932bfa72b955..2b38b5b6b41ba266eef32215731b3a3b826578c1 100644 (file)
  ************************************************************************/
 
 // 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();
 //
 ?>