* -------------------------------------------------------------------- *
* 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!!!!!! *
* -------------------------------------------------------------------- *
// 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();
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);
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'
} 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",
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);
}
}
}
// 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;
}
//