X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fadmin-inc.php;h=c0ba4d31dac08ad8ba0be6c8d4389ccdaa797b46;hb=2142149f3f72f1a2476f95a87937c044d63bbaf2;hp=8e583b643686f84c4c268eb5eddcc8fb45215eb1;hpb=efee806bdf3f96472cfc10247943446169f752d1;p=mailer.git diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 8e583b6436..c0ba4d31da 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -45,7 +45,7 @@ function REGISTER_ADMIN ($user, $md5, $email=WEBMASTER) array($user), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Ok, let's create the admin login - $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins (login, password, email) VALUES('%s', '%s', '%s')", + $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins (login, password, email) VALUES ('%s', '%s', '%s')", array($user, $md5, $email), __FILE__, __LINE__); $ret = "done"; } else { @@ -71,7 +71,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) // Get password from cache $data['password'] = $cacheArray['admins']['password'][$admin_login]; $ret = "pass"; - $_CONFIG['cache_hits']++; + if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } // Include more admins data? if (GET_EXT_VERSION("admins") >= "0.7.0") { @@ -79,7 +79,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) $data['login_failtures'] = $cacheArray['admins']['login_failtures'][$admin_login]; $data['last_failture'] = $cacheArray['admins']['last_failture'][$admin_login]; } // END - if - } elseif (EXT_IS_ACTIVE("cache")) { + } elseif (!EXT_IS_ACTIVE("cache")) { $ADD = ""; if (GET_EXT_VERSION("admins") >= "0.7.0") { // Load them here @@ -232,6 +232,7 @@ function admin_WriteData ($file, $comment, $prefix, $suffix, $DATA, $seek=0) { // Initialize some variables $done = false; $seek++; + $next=-1; $found = false; // Is the file there and read-/write-able? @@ -256,7 +257,7 @@ function admin_WriteData ($file, $comment, $prefix, $suffix, $DATA, $seek=0) { if (strpos($line, $search) > -1) { $next = 0; $found = true; } if ($next > -1) { - if ($next == $seek) { + if ($next === $seek) { $next = -1; $line = $prefix . $DATA . $suffix."\n"; } else { @@ -645,7 +646,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con // Translate the value? (comma to dot!) if ((is_array($translateComma)) && (in_array($id, $translateComma))) { // Then do it here... :) - $val = str_replace(",", ".", $val); + $val = REVERT_COMMA($val); } // END - if // Shall we add numbers or strings? @@ -694,7 +695,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con $VALUEs = implode(", ", $VALUEs); // Generate SQL string - $SQL = "INSERT INTO "._MYSQL_PREFIX.$tableName." (".$KEYs.") VALUES(".$VALUEs.")"; + $SQL = "INSERT INTO "._MYSQL_PREFIX.$tableName." (".$KEYs.") VALUES (".$VALUEs.")"; } // Free memory @@ -770,7 +771,7 @@ function ADMIN_CHECK_MENU_MODE() { if (isset($cacheArray['admins']['la_mode'][get_session('admin_login')])) { // Load from cache $ADMIN = $cacheArray['admins']['la_mode'][get_session('admin_login')]; - $_CONFIG['cache_hits']++; + if (isset($_CONFIG['cache_hits'])) { $_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 login='%s' LIMIT 1", @@ -846,8 +847,7 @@ function ADMIN_SEND_BUILD_MAILS ($mode, $table, $content, $id, $subjectPart="") // Is the raw userid set? if ($_POST['uid_raw'][$id] > 0) { // Generate subject - $eval = "\$subjectLine = MEMBER_".$subject."_".strtoupper($table)."_SUBJECT;"; - eval($eval); + $subjectLine = constant('MEMBER_'.strtoupper($subject).'_'.strtoupper($table).'_SUBJECT'); // Load email template if (!empty($subjectPart)) { @@ -861,8 +861,7 @@ function ADMIN_SEND_BUILD_MAILS ($mode, $table, $content, $id, $subjectPart="") } // END - if // Generate subject - $eval = "\$subjectLine = ADMIN_".$subject."_".strtoupper($table)."_SUBJECT;"; - eval($eval); + $subjectLine = constant('ADMIN_'.strtoupper($subject).'_'.strtoupper($table).'_SUBJECT'); // Send admin notification out if (!empty($subjectPart)) {