From 97cc48768dde69e5a98aab29b54ae7326422f9cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 28 Oct 2009 03:19:23 +0000 Subject: [PATCH 1/1] Moved filter function back to filters.php, fix for non-installed ext-sql_patches --- inc/filter-functions.php | 2 +- inc/filters.php | 22 ++++++++++++++++++++++ inc/language/de.php | 1 - inc/modules/admin/admin-inc.php | 28 +--------------------------- 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/inc/filter-functions.php b/inc/filter-functions.php index e65b789167..dca5b9ec6c 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -197,7 +197,7 @@ function registerFilter ($filterName, $filterFunction, $silentAbort = true, $for // Is the function there? if (!function_exists($filterFunction)) { // Then abort here - addFatalMessage(__FUNCTION__, __LINE__, sprintf(getMessage('FILTER_FAILED_404'), $filterFunction, $filterName)); + addFatalMessage(__FUNCTION__, __LINE__, sprintf("Filter function %s could not be added to filter chain %s.", $filterFunction, $filterName)); return false; } // END - if diff --git a/inc/filters.php b/inc/filters.php index 4380a52ba3..c90cdea9be 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -659,5 +659,27 @@ function FILTER_LOAD_RUNTIME_INCLUDES () { //* DEBUG: */ die(); } +// Filter for checking admin ACL +function FILTER_CHECK_ADMIN_ACL () { + // Extension not installed so it's always allowed to access everywhere! + $ret = true; + + // Ok, Cookie-Update done + if ((isExtensionInstalledAndNewer('admins', '0.3.0')) && (isExtensionActive('admins'))) { + // Check if action GET variable was set + $action = getAction(); + if (isWhatSet()) { + // Get action value by what-value + $action = getModeAction('admin', getWhat()); + } // END - if + + // Check for access control line of current menu entry + $ret = adminsCheckAdminAcl($action, getWhat()); + } // END - if + + // Set it here + $GLOBALS['acl_allow'] = $ret; +} + // [EOF] ?> diff --git a/inc/language/de.php b/inc/language/de.php index 5adaa10faf..8762613836 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1176,7 +1176,6 @@ addMessages(array( // Filter sub-system 'FILTER_FAILED_ALREADY_INIT' => "Filter-System ist bereits initialisiert.", 'FILTER_FAILED_ALREADY_ADDED' => "Die Filterfunktion %s ist bereits der Filterkette %s hinzugefügt.", - 'FILTER_FAILED_404' => "Die Filterfunktion %s wurde nicht gefunden und konnte der Filterkette %s nicht hinzugefügt werden.", 'FILTER_FAILED_NO_FILTER_FOUND' => "Die Filterkette %s konnte nicht gefunden werden.", 'FILTER_FAILED_NOT_REMOVED' => "Die Filterfunktion %s konnte nicht aus der Filterkette %s entfernt werden, da sie nicht existiert.", 'FILTER_FLUSH_FAILED_NO_DATABASE' => "Kann die Filterketten nicht speichern. Datenbank fehlt!", diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index ffdab4e9b2..4ee9340b32 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -1211,7 +1211,7 @@ function doResetAdminPassword ($login, $password) { $passHash = ''; // Now check if we have sql_patches installed - if (getExtensionVersion('sql_patches') >= '0.3.6') { + if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) { // Use new way of hashing $passHash = generateHash($password); } else { @@ -1295,31 +1295,5 @@ function adminCreateUserLink ($userid) { return '{?URL?}/modules.php?module=admin&what=list_user'; } -// ----------------------------------------------------------------------------- -// --- Filter functions --- -// ----------------------------------------------------------------------------- - -// Filter for checking admin ACL -function FILTER_CHECK_ADMIN_ACL () { - // Extension not installed so it's always allowed to access everywhere! - $ret = true; - - // Ok, Cookie-Update done - if ((isExtensionInstalledAndNewer('admins', '0.3.0')) && (isExtensionActive('admins'))) { - // Check if action GET variable was set - $action = getAction(); - if (isWhatSet()) { - // Get action value by what-value - $action = getModeAction('admin', getWhat()); - } // END - if - - // Check for access control line of current menu entry - $ret = adminsCheckAdminAcl($action, getWhat()); - } // END - if - - // Set it here - $GLOBALS['acl_allow'] = $ret; -} - // [EOF] ?> -- 2.30.2