Implemented Feature #1637010: loginUsername & loginPassword not different for every...
authormr-russ <mr-russ>
Wed, 18 Apr 2007 14:06:14 +0000 (14:06 +0000)
committermr-russ <mr-russ>
Wed, 18 Apr 2007 14:06:14 +0000 (14:06 +0000)
Password field name is appended with the MD5 of the server.
Username should not be required.

HISTORY
libraries/lib.inc.php
login.php

diff --git a/HISTORY b/HISTORY
index 693d7ada2e54496d6d936e316b97dea4ec3e31c0..4c7b33cc2f7fa038669e2da3a5e0b12dc69e6e57 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -5,6 +5,7 @@ Version 4.2
 -----------
 
 Features
+* Login will allow browsers to save different usernames and passwords for different servers.
 * Pagination selection available fore reports
 * You can configure reports db, schema and table names
 
index 602bea51bf3144aa4134a7774f978d1c40d90883..01e32a0728eee71221e239110e8e379b04d7885e 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Function library read in upon startup
         *
-        * $Id: lib.inc.php,v 1.112 2007/01/22 14:19:18 soranzo Exp $
+        * $Id: lib.inc.php,v 1.113 2007/04/18 14:06:14 mr-russ Exp $
         */
        include_once('./libraries/decorator.inc.php');
        include_once('./lang/translations.php');
        ini_set('magic_quotes_runtime', 0);
        ini_set('magic_quotes_sybase', 0);
        ini_set('arg_separator.output', '&amp;');
-       
+
        // If login action is set, then set session variables
        if (isset($_POST['loginServer']) && isset($_POST['loginUsername']) && 
-               isset($_POST['loginPassword'])) {
+               isset($_POST['loginPassword_'.md5($_POST['loginServer'])])) {
                
                $_server_info = $misc->getServerInfo($_POST['loginServer']);
                
                $_server_info['username'] = $_POST['loginUsername'];
-               $_server_info['password'] = $_POST['loginPassword'];
+               $_server_info['password'] = $_POST['loginPassword_'.md5($_POST['loginServer'])];
                
                $misc->setServerInfo(null, $_server_info, $_POST['loginServer']);
 
                // Check for shared credentials
                if (isset($_POST['loginShared'])) {
                        $_SESSION['sharedUsername'] = $_POST['loginUsername'];
-                       $_SESSION['sharedPassword'] = $_POST['loginPassword'];
+                       $_SESSION['sharedPassword'] = $_POST['loginPassword_'.md5($_POST['loginServer'])];
                }
                
                $_reload_browser = true;
index 1142c873ab0f05bb8557a9a64e655b3258bf44e9..6aa28df262c20fc5504c317834e5adb20490310d 100755 (executable)
--- a/login.php
+++ b/login.php
@@ -3,7 +3,7 @@
        /**
         * Login screen
         *
-        * $Id: login.php,v 1.32 2006/06/17 12:57:36 xzilla Exp $
+        * $Id: login.php,v 1.33 2007/04/18 14:06:14 mr-russ Exp $
         */
        global $conf;
        
@@ -40,7 +40,7 @@
                </tr>
                <tr>
                        <td><?php echo $lang['strpassword']; ?></td>
-                       <td><input type="password" name="loginPassword" size="24" /></td>
+                       <td><input type="password" name="loginPassword_<?php echo md5($_REQUEST['server']); ?>" size="24" /></td>
                </tr>
        </table>
 <?php if (sizeof($conf['servers']) > 1) : ?>