diff -r be6c5fdd9203 -r 4ccdfeee9a11 plugins/admin/UserManager.php --- a/plugins/admin/UserManager.php Mon Dec 31 21:43:51 2007 -0500 +++ b/plugins/admin/UserManager.php Thu Jan 03 00:53:33 2008 -0500 @@ -36,7 +36,7 @@ if ( defined('ENANO_DEMO_MODE') ) { - $errors[] = 'Users cannot be modified or deleted in demo mode.'; + $errors[] = $lang->get('acpum_err_nosave_demo'); } $user_id = intval($_POST['user_id']); @@ -51,7 +51,7 @@ $q = $db->sql_query('DELETE FROM '.table_prefix."users WHERE user_id=$user_id;"); if ( !$q ) $db->_die(); - echo '
The user account has been deleted.
'; + echo '
' . $lang->get('acpum_msg_delete_success') . '
'; } else { @@ -66,7 +66,7 @@ { $username = $_POST['username']; if ( !preg_match('#^'.$session->valid_username.'$#', $username) ) - $errors[] = 'The username you entered contains invalid characters.'; + $errors[] = $lang->get('acpum_err_illegal_username'); $password = false; if ( $_POST['changing_pw'] == 'yes' ) @@ -82,13 +82,13 @@ } else { - $errors[] = 'Session manager denied public encryption key lookup request'; + $errors[] = $lang->get('acpum_err_no_aes_key'); } } $email = $_POST['email']; if ( !preg_match('/^(?:[\w\d]+\.?)+@((?:(?:[\w\d]\-?)+\.)+\w{2,4}|localhost)$/', $email) ) - $errors[] = 'You have entered an invalid e-mail address.'; + $errors[] = $lang->get('acpum_err_illegal_email'); $real_name = $_POST['real_name']; } @@ -389,7 +389,7 @@ } } - echo '
Your changes have been saved.
'; + echo '
' . $lang->get('acpum_msg_save_success') . '
'; } } } @@ -397,7 +397,7 @@ if ( count($errors) > 0 ) { echo '
- Your request could not be processed due to the following validation errors: + ' . $lang->get('acpum_err_validation_fail') . ' @@ -455,7 +455,7 @@ if ( $db->numrows() < 1 ) { - echo '
The username you entered could not be found.
'; + echo '
' . $lang->get('acpum_err_bad_username') . '
'; } else { @@ -501,7 +501,7 @@ { if ( defined('ENANO_DEMO_MODE') ) { - echo '
Sorry Charlie, no can do. You might mess up other people logged into the demo site.
'; + echo '
' . $lang->get('acpum_err_sessionclear_demo') . '
'; } else { @@ -534,27 +534,27 @@ $db->sql_query('DELETE FROM '.table_prefix.'session_keys;'); $db->sql_query('INSERT INTO '.table_prefix.'session_keys( session_key,salt,user_id,auth_level,source_ip,time ) VALUES( \''.$ra['session_key'].'\', \''.$ra['salt'].'\', \''.$session->user_id.'\', \''.$ra['auth_level'].'\', \''.$ra['source_ip'].'\', '.$ra['time'].' ),( \''.$rb['session_key'].'\', \''.$rb['salt'].'\', \''.$session->user_id.'\', \''.$rb['auth_level'].'\', \''.$rb['source_ip'].'\', '.$rb['time'].' )'); - echo '
The session key table has been cleared. Your database should be a little bit smaller now.
'; + echo '
' . $lang->get('acpum_msg_sessionclear_success') . '
'; } } echo '
'; - echo '

User administration panel

'; - echo '

From this panel you can modify or delete user accounts.

'; + echo '

' . $lang->get('acpum_heading_main') . '

'; + echo '

' . $lang->get('acpum_hint_intro') . '

'; echo ' -
Search for user:
- If your browser supports AJAX, this will provide suggestions for you. +
' . $lang->get('acpum_field_search_user') . '
+ ' . $lang->get('acpum_field_search_user_hint') . '
' . $template->username_field('username') . ' - +
'; - echo '

Clear session key table

'; - echo '

It\'s a good idea to clean out your session keys table every once in a while, since this helps to reduce database size. During this process you will be logged off and (hopefully) logged back on automatically. If you do this, all users besides you will be logged off, so be sure to do this at a time when traffic is low.

'; - echo '

'; + echo '

' . $lang->get('acpum_heading_clear_sessions') . '

'; + echo '

' . $lang->get('acpum_hint_clear_sessions') . '

'; + echo '

'; echo '
'; if(isset($_GET['action']) && isset($_GET['user'])) @@ -563,22 +563,47 @@ { case "activate": $e = $db->sql_query('SELECT activation_key FROM '.table_prefix.'users WHERE username=\'' . $db->escape($_GET['user']) . '\''); - if($e) + if ( $e ) { + // attempt to activate the account $row = $db->fetchrow(); $db->free_result(); - if($session->activate_account($_GET['user'], $row['activation_key'])) { echo '
The user account "' . htmlspecialchars($_GET['user']) . '" has been activated.
'; $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE time_id=' . $db->escape($_GET['logid'])); } - else echo '
The user account "' . htmlspecialchars($_GET['user']) . '" has NOT been activated, possibly because the account is already active.
'; - } else echo '
Error activating account: '.mysql_error().'
'; + if ( $session->activate_account($_GET['user'], $row['activation_key']) ) + { + echo '
' . $lang->get('acpum_msg_activate_success', array('username' => htmlspecialchars($_GET['user']))) . '
'; + $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE time_id=' . $db->escape($_GET['logid'])); + } + else + { + echo '
' . $lang->get('acpum_err_activate_fail', array('username' => htmlspecialchars($_GET['user']))) . '
'; + } + } + else + { + echo '
Error activating account: '.$db->get_error().'
'; + } break; case "sendemail": - if($session->send_activation_mail($_GET['user'])) { echo '
The user "' . htmlspecialchars($_GET['user']) . '" has been sent an e-mail with an activation link.
'; $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE time_id=' . $db->escape($_GET['logid'])); } - else echo '
The user account "' . htmlspecialchars($_GET['user']) . '" has not been activated, probably because of a bad SMTP configuration.
'; + if ( $session->send_activation_mail($_GET['user'] ) ) + { + echo '
' . $lang->get('acpum_msg_activate_email_success', array('username' => htmlspecialchars($_GET['user']))) . '
'; + $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE time_id=' . $db->escape($_GET['logid'])); + } + else + { + echo '
' . $lang->get('acpum_err_activate_email_fail', array('username' => htmlspecialchars($_GET['user']))) . '
'; + } break; case "deny": $e = $db->sql_query('DELETE FROM '.table_prefix.'logs WHERE log_type=\'admin\' AND action=\'activ_req\' AND time_id=\'' . $db->escape($_GET['logid']) . '\';'); - if(!$e) echo '
Error during row deletion: '.mysql_error().'
'; - else echo '
All activation requests for the user "' . htmlspecialchars($_GET['user']) . '" have been deleted.
'; + if ( !$e ) + { + echo '
Error during row deletion: '.$db->get_error().'
'; + } + else + { + echo '
' . $lang->get('acpum_msg_activate_deny_success', array('username' => htmlspecialchars($_GET['user']))) . '
'; + } break; } } @@ -591,19 +616,42 @@ if($db->numrows() > 0) { $n = $db->numrows(); - if($n == 1) $s = $n . ' user is'; - else $s = $n . ' users are'; - echo '

