All, except security block, include()/require() rewritten to own LOAD_INC()/LOAD_INC_...
[mailer.git] / inc / modules / admin / admin-inc.php
index 75f66ff5b26bf0958b128a3c6fffe0e38f0768c7..f729b1da8f2be747a38177661b185ff2fb4f0ef7 100644 (file)
@@ -349,10 +349,10 @@ LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__);
        if (SQL_NUMROWS($result_action) == 1) {
 
                // Is valid but does the inlcude file exists?
-               $INC = sprintf("%sinc/modules/admin/action-%s.php", PATH, $act);
+               $INC = sprintf("inc/modules/admin/action-%s.php", $act);
                if ((FILE_READABLE($INC)) && (VALIDATE_MENU_ACTION("admin", $act, $wht)) && (__ACL_ALLOW == true)) {
                        // Ok, we finally load the admin action module
-                       require($INC);
+                       LOAD_INC($INC);
                } elseif (__ACL_ALLOW == false) {
                        // Access denied
                        LOAD_TEMPLATE("admin_menu_failed", false, getMessage('ADMIN_ACCESS_DENIED'));
@@ -469,7 +469,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
                <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_menu_sub\">\n";
                                        while (list($wht_sub, $title_what, $desc_what) = SQL_FETCHROW($result_what)) {
                                                // Filename
-                                               $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $wht_sub);
+                                               $INC = sprintf("%sinc/modules/admin/what-%s.php", constant('PATH'), $wht_sub);
                                                if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
                                                        $ACL = ADMINS_CHECK_ACL("", $wht_sub);
                                                } else {
@@ -729,7 +729,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con
 // Generate a selection box
 function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default="") {
        // Open the requested menu directory
-       $handle = opendir(sprintf("%sinc/modules/%s/", PATH, $menu)) or mxchange_die("Cannot load menu ".$menu."!");
+       $handle = opendir(sprintf("%sinc/modules/%s/", constant('PATH'), $menu)) or mxchange_die("Cannot load menu ".$menu."!");
 
        // Init the selection box
        $OUT = "<select name=\"".$name."\" class=\"admin_select\" size=\"1\">\n <option value=\"\">".IS_TOP_MENU."</option>\n";
@@ -739,7 +739,7 @@ function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default="") {
                // Is this a PHP script?
                if (($file != ".") && ($file != "..") && ($file != "lost+found") && (strpos($file, "".$type."-") > -1) && (strpos($file, ".php") > 0)) {
                        // Then test if the file is readable
-                       $test = sprintf("%sinc/modules/%s/%s", PATH, $menu, $file);
+                       $test = sprintf("%sinc/modules/%s/%s", constant('PATH'), $menu, $file);
 
                        // Is the file there?
                        if (FILE_READABLE($test)) {