// Is a userid set?
if (isGetRequestElementSet('userid')) {
// Load user's data
- $result_user = SQL_QUERY_ESC("SELECT status, gender, surname, family, email FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
- array(bigintval(getRequestElement('userid'))), __FILE__, __LINE__);
+ $result_user = SQL_QUERY_ESC("SELECT `status`, `gender`, `surname`, `family`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval(getRequestElement('userid'))), __FILE__, __LINE__);
$ACT = false;
if (SQL_NUMROWS($result_user) == 1) {
- // User found
- list($status, $gender, $surname, $family, $email) = SQL_FETCHROW($result_user);
-
- // Free result
- SQL_FREERESULT($result_user);
-
// Is a lock reason set?
if ((isPostRequestElementSet('lock')) && ($status != 'LOCKED')) {
// Ok, lock the account!
if (getExtensionVersion('user') >= '0.3.5') {
// Lock with reason
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `status`='LOCKED',lock_reason='%s',lock_timestamp=NOW() WHERE `userid`=%s LIMIT 1",
- array(postRequestElement('reason'), bigintval(getRequestElement('userid'))), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `status`='LOCKED', `lock_reason`='%s', `lock_timestamp`=NOW() WHERE `userid`=%s LIMIT 1",
+ array(postRequestElement('reason'), bigintval(getRequestElement('userid'))), __FILE__, __LINE__);
} else {
// Lock with no lock reason saved
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `status`='LOCKED' WHERE `userid`=%s LIMIT 1",
- array(bigintval(getRequestElement('userid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestElement('userid'))), __FILE__, __LINE__);
}
// Entry updated?
$message = loadEmailTemplate('lock-user', array('text' => postRequestElement('reason')), bigintval(getRequestElement('userid')));
// Send away...
- sendEmail(bigintval(getRequestElement('userid')), ADMIN_LOCKED_SUBJ, $message);
+ sendEmail(bigintval(getRequestElement('userid')), getMessage('ADMIN_LOCKED_SUBJ'), $message);
} // END - if
// Prepare message
// Account does not exists!
loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
}
+
+ // Free result
+ SQL_FREERESULT($result_user);
} else {
// List all users
addMemberSelectionBox();
}
-//
+// [EOF]
?>