summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-08-11 15:25:51 +0100
committerAndrew Dolgov <[email protected]>2007-08-11 15:25:51 +0100
commitf8c612d48305cfb54c6bfe44c55689ed062eca88 (patch)
treed3e64286d675c139bc94eaff353bdc404ceca07f
parent08e81c0b5c28d732a432f142de3f2c9316458a07 (diff)
add lang to login form (2)
-rw-r--r--functions.php11
-rw-r--r--login_form.php8
2 files changed, 19 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index cd30b4560..1dd0f4935 100644
--- a/functions.php
+++ b/functions.php
@@ -8,6 +8,15 @@
require_once 'config.php';
+ function get_translations() {
+ $tr = array("en_US" => "English",
+ "ru_RU" => "Russian",
+ "fr_FR" => "French",
+ "zh_CN" => "Chinese");
+
+ return $tr;
+ }
+
if (ENABLE_TRANSLATIONS == true) {
require_once "accept-to-gettext.php";
require_once "gettext/gettext.inc";
@@ -1377,6 +1386,8 @@
if (authenticate_user($link, $login, $password)) {
$_POST["password"] = "";
+ $_SESSION["language"] = $_POST["language"];
+
header("Location: " . $_SERVER["REQUEST_URI"]);
exit;
diff --git a/login_form.php b/login_form.php
index 55ad4b1a1..46a7b084c 100644
--- a/login_form.php
+++ b/login_form.php
@@ -50,6 +50,14 @@ window.onload = init;
<td align="right"><input name="login"></td></tr>
<tr><td align="right"><?php echo __("Password:") ?></td>
<td align="right"><input type="password" name="password"></td></tr>
+ <tr><td align="right"><?php echo __("Language:") ?></td>
+ <td align="right">
+ <?php
+ print_select_hash("language", "", get_translations(),
+ "style='width : 100%'");
+
+ ?>
+ </td></tr>
<!-- <tr><td colspan="2">
<input type="checkbox" name="remember_me" id="remember_me">
<label for="remember_me">Remember me on this computer</label>