]> git.joonet.de Git - adminer.git/commitdiff
AJAX only with login
authorJakub Vrana <jakub@vrana.cz>
Fri, 26 Nov 2010 09:26:08 +0000 (10:26 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 26 Nov 2010 09:32:30 +0000 (10:32 +0100)
adminer/include/auth.inc.php
adminer/include/design.inc.php
adminer/static/functions.js

index 590b4c239af41a61651d6bb497a2ddd803c9e4c0..d951c526923bd7a4a4468259dca966d6012be40b 100644 (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();
index dfad385aef59fcd3f588d09efeb538dcfb7bc5df..6e9bb84022232ad4b3ffdcd4fd8d2b649582344d 100644 (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>
 
index c678e785beb117b826c12a484ad18e83a013ecae..91a3b0cb99d86a9af68d80cc3e994cabd0eaefee 100644 (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;