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') . '
' . implode(" \n ", $errors) . '
@@ -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 '
';
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 request Requested by Requested for COPPA user Actions ';
+
+
+ ' . $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') . '
+ ';
$cls = 'row2';
while($row = $db->fetchrow())
{
if($cls == 'row2') $cls = 'row1';
else $cls = 'row2';
- $coppa = ( $row['user_coppa'] == '1' ) ? 'Yes ' : 'No';
- echo ''.date('F d, Y h:i a', $row['time_id']).' '.$row['author'].' '.$row['edit_summary'].' ' . $coppa . ' Activate now Send activation e-mail Deny request ';
+ $coppa = ( $row['user_coppa'] == '1' ) ? '' . $lang->get('acpum_coppauser_yes') . ' ' : $lang->get('acpum_coppauser_no');
+ echo '
+ '.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') . '
+
+ ';
}
echo '
';
}
@@ -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}
- {lang:adminusers_avatar_lbl_change}
+ {lang:acpum_avatar_lbl_change}
- {lang:adminusers_avatar_lbl_keep}
- {lang:adminusers_avatar_lbl_remove}
- {lang:adminusers_avatar_lbl_set_http}
+ {lang:acpum_avatar_lbl_keep}
+ {lang:acpum_avatar_lbl_remove}
+ {lang:acpum_avatar_lbl_set_http}
{lang:usercp_avatar_lbl_url}
{lang:usercp_avatar_lbl_url_desc} {lang:usercp_avatar_limits}
- {lang:adminusers_avatar_lbl_set_file}
+ {lang:acpum_avatar_lbl_set_file}
{lang:usercp_avatar_lbl_file}
{lang:usercp_avatar_lbl_file_desc} {lang:usercp_avatar_limits}
@@ -1009,44 +1061,43 @@
- Administrator-only options
+ {lang:acpum_heading_adminonly}
- User account is active
- If this is unchecked, the existing activation key will be overwritten in the database, thus invalidating any activation e-mails sent to the user.
+ {lang:acpum_field_active_title}
+ {lang:acpum_field_active_hint}
- checked="checked" /> Account is active and enabled
+ checked="checked" /> {lang:acpum_field_active}
- User's site access level
- If this is changed, the relevant group memberships will be updated accordingly.
+ {lang:acpum_field_userlevel}
+ {lang:acpum_field_userlevel_hint}
- selected="selected">Normal member
- selected="selected">Moderator
- selected="selected">Site administrator
+ selected="selected">{lang:userfuncs_ml_level_member}
+ selected="selected">{lang:userfuncs_ml_level_mod}
+ selected="selected">{lang:userfuncs_ml_level_admin}
- Delete user account
+ {lang:acpum_field_deleteaccount_title}
- Permanently delete this user account when I click Save
+ {lang:acpum_field_deleteaccount}
-
WARNING! This will delete your own user account!
+
+
{lang:acpum_msg_delete_own_account}
-
Even if you delete this user account, the username will be shown in page edit history, comments, and other areas of the site.
- Deleting a user account CANNOT BE UNDONE and should only be done in extreme circumstances.
- If the user has violated the site policy, deleting the account will not prevent him from using the site or creating a new account, for that you need to add a new ban rule.
+
{lang:acpum_field_deleteaccount_hint}
@@ -1055,8 +1106,8 @@
-
-
+
+