diff --git a/connect.inc.php b/connect.inc.php index 9025445d..65281d67 100644 --- a/connect.inc.php +++ b/connect.inc.php @@ -1,11 +1,12 @@ select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]))) { +if (!(strlen($_GET["db"]) ? $mysql->select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]))) { unset($_SESSION["databases"][$_GET["server"]]); page_header(lang('Select database')); if (strlen($_GET["db"])) { echo "

" . lang('Invalid database.') . "

\n"; } else { - echo '

' . lang('Create new database') . '

'; + echo '

' . lang('Create new database') . "

\n"; + echo '

' . lang('Process list') . "

\n"; } page_footer("db"); exit; diff --git a/index.php b/index.php index fd0f6f38..1b31c8c3 100644 --- a/index.php +++ b/index.php @@ -64,6 +64,8 @@ if (isset($_GET["dump"])) { include "./foreign.inc.php"; } elseif (isset($_GET["createv"])) { include "./createv.inc.php"; + } elseif (isset($_GET["processlist"])) { + include "./processlist.inc.php"; } else { $TOKENS = array(); page_header(htmlspecialchars(lang('Database') . ": " . $_GET["db"])); diff --git a/lang.inc.php b/lang.inc.php index 8e1a9313..74ab0433 100644 --- a/lang.inc.php +++ b/lang.inc.php @@ -6,6 +6,7 @@ function lang($idf = null, $number = null) { 'Query executed OK, %d row(s) affected.' => array('Query executed OK, %d row affected.', 'Query executed OK, %d rows affected.'), '%d byte(s)' => array('%d byte', '%d bytes'), 'Routine has been called, %d row(s) affected.' => array('Routine has been called, %d row affected.', 'Routine has been called, %d rows affected.'), + '%d process(es) has been killed.' => array('%d process has been killed.', '%d processes have been killed.'), ), 'cs' => array( 'Login' => 'Přihlásit se', @@ -129,6 +130,10 @@ function lang($idf = null, $number = null) { 'Create view' => 'Vytvořit pohled', 'Unable to operate view' => 'Nepodařilo se zpracovat pohled', 'Name' => 'Název', + 'Process list' => 'Seznam procesů', + '%d process(es) has been killed.' => array('Byl ukončen %d proces.', 'Byly ukončeny %d procesy.', 'Bylo ukončeno %d procesů.'), + 'Unable to kill process' => 'Nepodařilo se ukončit proces.', + 'Kill' => 'Ukončit', ), ); if (!isset($idf)) { diff --git a/processlist.inc.php b/processlist.inc.php new file mode 100644 index 00000000..a7ab41f4 --- /dev/null +++ b/processlist.inc.php @@ -0,0 +1,39 @@ +query("KILL " . intval($val))) { + $killed++; + } + } + if ($killed || !$_POST["kill"]) { + redirect($SELF . "processlist=", lang('%d process(es) has been killed.', $killed)); + } + $error = $mysql->error; +} + +page_header(lang('Process list')); + +if ($_POST) { + echo "

" . lang('Unable to kill process') . ": " . htmlspecialchars($error) . "

\n"; +} +?> + +
+ +query("SHOW PROCESSLIST"); +for ($i=0; $row = $result->fetch_assoc(); $i++) { + if (!$i) { + echo "\n"; //! translation + } + echo "\n"; +} +$result->free(); +?> +
 " . implode("", array_keys($row)) . "
" . implode("", $row) . "
+

+ + +

+