mirror of
https://github.com/vrana/adminer.git
synced 2025-08-17 20:01:25 +02:00
Use
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@667 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -43,7 +43,7 @@ if ($_POST) {
|
||||
<tr><th><?php echo lang('Every'); ?></th><td><input name="INTERVAL_VALUE" value="<?php echo htmlspecialchars($row["INTERVAL_VALUE"]); ?>" size="6" /> <select name="INTERVAL_FIELD"><?php echo optionlist($intervals, $row["INTERVAL_FIELD"]); ?></select></td></tr>
|
||||
<tr><th><?php echo lang('Status'); ?></th><td><select name="STATUS"><?php echo optionlist($statuses, $row["STATUS"]); ?></select></td></tr>
|
||||
<tr><th><?php echo lang('Comment'); ?></th><td><input name="EVENT_COMMENT" value="<?php echo htmlspecialchars($row["EVENT_COMMENT"]); ?>" maxlength="64" /></td></tr>
|
||||
<tr><th></th><td><label><input type="checkbox" name="ON_COMPLETION" value="PRESERVE"<?php echo ($row["ON_COMPLETION"] == "PRESERVE" ? " checked='checked'" : ""); ?> /><?php echo lang('On completion preserve'); ?></label></td></tr>
|
||||
<tr><th> </th><td><label><input type="checkbox" name="ON_COMPLETION" value="PRESERVE"<?php echo ($row["ON_COMPLETION"] == "PRESERVE" ? " checked='checked'" : ""); ?> /><?php echo lang('On completion preserve'); ?></label></td></tr>
|
||||
</table>
|
||||
<p><textarea name="EVENT_DEFINITION" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["EVENT_DEFINITION"]); ?></textarea></p>
|
||||
<p>
|
||||
|
@@ -4,7 +4,7 @@ function input($name, $field, $value, $separator = "</td><td>") { //! pass empty
|
||||
$name = htmlspecialchars(bracket_escape($name));
|
||||
echo "<td" . ($separator ? " class='function'" : "") . ">";
|
||||
if ($field["type"] == "enum") {
|
||||
echo $separator . (isset($_GET["select"]) ? ' <label><input type="radio" name="fields[' . $name . ']" value="-1" checked="checked" /><em>' . lang('original') . '</em></label>' : "");
|
||||
echo ($separator ? " $separator" : "") . (isset($_GET["select"]) ? ' <label><input type="radio" name="fields[' . $name . ']" value="-1" checked="checked" /><em>' . lang('original') . '</em></label>' : "");
|
||||
if ($field["null"] || isset($_GET["default"])) {
|
||||
echo ' <label><input type="radio" name="fields[' . $name . ']" value=""' . (($field["null"] ? isset($value) : strlen($value)) || isset($_GET["select"]) ? '' : ' checked="checked"') . ' />' . ($field["null"] ? '<em>NULL</em>' : '') . '</label>';
|
||||
}
|
||||
@@ -42,7 +42,7 @@ function input($name, $field, $value, $separator = "</td><td>") { //! pass empty
|
||||
if ($field["null"] || isset($_GET["default"])) {
|
||||
array_unshift($options, "NULL");
|
||||
}
|
||||
echo (count($options) > 1 || isset($_GET["select"]) ? '<select name="function[' . $name . ']">' . (isset($_GET["select"]) ? '<option value="orig">' . lang('original') . '</option>' : '') . optionlist($options, (isset($value) ? (string) $_POST["function"][$name] : null)) . '</select>' : "") . $separator;
|
||||
echo (count($options) > 1 || isset($_GET["select"]) ? '<select name="function[' . $name . ']">' . (isset($_GET["select"]) ? '<option value="orig">' . lang('original') . '</option>' : '') . optionlist($options, (isset($value) ? (string) $_POST["function"][$name] : null)) . '</select>' : ($separator ? " " : "")) . $separator;
|
||||
if ($field["type"] == "set") { //! 64 bits
|
||||
preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches);
|
||||
foreach ($matches[1] as $i => $val) {
|
||||
|
@@ -201,6 +201,8 @@ function select($result, $dbh2 = null) {
|
||||
} else {
|
||||
if ($blobs[$key] && !is_utf8($val)) {
|
||||
$val = "<i>" . lang('%d byte(s)', strlen($val)) . "</i>"; //! link to download
|
||||
} elseif (!strlen(trim($val))) {
|
||||
$val = " ";
|
||||
} else {
|
||||
$val = nl2br(htmlspecialchars($val));
|
||||
if ($types[$key] == 254) {
|
||||
|
@@ -176,11 +176,11 @@ if (isset($_GET["download"])) {
|
||||
echo '<input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . '"' . (in_array($row["Name"], (array) $_POST["tables"], true) ? ' checked="checked"' : '') . ' onclick="form_uncheck(\'check-all\');" /></td><th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th><td>$row[Engine]</td><td>$row[Collation]</td>";
|
||||
foreach (array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create", "Rows" => "select") as $key => $link) {
|
||||
$val = number_format($row[$key], 0, '.', lang(','));
|
||||
echo '<td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($row["Name"]) . '">' . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val) . '</a>' : '') . '</td>';
|
||||
echo '<td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($row["Name"]) . '">' . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val) . '</a>' : ' ') . '</td>';
|
||||
}
|
||||
echo "<td>" . htmlspecialchars($row["Comment"]) . "</td>";
|
||||
echo "<td>" . (strlen(trim($row["Comment"])) ? htmlspecialchars($row["Comment"]) : " ") . "</td>";
|
||||
} else {
|
||||
echo '<th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="8"><a href="' . htmlspecialchars($SELF) . "select=" . urlencode($row["Name"]) . '">' . lang('View') . '</a></td>';
|
||||
echo ' </td><th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="8"><a href="' . htmlspecialchars($SELF) . "select=" . urlencode($row["Name"]) . '">' . lang('View') . '</a></td>';
|
||||
}
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ if (!$result) {
|
||||
$result = $dbh->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
|
||||
}
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<thead><tr><th></th><th>" . lang('Username') . "</th><th>" . lang('Server') . "</th></tr></thead>\n";
|
||||
echo "<thead><tr><th> </th><th>" . lang('Username') . "</th><th>" . lang('Server') . "</th></tr></thead>\n";
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
echo '<tr' . odd() . '><td><a href="' . htmlspecialchars($SELF) . 'user=' . urlencode($row["User"]) . '&host=' . urlencode($row["Host"]) . '">' . lang('edit') . '</a></td><td>' . htmlspecialchars($row["User"]) . "</td><td>" . htmlspecialchars($row["Host"]) . "</td></tr>\n";
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ page_header(lang('Process list'), $error);
|
||||
$result = $dbh->query("SHOW PROCESSLIST");
|
||||
for ($i=0; $row = $result->fetch_assoc(); $i++) {
|
||||
if (!$i) {
|
||||
echo "<thead><tr lang='en'><th></th><th>" . implode("</th><th>", array_keys($row)) . "</th></tr></thead>\n";
|
||||
echo "<thead><tr lang='en'><th> </th><th>" . implode("</th><th>", array_keys($row)) . "</th></tr></thead>\n";
|
||||
}
|
||||
echo "<tr" . odd() . "><td><input type='checkbox' name='kill[]' value='$row[Id]' /></td><td>" . implode("</td><td>", $row) . "</td></tr>\n";
|
||||
}
|
||||
|
@@ -249,7 +249,9 @@ if (!$columns) {
|
||||
} elseif (preg_match('~blob|binary~', $fields[$key]["type"]) && !is_utf8($val)) {
|
||||
$val = '<a href="' . htmlspecialchars($SELF) . 'download=' . urlencode($_GET["select"]) . '&field=' . urlencode($key) . '&' . $unique_idf . '">' . lang('%d byte(s)', strlen($val)) . '</a>';
|
||||
} else {
|
||||
if (intval($text_length) > 0 && preg_match('~blob|text~', $fields[$key]["type"])) {
|
||||
if (!strlen(trim($val))) {
|
||||
$val = " ";
|
||||
} elseif (intval($text_length) > 0 && preg_match('~blob|text~', $fields[$key]["type"])) {
|
||||
$val = shorten_utf8($val, intval($text_length));
|
||||
} else {
|
||||
$val = nl2br(htmlspecialchars($val));
|
||||
|
@@ -52,7 +52,7 @@ if ($result) {
|
||||
$link = (strlen($foreign_key["db"]) ? "<strong>" . htmlspecialchars($foreign_key["db"]) . "</strong>." : "") . htmlspecialchars($foreign_key["table"]);
|
||||
echo '<td><a href="' . htmlspecialchars(strlen($foreign_key["db"]) ? preg_replace('~db=[^&]*~', "db=" . urlencode($foreign_key["db"]), $SELF) : $SELF) . "table=" . urlencode($foreign_key["table"]) . "\">$link</a>";
|
||||
echo "(<em>" . implode("</em>, <em>", array_map('htmlspecialchars', $foreign_key["target"])) . "</em>)</td>";
|
||||
echo '<td>' . (!strlen($foreign_key["db"]) ? '<a href="' . htmlspecialchars($SELF) . 'foreign=' . urlencode($_GET["table"]) . '&name=' . urlencode($name) . '">' . lang('Alter') . '</a>' : '') . '</td>';
|
||||
echo '<td>' . (!strlen($foreign_key["db"]) ? '<a href="' . htmlspecialchars($SELF) . 'foreign=' . urlencode($_GET["table"]) . '&name=' . urlencode($name) . '">' . lang('Alter') . '</a>' : ' ') . '</td>';
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
|
@@ -162,7 +162,7 @@ foreach (array(
|
||||
$name = '"grants[' . $i . '][' . htmlspecialchars(strtoupper($privilege)) . ']"';
|
||||
$value = $grant[strtoupper($privilege)];
|
||||
if ($context == "Server Admin" && $object != (isset($grants["*.*"]) ? "*.*" : "")) {
|
||||
echo "<td></td>";
|
||||
echo "<td> </td>";
|
||||
} elseif (isset($_GET["grant"])) {
|
||||
echo "<td><select name=$name><option></option><option value='1'" . ($value ? " selected='selected'" : "") . ">" . lang('Grant') . "</option><option value='0'" . ($value == "0" ? " selected='selected'" : "") . ">" . lang('Revoke') . "</option></select></td>";
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user