// Is a userid set?
if (isGetRequestParameterSet('userid')) {
// Action not performed by default
- $ACT = false;
+ $isActive = false;
// Load user's data
if (fetchUserData(getRequestParameter('userid'))) {
$message = loadEmailTemplate('lock-user', array('text' => postRequestParameter('reason')), bigintval(getRequestParameter('userid')));
// Send away...
- sendEmail(bigintval(getRequestParameter('userid')), getMessage('ADMIN_LOCKED_SUBJ'), $message);
+ sendEmail(bigintval(getRequestParameter('userid')), '{--ADMIN_LOCKED_SUBJECT--}', $message);
} // END - if
// Prepare message
- $message = getMaskedMessage('USER_ACCOUNT_LOCKED', getRequestParameter('userid'));
- $ACT = true;
+ $message = getMaskedMessage('ADMIN_USER_ACCOUNT_LOCKED', bigintval(getRequestParameter('userid')));
+ $isActive = true;
} elseif ((isPostRequestParameterSet('unlock')) && (getUserData('status') == 'LOCKED')) {
// Ok, unlock the account!
if (isExtensionInstalledAndNewer('user', '0.3.5')) {
$message = loadEmailTemplate('unlock-user', array('text' => postRequestParameter('reason')), bigintval(getRequestParameter('userid')));
// Send away...
- sendEmail(bigintval(getRequestParameter('userid')), getMessage('ADMIN_UNLOCKED_SUBJ'), $message);
+ sendEmail(bigintval(getRequestParameter('userid')), '{--ADMIN_UNLOCKED_SUBJECT--}', $message);
if (isExtensionActive('rallye')) {
addUserToReferalRallye(getRequestParameter('userid'));
} // END - if
} // END - if
// Prepare message
- $message = getMaskedMessage('USER_ACCOUNT_UNLOCKED', getRequestParameter('userid'));
- $ACT = true;
+ $message = getMaskedMessage('ADMIN_USER_ACCOUNT_UNLOCKED', bigintval(getRequestParameter('userid')));
+ $isActive = true;
} elseif (isFormSent('del')) {
// Delete the account
- $ACT = true;
+ $isActive = true;
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']);
case 'UNCONFIRMED': // Unconfirmed accounts cannot be unlocked!
$content['ok'] = 'del';
- $content['header'] = getMaskedMessage('ADMIN_HEADER_DEL_ACCOUNT', $content['userid']);
- $content['text'] = getMaskedMessage('ADMIN_TEXT_DEL_ACCOUNT', $content['userid']);
+ $content['header'] = getMaskedMessage('ADMIN_HEADER_DELETE_ACCOUNT', $content['userid']);
+ $content['text'] = getMaskedMessage('ADMIN_TEXT_DELETE_ACCOUNT', $content['userid']);
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_unsaved', false, getMaskedMessage('ADMIN_MEMBER_404', bigintval(getRequestParameter('userid'))) . '</div>');
}
}
// Is an URL set?
- if (!empty($URL)) {
+ if (!empty($url)) {
// Reload and die...
- redirectToUrl($URL);
- } elseif ($ACT) {
+ redirectToUrl($url);
+ } elseif ($isActive) {
// An action was performed...
if (!empty($message)) {
- loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . $message . '</div>');
+ loadTemplate('admin_settings_unsaved', false, $message);
} else {
- loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMessage('ADMIN_USER_UPDATED') . '</div>');
+ loadTemplate('admin_settings_saved', false, '{--ADMIN_USER_UPDATED--}');
}
}
} else {
// Account does not exists!
- loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', getRequestParameter('userid')) . '</div>');
+ loadTemplate('admin_settings_unsaved', false, getMaskedMessage('ADMIN_MEMBER_404', bigintval(getRequestParameter('userid'))));
}
} else {
// List all users