Mahor rewrite:
[mailer.git] / inc / modules / admin / admin-inc.php
index 586f1803f7e6aac8004a6ff6f471002993e63a73..9ac190ce3747de34f9ab11b231a5dc720f0ec1c2 100644 (file)
@@ -73,7 +73,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
                // Get password from cache
                $data['password'] = $cacheArray['admins']['password'][$aid];
                $ret = "pass";
-               if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+               if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
 
                // Include more admins data?
                if (GET_EXT_VERSION("admins") >= "0.7.0") {
@@ -383,7 +383,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
        $menuTitle = array();
 
        // Is there a cache instance?
-       if ((is_object($cacheInstance)) && (isset($_CONFIG['cache_admin_menu'])) && ($_CONFIG['cache_admin_menu'] == "Y")) {
+       if ((is_object($cacheInstance)) && (getConfig('cache_admin_menu') == "Y")) {
                // Create cache name
                $cacheName = "admin_".$act."_".$wht."_".GET_LANGUAGE()."_".strtolower(get_session('admin_login'));
 
@@ -537,7 +537,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
        eval($eval);
 
        // Is there a cache instance again?
-       if ((is_object($cacheInstance)) && (isset($_CONFIG['cache_admin_menu'])) && ($_CONFIG['cache_admin_menu'] == "Y")) {
+       if ((is_object($cacheInstance)) && (getConfig('cache_admin_menu') == "Y")) {
                // Init cache
                $cacheInstance->init($cacheName);
 
@@ -775,7 +775,8 @@ function ADMIN_CHECK_MENU_MODE() {
        global $_CONFIG, $cacheArray;
 
        // Set the global mode as the mode for all admins
-       $MODE = $_CONFIG['admin_menu']; $ADMIN = $MODE;
+       $MODE = getConfig('admin_menu');
+       $ADMIN = $MODE;
 
        // Get admin id
        $aid = GET_CURRENT_ADMIN_ID();
@@ -784,11 +785,11 @@ function ADMIN_CHECK_MENU_MODE() {
        if (isset($cacheArray['admins']['la_mode'][$aid])) {
                // Load from cache
                $ADMIN = $cacheArray['admins']['la_mode'][$aid];
-               if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+               if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
        } elseif (GET_EXT_VERSION("admins") >= "0.6.7") {
                // Load from database when version of "admins" is enough
                $result = SQL_QUERY_ESC("SELECT la_mode FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
-                array($aid), __FILE__, __LINE__);
+                       array($aid), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Load data
                        list($ADMIN) = SQL_FETCHROW($result);
@@ -1192,7 +1193,7 @@ function ADMIN_TEST_PROXY_SETTINGS ($settingsArray) {
        global $_CONFIG;
 
        // Set temporary the new settings
-       $_CONFIG = array_merge($_CONFIG, $settingsArray);
+       $_CONFIG = merge_array($_CONFIG, $settingsArray);
 
        // Now get the test URL
        $content = GET_URL("check-updates3.php");