<?php
-if (!(strlen($_GET["db"]) ? $mysql->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 "<p class='error'>" . lang('Invalid database.') . "</p>\n";
} else {
- echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Create new database') . '</a></p>';
+ echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Create new database') . "</a></p>\n";
+ echo '<p><a href="' . htmlspecialchars($SELF) . 'processlist=">' . lang('Process list') . "</a></p>\n";
}
page_footer("db");
exit;
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"]));
'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',
'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)) {
--- /dev/null
+<?php
+if ($_POST && !$error) {
+ $killed = 0;
+ foreach ((array) $_POST["kill"] as $val) {
+ if ($mysql->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 "<p class='error'>" . lang('Unable to kill process') . ": " . htmlspecialchars($error) . "</p>\n";
+}
+?>
+
+<form action="" method="post">
+<table border="1" cellspacing="0" cellpadding="2">
+<?php
+$result = $mysql->query("SHOW PROCESSLIST");
+for ($i=0; $row = $result->fetch_assoc(); $i++) {
+ if (!$i) {
+ echo "<thead><tr><th> </th><th>" . implode("</th><th>", array_keys($row)) . "</th></tr></thead>\n"; //! translation
+ }
+ echo "<tr><td><input type='checkbox' name='kill[]' value='$row[Id]' /></td><td>" . implode("</td><td>", $row) . "</td></tr>\n";
+}
+$result->free();
+?>
+</table>
+<p>
+<input type="hidden" name="token" value="<?php echo $token; ?>" />
+<input type="submit" value="<?php echo lang('Kill'); ?>" />
+</p>
+</form>