]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/admins_functions.php
Rewritten to use str_replace() instead of preg_replace()
[mailer.git] / inc / libs / admins_functions.php
index 8e8eb553cdc6a6b5c9ab30cb99a778649df2e73f..cb34ef32ef56565e117a36135abb8bdc131070c3 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Funktionen fuer die admins-Erweiterung           *
  * -------------------------------------------------------------------- *
- * $Revision:: 856                                                    $ *
- * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. March 2009)             $ *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author:: stelzi                                                   $ *
+ * $Author::                                                          $ *
  * Needs to be in all Files and every File needs "svn propset           *
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
@@ -173,13 +173,13 @@ function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) {
                // When both passwords match update admin account
                if ($POST['pass1'][$id] == $POST['pass2'][$id]) {
                        // Save only when both passwords are the same (also when they are empty)
-                       $ADD = ""; $cache_update = "1";
+                       $add = ""; $cache_update = "1";
 
                        // Generate hash
                        $hash = generateHash($POST['pass1'][$id]);
 
                        // Save password when set
-                       if (!empty($POST['pass1'][$id])) $ADD = sprintf(", password='%s'", SQL_ESCAPE($hash));
+                       if (!empty($POST['pass1'][$id])) $add = sprintf(", password='%s'", SQL_ESCAPE($hash));
 
                        // Get admin's ID
                        $aid = GET_CURRENT_ADMIN_ID();
@@ -195,7 +195,7 @@ function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) {
                                        set_session('admin_login', $login);
 
                                        // Update password cookie as well?
-                                       if (!empty($ADD)) set_session('admin_md5', $hash);
+                                       if (!empty($add)) set_session('admin_md5', $hash);
                                } elseif (generateHash($POST['pass1'][$id], $salt) != get_session('admin_md5')) {
                                        // Update password cookie
                                        set_session('admin_md5', $hash);
@@ -209,7 +209,7 @@ function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) {
                        if ($default == "allow") {
                                // Allow changing default ACL
                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET
-login='%s'".$ADD.",
+login='%s'".$add.",
 email='%s',
 default_acl='%s',
 la_mode='%s'
@@ -224,7 +224,7 @@ WHERE id=%s LIMIT 1",
                        } else {
                                // Do not allow it here
                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET
-login='%s'".$ADD.",
+login='%s'".$add.",
 email='%s',
 la_mode='%s'
 WHERE id=%s LIMIT 1",
@@ -240,15 +240,15 @@ WHERE id=%s LIMIT 1",
                        CACHE_PURGE_ADMIN_MENU($id);
 
                        // Admin account saved
-                       $MSG = ADMIN_ACCOUNT_SAVED;
+                       $message = ADMIN_ACCOUNT_SAVED;
                } else {
                        // Passwords did not match
-                       $MSG = ADMINS_ERROR_PASS_MISMATCH;
+                       $message = ADMINS_ERROR_PASS_MISMATCH;
                }
 
                // Display message
-               if (!empty($MSG)) {
-                       LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+               if (!empty($message)) {
+                       LOAD_TEMPLATE("admin_settings_saved", false, $message);
                }
        }
 
@@ -398,14 +398,14 @@ function ADMINS_LIST_ADMIN_ACCOUNTS() {
 }
 
 // Filter for adding extra data to the query
-function FILTER_ADD_EXTRA_SQL_DATA ($ADD = "") {
+function FILTER_ADD_EXTRA_SQL_DATA ($add = "") {
        // Is the admins extension updated? (should be!)
-       if (GET_EXT_VERSION("admins") >= "0.3")   $ADD .= ", default_acl AS def_acl";
-       if (GET_EXT_VERSION("admins") >= "0.6.7") $ADD .= ", la_mode";
-       if (GET_EXT_VERSION("admins") >= "0.7.2") $ADD .= ", login_failures, UNIX_TIMESTAMP(last_failure) AS last_failure";
+       if (GET_EXT_VERSION("admins") >= "0.3")   $add .= ", default_acl AS def_acl";
+       if (GET_EXT_VERSION("admins") >= "0.6.7") $add .= ", la_mode";
+       if (GET_EXT_VERSION("admins") >= "0.7.2") $add .= ", login_failures, UNIX_TIMESTAMP(last_failure) AS last_failure";
 
        // Return it
-       return $ADD;
+       return $add;
 }
 
 //