Use namespace in login form

This commit is contained in:
Jakub Vrana
2012-05-14 00:08:32 -07:00
parent 6591d485e9
commit f595f9313e
6 changed files with 30 additions and 28 deletions

View File

@@ -37,13 +37,13 @@ class AdminerLoginServers {
function loginForm() {
?>
<table cellspacing="0">
<tr><th><?php echo lang('Server'); ?><td><input type="hidden" name="driver" value="<?php echo $this->driver; ?>"><select name="server"><?php echo optionlist($this->servers, SERVER); ?></select>
<tr><th><?php echo lang('Username'); ?><td><input id="username" name="username" value="<?php echo h($_GET["username"]); ?>">
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="password">
<tr><th><?php echo lang('Server'); ?><td><input type="hidden" name="auth[driver]" value="<?php echo $this->driver; ?>"><select name="auth[server]"><?php echo optionlist($this->servers, SERVER); ?></select>
<tr><th><?php echo lang('Username'); ?><td><input id="username" name="auth[username]" value="<?php echo h($_GET["username"]); ?>">
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="auth[password]">
</table>
<p><input type="submit" value="<?php echo lang('Login'); ?>">
<?php
echo checkbox("permanent", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
echo checkbox("auth[permanent]", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
return true;
}

View File

@@ -18,8 +18,8 @@ class AdminerPasswordSha1 {
$this->login = $login;
$this->passwordSha1 = $passwordSha1;
$this->credentials = $credentials;
if (isset($_POST["password"])) {
$_POST["password"] = sha1($_POST["password"]);
if (isset($_POST["auth"])) {
$_POST["auth"]["password"] = sha1($_POST["auth"]["password"]);
}
}
@@ -32,7 +32,7 @@ class AdminerPasswordSha1 {
}
function permanentLogin() {
//! should save original $_POST["password"] and hash after load
//! should save original $_POST["auth"]["password"] and hash after load
}
}