# HG changeset patch # User Dan # Date 1193596333 14400 # Node ID 8a00247d1deea4f9395e41bcdad2cbbf3b14f04d # Parent c75ad574b56d172c5cc93d67d37961be37606118 Login page mostly localized diff -r c75ad574b56d -r 8a00247d1dee ajax.php --- a/ajax.php Sat Oct 27 13:54:44 2007 -0400 +++ b/ajax.php Sun Oct 28 14:32:13 2007 -0400 @@ -33,35 +33,50 @@ define('ENANO_ROOT', dirname($filename)); require(ENANO_ROOT.'/includes/functions.php'); require(ENANO_ROOT.'/includes/dbal.php'); + require(ENANO_ROOT.'/includes/json.php'); $db = new mysql(); $db->connect(); - // should be connected now + // result is sent using JSON + $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); + $return = Array( + 'mode' => 'success', + 'users_real' => Array() + ); + + // should be connected to the DB now $name = (isset($_GET['name'])) ? $db->escape($_GET['name']) : false; if ( !$name ) { - die('userlist = new Array(); errorstring=\'Invalid URI\''); + $return = array( + 'mode' => 'error', + 'error' => 'Invalid URI' + ); + die( $json->encode($return) ); } - $q = $db->sql_query('SELECT username,user_id FROM '.table_prefix.'users WHERE lcase(username) LIKE lcase(\'%'.$name.'%\');'); + $allowanon = ( isset($_GET['allowanon']) && $_GET['allowanon'] == '1' ) ? '' : ' AND user_id > 1'; + $q = $db->sql_query('SELECT username FROM '.table_prefix.'users WHERE lcase(username) LIKE lcase(\'%'.$name.'%\')' . $allowanon . ' ORDER BY username ASC;'); if ( !$q ) { - die('userlist = new Array(); errorstring=\'MySQL error selecting username data: '.addslashes(mysql_error()).'\''); + $return = array( + 'mode' => 'error', + 'error' => 'MySQL error selecting username data: '.addslashes(mysql_error()) + ); + die( $json->encode($return) ); } - if($db->numrows() < 1) - { - die('userlist = new Array(); errorstring=\'No usernames found\';'); - } - echo 'var errorstring = false; userlist = new Array();'; $i = 0; while($r = $db->fetchrow()) { - echo "userlist[$i] = '".addslashes($r['username'])."'; "; + $return['users_real'][] = $r['username']; $i++; } $db->free_result(); // all done! :-) $db->close(); + + echo $json->encode( $return ); + exit; } diff -r c75ad574b56d -r 8a00247d1dee includes/clientside/static/ajax.js --- a/includes/clientside/static/ajax.js Sat Oct 27 13:54:44 2007 -0400 +++ b/includes/clientside/static/ajax.js Sun Oct 28 14:32:13 2007 -0400 @@ -1192,6 +1192,7 @@ mydiv.style.position = 'absolute'; mydiv.style.top = '0px'; mydiv.id = 'autoCaptcha'; + mydiv.style.zIndex = String( getHighestZ() + 1 ); var img = document.createElement('img'); img.onload = function() { diff -r c75ad574b56d -r 8a00247d1dee includes/common.php --- a/includes/common.php Sat Oct 27 13:54:44 2007 -0400 +++ b/includes/common.php Sun Oct 28 14:32:13 2007 -0400 @@ -104,6 +104,7 @@ // In addition, $enano_config is used to fetch config information if die_semicritical() is called. global $email; +global $lang; if(!isset($_SERVER['HTTP_HOST'])) grinding_halt('Cannot get hostname', '

Your web browser did not provide the HTTP Host: field. This site requires a modern browser that supports the HTTP 1.1 standard.

