SHOW DATABASES can be revoked
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@506 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
766caa4ddc
commit
49f7886f41
|
@ -76,16 +76,18 @@ function page_footer($missing = false) {
|
||||||
</form>
|
</form>
|
||||||
<form action="">
|
<form action="">
|
||||||
<p><?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /><?php } ?>
|
<p><?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /><?php } ?>
|
||||||
<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option>
|
<?php if (get_databases()) { ?>
|
||||||
<?php
|
<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option><?php echo optionlist(get_databases(), $_GET["db"]); ?></select>
|
||||||
echo optionlist(get_databases(), $_GET["db"]);
|
<?php } else { ?>
|
||||||
?>
|
<input name="db" value="<?php echo htmlspecialchars($_GET["db"]); ?>" /> <input type="submit" value="<?php echo lang('Use'); ?>" />
|
||||||
</select>
|
<?php } ?>
|
||||||
<?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value="" /><?php } ?>
|
<?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value="" /><?php } ?>
|
||||||
<?php if (isset($_GET["schema"])) { ?><input type="hidden" name="schema" value="" /><?php } ?>
|
<?php if (isset($_GET["schema"])) { ?><input type="hidden" name="schema" value="" /><?php } ?>
|
||||||
<?php if (isset($_GET["dump"])) { ?><input type="hidden" name="dump" value="" /><?php } ?>
|
<?php if (isset($_GET["dump"])) { ?><input type="hidden" name="dump" value="" /><?php } ?>
|
||||||
</p>
|
</p>
|
||||||
|
<?php if (get_databases()) { ?>
|
||||||
<noscript><p><input type="submit" value="<?php echo lang('Use'); ?>" /></p></noscript>
|
<noscript><p><input type="submit" value="<?php echo lang('Use'); ?>" /></p></noscript>
|
||||||
|
<?php } ?>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
if ($missing != "db" && strlen($_GET["db"])) {
|
if ($missing != "db" && strlen($_GET["db"])) {
|
||||||
|
|
|
@ -31,12 +31,14 @@ function optionlist($options, $selected = array()) {
|
||||||
|
|
||||||
function get_vals($query) {
|
function get_vals($query) {
|
||||||
global $mysql;
|
global $mysql;
|
||||||
$result = $mysql->query($query);
|
|
||||||
$return = array();
|
$return = array();
|
||||||
while ($row = $result->fetch_row()) {
|
$result = $mysql->query($query);
|
||||||
$return[] = $row[0];
|
if ($result) {
|
||||||
|
while ($row = $result->fetch_row()) {
|
||||||
|
$return[] = $row[0];
|
||||||
|
}
|
||||||
|
$result->free();
|
||||||
}
|
}
|
||||||
$result->free();
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,8 @@ if (isset($_GET["download"])) {
|
||||||
}
|
}
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
echo "<p><input type='hidden' name='token' value='$token' /><input type='submit' value='" . lang('Analyze') . "' /> <input type='submit' name='optimize' value='" . lang('Optimize') . "' /> <input type='submit' name='check' value='" . lang('Check') . "' /> <input type='submit' name='repair' value='" . lang('Repair') . "' /> <input type='submit' name='truncate' value='" . lang('Truncate') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\" /> <input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\" /></p>\n";
|
echo "<p><input type='hidden' name='token' value='$token' /><input type='submit' value='" . lang('Analyze') . "' /> <input type='submit' name='optimize' value='" . lang('Optimize') . "' /> <input type='submit' name='check' value='" . lang('Check') . "' /> <input type='submit' name='repair' value='" . lang('Repair') . "' /> <input type='submit' name='truncate' value='" . lang('Truncate') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\" /> <input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\" /></p>\n";
|
||||||
echo "<p>" . lang('Move to other database') . ": <select name='target'>" . optionlist(get_databases(), (isset($_POST["target"]) ? $_POST["target"] : $_GET["db"])) . "</select> <input type='submit' name='move' value='" . lang('Move') . "' /></p>\n";
|
$db = (isset($_POST["target"]) ? $_POST["target"] : $_GET["db"]);
|
||||||
|
echo "<p>" . lang('Move to other database') . (get_databases() ? ": <select name='target'>" . optionlist(get_databases(), $db) . "</select>" : ': <input name="target" value="' . htmlspecialchars($db) . '" />') . " <input type='submit' name='move' value='" . lang('Move') . "' /></p>\n";
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
}
|
}
|
||||||
$result->free();
|
$result->free();
|
||||||
|
|
Loading…
Reference in a new issue