]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/admins_functions.php
A lot eval() commands rewritten to constant() function
[mailer.git] / inc / libs / admins_functions.php
index 65325e1a698ca1b755a5a82b27e9e2038d9be255..550b8a69bc539399caf339908aafe5b8a0092070 100644 (file)
@@ -53,7 +53,7 @@ function ADMINS_CHECK_ACL($act, $wht) {
                $default = $cacheArray['admins']['def_acl'][get_session('admin_login')];
 
                // Count cache hits
-               $_CONFIG['cache_hits']++;
+               if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
        } elseif (!is_object($cacheInstance)) {
                // Load from database
                $default = GET_ADMIN_DEFAULT_ACL(get_session('admin_login'));
@@ -95,7 +95,7 @@ function ADMINS_CHECK_ACL($act, $wht) {
                                        }
                                        if ($lines == 1) {
                                                // Count cache hits
-                                               $_CONFIG['cache_hits']++;
+                                               if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
                                                break;
                                        }
                                }
@@ -328,10 +328,8 @@ function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) {
                                // Entry found
                                $content = SQL_FETCHARRAY($result);
                                SQL_FREERESULT($result);
-                               $eval = "\$content['mode'] = ADMINS_".strtoupper($content['mode'])."_MODE;";
-                               eval($eval);
-                               $eval = "\$content['la_mode'] = ADMINS_".strtoupper($content['la_mode'])."_LA_SETTING;";
-                               eval($eval);
+                               $content['mode'] = constant('ADMINS_'.strtoupper($content['mode']).'_MODE');
+                               $content['la_mode'] = constant('ADMINS_'.strtoupper($content['la_mode']).'_LA_SETTING');
 
                                // Prepare some more data
                                $content['sw'] = $SW;
@@ -389,10 +387,8 @@ function ADMINS_LIST_ADMIN_ACCOUNTS() {
        $SW = 2; $OUT = "";
        while ($content = SQL_FETCHARRAY($result)) {
                // Compile some variables
-               $eval = "\$content['mode'] = ADMINS_".strtoupper($content['mode'])."_MODE;";
-               eval($eval);
-               $eval = "\$content['la_mode'] = ADMINS_".strtoupper($content['la_mode'])."_LA_SETTING;";
-               eval($eval);
+               $content['mode'] = constant('ADMINS_'.strtoupper($content['mode']).'_MODE');
+               $content['la_mode'] = constant('ADMINS_'.strtoupper($content['la_mode']).'_LA_SETTING');
 
                // Prepare some more data
                $content['sw']         = $SW;