From 4e0e1b6de3c0722b6d374a5fc2232b8417f814b9 Mon Sep 17 00:00:00 2001 From: mr-russ Date: Wed, 18 Apr 2007 14:06:14 +0000 Subject: [PATCH] Implemented Feature #1637010: loginUsername & loginPassword not different for every server. Password field name is appended with the MD5 of the server. Username should not be required. --- HISTORY | 1 + libraries/lib.inc.php | 10 +++++----- login.php | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/HISTORY b/HISTORY index 693d7ada..4c7b33cc 100644 --- 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 diff --git a/libraries/lib.inc.php b/libraries/lib.inc.php index 602bea51..01e32a07 100644 --- a/libraries/lib.inc.php +++ b/libraries/lib.inc.php @@ -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'); @@ -72,22 +72,22 @@ ini_set('magic_quotes_runtime', 0); ini_set('magic_quotes_sybase', 0); ini_set('arg_separator.output', '&'); - + // 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; diff --git a/login.php b/login.php index 1142c873..6aa28df2 100755 --- 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 @@ - + 1) : ?> -- 2.39.5