// Some security stuff...
if (!defined('__SECURITY')) {
die();
-}
+} // END - if
// Check ACL for menu combination
function isAdminsAllowedByAcl ($action, $what) {
return $GLOBALS[__FUNCTION__][$adminId][$action][$what];
}
- // But default result is failed
- $GLOBALS[__FUNCTION__][$action][$what] = FALSE;
-
// Get admin's defult access right
$default = getAdminDefaultAcl($adminId);
SQL_FREERESULT($result);
}
+ // But default result is failed
+ $GLOBALS[__FUNCTION__][$adminId][$action][$what] = FALSE;
+
// Check ACL and (maybe) allow
//* DEBUG: */ debugOutput('default='.$default.',acl_mode='.$aclMode.',parent='.intval($parent));
if ((($default == 'allow') && ($aclMode != 'deny')) || (($default == 'deny') && ($aclMode == 'allow')) || ($parent === TRUE) || (($default == 'NO-ACL') && ($aclMode == 'failed') && ($parent === FALSE))) {
// Free memory
SQL_FREERESULT($result);
- } elseif (isValidUserId($email)) {
+ } elseif (isValidId($email)) {
// Direct id given
$email = '{%url=modules.php?module=' . $mod . '&what=admins_contct&id=' . bigintval($email) . '%}';
} else {
// Admin account saved
$message = '{--ADMIN_ACCOUNT_SAVED--}';
- } elseif ((!empty($postData['pass1'])) && (!empty($postData['pass2']))) {
+ } elseif ((!empty($postData['password1'])) && (!empty($postData['password2']))) {
// Update only if both passwords match
- if (($postData['pass1'][$id] == $postData['pass2'][$id])) {
+ if (($postData['password1'][$id] == $postData['password2'][$id])) {
// Save only when both passwords are the same (also when they are empty)
$add = ''; $cache_update = 1;
// Generate hash
- $hash = generateHash($postData['pass1'][$id]);
+ $hash = generateHash($postData['password1'][$id]);
// Save password when set
- if (!empty($postData['pass1'][$id])) {
+ if (!empty($postData['password1'][$id])) {
$add = sprintf(",`password`='%s'", SQL_ESCAPE($hash));
} // END - if
if (!empty($add)) {
setAdminMd5($hash);
} // END - if
- } elseif (generateHash($postData['pass1'][$id], $salt) != getAdminMd5()) {
+ } elseif (generateHash($postData['password1'][$id], $salt) != getAdminMd5()) {
// Update password cookie
setAdminMd5($hash);
}
$id = bigintval($id);
// Get the admin's data
- $result = SQL_QUERY_ESC("SELECT `login`, `email` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC('SELECT `login`, `email` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1',
array($id), __FUNCTION__, __LINE__);
if ((SQL_NUMROWS($result) == 1) && ($selected == 1)) {
// Entry found
$id = bigintval($id);
// Get the admin's data
- $result = SQL_QUERY_ESC("SELECT `login`, `email`, `default_acl` AS `access_mode`, `la_mode` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC('SELECT
+ `login`,
+ `email`,
+ `default_acl` AS `access_mode`,
+ `la_mode`
+FROM
+ `{?_MYSQL_PREFIX?}_admins`
+WHERE
+ `id`=%s
+LIMIT 1',
array($id), __FUNCTION__, __LINE__);
// Is there an entry?
// Delete only when it's not your own account!
if (($del == 1) && (getCurrentAdminId() != $id)) {
// Rewrite his tasks to all admins
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=NULL WHERE `assigned_admin`=%s",
+ SQL_QUERY_ESC('UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=NULL WHERE `assigned_admin`=%s',
array($id), __FUNCTION__, __LINE__);
// Remove account
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ SQL_QUERY_ESC('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1',
array($id), __FUNCTION__, __LINE__);
}
}
__FUNCTION__, __LINE__);
} else {
// If Admin-Id is not "to-all" select
- $result = SQL_QUERY_ESC("SELECT `email` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id` IN (%s) ORDER BY `id` ASC",
+ $result = SQL_QUERY_ESC('SELECT `email` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id` IN (%s) ORDER BY `id` ASC',
array($adminId), __FUNCTION__, __LINE__);
}
}
// Is the template a bug report?
if ($template == 'admin_report_bug') {
// Then set 'Reply-To:' again
- $mailHeader = 'Reply-To: webmaster@mxchange.org' . chr(10);
+ $mailHeader = 'Reply-To: webmaster@mxchange.org' . PHP_EOL;
} // END - if
// Load email addresses and send away
incrementStatsEntry('cache_hits');
} elseif (!isExtensionInstalled('cache')) {
// Load from database
- $result = SQL_QUERY_ESC("SELECT `expert_settings` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC('SELECT `expert_settings` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1',
array($adminId), __FUNCTION__, __LINE__);
// Entry found?
incrementStatsEntry('cache_hits');
} elseif (!isExtensionInstalled('cache')) {
// Load from database
- $result = SQL_QUERY_ESC("SELECT `expert_warning` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC('SELECT `expert_warning` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1',
array($adminId), __FUNCTION__, __LINE__);
// Entry found?
incrementStatsEntry('cache_hits');
} elseif (!isExtensionActive('cache')) {
// Load from database
- $result = SQL_QUERY_ESC("SELECT `login_failures` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC('SELECT `login_failures` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1',
array($adminId), __FUNCTION__, __LINE__);
// Is there an entry?
incrementStatsEntry('cache_hits');
} elseif (!isExtensionActive('cache')) {
// Load from database
- $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`last_failure`) AS `last_failure` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC('SELECT UNIX_TIMESTAMP(`last_failure`) AS `last_failure` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1',
array($adminId), __FUNCTION__, __LINE__);
// Is there an entry?