Login variables must begin with 'login'. Use tab for indent in HTML. Simplify languag...
authorsoranzo <soranzo>
Tue, 2 Aug 2005 15:56:30 +0000 (15:56 +0000)
committersoranzo <soranzo>
Tue, 2 Aug 2005 15:56:30 +0000 (15:56 +0000)
libraries/lib.inc.php
login.php

index 8e864f510168b0a60cddd9a6ca0c66f233e2f5d0..3ffb0d6d8f438acb72c5ac3b4be5aa5212b0857e 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Function library read in upon startup
         *
-        * $Id: lib.inc.php,v 1.102 2005/08/01 05:54:31 chriskl Exp $
+        * $Id: lib.inc.php,v 1.103 2005/08/02 15:56:30 soranzo Exp $
         */
        include_once('decorator.inc.php');
        include_once('./lang/translations.php');
@@ -85,7 +85,7 @@
                $misc->setServerInfo(null, $_server_info, $_POST['loginServer']);
 
                // Check for shared credentials
-               if (isset($_POST['sharePassword'])) {
+               if (isset($_POST['loginShared'])) {
                        $_SESSION['sharedUsername'] = $_POST['loginUsername'];
                        $_SESSION['sharedPassword'] = $_POST['loginPassword'];
                }
 
        // Determine language file to import:
        // 1. Check for the language from a request var
-       if (isset($_REQUEST['language'])) {
-               $_language = strtolower($_REQUEST['language']);
-               if (!isset($appLangFiles[$_language]))
-                       unset($_language);
-       }
+       if (isset($_REQUEST['language']) && isset($appLangFiles[$_REQUEST['language']]))
+               $_language = $_REQUEST['language'];
        
        // 2. Check for language session var
        if (!isset($_language) && isset($_SESSION['webdbLanguage']) && isset($appLangFiles[$_SESSION['webdbLanguage']])) {
index 0c7019ffb2722217b3849c6235d8e05ab78c4b16..fbb3a4940d4218a7b47c93893df79d660c07cfde 100755 (executable)
--- a/login.php
+++ b/login.php
@@ -3,7 +3,7 @@
        /**
         * Login screen
         *
-        * $Id: login.php,v 1.29 2005/08/01 15:40:15 soranzo Exp $
+        * $Id: login.php,v 1.30 2005/08/02 15:56:30 soranzo Exp $
         */
 
        // This needs to be an include once to prevent lib.inc.php infinite recursive includes.
@@ -23,8 +23,6 @@
 
 <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" name="login_form">
 <?php
-       // Set sharePassword by default
-       if (!isset($_POST['loginUsername'])) $_POST['sharePassword'] = 'on';
        if (!empty($_POST)) $vars =& $_POST;
        else $vars =& $_GET;
        // Pass request vars through form (is this a security risk???)
                echo "<input type=\"hidden\" name=\"", htmlspecialchars($key), "\" value=\"", htmlspecialchars($val), "\" />\n";
        }
 ?>
- <input type="hidden" name="loginServer" value="<?php echo htmlspecialchars($_REQUEST['server']); ?>" />
- <table class="navbar" border="0" cellpadding="5" cellspacing="3">
-  <tr>
-   <td><?php echo $lang['strusername']; ?></td>
-   <td><input type="text" name="loginUsername" value="<?php if (isset($_POST['loginUsername'])) echo htmlspecialchars($_POST['loginUsername']); ?>" size="24" /></td>
-  </tr>
-  <tr>
-   <td><?php echo $lang['strpassword']; ?></td>
-   <td><input type="password" name="loginPassword" size="24" /></td>
-  </tr>
- </table>
<p><input type="checkbox" name="sharePassword" <?php echo isset($_POST['sharePassword']) ? 'checked="checked"' : '' ?> /><?php echo $lang['strtrycred'] ?></p>
- <p><input type="submit" name="loginSubmit" value="<?php echo $lang['strlogin']; ?>" /></p>
      <input type="hidden" name="loginServer" value="<?php echo htmlspecialchars($_REQUEST['server']); ?>" />
      <table class="navbar" border="0" cellpadding="5" cellspacing="3">
+               <tr>
+                       <td><?php echo $lang['strusername']; ?></td>
+                       <td><input type="text" name="loginUsername" value="<?php if (isset($_POST['loginUsername'])) echo htmlspecialchars($_POST['loginUsername']); ?>" size="24" /></td>
+               </tr>
+               <tr>
+                       <td><?php echo $lang['strpassword']; ?></td>
+                       <td><input type="password" name="loginPassword" size="24" /></td>
+               </tr>
      </table>
      <p><input type="checkbox" name="loginShared" <?php echo isset($_POST['loginShared']) ? 'checked="checked"' : '' ?> /><?php echo $lang['strtrycred'] ?></p>
      <p><input type="submit" name="loginSubmit" value="<?php echo $lang['strlogin']; ?>" /></p>
 </form>
 
 <script type="text/javascript">