diff -r c75ad574b56d -r 8a00247d1dee plugins/SpecialUserFuncs.php --- a/plugins/SpecialUserFuncs.php Sat Oct 27 13:54:44 2007 -0400 +++ b/plugins/SpecialUserFuncs.php Sun Oct 28 14:32:13 2007 -0400 @@ -100,6 +100,7 @@ { global $db, $session, $paths, $template, $plugins; // Common objects global $__login_status; + global $lang; $pubkey = $session->rijndael_genkey(); $challenge = $session->dss_rand(); @@ -181,34 +182,34 @@ $paths->main_page(); $template->header(); echo '
'; - $header = ( $level > USER_LEVEL_MEMBER ) ? 'Please re-enter your login details' : 'Please enter your username and password to log in.'; + $header = ( $level > USER_LEVEL_MEMBER ) ? $lang->get('user_login_message_short_elev') : $lang->get('user_login_message_short'); if ( isset($_POST['login']) ) { $errstring = $__login_status['error']; switch($__login_status['error']) { case 'key_not_found': - $errstring = 'Enano couldn\'t look up the encryption key used to encrypt your password. This most often happens if a cache rotation occurred during your login attempt, or if you refreshed the login page.'; + $errstring = $lang->get('user_err_key_not_found'); break; case 'key_wrong_length': - $errstring = 'The encryption key was the wrong length.'; + $errstring = $lang->get('user_err_key_wrong_length'); break; case 'too_big_for_britches': - $errstring = 'You are trying to authenticate at a level that your user account does not permit.'; + $errstring = $lang->get('user_err_too_big_for_britches'); break; case 'invalid_credentials': - $errstring = 'You have entered an invalid username or password. Please enter your login details again.'; + $errstring = $lang->get('user_err_invalid_credentials'); if ( $__login_status['lockout_policy'] == 'lockout' ) { - $errstring .= ' You have used up '.$__login_status['lockout_fails'].' out of '.$__login_status['lockout_threshold'].' login attempts. After you have used up all '.$data['lockout_threshold'].' login attempts, you will be locked out from logging in for '.$__login_status['lockout_duration'].' minutes.'; + $errstring .= $lang->get('err_invalid_credentials_lockout', array('lockout_fails' => $__login_status['lockout_fails'])); } else if ( $__login_status['lockout_policy'] == 'captcha' ) { - $errstring .= ' You have used up '.$__login_status['lockout_fails'].' out of '.$__login_status['lockout_threshold'].' login attempts. After you have used up all '.$data['lockout_threshold'].' login attempts, you will have to enter a visual confirmation code before logging in, effective for '.$__login_status['lockout_duration'].' minutes.'; + $errstring .= $lang->get('user_err_invalid_credentials_lockout_captcha', array('lockout_fails' => $__login_status['lockout_fails'])); } break; case 'backend_fail': - $errstring = 'You entered the right credentials and everything was validated, but for some reason Enano couldn\'t register your session. This is an internal problem with the site and you are encouraged to contact site administration.'; + $errstring = $lang->get('user_err_backend_fail'); break; case 'locked_out': $attempts = intval($__login_status['lockout_fails']); @@ -216,13 +217,15 @@ $attempts = $__login_status['lockout_threshold']; $server_time = time(); - $time_rem = $__login_status['lockout_duration'] - round( ( $server_time - $__login_status['lockout_last_time'] ) / 60 ); + $time_rem = ( $__login_status['lockout_last_time'] == time() ) ? $__login_status['lockout_duration'] : $__login_status['lockout_duration'] - round( ( $server_time - $__login_status['lockout_last_time'] ) / 60 ); + if ( $time_rem < 1 ) + $time_rem = $__login_status['lockout_duration']; - $s = ( $time_rem == 1 ) ? '' : 's'; - $errstring = "You have used up all {$__login_status['lockout_threshold']} allowed login attempts. Please wait {$time_rem} minute$s before attempting to log in again"; - if ( $__login_status['lockout_policy'] == 'captcha' ) - $errstring .= ', or enter the visual confirmation code shown above in the appropriate box'; - $errstring .= '.'; + $s = ( $time_rem == 1 ) ? '' : $lang->get('meta_plural'); + + $captcha_string = ( $__login_status['lockout_policy'] == 'captcha' ) ? $lang->get('err_locked_out_captcha_blurb') : ''; + $errstring = $lang->get('user_err_locked_out', array('plural' => $s, 'captcha_blurb' => $captcha_string, 'time_rem' => $time_rem)); + break; } echo '
'.$errstring.'
'; @@ -246,18 +249,18 @@ Logging in enables you to use your preferences and access member information. If you don\'t have a username and password here, you can create an account.

'; + echo '

' . $lang->get('user_login_body', array('reg_link' => makeUrlNS('Special', 'Register'))) . '

'; } else { - echo '

You are requesting that a sensitive operation be performed. To continue, please re-enter your password to confirm your identity.

'; + echo '

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

'; } ?> - Username: + get('user_login_field_username'); ?>: - Forgot your password? No problem.
- Maybe you need to create an account.
+ get('user_login_forgotpass_blurb', array('forgotpass_link' => makeUrlNS('Special', 'PasswordReset'))); ?>
+ get('user_login_createaccount_blurb', array('reg_link' => makeUrlNS('Special', 'Register'))); ?>
- Password:
+ + get('user_login_field_password'); ?>: + - Code in image:
+ get('user_login_field_captcha'); ?>:
@@ -303,8 +308,12 @@ -

Important note regarding cryptography: Some countries do not allow the import or use of cryptographic technology. If you live in one of the countries listed below, you should log in without using encryption.

-

This restriction applies to the following countries: Belarus, China, India, Israel, Kazakhstan, Mongolia, Pakistan, Russia, Saudi Arabia, Singapore, Tunisia, Venezuela, and Vietnam.

+ getAllParams() ) ? '/' . $return : ''; + $nocrypt_link = makeUrlNS('Special', "Login$returnpage_link", "level=$level&use_crypt=0", true); + echo '

' . $lang->get('user_login_nocrypt_title') . ': ' . $lang->get('user_login_nocrypt_body', array('nocrypt_link' => $nocrypt_link)) . '

'; + echo '

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

'; + ?>