Even more rewrites/fixes from EL branch (please report any broken part after you...
[mailer.git] / inc / modules / admin / what-lock_user.php
index 1f33460..f91f2ae 100644 (file)
@@ -75,7 +75,7 @@ if (isGetRequestParameterSet('userid')) {
                        } // END - if
 
                        // Prepare message
-                       $message = getMaskedMessage('USER_ACCOUNT_LOCKED', getRequestParameter('userid'));
+                       $message = getMaskedMessage('USER_ACCOUNT_LOCKED', bigintval(getRequestParameter('userid')));
                        $ACT = true;
                } elseif ((isPostRequestParameterSet('unlock')) && (getUserData('status') == 'LOCKED')) {
                        // Ok, unlock the account!
@@ -110,7 +110,7 @@ LIMIT 1",
                        } // END - if
 
                        // Prepare message
-                       $message = getMaskedMessage('USER_ACCOUNT_UNLOCKED', getRequestParameter('userid'));
+                       $message = getMaskedMessage('USER_ACCOUNT_UNLOCKED', bigintval(getRequestParameter('userid')));
                        $ACT = true;
                } elseif (isFormSent('del')) {
                        // Delete the account
@@ -118,19 +118,15 @@ LIMIT 1",
                        loadIncludeOnce('inc/modules/admin/what-del_user.php');
                } elseif (isPostRequestParameterSet('no')) {
                        // Do not lock him...
-                       $URL = adminCreateUserLink(getRequestParameter('userid'));
+                       $url = adminCreateUserLink(getRequestParameter('userid'));
                } else {
                        // Load user data we need
                        if (fetchUserData(getRequestParameter('userid'))) {
                                // Transfer data to constants for the template
-                               $content['email']   = generateEmailLink(getUserData('email'), 'user_data');
-                               $content['surname'] = getUserData('surname');
-                               $content['family']  = getUserData('family');
-                               $content['status']  = getUserData('status');
-                               $content['userid']  = bigintval(getRequestParameter('userid'));
+                               $content['userid']  = getRequestParameter('userid');
 
                                // Realy want to lock?
-                               switch ($content['status']) {
+                               switch (getUserData('status')) {
                                        case 'CONFIRMED': // Yes, lock him down... ;-)
                                                $content['ok']     = 'lock';
                                                $content['header'] = getMaskedMessage('ADMIN_HEADER_LOCK_ACCOUNT', $content['userid']);
@@ -150,32 +146,29 @@ LIMIT 1",
                                                break;
                                }
 
-                               // Translate user status
-                               $content['status'] = translateUserStatus($content['status']);
-
                                // Output form
                                loadTemplate('admin_lock_user', false, $content);
                        } else {
                                // Account does not exists!
-                               loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', getRequestParameter('userid')) . '</div>');
+                               loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', bigintval(getRequestParameter('userid'))) . '</div>');
                        }
                }
 
                // Is an URL set?
-               if (!empty($URL)) {
+               if (!empty($url)) {
                        // Reload and die...
-                       redirectToUrl($URL);
+                       redirectToUrl($url);
                } elseif ($ACT) {
                        // An action was performed...
                        if (!empty($message)) {
                                loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . $message . '</div>');
                        } else {
-                               loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMessage('ADMIN_USER_UPDATED') . '</div>');
+                               loadTemplate('admin_settings_saved', false, '<div class="admin_failed">{--ADMIN_USER_UPDATED--}</div>');
                        }
                }
        } else {
                // Account does not exists!
-               loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', getRequestParameter('userid')) . '</div>');
+               loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', bigintval(getRequestParameter('userid'))) . '</div>');
        }
 } else {
        // List all users