From d7095e5633245b7efc2e271e1bf0c3eb9ecad532 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 3 Nov 2009 17:08:14 +0000 Subject: [PATCH] Fixes for constant and old lost code removed --- inc/modules/admin/what-lock_user.php | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/inc/modules/admin/what-lock_user.php b/inc/modules/admin/what-lock_user.php index f986bd30e8..c418df55cb 100644 --- a/inc/modules/admin/what-lock_user.php +++ b/inc/modules/admin/what-lock_user.php @@ -47,27 +47,21 @@ addMenuDescription('admin', __FILE__); // 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? @@ -76,7 +70,7 @@ if (isGetRequestElementSet('userid')) { $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 @@ -189,10 +183,13 @@ LIMIT 1", // Account does not exists! loadTemplate('admin_settings_saved', false, "
".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."
"); } + + // Free result + SQL_FREERESULT($result_user); } else { // List all users addMemberSelectionBox(); } -// +// [EOF] ?> -- 2.39.5