2007-07-02 05:51:26 +00:00
|
|
|
<?php
|
2009-05-29 20:30:16 +00:00
|
|
|
function connect_error() {
|
2009-07-30 08:12:54 +00:00
|
|
|
global $dbh, $VERSION;
|
2007-07-02 05:51:26 +00:00
|
|
|
if (strlen($_GET["db"])) {
|
2009-07-28 16:20:50 +00:00
|
|
|
page_header(lang('Database') . ": " . h($_GET["db"]), lang('Invalid database.'), false);
|
2007-07-02 20:21:30 +00:00
|
|
|
} else {
|
2008-04-10 14:37:10 +00:00
|
|
|
page_header(lang('Select database'), "", null);
|
2009-06-21 23:35:27 +00:00
|
|
|
foreach (array(
|
|
|
|
'database' => lang('Create new database'),
|
|
|
|
'privileges' => lang('Privileges'),
|
|
|
|
'processlist' => lang('Process list'),
|
|
|
|
'variables' => lang('Variables'),
|
|
|
|
) as $key => $val) {
|
2009-07-30 08:12:54 +00:00
|
|
|
echo '<p><a href="' . h(ME) . "$key=\">$val</a>\n";
|
2009-06-21 23:35:27 +00:00
|
|
|
}
|
2009-07-11 20:30:40 +00:00
|
|
|
echo "<p>" . lang('MySQL version: %s through PHP extension %s', "<b" . ($dbh->server_info < 4.1 ? " class='binary'" : "") . ">$dbh->server_info</b>", "<b>$dbh->extension</b>") . "\n";
|
2009-07-28 16:20:50 +00:00
|
|
|
echo "<p>" . lang('Logged as: %s', "<b>" . h($dbh->result($dbh->query("SELECT USER()"))) . "</b>") . "\n";
|
2007-07-02 05:51:26 +00:00
|
|
|
}
|
2007-07-06 08:47:20 +00:00
|
|
|
page_footer("db");
|
2009-05-29 20:30:16 +00:00
|
|
|
}
|
|
|
|
|
2009-06-16 15:10:37 +00:00
|
|
|
if (!(strlen($_GET["db"]) ? $dbh->select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["variables"]))) {
|
2009-05-29 20:30:16 +00:00
|
|
|
if (strlen($_GET["db"])) {
|
|
|
|
unset($_SESSION["databases"][$_GET["server"]]);
|
|
|
|
}
|
2009-06-21 23:20:32 +00:00
|
|
|
connect_error(); // separate function to catch SQLite error
|
2007-07-02 05:51:26 +00:00
|
|
|
exit;
|
|
|
|
}
|