]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Changed all admin getter, closed internal TODOs:
[mailer.git] / inc / wrapper-functions.php
index df22a69ec048c2be90c1dedc38bd08ec5b937f1d..e44abe4e868658b818d5c9e3498666976357d1e0 100644 (file)
@@ -775,7 +775,7 @@ function isDemoModeActive () {
        // Is cache set?
        if (!isset($GLOBALS['demo_mode_active'])) {
                // Simply check it
-               $GLOBALS['demo_mode_active'] = ((isExtensionActive('demo')) && (getSession('admin_login') == 'demo'));
+               $GLOBALS['demo_mode_active'] = ((isExtensionActive('demo')) && (getAdminLogin(getSession('admin_id')) == 'demo'));
        } // END - if
 
        // Return it
@@ -788,35 +788,20 @@ function getPhpCaching () {
 }
 
 // Checks wether the admin hash is set
-function isAdminHashSet ($admin) {
-       /**
-        * @TODO Do we really need this check? If yes, try to fix this:
-        * 1.:functions.php:2504, debug_get_mailable_backtrace(0)
-        * 2.:wrapper-functions.php:744, debug_report_bug(1)
-        * 3.:mysql-manager.php:728, isAdminHashSet(1)
-        * 4.:filters.php:384, isAdmin(0)
-        * 5.:debug_get_mailable_backtrace:2457, FILTER_DETERMINE_USERNAME(1)
-        * 6.:filter-functions.php:280, call_user_func_array(2)
-        * 7.:load_cache.php:74, runFilterChain(1)
-        * 8.:inc-functions.php:131, include(1)
-        * 9.:inc-functions.php:145, loadInclude(1)
-        * 10.:mysql-connect.php:104, loadIncludeOnce(1)
-        * 11.:inc-functions.php:131, include(1)
-        * 12.:inc-functions.php:145, loadInclude(1)
-        * 13.:config-global.php:106, loadIncludeOnce(1)
-        * 14.:js.php:57, require(1)
-        */
+function isAdminHashSet ($adminId) {
+       // Is the array there?
        if (!isset($GLOBALS['cache_array']['admin'])) {
+               // Missing array should be reported
                debug_report_bug(__FUNCTION__, __LINE__, 'Cache not set.');
        } // END - if
 
        // Check for admin hash
-       return isset($GLOBALS['cache_array']['admin']['password'][$admin]);
+       return isset($GLOBALS['cache_array']['admin']['password'][$adminId]);
 }
 
 // Setter for admin hash
-function setAdminHash ($admin, $hash) {
-       $GLOBALS['cache_array']['admin']['password'][$admin] = $hash;
+function setAdminHash ($adminId, $hash) {
+       $GLOBALS['cache_array']['admin']['password'][$adminId] = $hash;
 }
 
 // Init user data array