Fixes for constant and old lost code removed
authorRoland Häder <roland@mxchange.org>
Tue, 3 Nov 2009 17:08:14 +0000 (17:08 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 3 Nov 2009 17:08:14 +0000 (17:08 +0000)
inc/modules/admin/what-lock_user.php

index f986bd3..c418df5 100644 (file)
@@ -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, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
        }
+
+       // Free result
+       SQL_FREERESULT($result_user);
 } else {
        // List all users
        addMemberSelectionBox();
 }
 
-//
+// [EOF]
 ?>