AJAX only with login
This commit is contained in:
parent
8ce9ba616d
commit
8194002102
|
@ -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);
|
page_header(lang('Login'), $error, null);
|
||||||
echo "<form action='' method='post'>\n";
|
echo "<form action='' method='post'>\n";
|
||||||
$adminer->loginForm();
|
$adminer->loginForm();
|
||||||
|
|
|
@ -32,7 +32,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
||||||
<link rel="stylesheet" type="text/css" href="adminer.css">
|
<link rel="stylesheet" type="text/css" href="adminer.css">
|
||||||
<?php } ?>
|
<?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="../adminer/static/functions.js"></script>
|
||||||
<script type="text/javascript" src="static/editing.js"></script>
|
<script type="text/javascript" src="static/editing.js"></script>
|
||||||
|
|
||||||
|
|
|
@ -368,7 +368,7 @@ function selectDblClick(td, event, text) {
|
||||||
|
|
||||||
/** Load link by AJAX
|
/** Load link by AJAX
|
||||||
* @param MouseEvent
|
* @param MouseEvent
|
||||||
* @param [string]
|
* @param string
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function bodyClick(event, db) {
|
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)) {
|
if (/^a$/i.test(el.tagName) && !/^https?:|#/i.test(el.getAttribute('href')) && /[&?]username=/.exec(el.href)) {
|
||||||
var match = /&db=([^&]*)/.exec(el.href);
|
var match = /&db=([^&]*)/.exec(el.href);
|
||||||
if (db === (match ? match[1] : '') && ajaxMain(el.href, '', event)) {
|
return !(db == (match ? match[1] : '') && ajaxMain(el.href, '', event));
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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 !ajaxForm(el.form, (el.name ? encodeURIComponent(el.name) + '=1' : ''));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue