bug #682161
[phpmyadmin/crack.git] / server_processlist.php3
blob49f9ac0ae9c5fe4514e24ab60df6431dcd0629f9
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * Does the common work
8 */
9 require('./server_common.inc.php3');
12 /**
13 * Kills a selected process
15 if (!empty($kill)) {
16 $sql_query = 'KILL ' . $kill . ';';
17 if (@PMA_mysql_query($sql_query, $userlink)) {
18 $message = sprintf($strThreadSuccessfullyKilled, $kill);
19 } else {
20 $message = sprintf($strCouldNotKill, $kill);
25 /**
26 * Displays the links
28 require('./server_links.inc.php3');
31 /**
32 * Displays the sub-page heading
34 echo '<h2>' . "\n"
35 . ' ' . $strProcesslist . "\n"
36 . '</h2>' . "\n";
39 /**
40 * Sends the query and buffers the result
42 $serverProcesses = array();
43 $res = @PMA_mysql_query('SHOW PROCESSLIST;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW PROCESSLIST;');
44 while ($row = PMA_mysql_fetch_array($res, MYSQL_ASSOC)) {
45 $serverProcesses[] = $row;
47 @mysql_free_result($res);
48 unset($res);
49 unset($row);
52 /**
53 * Displays the page
56 <table border="0">
57 <tr>
58 <th></th>
59 <th>&nbsp;<?php echo $strId; ?>&nbsp;</th>
60 <th>&nbsp;<?php echo $strUser; ?>&nbsp;</th>
61 <th>&nbsp;<?php echo $strHost; ?>&nbsp;</th>
62 <th>&nbsp;<?php echo $strDatabase; ?>&nbsp;</th>
63 <th>&nbsp;<?php echo $strCommand; ?>&nbsp;</th>
64 <th>&nbsp;<?php echo $strTime; ?>&nbsp;</th>
65 <th>&nbsp;<?php echo $strStatus; ?>&nbsp;</th>
66 <th>&nbsp;<?php echo $strSQLQuery; ?>&nbsp;</th>
67 </tr>
68 <?php
69 $useBgcolorOne = TRUE;
70 while (list($name, $value) = each($serverProcesses)) {
72 <tr>
73 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<a href="./server_processlist.php3?<?php echo $url_query . '&amp;kill=' . $value['Id']; ?>"><?php echo $strKill; ?></a>&nbsp;</td>
74 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right">&nbsp;<?php echo $value['Id']; ?>&nbsp;</td>
75 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo $value['User']; ?>&nbsp;</td>
76 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo $value['Host']; ?>&nbsp;</td>
77 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo (empty($value['db']) ? '<i>' . $strNone . '</i>' : $value['db']); ?>&nbsp;</td>
78 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo $value['Command']; ?>&nbsp;</td>
79 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right">&nbsp;<?php echo $value['Time']; ?>&nbsp;</td>
80 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo (empty($value['State']) ? '---' : $value['State']); ?>&nbsp;</td>
81 <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo (empty($value['Info']) ? '---' : PMA_SQP_formatHtml(PMA_SQP_parse($value['Info']))); ?>&nbsp;</td>
82 <?php
83 $useBgcolorOne = !$useBgcolorOne;
86 </tr>
87 <?php
89 </table>
90 <?php
93 /**
94 * Sends the footer
96 require('./footer.inc.php3');