'); @@ -188,6 +189,27 @@ } } +// Is there no default language? +if ( getConfig('lang_default') === false ) +{ + $q = $db->sql_query('SELECT lang_id FROM '.table_prefix.'language LIMIT 1;'); + if ( !$q ) + $db->_die('common.php - setting default language'); + if ( $db->numrows() < 1 && !defined('ENANO_ALLOW_LOAD_NOLANG') ) + { + grinding_halt('No languages', '

There are no languages installed on this site.

+

If you are the website administrator, you may install a language by writing and executing a simple PHP script to install it:

+
+<?php
+define("ENANO_ALLOW_LOAD_NOLANG", 1);
+$_GET["title"] = "langinstall";
+require("includes/common.php");
+install_language("eng", "English", "English", ENANO_ROOT . "/language/english/enano.json");
'); + } + $row = $db->fetchrow(); + setConfig('default_language', $row['lang_id']); +} + // Our list of tables included in Enano $system_table_list = Array( table_prefix.'categories', diff -r c75ad574b56d -r 8a00247d1dee includes/functions.php --- a/includes/functions.php Sat Oct 27 13:54:44 2007 -0400 +++ b/includes/functions.php Sun Oct 28 14:32:13 2007 -0400 @@ -3166,6 +3166,53 @@ return $score; } +/** + * Installs a language. + * @param string The ISO-639-3 identifier for the language. Maximum of 6 characters, usually 3. + * @param string The name of the language in English (Spanish) + * @param string The name of the language natively (EspaƱol) + * @param string The path to the file containing the language's strings. Optional. + */ + +function install_language($lang_code, $lang_name_neutral, $lang_name_local, $lang_file = false) +{ + global $db, $session, $paths, $template, $plugins; // Common objects + + $q = $db->sql_query('SELECT 1 FROM '.table_prefix.'language WHERE lang_code = "' . $db->escape($lang_code) . '";'); + if ( !$q ) + $db->_die('functions.php - checking for language existence'); + + if ( $db->numrows() > 0 ) + // Language already exists + return false; + + $q = $db->sql_query('INSERT INTO ' . table_prefix . 'language(lang_code, lang_name_default, lang_name_native) + VALUES( + "' . $db->escape($lang_code) . '", + "' . $db->escape($lang_name_neutral) . '", + "' . $db->escape($lang_name_native) . '" + );'); + if ( !$q ) + $db->_die('functions.php - installing language'); + + $lang_id = $db->insert_id(); + if ( empty($lang_id) ) + return false; + + // Do we also need to install a language file? + if ( is_string($lang_file) && file_exists($lang_file) ) + { + $lang = new Language($lang_id); + $lang->import($lang_file); + } + else if ( is_string($lang_file) && !file_exists($lang_file) ) + { + echo 'Notice: Can\'t load language file, so the specified language wasn\'t fully installed.
'; + return false; + } + return true; +} + //die('
Original:  01010101010100101010100101010101011010'."\nProcessed: ".uncompress_bitfield(compress_bitfield('01010101010100101010100101010101011010')).'
'); ?> diff -r c75ad574b56d -r 8a00247d1dee includes/lang.php --- a/includes/lang.php Sat Oct 27 13:54:44 2007 -0400 +++ b/includes/lang.php Sun Oct 28 14:32:13 2007 -0400 @@ -81,7 +81,7 @@ $db->_die('lang.php - attempting to pass invalid value to constructor'); } - $lang_default = ( $x = getConfig('default_language') ) ? intval($x) : 1; + $lang_default = ( $x = getConfig('default_language') ) ? intval($x) : 'def'; $q = $db->sql_query("SELECT lang_id, lang_code, ( lang_id = $lang_default ) AS is_default FROM " . table_prefix . "language WHERE $sql_col OR lang_id = $lang_default ORDER BY is_default DESC LIMIT 1;"); if ( !$q ) @@ -372,6 +372,8 @@ } // Found it! // Perform substitutions. + // if ( is_array($substitutions) ) + // die('
' . print_r($substitutions, true) . '
'); if ( !is_array($substitutions) ) $substitutions = array(); return $this->substitute($string, $substitutions); @@ -395,11 +397,21 @@ $string = str_replace($matches[0][$i], $result, $string); } } + preg_match_all('/%config\.([a-z0-9_]+)%/', $string, $matches); + if ( count($matches[0]) > 0 ) + { + foreach ( $matches[1] as $i => $string_id ) + { + $result = getConfig($string_id); + $string = str_replace($matches[0][$i], $result, $string); + } + } foreach ( $subs as $key => $value ) { - $string = str_replace("%$key%", $value, $string); + $subs[$key] = strval($value); + $string = str_replace("%{$key}%", "{$subs[$key]}", $string); } - return $string; + return "[L] $string"; } } // class Language diff -r c75ad574b56d -r 8a00247d1dee includes/sessions.php --- a/includes/sessions.php Sat Oct 27 13:54:44 2007 -0400 +++ b/includes/sessions.php Sun Oct 28 14:32:13 2007 -0400 @@ -362,6 +362,7 @@ function start() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if($this->started) return; $this->started = true; $user = false; @@ -381,6 +382,9 @@ if(!$this->compat && $userdata['account_active'] != 1 && $data[1] != 'Special' && $data[1] != 'Admin') { + $language = intval(getConfig('default_language')); + $lang = new Language($language); + $this->logout(); $a = getConfig('account_activation'); switch($a) @@ -480,6 +484,13 @@ } $user = true; + // Set language + if ( !defined('ENANO_ALLOW_LOAD_NOLANG') ) + { + $lang_id = intval($userdata['user_lang']); + $lang = new Language($lang_id); + } + if(isset($_REQUEST['auth']) && !$this->sid_super) { // Now he thinks he's a moderator. Or maybe even an administrator. Let's find out if he's telling the truth. @@ -1111,6 +1122,7 @@ function register_guest_session() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; $this->username = $_SERVER['REMOTE_ADDR']; $this->user_level = USER_LEVEL_GUEST; if($this->compat || defined('IN_ENANO_INSTALL')) @@ -1124,6 +1136,12 @@ $this->style = ( isset($_GET['style']) && file_exists(ENANO_ROOT.'/themes/'.$this->theme . '/css/'.$_GET['style'].'.css' )) ? $_GET['style'] : substr($template->named_theme_list[$this->theme]['default_style'], 0, strlen($template->named_theme_list[$this->theme]['default_style'])-4); } $this->user_id = 1; + if ( !defined('ENANO_ALLOW_LOAD_NOLANG') ) + { + // This is a VERY special case we are allowing. It lets the installer create languages using the Enano API. + $language = intval(getConfig('default_language')); + $lang = new Language($language); + } } /** @@ -1151,7 +1169,7 @@ } $keyhash = md5($key); $salt = $db->escape($keydata[3]); - $query = $db->sql_query('SELECT u.user_id AS uid,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,k.source_ip,k.time,k.auth_level,COUNT(p.message_id) AS num_pms,x.* FROM '.table_prefix.'session_keys AS k + $query = $db->sql_query('SELECT u.user_id AS uid,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,k.source_ip,k.time,k.auth_level,COUNT(p.message_id) AS num_pms,u.user_lang,x.* FROM '.table_prefix.'session_keys AS k LEFT JOIN '.table_prefix.'users AS u ON ( u.user_id=k.user_id ) LEFT JOIN '.table_prefix.'users_extra AS x diff -r c75ad574b56d -r 8a00247d1dee language/english/enano.json --- a/language/english/enano.json Sat Oct 27 13:54:44 2007 -0400 +++ b/language/english/enano.json Sun Oct 28 14:32:13 2007 -0400 @@ -35,15 +35,27 @@ err_key_wrong_length: 'The encryption key was the wrong length.', err_too_big_for_britches: 'You are trying to authenticate at a level that your user account does not permit.', err_invalid_credentials: 'You have entered an invalid username or password. Please enter your login details again.', - err_invalid_credentials_lockout: ' You have used up %lockout_fails% out of %lockout_threshold% login attempts. After you have used up all %lockout_threshold% login attempts, you will be locked out from logging in for %lockout_duration% minutes.', - err_invalid_credentials_lockout_captcha: ' You have used up %lockout_fails% out of %lockout_threshold% login attempts. After you have used up all %lockout_threshold% login attempts, you will have to enter a visual confirmation code while logging in, effective for %lockout_duration% minutes.', + err_invalid_credentials_lockout: ' You have used up %fails% out of %config.lockout_threshold% login attempts. After you have used up all %config.lockout_threshold% login attempts, you will be locked out from logging in for %config.lockout_duration% minutes.', + err_invalid_credentials_lockout_captcha: ' You have used up %lockout_fails% out of %config.lockout_threshold% login attempts. After you have used up all %config.lockout_threshold% login attempts, you will have to enter a visual confirmation code while logging in, effective for %config.lockout_duration% minutes.', err_backend_fail: '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.', - err_locked_out: 'You have used up all %lockout_threshold% allowed login attempts. Please wait %time_rem% minute%plural% before attempting to log in again%captcha_blurb%.', - err_locked_out_captcha_blurb: ', or enter the visual confirmation code shown above in the appropriate box' + err_locked_out: 'You have used up all %config.lockout_threshold% allowed login attempts. Please wait %time_rem% minute%plural% before attempting to log in again%config.captcha_blurb%.', + err_locked_out_captcha_blurb: ', or enter the visual confirmation code shown above in the appropriate box', + login_body: '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.', + login_body_elev: 'You are requesting that a sensitive operation be performed. To continue, please re-enter your password to confirm your identity.', + login_field_username: 'Username', + login_field_password: 'Password', + login_forgotpass_blurb: 'Forgot your password? No problem.', + login_createaccount_blurb: 'Maybe you need to create an account.', + login_field_captcha: 'Code in image', + login_nocrypt_title: 'Important note regarding cryptography', + login_nocrypt_body: '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.', + login_nocrypt_countrylist: 'This restriction applies to the following countries: Belarus, China, India, Israel, Kazakhstan, Mongolia, Pakistan, Russia, Saudi Arabia, Singapore, Tunisia, Venezuela, and Vietnam.', }, page: { }, - adm: { + comment: { + }, + admhome: { }, } }; diff -r c75ad574b56d -r 8a00247d1dee plugins/PrivateMessages.php --- a/plugins/PrivateMessages.php Sat Oct 27 13:54:44 2007 -0400 +++ b/plugins/PrivateMessages.php Sun Oct 28 14:32:13 2007 -0400 @@ -35,12 +35,18 @@ function page_Special_PrivateMessages() { global $db, $session, $paths, $template, $plugins; // Common objects - if(!$session->user_logged_in) die_friendly('Access denied', '

You need to log in to view your private messages.

'); + if ( !$session->user_logged_in ) + { + die_friendly('Access denied', '

You need to log in to view your private messages.

'); + } $argv = Array(); $argv[] = $paths->getParam(0); $argv[] = $paths->getParam(1); $argv[] = $paths->getParam(2); - if(!$argv[0]) $argv[0] = 'InVaLiD'; + if ( !$argv[0] ) + { + $argv[0] = 'InVaLiD'; + } switch($argv[0]) { default: @@ -48,17 +54,29 @@ break; case 'View': $id = $argv[1]; - if(!preg_match('#^([0-9]+)$#', $id)) die_friendly('Message error', '

Invalid message ID

'); + if ( !preg_match('#^([0-9]+)$#', $id) ) + { + die_friendly('Message error', '

Invalid message ID

'); + } $q = $db->sql_query('SELECT p.message_from, p.message_to, p.subject, p.message_text, p.date, p.folder_name, u.signature FROM '.table_prefix.'privmsgs AS p LEFT JOIN '.table_prefix.'users AS u ON (p.message_from=u.username) WHERE message_id='.$id.''); - if(!$q) $db->_die('The message data could not be selected.'); + if ( !$q ) + { + $db->_die('The message data could not be selected.'); + } $r = $db->fetchrow(); $db->free_result(); - if( ($r['message_to'] != $session->username && $r['message_from'] != $session->username ) || $r['folder_name']=='drafts' ) die_friendly('Access denied', '

You are not authorized to view this message.

'); - if($r['message_to'] == $session->username) + if ( ($r['message_to'] != $session->username && $r['message_from'] != $session->username ) || $r['folder_name']=='drafts' ) + { + die_friendly('Access denied', '

You are not authorized to view this message.

'); + } + if ( $r['message_to'] == $session->username ) { $q = $db->sql_query('UPDATE '.table_prefix.'privmsgs SET message_read=1 WHERE message_id='.$id.''); $db->free_result(); - if(!$q) $db->_die('Could not mark message as read'); + if ( !$q ) + { + $db->_die('Could not mark message as read'); + } } $template->header(); userprefs_show_menu(); @@ -69,7 +87,7 @@ Subject: Date: Message:'; echo RenderMan::render($r['signature']); @@ -82,33 +100,60 @@ break; case 'Move': $id = $argv[1]; - if(!preg_match('#^([0-9]+)$#', $id)) die_friendly('Message error', '

Invalid message ID

'); + if ( !preg_match('#^([0-9]+)$#', $id) ) + { + die_friendly('Message error', '

Invalid message ID

'); + } $q = $db->sql_query('SELECT message_to FROM '.table_prefix.'privmsgs WHERE message_id='.$id.''); - if(!$q) $db->_die('The message data could not be selected.'); + if ( !$q ) + { + $db->_die('The message data could not be selected.'); + } $r = $db->fetchrow(); $db->free_result(); - if($r['message_to'] != $session->username) die_friendly('Access denied', '

You are not authorized to alter this message.

'); + if ( $r['message_to'] != $session->username ) + { + die_friendly('Access denied', '

You are not authorized to alter this message.

'); + } $fname = $argv[2]; - if(!$fname || ( $fname != 'Inbox' && $fname != 'Outbox' && $fname != 'Sent' && $fname != 'Drafts' && $fname != 'Archive' ) ) die_friendly('Invalid request', '

The folder name "'.$fname.'" is invalid.

'); + if ( !$fname || ( $fname != 'Inbox' && $fname != 'Outbox' && $fname != 'Sent' && $fname != 'Drafts' && $fname != 'Archive' ) ) + { + die_friendly('Invalid request', '

The folder name "'.$fname.'" is invalid.

'); + } $q = $db->sql_query('UPDATE '.table_prefix.'privmsgs SET folder_name=\''.strtolower($fname).'\' WHERE message_id='.$id.';'); $db->free_result(); - if(!$q) $db->_die('The message was not successfully moved.'); + if ( !$q ) + { + $db->_die('The message was not successfully moved.'); + } die_friendly('Message status', '

Your message has been moved to the folder "'.$fname.'".

Return to inbox

'); break; case 'Delete': $id = $argv[1]; - if(!preg_match('#^([0-9]+)$#', $id)) die_friendly('Message error', '

Invalid message ID

'); + if ( !preg_match('#^([0-9]+)$#', $id) ) + { + die_friendly('Message error', '

Invalid message ID

'); + } $q = $db->sql_query('SELECT message_to FROM '.table_prefix.'privmsgs WHERE message_id='.$id.''); - if(!$q) $db->_die('The message data could not be selected.'); + if ( !$q ) + { + $db->_die('The message data could not be selected.'); + } $r = $db->fetchrow(); - if($r['message_to'] != $session->username) die_friendly('Access denied', '

You are not authorized to delete this message.

'); + if ( $r['message_to'] != $session->username ) + { + die_friendly('Access denied', '

You are not authorized to delete this message.

'); + } $q = $db->sql_query('DELETE FROM '.table_prefix.'privmsgs WHERE message_id='.$id.';'); - if(!$q) $db->_die('The message was not successfully deleted.'); + if ( !$q ) + { + $db->_die('The message was not successfully deleted.'); + } $db->free_result(); die_friendly('Message status', '

The message has been deleted.

Return to inbox

'); break; case 'Compose': - if($argv[1]=='Send' && isset($_POST['_send'])) + if ( $argv[1]=='Send' && isset($_POST['_send']) ) { // Check each POST DATA parameter... if(!isset($_POST['to']) || ( isset($_POST['to']) && $_POST['to'] == '')) die_friendly('Sending of message failed', '

Please enter the username to which you want to send your message.

'); @@ -191,10 +236,26 @@ ?>
- - - - + + + + + + + + + + +
Compose new private message
To:
Separate multiple names with a single comma; you
can send this message to up to users.
username_field('to', (isset($_POST['_savedraft'])) ? $_POST['to'] : $to ); ?>
Subject:
Message:
Compose new private message
+ To:
+ Separate multiple names with a single comma; you
+ may send this message to up to users.
+
+ username_field('to', (isset($_POST['_savedraft'])) ? $_POST['to'] : $to ); ?> +
+ Subject: + +
Message:
- - - + + +
Edit draft
To:
Separate multiple names with a single comma
Subject:
Message:
To:
Separate multiple names with a single comma
Subject:
Message:
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') . '

'; + ?> diff -r c75ad574b56d -r 8a00247d1dee schema.sql --- a/schema.sql Sat Oct 27 13:54:44 2007 -0400 +++ b/schema.sql Sun Oct 28 14:32:13 2007 -0400 @@ -104,6 +104,7 @@ temp_password text, temp_password_time int(12) NOT NULL DEFAULT 0, user_coppa tinyint(1) NOT NULL DEFAULT 0, + user_lang smallint(5) NOT NULL, PRIMARY KEY (user_id) ) CHARACTER SET `utf8`; diff -r c75ad574b56d -r 8a00247d1dee upgrade.sql --- a/upgrade.sql Sat Oct 27 13:54:44 2007 -0400 +++ b/upgrade.sql Sun Oct 28 14:32:13 2007 -0400 @@ -9,6 +9,9 @@ -- UPDATE {{TABLE_PREFIX}}group_members SET group_id=9998 WHERE group_id=4; -- INSERT INTO {{TABLE_PREFIX}}groups(group_id,group_name,group_type,system_group) VALUES(4, 'Regular members', 3, 1); CREATE TABLE {{TABLE_PREFIX}}lockout( id int(12) NOT NULL auto_increment, ipaddr varchar(40) NOT NULL, action ENUM('credential', 'level') NOT NULL DEFAULT 'credential', timestamp int(12) NOT NULL DEFAULT 0, PRIMARY KEY ( id ) ) CHARACTER SET `utf8`; +CREATE TABLE {{TABLE_PREFIX}}language( lang_id smallint(5) NOT NULL auto_increment, lang_code varchar(16) NOT NULL, lang_name_default varchar(64) NOT NULL, lang_name_native varchar(64) NOT NULL, PRIMARY KEY ( lang_id ) ) CHARACTER SET `utf8`; +CREATE TABLE {{TABLE_PREFIX}}language_strings( string_id bigint(15) NOT NULL auto_increment, lang_id smallint(5) NOT NULL, string_category varchar(32) NOT NULL, string_name varchar(64) NOT NULL, string_content longtext NOT NULL, PRIMARY KEY ( string_id ) ); +ALTER TABLE {{TABLE_PREFIX}}users ADD COLUMN user_lang smallint(5) NOT NULL; ---END Stable1.0ToUnstable1.1--- ---BEGIN 1.0.2--- ---END 1.0.2---