From d22205247313f4b67db5c9aa3aac07cd9d073bce Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 1 Mar 2009 05:18:37 +0000 Subject: [PATCH] __ACL_ALLOW rewritten to and @TODO finished --- DOCS/TODOs.txt | 12 +++++------- inc/functions.php | 15 ++------------- inc/modules/admin.php | 2 +- inc/modules/admin/admin-inc.php | 4 ++-- inc/modules/login.php | 6 +++--- 5 files changed, 13 insertions(+), 26 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index d1aa0a4db1..1d5b971344 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -43,13 +43,11 @@ ./inc/functions.php:1306: // @TODO Remove this if() block if all is working fine ./inc/functions.php:2019:// @TODO Can this function be deprecated? ./inc/functions.php:2334:// @TODO Rewrite all language constants to this function. -./inc/functions.php:2582: // @TODO Try to find all locations where an FQFN is given to these two -./inc/functions.php:2583: // @TODO functions and avoid it. -./inc/functions.php:2647: // @TODO Add a little more infos here -./inc/functions.php:2753:// @TODO Implement $compress -./inc/functions.php:2760:// @TODO Implement $decompress -./inc/functions.php:2863: // @TODO We may want to switch over to UTF-8 here! -./inc/functions.php:2871:// @TODO Rewrite this function to use READ_FILE() and WRITE_FILE() +./inc/functions.php:2636: // @TODO Add a little more infos here +./inc/functions.php:2742:// @TODO Implement $compress +./inc/functions.php:2749:// @TODO Implement $decompress +./inc/functions.php:2852: // @TODO We may want to switch over to UTF-8 here! +./inc/functions.php:2860:// @TODO Rewrite this function to use READ_FILE() and WRITE_FILE() ./inc/mysql-manager.php:162: // @TODO Nothing helped??? ./inc/mysql-manager.php:599: // @TODO Why is this global??? #100 ./inc/mysql-manager.php:927: // @TODO Why does this lead into an endless loop but we still need it??? diff --git a/inc/functions.php b/inc/functions.php index e779bae692..af966907f6 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2575,19 +2575,8 @@ function getActualVersion ($type = 0) { // Loads an include file and logs any missing files for debug purposes function LOAD_INC ($INC) { - // Get constant path - $PATH = constant('PATH'); - - // Use the include file name directly - // @TODO Try to find all locations where an FQFN is given to these two - // @TODO functions and avoid it. - $FQFN = $INC; - - // Check if PATH is in $INC - if (substr($INC, 0, $PATH) != $PATH) { - // Add it. This is why we need a trailing slash in config.php - $FQFN = $PATH . $INC; - } // END - if + // Add the path. This is why we need a trailing slash in config.php + $FQFN = constant('PATH') . $INC; // Is the include file there? if (!FILE_READABLE($FQFN)) { diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 18156e298c..275e45d605 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -341,7 +341,7 @@ if (!isAdminRegistered()) { { case "done": // Check for access control line of current menu entry - define('__ACL_ALLOW', RUN_FILTER('check_admin_acl')); + $GLOBALS['acl_allow'] = RUN_FILTER('check_admin_acl'); // When type of admin menu is not set fallback to old menu system if (!isConfigEntrySet('admin_menu')) setConfigEntry('admin_menu', "OLD"); diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 228fdf5018..288510d631 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -270,10 +270,10 @@ LIMIT 1", array($act, $wht, $wht), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_action) == 1) { // Is valid but does the inlcude file exists? $INC = sprintf("inc/modules/admin/action-%s.php", $act); - if ((INCLUDE_READABLE($INC)) && (VALIDATE_MENU_ACTION("admin", $act, $wht)) && (__ACL_ALLOW == true)) { + if ((INCLUDE_READABLE($INC)) && (VALIDATE_MENU_ACTION("admin", $act, $wht)) && ($GLOBALS['acl_allow'] === true)) { // Ok, we finally load the admin action module LOAD_INC($INC); - } elseif (__ACL_ALLOW == false) { + } elseif ($GLOBALS['acl_allow'] === false) { // Access denied LOAD_TEMPLATE("admin_menu_failed", false, getMessage('ADMIN_ACCESS_DENIED')); addFatalMessage(__FUNCTION__, __LINE__, getMessage('ADMIN_ACCESS_DENIED')); diff --git a/inc/modules/login.php b/inc/modules/login.php index 229c0747c6..a4938ec811 100644 --- a/inc/modules/login.php +++ b/inc/modules/login.php @@ -78,10 +78,10 @@ if ((getConfig('member_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) OUTPUT_HTML(" "); -$INC_ACTION = sprintf("inc/modules/member/action-%s.php", $act); -if ((FILE_READABLE($INC_ACTION)) && (VALIDATE_MENU_ACTION("member", $GLOBALS['action'], $GLOBALS['what']))) { +$INC = sprintf("inc/modules/member/action-%s.php", $act); +if ((INCLUDE_READABLE($INC)) && (VALIDATE_MENU_ACTION("member", $GLOBALS['action'], $GLOBALS['what']))) { // Requested module is available so we load it - LOAD_INC($INC_ACTION); + LOAD_INC($INC); } else { // Invalid module specified or not found... LOAD_URL("modules.php?module=login"); -- 2.39.2