1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 09:34:10 +02:00

Merge branch 'master' into ajax

This commit is contained in:
Jakub Vrana
2010-10-18 07:50:03 +02:00
22 changed files with 138 additions and 55 deletions

View File

@@ -28,7 +28,7 @@ if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP c
if (!$_POST["collation"]) { if (!$_POST["collation"]) {
redirect(substr(ME, 0, -1)); redirect(substr(ME, 0, -1));
} }
query_redirect("ALTER DATABASE " . idf_escape($_POST["name"]) . " COLLATE $_POST[collation]", substr(ME, 0, -1), lang('Database has been altered.')); //! SQL injection - quotes are not allowed in MS SQL 2005 query_redirect("ALTER DATABASE " . idf_escape($_POST["name"]) . (eregi('^[a-z0-9_]+$', $_POST["collation"]) ? " COLLATE $_POST[collation]" : ""), substr(ME, 0, -1), lang('Database has been altered.'));
} }
} }

View File

@@ -154,7 +154,9 @@ if ($_GET["ns"] !== "") {
echo '<p><a href="' . h(ME) . 'event=">' . lang('Create event') . "</a>\n"; echo '<p><a href="' . h(ME) . 'event=">' . lang('Create event') . "</a>\n";
} }
if ($tables_list) {
page_footer(); page_footer();
echo "<script type='text/javascript' src='" . h(ME) . "script=db'></script>\n"; echo "<script type='text/javascript' src='" . h(ME . "script=db&token=$token") . "'></script>\n";
exit; // page_footer() already called exit; // page_footer() already called
}
} }

View File