'.$s . ' awaiting account activation

'; + $str = ( $n == 1 ) ? + $lang->get('acpum_heading_activation_one') : + $lang->get('acpum_heading_activation_plural', array('count' => strval($n))); + + echo '

' . $str . '

'; + echo '
- - '; +
Date of requestRequested byRequested forCOPPA userActions
+ + + + + + + '; $cls = 'row2'; while($row = $db->fetchrow()) { if($cls == 'row2') $cls = 'row1'; else $cls = 'row2'; - $coppa = ( $row['user_coppa'] == '1' ) ? 'Yes' : 'No'; - echo ''; + $coppa = ( $row['user_coppa'] == '1' ) ? '' . $lang->get('acpum_coppauser_yes') . '' : $lang->get('acpum_coppauser_no'); + echo ' + + + + + + + + '; } echo '
' . $lang->get('acpum_col_activate_timestamp') . '' . $lang->get('acpum_col_activate_requestedby') . '' . $lang->get('acpum_col_activate_requestedfor') . '' . $lang->get('acpum_col_activate_coppauser') . '' . $lang->get('acpum_col_activate_actions') . '
'.date('F d, Y h:i a', $row['time_id']).''.$row['author'].''.$row['edit_summary'].'' . $coppa . 'Activate nowSend activation e-mailDeny request
'.enano_date('F d, Y h:i a', $row['time_id']).''.$row['author'].''.$row['edit_summary'].'' . $coppa . ' + ' . $lang->get('acpum_btn_activate_now') . ' + + ' . $lang->get('acpum_btn_send_email') . ' + + ' . $lang->get('acpum_btn_activate_deny') . ' +
'; } @@ -768,7 +816,7 @@ { if ( form.new_password.value != form.new_password_confirm.value ) { - alert('The passwords you entered did not match.'); + alert(\$lang.get('user_reg_err_alert_password_nomatch')); return false; } form.new_password_confirm.value = ''; @@ -790,7 +838,7 @@ - Editing user: {USERNAME} + {lang:acpum_heading_editing_user} {USERNAME} @@ -798,35 +846,36 @@ - Basic options + {lang:acpum_heading_basic_options} - Username:
- Must be at least 2 characters in length + {lang:acpum_field_username}
+ {lang:acpum_field_username_hint} - disabled="disabled" /> You cannot change your own username. To change your username you must log into a different administrative account. + disabled="disabled" /> + {lang:acpum_msg_same_user_username} - Password: + {lang:acpum_field_password}
- Password strength requirements are not enforced here. + {lang:acpum_field_password_hint}