]> git.wh0rd.org Git - tt-rss.git/commitdiff
add lang to login form (2)
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 11 Aug 2007 14:25:51 +0000 (15:25 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 11 Aug 2007 14:25:51 +0000 (15:25 +0100)
functions.php
login_form.php

index cd30b45606b345d47af69d00fd97a43a2bf14458..1dd0f49353e8c7fc8d9b30a3209709baf179646d 100644 (file)
@@ -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";
                                if (authenticate_user($link, $login, $password)) {
                                        $_POST["password"] = "";
 
+                                       $_SESSION["language"] = $_POST["language"];
+
                                        header("Location: " . $_SERVER["REQUEST_URI"]);
                                        exit;
 
index 55ad4b1a1d88d7130e3bc83a3e58f3e7f1220201..46a7b084c24ea72f3684151713aa98c1d131418e 100644 (file)
@@ -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>