@@ -383,7 +383,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
} }
function create_database($db, $collation) { function create_database($db, $collation) {
return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " COLLATE $collation" : "")); return queries("CREATE DATABASE " . idf_escape($db) . (eregi('^[a-z0-9_]+$', $collation) ? " COLLATE $collation" : ""));
} }
function drop_databases($databases) { function drop_databases($databases) {
@@ -391,7 +391,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
} }
function rename_database($name, $collation) { function rename_database($name, $collation) {
if ($collation) { if (eregi('^[a-z0-9_]+$', $collation)) {
queries("ALTER DATABASE " . idf_escape(DB) . " COLLATE $collation"); queries("ALTER DATABASE " . idf_escape(DB) . " COLLATE $collation");
} }
queries("ALTER DATABASE " . idf_escape(DB) . " MODIFY NAME = " . idf_escape($name)); queries("ALTER DATABASE " . idf_escape(DB) . " MODIFY NAME = " . idf_escape($name));

View File

@@ -22,11 +22,11 @@ if (isset($_GET["pgsql"])) {
function connect($server, $username, $password) { function connect($server, $username, $password) {
set_error_handler(array($this, '_error')); set_error_handler(array($this, '_error'));
$this->_string = "host='" . str_replace(":", "' port='", addcslashes($server, "'\\")) . "' user='" . addcslashes($username, "'\\") . "' password='" . addcslashes($password, "'\\") . "'"; $this->_string = "host='" . str_replace(":", "' port='", addcslashes($server, "'\\")) . "' user='" . addcslashes($username, "'\\") . "' password='" . addcslashes($password, "'\\") . "'";
$this->_link = @pg_connect($this->_string . (DB != "" ? " dbname='" . addcslashes(DB, "'\\") . "'" : ""), PGSQL_CONNECT_FORCE_NEW); $this->_link = @pg_connect($this->_string . (DB != "" ? " dbname='" . addcslashes(DB, "'\\") . "'" : " dbname='template1'"), PGSQL_CONNECT_FORCE_NEW);
if (!$this->_link && DB != "") { if (!$this->_link && DB != "") {
// try to connect directly with database for performance // try to connect directly with database for performance
$this->_database = false; $this->_database = false;
$this->_link = @pg_connect($this->_string, PGSQL_CONNECT_FORCE_NEW); $this->_link = @pg_connect("$this->_string dbname='template1'", PGSQL_CONNECT_FORCE_NEW);
} }
restore_error_handler(); restore_error_handler();
if ($this->_link) { if ($this->_link) {
@@ -53,7 +53,7 @@ if (isset($_GET["pgsql"])) {
} }
function close() { function close() {
$this->_link = @pg_connect($this->_string); $this->_link = @pg_connect("$this->_string dbname='template1'");
} }
function query($query, $unbuffered = false) { function query($query, $unbuffered = false) {

View File

@@ -345,12 +345,26 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
return q($val); return q($val);
} }
function check_sqlite_name($name) {
// avoid creating PHP files on unsecured servers
global $connection;
$extensions = "db|sdb|sqlite";
if (!preg_match("~^[^\\0]*\\.($extensions)\$~", $name)) {
$connection->error = lang('Please use one of the extensions %s.', str_replace("|", ", ", $extensions));
return false;
}
return true;
}
function create_database($db, $collation) { function create_database($db, $collation) {
global $connection; global $connection;
if (file_exists($db)) { if (file_exists($db)) {
$connection->error = lang('File exists.'); $connection->error = lang('File exists.');
return false; return false;
} }
if (!check_sqlite_name($db)) {
return false;
}
$link = new Min_SQLite($db); //! exception handler $link = new Min_SQLite($db); //! exception handler
$link->query('PRAGMA encoding = "UTF-8"'); $link->query('PRAGMA encoding = "UTF-8"');
$link->query('CREATE TABLE adminer (i)'); // otherwise creates empty file $link->query('CREATE TABLE adminer (i)'); // otherwise creates empty file
@@ -372,6 +386,9 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
function rename_database($name, $collation) { function rename_database($name, $collation) {
global $connection; global $connection;
if (!check_sqlite_name($name)) {
return false;
}
$connection->Min_SQLite(":memory:"); $connection->Min_SQLite(":memory:");
$connection->error = lang('File exists.'); $connection->error = lang('File exists.');
return @rename(DB, $name); return @rename(DB, $name);

View File

@@ -32,6 +32,13 @@ class Adminer {
return DB; return DB;
} }
/** Headers to send before HTML output
* @return null
*/
function headers() {
header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin
}
/** Print login form /** Print login form
* @return null * @return null
*/ */
@@ -484,7 +491,7 @@ document.getElementById('username').focus();
} }
/** Prints navigation after Adminer title /** 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 * @return null
*/ */
function navigation($missing) { function navigation($missing) {
@@ -516,10 +523,14 @@ document.getElementById('username').focus();
?> ?>
<form action="" method="post"> <form action="" method="post">
<p class="logout"> <p class="logout">
<a href="<?php echo h(ME); ?>sql="><?php echo bold(lang('SQL command'), isset($_GET["sql"])); ?></a> <?php
<?php if (support("dump")) { ?> if (DB == "" || !$missing) {
<a href="<?php echo h(ME); ?>dump=<?php echo urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]); ?>"><?php echo bold(lang('Dump'), isset($_GET["dump"])); ?></a> echo "<a href='" . h(ME) . "sql='>" . bold(lang('SQL command'), isset($_GET["sql"])) . "</a>\n";
<?php } ?> if (support("dump")) {
echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "'>" . bold(lang('Dump'), isset($_GET["dump"])) . "</a>\n";
}
}
?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>"> <input type="submit" name="logout" value="<?php echo lang('Logout'); ?>">
</p> </p>
@@ -537,7 +548,7 @@ document.getElementById('username').focus();
set_schema($_GET["ns"]); set_schema($_GET["ns"]);
} }
} }
if ($_GET["ns"] !== "") { if ($_GET["ns"] !== "" && !$missing) {
$tables = tables_list(); $tables = tables_list();
if (!$tables) { if (!$tables) {
echo "<p class='message'>" . lang('No tables.') . "\n"; echo "<p class='message'>" . lang('No tables.') . "\n";

View File

@@ -6,7 +6,6 @@ function connect_error() {
page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true); page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true);
} else { } else {
if ($_POST["db"] && !$error) { if ($_POST["db"] && !$error) {
set_session("dbs", null);
queries_redirect(substr(ME, 0, -1), lang('Databases have been dropped.'), drop_databases($_POST["db"])); queries_redirect(substr(ME, 0, -1), lang('Databases have been dropped.'), drop_databases($_POST["db"]));
} }
@@ -26,6 +25,7 @@ function connect_error() {
echo "<p>" . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n"; echo "<p>" . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
$databases = get_databases(); $databases = get_databases();
if ($databases) { if ($databases) {
$scheme = support("scheme");
$collations = collations(); $collations = collations();
echo "<form action='' method='post'>\n"; echo "<form action='' method='post'>\n";
echo "<table cellspacing='0' onclick='tableClick(event);'>\n"; echo "<table cellspacing='0' onclick='tableClick(event);'>\n";
@@ -34,7 +34,7 @@ function connect_error() {
$root = h(ME) . "db=" . urlencode($db); $root = h(ME) . "db=" . urlencode($db);
echo "<tr" . odd() . "><td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"])); echo "<tr" . odd() . "><td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"]));
echo "<th><a href='$root'>" . h($db) . "</a>"; echo "<th><a href='$root'>" . h($db) . "</a>";
echo "<td><a href='$root&amp;database='>" . nbsp(db_collation($db, $collations)) . "</a>"; echo "<td><a href='$root" . ($scheme ? "&amp;ns=" : "") . "&amp;database='>" . nbsp(db_collation($db, $collations)) . "</a>";
echo "<td align='right'><a href='$root&amp;schema=' id='tables-" . h($db) . "'>?</a>"; echo "<td align='right'><a href='$root&amp;schema=' id='tables-" . h($db) . "'>?</a>";
echo "\n"; echo "\n";
} }
@@ -44,7 +44,9 @@ function connect_error() {
} }
} }
page_footer("db"); page_footer("db");
echo "<script type='text/javascript' src='" . h(ME) . "script=connect'></script>\n"; if ($databases) {
echo "<script type='text/javascript' src='" . h(ME . "script=connect&token=$token") . "'></script>\n";
}
} }
if (isset($_GET["status"])) { if (isset($_GET["status"])) {
@@ -58,6 +60,13 @@ if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET
exit; exit;
} }
if (support("scheme") && DB != "" && $_GET["ns"] !== "" && (!isset($_GET["ns"]) || !set_schema($_GET["ns"]))) { if (support("scheme") && DB != "" && $_GET["ns"] !== "") {
if (!isset($_GET["ns"])) {
redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema()); 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

@@ -9,7 +9,7 @@
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
global $LANG, $HTTPS, $adminer, $connection, $drivers; global $LANG, $HTTPS, $adminer, $connection, $drivers;
header("Content-Type: text/html; charset=utf-8"); header("Content-Type: text/html; charset=utf-8");
header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin $adminer->headers();
if ($_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { if ($_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") {
$title_all = $title . ($title2 != "" ? ": " . h($title2) : ""); $title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
$protocol = ($HTTPS ? "https" : "http"); $protocol = ($HTTPS ? "https" : "http");
@@ -76,7 +76,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
} }
/** Print HTML footer /** Print HTML footer
* @param string auth|db * @param string "auth", "db", "ns"
* @return null * @return null
*/ */
function page_footer($missing = "") { function page_footer($missing = "") {

View File

@@ -62,7 +62,7 @@ $translations = array(
'Action' => 'Acció', 'Action' => 'Acció',
'edit' => 'edita', 'edit' => 'edita',
'Page' => 'Plana', 'Page' => 'Plana',
'Query executed OK, %d row(s) affected.' => array('Consulta executada correctament, %d fila modificada', 'Consulta executada correctament, %d files modificades'), 'Query executed OK, %d row(s) affected.' => array('Consulta executada correctament, %d fila modificada.', 'Consulta executada correctament, %d files modificades.'),
'Error in query' => 'Error en la consulta', 'Error in query' => 'Error en la consulta',
'Execute' => 'Executa', 'Execute' => 'Executa',
'Table' => 'Taula', 'Table' => 'Taula',
@@ -78,14 +78,14 @@ $translations = array(
'Unable to upload a file.' => 'Impossible adjuntar el fitxer.', 'Unable to upload a file.' => 'Impossible adjuntar el fitxer.',
'File upload' => 'Adjunta un fitxer', 'File upload' => 'Adjunta un fitxer',
'File uploads are disabled.' => 'L\'ddjunció de fitxers està desactivada.', 'File uploads are disabled.' => 'L\'ddjunció de fitxers està desactivada.',
'Routine has been called, %d row(s) affected.' => array('S\'ha cridat la rutina, %d fila modificada', 'S\'ha cridat la rutina, %d files modificades'), 'Routine has been called, %d row(s) affected.' => array('S\'ha cridat la rutina, %d fila modificada.', 'S\'ha cridat la rutina, %d files modificades.'),
'Call' => 'Crida', 'Call' => 'Crida',
'No extension' => 'Cap extensió', 'No extension' => 'Cap extensió',
'None of the supported PHP extensions (%s) are available.' => 'No hi ha cap de les extensions PHP soporatades (%s) disponible.', 'None of the supported PHP extensions (%s) are available.' => 'No hi ha cap de les extensions PHP soporatades (%s) disponible.',
'Session support must be enabled.' => 'Cal que estigui permès l\'us de sessions.', 'Session support must be enabled.' => 'Cal que estigui permès l\'us de sessions.',
'Session expired, please login again.' => 'La sessió ha expirat, torna a iniciar-ne una.', 'Session expired, please login again.' => 'La sessió ha expirat, torna a iniciar-ne una.',
'Text length' => 'Longitud del text', 'Text length' => 'Longitud del text',
'Foreign key has been dropped.' => 'S\'ha suprimit la clau forana', 'Foreign key has been dropped.' => 'S\'ha suprimit la clau forana.',
'Foreign key has been altered.' => 'S\'ha modificat la clau forana.', 'Foreign key has been altered.' => 'S\'ha modificat la clau forana.',
'Foreign key has been created.' => 'S\'ha creat la clau forana.', 'Foreign key has been created.' => 'S\'ha creat la clau forana.',
'Foreign key' => 'Clau forana', 'Foreign key' => 'Clau forana',
@@ -120,9 +120,9 @@ $translations = array(
'Alter procedure' => 'Modifica el procediment', 'Alter procedure' => 'Modifica el procediment',
'Return type' => 'Tipus retornat', 'Return type' => 'Tipus retornat',
'Add trigger' => 'Afegeix un activador', 'Add trigger' => 'Afegeix un activador',
'Trigger has been dropped.' => 'S\'ha suprimit l\'activador', 'Trigger has been dropped.' => 'S\'ha suprimit l\'activador.',
'Trigger has been altered.' => 'S\'ha modificat l\'activador', 'Trigger has been altered.' => 'S\'ha modificat l\'activador.',
'Trigger has been created.' => 'S\'ha creat l\'activador', 'Trigger has been created.' => 'S\'ha creat l\'activador.',
'Alter trigger' => 'Modifica l\'activador', 'Alter trigger' => 'Modifica l\'activador',
'Create trigger' => 'Crea un activador', 'Create trigger' => 'Crea un activador',
'Time' => 'Temps', 'Time' => 'Temps',
@@ -180,7 +180,7 @@ $translations = array(
'Tables have been truncated.' => 'S\'han escapçat les taules.', 'Tables have been truncated.' => 'S\'han escapçat les taules.',
'Rows' => 'Files', 'Rows' => 'Files',
',' => ',', ',' => ',',
'Tables have been moved.' => 'S\'han desplaçat les taules', 'Tables have been moved.' => 'S\'han desplaçat les taules.',
'Move to other database' => 'Desplaça a una altra base de dades', 'Move to other database' => 'Desplaça a una altra base de dades',
'Move' => 'Desplaça', 'Move' => 'Desplaça',
'Engine' => 'Motor', 'Engine' => 'Motor',

View File

@@ -25,6 +25,7 @@ $translations = array(
'Save' => 'Uložit', 'Save' => 'Uložit',
'Drop' => 'Odstranit', 'Drop' => 'Odstranit',
'Database has been dropped.' => 'Databáze byla odstraněna.', 'Database has been dropped.' => 'Databáze byla odstraněna.',
'Databases have been dropped.' => 'Databáze byly odstraněny.',
'Database has been created.' => 'Databáze byla vytvořena.', 'Database has been created.' => 'Databáze byla vytvořena.',
'Database has been renamed.' => 'Databáze byla přejmenována.', 'Database has been renamed.' => 'Databáze byla přejmenována.',
'Database has been altered.' => 'Databáze byla změněna.', 'Database has been altered.' => 'Databáze byla změněna.',
@@ -40,7 +41,10 @@ $translations = array(
'Create new table' => 'Vytvořit novou tabulku', 'Create new table' => 'Vytvořit novou tabulku',
'Item has been deleted.' => 'Položka byla smazána.', 'Item has been deleted.' => 'Položka byla smazána.',
'Item has been updated.' => 'Položka byla aktualizována.', 'Item has been updated.' => 'Položka byla aktualizována.',
// %s can contain auto-increment value
'Item%s has been inserted.' => 'Položka%s byla vložena.', 'Item%s has been inserted.' => 'Položka%s byla vložena.',
'Edit' => 'Upravit', 'Edit' => 'Upravit',
'Insert' => 'Vložit', 'Insert' => 'Vložit',
'Save and insert next' => 'Uložit a vložit další', 'Save and insert next' => 'Uložit a vložit další',
@@ -180,7 +184,7 @@ $translations = array(
'Tables have been truncated.' => 'Tabulky byly vyprázdněny.', 'Tables have been truncated.' => 'Tabulky byly vyprázdněny.',
'Rows' => 'Řádků', 'Rows' => 'Řádků',
',' => ' ', ',' => ' ',
'Tables have been moved.' => 'Tabulky byly přesunuty', 'Tables have been moved.' => 'Tabulky byly přesunuty.',
'Move to other database' => 'Přesunout do jiné databáze', 'Move to other database' => 'Přesunout do jiné databáze',
'Move' => 'Přesunout', 'Move' => 'Přesunout',
'Engine' => 'Úložiště', 'Engine' => 'Úložiště',
@@ -227,16 +231,30 @@ $translations = array(
'File does not exist.' => 'Soubor neexistuje.', 'File does not exist.' => 'Soubor neexistuje.',
'Permanent login' => 'Trvalé přihlášení', 'Permanent login' => 'Trvalé přihlášení',
'%d in total' => '%d celkem', '%d in total' => '%d celkem',
// label for e-mail attachments in Adminer Editor
'Attachments' => 'Přílohy', 'Attachments' => 'Přílohy',
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Systém', 'System' => 'Systém',
// link to last page if exact number is unknown
'last' => 'poslední', 'last' => 'poslední',
// new data type categories
'Network' => 'Síť', 'Network' => 'Síť',
'Geometry' => 'Geometrie', 'Geometry' => 'Geometrie',
'Databases have been dropped.' => 'Databáze byly odstraněny.',
// general SQLite error in create, drop or rename database
'File exists.' => 'Soubor existuje.', 'File exists.' => 'Soubor existuje.',
'Please use one of the extensions %s.' => 'Prosím použijte jednu z koncovek %s.',
// selects now support in-place editing
'Double click on a value to modify it.' => 'Dvojklikněte na políčko, které chcete změnit.', 'Double click on a value to modify it.' => 'Dvojklikněte na políčko, které chcete změnit.',
'Increase Text length to modify this value.' => 'Ke změně této hodnoty zvyšte Délku textů.', 'Increase Text length to modify this value.' => 'Ke změně této hodnoty zvyšte Délku textů.',
'Use edit link to modify this value.' => 'Ke změně této hodnoty použijte odkaz upravit.', 'Use edit link to modify this value.' => 'Ke změně této hodnoty použijte odkaz upravit.',
// PostgreSQL and MS SQL schema support
'Alter schema' => 'Pozměnit schéma', 'Alter schema' => 'Pozměnit schéma',
'Create schema' => 'Vytvořit schéma', 'Create schema' => 'Vytvořit schéma',
'Schema has been dropped.' => 'Schéma bylo odstraněno.', 'Schema has been dropped.' => 'Schéma bylo odstraněno.',
@@ -244,19 +262,32 @@ $translations = array(
'Schema has been altered.' => 'Schéma bylo změněno.', 'Schema has been altered.' => 'Schéma bylo změněno.',
'schema' => 'schéma', 'schema' => 'schéma',
'Schema' => 'Schéma', 'Schema' => 'Schéma',
'Invalid schema.' => 'Nesprávné schéma.',
// PostgreSQL sequences support
'Sequences' => 'Sekvence', 'Sequences' => 'Sekvence',
'Create sequence' => 'Vytvořit sekvenci', 'Create sequence' => 'Vytvořit sekvenci',
'Sequence has been dropped.' => 'Sekvence byla odstraněna.', 'Sequence has been dropped.' => 'Sekvence byla odstraněna.',
'Sequence has been created.' => 'Sekvence byla vytvořena.', 'Sequence has been created.' => 'Sekvence byla vytvořena.',
'Sequence has been altered.' => 'Sekvence byla změněna.', 'Sequence has been altered.' => 'Sekvence byla změněna.',
'Alter sequence' => 'Pozměnit sekvenci', 'Alter sequence' => 'Pozměnit sekvenci',
// PostgreSQL user types support
'User types' => 'Uživatelské typy', 'User types' => 'Uživatelské typy',
'Create type' => 'Vytvořit typ', 'Create type' => 'Vytvořit typ',
'Type has been dropped.' => 'Typ byl odstraněn.', 'Type has been dropped.' => 'Typ byl odstraněn.',
'Type has been created.' => 'Typ byl vytvořen.', 'Type has been created.' => 'Typ byl vytvořen.',
'Alter type' => 'Pozměnit typ', 'Alter type' => 'Pozměnit typ',
// label for search in whole database
'Search data in tables' => 'Vyhledat data v tabulkách', 'Search data in tables' => 'Vyhledat data v tabulkách',
// label for box with "Run webserver file adminer.sql"
'From server' => 'Ze serveru', 'From server' => 'Ze serveru',
// label for value '' in enum data type
'empty' => 'prázdné', 'empty' => 'prázdné',
// function translation used in Editor
'now' => 'teď', 'now' => 'teď',
); );

View File

@@ -69,7 +69,7 @@ $translations = array(
'Foreign keys' => 'Idegen kulcs', 'Foreign keys' => 'Idegen kulcs',
'Triggers' => 'Trigger', 'Triggers' => 'Trigger',
'View' => 'Nézet', 'View' => 'Nézet',
'Unable to select the table' => 'Nem tudom kiválasztani a táblát.', 'Unable to select the table' => 'Nem tudom kiválasztani a táblát',
'Invalid CSRF token. Send the form again.' => 'Érvénytelen CSRF azonosító. Küldd újra az űrlapot.', 'Invalid CSRF token. Send the form again.' => 'Érvénytelen CSRF azonosító. Küldd újra az űrlapot.',
'Comment' => 'Megjegyzés', 'Comment' => 'Megjegyzés',
'Default values' => 'Alapértelmezett értékek', 'Default values' => 'Alapértelmezett értékek',
@@ -113,7 +113,7 @@ $translations = array(
'Database schema' => 'Adatbázis séma', 'Database schema' => 'Adatbázis séma',
'Create procedure' => 'Eljárás létrehozása', 'Create procedure' => 'Eljárás létrehozása',
'Create function' => 'Funkció létrehozása', 'Create function' => 'Funkció létrehozása',
'Routine has been dropped.' => 'A rutin eldobva,', 'Routine has been dropped.' => 'A rutin eldobva.',
'Routine has been altered.' => 'A rutin módosult.', 'Routine has been altered.' => 'A rutin módosult.',
'Routine has been created.' => 'A rutin létrejött.', 'Routine has been created.' => 'A rutin létrejött.',
'Alter function' => 'Funkció módosítása', 'Alter function' => 'Funkció módosítása',
@@ -180,7 +180,7 @@ $translations = array(
'Tables have been truncated.' => 'A tábla felszabadítva.', 'Tables have been truncated.' => 'A tábla felszabadítva.',
'Rows' => 'Oszlop', 'Rows' => 'Oszlop',
',' => ' ', ',' => ' ',
'Tables have been moved.' => 'Táblák áthelyezve', 'Tables have been moved.' => 'Táblák áthelyezve.',
'Move to other database' => 'Áthelyezés másik adatbázisba', 'Move to other database' => 'Áthelyezés másik adatbázisba',
'Move' => 'Áthelyez', 'Move' => 'Áthelyez',
'Engine' => 'Motor', 'Engine' => 'Motor',
@@ -194,13 +194,13 @@ $translations = array(
'Partitions' => 'Particiók', 'Partitions' => 'Particiók',
'Partition name' => 'Partició neve', 'Partition name' => 'Partició neve',
'Values' => 'Értékek', 'Values' => 'Értékek',
'%d row(s) have been imported.' => array('%d sor importálva.', '%d sor importálva', '%d sor importálva'), '%d row(s) have been imported.' => array('%d sor importálva.', '%d sor importálva.', '%d sor importálva.'),
'CSV Import' => 'CSV importálása', 'CSV Import' => 'CSV importálása',
'Import' => 'Importálás', 'Import' => 'Importálás',
'Show structure' => 'Struktúra', 'Show structure' => 'Struktúra',
'Select data' => 'Tartalom', 'Select data' => 'Tartalom',
'Stop on error' => 'Hiba esetén megáll', 'Stop on error' => 'Hiba esetén megáll',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'A maximális mezőszámot elérted. Növeld meg ezeket: %s, %s', 'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'A maximális mezőszámot elérted. Növeld meg ezeket: %s, %s.',
'anywhere' => 'bárhol', 'anywhere' => 'bárhol',
'%.3f s' => '%.3f másodperc', '%.3f s' => '%.3f másodperc',
'$1-$3-$5' => '$6.$4.$1', '$1-$3-$5' => '$6.$4.$1',

View File

@@ -187,7 +187,7 @@ $translations = array(
'Truncate' => 'Svuota', 'Truncate' => 'Svuota',
'Move to other database' => 'Sposta in altro database', 'Move to other database' => 'Sposta in altro database',
'Move' => 'Sposta', 'Move' => 'Sposta',
'%d item(s) have been affected.' => array('Il risultato consiste in %d elemento', 'Il risultato consiste in %d elementi'), '%d item(s) have been affected.' => array('Il risultato consiste in %d elemento.', 'Il risultato consiste in %d elementi.'),
'whole result' => 'intero risultato', 'whole result' => 'intero risultato',
'Clone' => 'Clona', 'Clone' => 'Clona',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Troppi campi. Per favore aumentare %s e %s.', 'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Troppi campi. Per favore aumentare %s e %s.',

View File

@@ -147,7 +147,7 @@ $translations = array(
'Move down' => 'Переместить вниз', 'Move down' => 'Переместить вниз',
'Functions' => 'Функции', 'Functions' => 'Функции',
'Aggregation' => 'Агрегация', 'Aggregation' => 'Агрегация',
'Export' => 'Експорт', 'Export' => 'Экспорт',
'Output' => 'Выходные данные', 'Output' => 'Выходные данные',
'open' => 'открыть', 'open' => 'открыть',
'save' => 'сохранить', 'save' => 'сохранить',

View File

@@ -170,9 +170,9 @@ $translations = array(
'On completion preserve' => 'Po dokončení zachovat', 'On completion preserve' => 'Po dokončení zachovat',
'Save and continue edit' => 'Uložiť a pokračovať v úpravách', 'Save and continue edit' => 'Uložiť a pokračovať v úpravách',
'original' => 'originál', 'original' => 'originál',
'Tables have been truncated.' => 'Tabuľka bola vyprázdnená', 'Tables have been truncated.' => 'Tabuľka bola vyprázdnená.',
'Tables have been moved.' => 'Tabuľka bola presunutá', 'Tables have been moved.' => 'Tabuľka bola presunutá.',
'Tables have been dropped.' => 'Tabuľka bola odstránená', 'Tables have been dropped.' => 'Tabuľka bola odstránená.',
'Tables and views' => 'Tabuľky a pohľady', 'Tables and views' => 'Tabuľky a pohľady',
'Engine' => 'Typ', 'Engine' => 'Typ',
'Collation' => 'Porovnávanie', 'Collation' => 'Porovnávanie',

View File

@@ -2,14 +2,14 @@
$translations = array( $translations = array(
'Login' => 'நுழை', 'Login' => 'நுழை',
'Logout successful.' => 'வெற்றிக‌ர‌மாய் வெளியேறியாயிற்று.', 'Logout successful.' => 'வெற்றிக‌ர‌மாய் வெளியேறியாயிற்று.',
'Invalid credentials.' => 'ச‌ரியான‌ விப‌ர‌ங்க‌ள் இல்லை', 'Invalid credentials.' => 'ச‌ரியான‌ விப‌ர‌ங்க‌ள் இல்லை.',
'Server' => 'வ‌ழ‌ங்கி (Server)', 'Server' => 'வ‌ழ‌ங்கி (Server)',
'Username' => 'ப‌ய‌னாள‌ர் (User)', 'Username' => 'ப‌ய‌னாள‌ர் (User)',
'Password' => 'க‌ட‌வுச்சொல்', 'Password' => 'க‌ட‌வுச்சொல்',
'Select database' => 'த‌க‌வ‌ல்த‌ள‌த்தை தேர்வு செய்', 'Select database' => 'த‌க‌வ‌ல்த‌ள‌த்தை தேர்வு செய்',
'Invalid database.' => 'த‌க‌வ‌ல்த‌ள‌ம் ச‌ரியானதல்ல‌.', 'Invalid database.' => 'த‌க‌வ‌ல்த‌ள‌ம் ச‌ரியானதல்ல‌.',
'Create new database' => 'புதிய‌ த‌க‌வ‌ல்த‌ள‌த்தை உருவாக்கு', 'Create new database' => 'புதிய‌ த‌க‌வ‌ல்த‌ள‌த்தை உருவாக்கு',
'Table has been dropped.' => 'அட்ட‌வ‌ணை நீக்க‌ப்ப‌ட்ட‌து', 'Table has been dropped.' => 'அட்ட‌வ‌ணை நீக்க‌ப்ப‌ட்ட‌து.',
'Table has been altered.' => 'அட்ட‌வணை மாற்ற‌ப்ப‌ட்ட‌து.', 'Table has been altered.' => 'அட்ட‌வணை மாற்ற‌ப்ப‌ட்ட‌து.',
'Table has been created.' => 'அட்ட‌வ‌ணை உருவாக்க‌ப்ப‌ட்ட‌து.', 'Table has been created.' => 'அட்ட‌வ‌ணை உருவாக்க‌ப்ப‌ட்ட‌து.',
'Alter table' => 'அட்ட‌வ‌ணையை மாற்று', 'Alter table' => 'அட்ட‌வ‌ணையை மாற்று',
@@ -62,13 +62,13 @@ $translations = array(
'edit' => 'தொகு', 'edit' => 'தொகு',
'Page' => 'ப‌க்க‌ம்', 'Page' => 'ப‌க்க‌ம்',
'Query executed OK, %d row(s) affected.' => array('வின‌வ‌ல் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌து, %d வ‌ரிசை மாற்ற‌ப்ப‌ட்ட‌து.', 'வின‌வ‌ல் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌து, %d வ‌ரிசைக‌ள் மாற்றப்ப‌ட்ட‌ன‌.'), 'Query executed OK, %d row(s) affected.' => array('வின‌வ‌ல் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌து, %d வ‌ரிசை மாற்ற‌ப்ப‌ட்ட‌து.', 'வின‌வ‌ல் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌து, %d வ‌ரிசைக‌ள் மாற்றப்ப‌ட்ட‌ன‌.'),
'Error in query' => 'வின‌வ‌லில் த‌வ‌றுள்ள‌து.', 'Error in query' => 'வின‌வ‌லில் த‌வ‌றுள்ள‌து',
'Execute' => 'செய‌ல்ப‌டுத்து', 'Execute' => 'செய‌ல்ப‌டுத்து',
'Table' => 'அட்ட‌வ‌ணை', 'Table' => 'அட்ட‌வ‌ணை',
'Foreign keys' => 'வேற்று விசைக‌ள்', 'Foreign keys' => 'வேற்று விசைக‌ள்',
'Triggers' => 'தூண்டுத‌ல்க‌ள்', 'Triggers' => 'தூண்டுத‌ல்க‌ள்',
'View' => 'தோற்றம்', 'View' => 'தோற்றம்',
'Unable to select the table' => 'அட்ட‌வ‌ணையை தேர்வு செய்ய‌ முடிய‌வில்லை.', 'Unable to select the table' => 'அட்ட‌வ‌ணையை தேர்வு செய்ய‌ முடிய‌வில்லை',
'Invalid CSRF token. Send the form again.' => 'CSRF டோக்க‌ன் செல்லாது. ப‌டிவ‌த்தை மீண்டும் அனுப்ப‌வும்.', 'Invalid CSRF token. Send the form again.' => 'CSRF டோக்க‌ன் செல்லாது. ப‌டிவ‌த்தை மீண்டும் அனுப்ப‌வும்.',
'Comment' => 'குறிப்பு', 'Comment' => 'குறிப்பு',
'Default values' => 'உள்ளிருக்கும் (Default) ம‌திப்புக‌ள் ', 'Default values' => 'உள்ளிருக்கும் (Default) ம‌திப்புக‌ள் ',
@@ -121,8 +121,8 @@ $translations = array(
'Trigger has been dropped.' => 'தூண்டு விசை நீக்க‌ப்ப‌ட்ட‌து.', 'Trigger has been dropped.' => 'தூண்டு விசை நீக்க‌ப்ப‌ட்ட‌து.',
'Trigger has been altered.' => 'தூண்டு விசை மாற்ற‌ப்ப‌ட்ட‌து.', 'Trigger has been altered.' => 'தூண்டு விசை மாற்ற‌ப்ப‌ட்ட‌து.',
'Trigger has been created.' => 'தூண்டு விசை உருவாக்க‌ப்ப‌ட்ட‌து.', 'Trigger has been created.' => 'தூண்டு விசை உருவாக்க‌ப்ப‌ட்ட‌து.',
'Alter trigger' => 'தூண்டு விசையை மாற்று.', 'Alter trigger' => 'தூண்டு விசையை மாற்று',
'Create trigger' => 'தூண்டு விசையை உருவாக்கு.', 'Create trigger' => 'தூண்டு விசையை உருவாக்கு',
'Time' => 'நேர‌ம்', 'Time' => 'நேர‌ம்',
'Event' => 'நிக‌ழ்ச்சி', 'Event' => 'நிக‌ழ்ச்சி',
'%d row(s)' => array('%d வ‌ரிசை', '%d வ‌ரிசைக‌ள்'), '%d row(s)' => array('%d வ‌ரிசை', '%d வ‌ரிசைக‌ள்'),
@@ -257,6 +257,6 @@ $translations = array(
'Network' => 'நெட்வொர்க்', 'Network' => 'நெட்வொர்க்',
'Geometry' => 'வ‌டிவ‌விய‌ல் (Geometry)', 'Geometry' => 'வ‌டிவ‌விய‌ல் (Geometry)',
'File exists.' => 'கோப்பு உள்ள‌து.', 'File exists.' => 'கோப்பு உள்ள‌து.',
'Attachments' => 'இணைப்புக‌ள்.', 'Attachments' => 'இணைப்புக‌ள்',
'now' => 'இப்பொழுது', 'now' => 'இப்பொழுது',
); );

View File

@@ -1,5 +1,8 @@
<?php <?php
header("Content-Type: text/javascript; charset=utf-8"); header("Content-Type: text/javascript; charset=utf-8");
if ($_GET["token"] != $token) { // CSRF protection
exit;
}
if ($_GET["script"] == "db") { if ($_GET["script"] == "db") {
$sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0); $sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0);

View File

@@ -126,7 +126,7 @@ if ($_POST && !$error) {
$set = array(); $set = array();
foreach ($row as $key => $val) { foreach ($row as $key => $val) {
$key = bracket_escape($key, 1); // 1 - back $key = bracket_escape($key, 1); // 1 - back
$set[] = idf_escape($key) . " = " . $adminer->processInput($fields[$key], $val); $set[] = idf_escape($key) . " = " . (ereg('char|text', $fields[$key]["type"]) || $val != "" ? $adminer->processInput($fields[$key], $val) : "NULL");
} }
$result = queries("UPDATE" . limit1(table($TABLE) . " SET " . implode(", ", $set), " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : ""))); // can change row on a different page without unique key $result = queries("UPDATE" . limit1(table($TABLE) . " SET " . implode(", ", $set), " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : ""))); // can change row on a different page without unique key
if (!$result) { if (!$result) {

View File

@@ -1,6 +1,10 @@
Adminer 3.0.1-dev: Adminer 3.0.1-dev:
Send the form by Ctrl+Enter in all textareas Send the form by Ctrl+Enter in all textareas
Disable creating SQLite databases with extension other than db, sdb, sqlite
Ability to use Adminer in a frame through customization
Catalan translation Catalan translation
MS SQL 2005 compatibility
PostgreSQL: connect if the eponymous database does not exist
Adminer 3.0.0 (released 2010-10-15): Adminer 3.0.0 (released 2010-10-15):
Drivers for MS SQL, SQLite, PostgreSQL, Oracle Drivers for MS SQL, SQLite, PostgreSQL, Oracle

View File

@@ -26,6 +26,10 @@ class Adminer {
); );
} }
function headers() {
header("X-Frame-Options: deny");
}
function loginForm() { function loginForm() {
?> ?>
<table cellspacing="0"> <table cellspacing="0">
@@ -412,7 +416,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$return = ($match["p1"] != "" ? $match["p1"] : ($match["p2"] != "" ? ($match["p2"] < 70 ? 20 : 19) . $match["p2"] : gmdate("Y"))) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match); $return = ($match["p1"] != "" ? $match["p1"] : ($match["p2"] != "" ? ($match["p2"] < 70 ? 20 : 19) . $match["p2"] : gmdate("Y"))) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match);
} }
$return = q($return); $return = q($return);
if (!ereg('varchar|text', $field["type"]) && $field["full_type"] != "tinyint(1)" && $value == "") { if (!ereg('char|text', $field["type"]) && $field["full_type"] != "tinyint(1)" && $value == "") {
$return = "NULL"; $return = "NULL";
} elseif (ereg('^(md5|sha1)$', $function)) { } elseif (ereg('^(md5|sha1)$', $function)) {
$return = "$function($return)"; $return = "$function($return)";
@@ -460,7 +464,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
</p> </p>
</form> </form>
<?php <?php
if ($missing != "db") { if ($missing != "db" && $missing != "ns") {
$table_status = table_status(); $table_status = table_status();
if (!$table_status) { if (!$table_status) {
echo "<p class='message'>" . lang('No tables.') . "\n"; echo "<p class='message'>" . lang('No tables.') . "\n";

View File

@@ -28,7 +28,7 @@ foreach (glob(dirname(__FILE__) . "/adminer/lang/" . ($_SESSION["lang"] ? $_SESS
$messages = $messages_all; $messages = $messages_all;
$file = file_get_contents($filename); $file = file_get_contents($filename);
$file = str_replace("\r", "", $file); $file = str_replace("\r", "", $file);
preg_match_all("~^(\\s*)(?:// )?(('(?:[^\\\\']+|\\\\.)*') => .*[^,\n]),?~m", $file, $matches, PREG_SET_ORDER); preg_match_all("~^(\\s*(?:// [^'].*\\s+)?)(?:// )?(('(?:[^\\\\']+|\\\\.)*') => .*[^,\n]),?~m", $file, $matches, PREG_SET_ORDER);
$s = ""; $s = "";
foreach ($matches as $match) { foreach ($matches as $match) {
if (isset($messages[$match[3]])) { if (isset($messages[$match[3]])) {

View File

@@ -1,5 +1,5 @@
Adminer - Database management in single PHP file Adminer - Database management in single PHP file
Adminer Editor - Database editor in single PHP file Adminer Editor - Data manipulation for end-users
http://www.adminer.org/ http://www.adminer.org/
Supports: MySQL, PostgreSQL, SQLite, MS SQL, Oracle Supports: MySQL, PostgreSQL, SQLite, MS SQL, Oracle
@@ -8,6 +8,7 @@ Apache License, Version 2.0
adminer/index.php - Run development version of Adminer adminer/index.php - Run development version of Adminer
editor/index.php - Run development version of Adminer Editor editor/index.php - Run development version of Adminer Editor
editor/example.php - Example customization
compile.php [driver] [lang] - Create a single file version compile.php [driver] [lang] - Create a single file version
lang.php [lang] - Update translations lang.php [lang] - Update translations
tests/selenium.html - Selenium test suite tests/selenium.html - Selenium test suite

View File

@@ -1,6 +1,6 @@
Transactions in export Transactions in export
Create view and routine options Create view and routine options
Variables editation, especially timezone Variables editation, especially timezone (or set by PHP date.timezone)
Highlight SQL textarea, then display query inside textarea in select - may use external CodeMirror Highlight SQL textarea, then display query inside textarea in select - may use external CodeMirror
Blob download and image display in edit form (important for Editor with hidden fields in select) Blob download and image display in edit form (important for Editor with hidden fields in select)
Add title to Logout, edit (in select) and select (in menu) in style "hever" Add title to Logout, edit (in select) and select (in menu) in style "hever"
@@ -34,6 +34,7 @@ Delimiter in export and SQL command
Backward keys in Editor Backward keys in Editor
PostgreSQL: PostgreSQL:
Display number of schemas in databases overview
Users - SELECT * FROM pg_user Users - SELECT * FROM pg_user
ORDER BY COUNT(*) ORDER BY COUNT(*)
Export - http://www.postgresql.org/docs/8.4/static/functions-info.html Export - http://www.postgresql.org/docs/8.4/static/functions-info.html