AJAX only with login

This commit is contained in:
Jakub Vrana 2010-11-26 10:26:08 +01:00
parent 8ce9ba616d
commit 8194002102
3 changed files with 5 additions and 6 deletions

View file

@ -73,6 +73,7 @@ function auth_error($exception = null) {
}
}
}
unset($_GET["username"]); // checked in page_header() for successful login
page_header(lang('Login'), $error, null);
echo "<form action='' method='post'>\n";
$adminer->loginForm();

View file

@ -32,7 +32,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<link rel="stylesheet" type="text/css" href="adminer.css">
<?php } ?>
<body class="<?php echo lang('ltr'); ?>" onclick="return bodyClick(event<?php echo (isset($_GET["username"]) ? ", '" . js_escape(DB) . "'" : ""); ?>);" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
<body class="<?php echo lang('ltr'); ?>"<?php if (isset($_GET["username"])) { ?> onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>');"<?php } ?> onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
<script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script>

View file

@ -368,7 +368,7 @@ function selectDblClick(td, event, text) {
/** Load link by AJAX
* @param MouseEvent
* @param [string]
* @param string
* @return bool
*/
function bodyClick(event, db) {
@ -381,11 +381,9 @@ function bodyClick(event, db) {
}
if (/^a$/i.test(el.tagName) && !/^https?:|#/i.test(el.getAttribute('href')) && /[&?]username=/.exec(el.href)) {
var match = /&db=([^&]*)/.exec(el.href);
if (db === (match ? match[1] : '') && ajaxMain(el.href, '', event)) {
return false;
}
return !(db == (match ? match[1] : '') && ajaxMain(el.href, '', event));
}
if (/^input$/i.test(el.tagName) && /submit|image/.test(el.type) && !/&(database|scheme|create|view|sql|user)=/.test(location.href) && /[&?]username=/.test(location.href)) {
if (/^input$/i.test(el.tagName) && /submit|image/.test(el.type) && !/&(database|scheme|create|view|sql|user)=/.test(location.href)) {
return !ajaxForm(el.form, (el.name ? encodeURIComponent(el.name) + '=1' : ''));
}
return true;