1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-17 20:01:25 +02:00

Report invalid schema

This commit is contained in:
Jakub Vrana
2010-10-18 02:15:58 +02:00
parent 09327efdaf
commit d49903b21d
5 changed files with 14 additions and 6 deletions

View File

@@ -491,7 +491,7 @@ document.getElementById('username').focus();
}
/** Prints navigation after Adminer title
* @param string can be "auth" if there is no database connection or "db" if there is no database selected
* @param string can be "auth" if there is no database connection, "db" if there is no database selected, "ns" with invalid schema
* @return null
*/
function navigation($missing) {
@@ -544,7 +544,7 @@ document.getElementById('username').focus();
set_schema($_GET["ns"]);
}
}
if ($_GET["ns"] !== "") {
if ($_GET["ns"] !== "" && $missing != "ns") {
$tables = tables_list();
if (!$tables) {
echo "<p class='message'>" . lang('No tables.') . "\n";

View File

@@ -60,6 +60,13 @@ if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET
exit;
}
if (support("scheme") && DB != "" && $_GET["ns"] !== "" && (!isset($_GET["ns"]) || !set_schema($_GET["ns"]))) {
redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema());
if (support("scheme") && DB != "" && $_GET["ns"] !== "") {
if (!isset($_GET["ns"])) {
redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema());
}
if (!set_schema($_GET["ns"])) {
page_header(lang('Schema') . ": " . h($_GET["ns"]), lang('Invalid schema.'), true);
page_footer("ns");
exit;
}
}

View File

@@ -73,7 +73,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
}
/** Print HTML footer
* @param string auth|db
* @param string "auth", "db", "ns"
* @return null
*/
function page_footer($missing = "") {

View File

@@ -262,6 +262,7 @@ $translations = array(
'Schema has been altered.' => 'Schéma bylo změněno.',
'schema' => 'schéma',
'Schema' => 'Schéma',
'Invalid schema.' => 'Nesprávné schéma.',
// PostgreSQL sequences support
'Sequences' => 'Sekvence',