]> git.joonet.de Git - adminer.git/commitdiff
Support Editor
authorJakub Vrana <jakub@vrana.cz>
Mon, 20 Aug 2012 06:25:23 +0000 (23:25 -0700)
committerJakub Vrana <jakub@vrana.cz>
Mon, 20 Aug 2012 06:31:46 +0000 (23:31 -0700)
adminer/include/functions.inc.php
editor/include/adminer.inc.php
editor/script.inc.php

index aa5b36a970f07551af9317d6f9033075b3b7e739..1460906e2eb05470d7d24fc52535c07a4d22f1b3 100644 (file)
@@ -905,7 +905,8 @@ function is_url($string) {
 */
 function slow_query($query) {
        global $adminer, $token;
-       if (support("kill") && is_object($connection2 = connect()) && (DB == "" || $connection2->select_db(DB))) {
+       $db = $adminer->database();
+       if (support("kill") && is_object($connection2 = connect()) && ($db == "" || $connection2->select_db($db))) {
                $kill = $connection2->result("SELECT CONNECTION_ID()"); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL
                ?>
 <script type="text/javascript">
index c21a1c4ec637c0641b3e47a92e7257970beb0343..54a0796acb32c2055f4d1c4f4d50524ec7630bb0 100644 (file)
@@ -30,6 +30,10 @@ class Adminer {
                return get_databases($flush);
        }
        
+       function queryTimeout() {
+               return 5;
+       }
+       
        function headers() {
                return true;
        }
index e1189ef2ec944055d39ec98080057f1874936da9..f7b7f6448cec2fd4329a920d0d1f2aa0b2d8605f 100644 (file)
@@ -1,5 +1,8 @@
 <?php
-if (list($table, $id, $name) = $adminer->_foreignColumn(column_foreign_keys($_GET["source"]), $_GET["field"])) {
+if ($_GET["script"] == "kill") {
+       $connection->query("KILL " . (+$_POST["kill"]));
+
+} elseif (list($table, $id, $name) = $adminer->_foreignColumn(column_foreign_keys($_GET["source"]), $_GET["field"])) {
        $result = $connection->query("SELECT $id, $name FROM " . table($table) . " WHERE " . (ereg('^[0-9]+$', $_GET["value"]) ? "$id = $_GET[value] OR " : "") . "$name LIKE " . q("$_GET[value]%") . " ORDER BY 2 LIMIT 11");
        for ($i=0; $i < 10 && ($row = $result->fetch_row()); $i++) {
                echo "<a href='" . h(ME . "edit=" . urlencode($table) . "&where" . urlencode("[" . bracket_escape(idf_unescape($id)) . "]") . "=" . urlencode($row[0])) . "'>" . h($row[1]) . "</a><br>\n";