Skip to content

Commit

Permalink
Implemented Feature #1637010: loginUsername & loginPassword not diffe…
Browse files Browse the repository at this point in the history
…rent for every server.

Password field name is appended with the MD5 of the server.
Username should not be required.
  • Loading branch information
mr-russ committed Apr 18, 2007
1 parent 1c49f70 commit 4e0e1b6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions HISTORY
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions libraries/lib.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) : ?>
Expand Down

0 comments on commit 4e0e1b6

Please sign in to comment.