From: jakubvrana Date: Fri, 29 May 2009 20:19:13 +0000 (+0000) Subject: Separate include X-Git-Tag: v3.0.0~902 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=041fb2e840c84c6a2c1d76c666a5089d67e1a3f3;p=adminer.git Separate include git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@623 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- diff --git a/_compile.php b/_compile.php index 6977f8ba..ce152f30 100644 --- a/_compile.php +++ b/_compile.php @@ -1,5 +1,5 @@ \n?\$~", '', $return); @@ -151,7 +151,7 @@ function php_shrink($input) { error_reporting(E_ALL & ~E_NOTICE); if ($_SERVER["argc"] > 1) { $_COOKIE["lang"] = $_SERVER["argv"][1]; - include dirname(__FILE__) . "/lang.inc.php"; + include dirname(__FILE__) . "/include/lang.inc.php"; if ($_SERVER["argc"] != 2 || !isset($langs[$_COOKIE["lang"]])) { echo "Usage: php _compile.php [lang]\nPurpose: Compile phpMinAdmin[-lang].php from index.php.\n"; exit(1); diff --git a/auth.inc.php b/auth.inc.php deleted file mode 100644 index 629df69c..00000000 --- a/auth.inc.php +++ /dev/null @@ -1,73 +0,0 @@ - -
- - - - -
" />
-

- $val) { - echo ''; - } - ?> - -

-
-connect($_GET["server"], $username, $_SESSION["passwords"][$_GET["server"]])) { - auth_error(); - exit; -} -unset($username); diff --git a/connect.inc.php b/connect.inc.php deleted file mode 100644 index ca5d92ee..00000000 --- a/connect.inc.php +++ /dev/null @@ -1,30 +0,0 @@ -query("SET SQL_QUOTE_SHOW_CREATE=1"); -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"]))) { - if (strlen($_GET["db"])) { - unset($_SESSION["databases"][$_GET["server"]]); - } - if (strlen($_GET["db"])) { - page_header(lang('Database') . ": " . htmlspecialchars($_GET["db"]), lang('Invalid database.'), false); - } else { - page_header(lang('Select database'), "", null); - echo '

' . lang('Create new database') . "

\n"; - echo '

' . lang('Privileges') . "

\n"; - echo '

' . lang('Process list') . "

\n"; - echo "

" . lang('MySQL version: %s through PHP extension %s', "server_info < 4.1 ? " class='binary'" : "") . ">$dbh->server_info", "$dbh->extension") . "

\n"; - echo "

" . lang('phpMinAdmin version: %s', "$VERSION") . ", " . lang('current version') . "" . (version_compare($VERSION, $_COOKIE["phpMinAdmin_version"]) < 0 ? ": " . htmlspecialchars($_COOKIE["phpMinAdmin_version"]) . "" : "") . "

\n"; - if (!isset($_COOKIE["phpMinAdmin_version"])) { - ?> - -" . lang('Logged as: %s', "" . htmlspecialchars($dbh->result($dbh->query("SELECT USER()"))) . "") . "

\n"; - } - page_footer("db"); - exit; -} -$dbh->query("SET CHARACTER SET utf8"); diff --git a/design.inc.php b/design.inc.php deleted file mode 100644 index 2e1d90fc..00000000 --- a/design.inc.php +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - -<?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " $VERSION"; ?> - - - - - - - - - - -
-' . (isset($_GET["server"]) ? htmlspecialchars($_GET["server"]) : lang('Server')) . ' » '; - if (is_array($breadcrumb)) { - if (strlen($_GET["db"])) { - echo '' . htmlspecialchars($_GET["db"]) . ' » '; - } - foreach ($breadcrumb as $key => $val) { - if (strlen($val)) { - echo '' . htmlspecialchars($val) . ' » '; - } - } - } - echo "$title

\n"; - } - echo "

$title" . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . "

\n"; - if ($_SESSION["messages"]) { - echo "

" . implode("

\n

", $_SESSION["messages"]) . "

\n"; - $_SESSION["messages"] = array(); - } - $databases = &$_SESSION["databases"][$_GET["server"]]; - if (strlen($_GET["db"]) && $databases && !in_array($_GET["db"], $databases, true)) { - $databases = null; - } - if (isset($databases) && !isset($_GET["sql"]) && !isset($_SESSION["coverage"])) { - session_write_close(); - } - if ($error) { - echo "

$error

\n"; - } -} - -function page_footer($missing = false) { - global $SELF, $dbh; - ?> -
- - - - - - - - - - - -' . lang('original') . ''; - } - if ($field["null"] || isset($_GET["default"])) { - echo ' '; - } - if (!isset($_GET["default"])) { - echo ''; - } - preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches); - foreach ($matches[1] as $i => $val) { - $val = stripcslashes(str_replace("''", "'", $val)); - $checked = (is_int($value) ? $value == $i+1 : $value === $val); - echo ' '; - } - } else { - $first = ($field["null"] || isset($_GET["default"])) + isset($_GET["select"]); - $onchange = ($first ? ' onchange="var f = this.form[\'function[' . addcslashes($name, "\r\n'\\") . ']\']; if (' . $first . ' > f.selectedIndex) f.selectedIndex = ' . $first . ';"' : ''); - $options = array(""); - if (!isset($_GET["default"])) { - if (preg_match('~char|date|time~', $field["type"])) { - $options = (preg_match('~char~', $field["type"]) ? array("", "md5", "sha1", "password", "uuid") : array("", "now")); - } - if (!isset($_GET["clone"]) && !isset($_GET["call"]) && preg_match('~int|float|double|decimal~', $field["type"])) { - $options = array("", "+", "-"); - } - } - if ($field["null"] || isset($_GET["default"])) { - array_unshift($options, "NULL"); - } - if (count($options) > 1 || isset($_GET["select"])) { - echo ''; - } - if ($field["type"] == "set") { //! 64 bits - preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches); - foreach ($matches[1] as $i => $val) { - $val = stripcslashes(str_replace("''", "'", $val)); - $checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true)); - echo ' '; - } - } elseif (strpos($field["type"], "text") !== false) { - echo ''; - } elseif (preg_match('~binary|blob~', $field["type"])) { - echo (ini_get("file_uploads") ? '' : lang('File uploads are disabled.') . ' '); - } else { - $maxlength = (!ereg('int', $field["type"]) && preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? ($match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0)); - echo ''; - } - } -} - -function process_input($name, $field) { - global $dbh; - $idf = bracket_escape($name); - $function = $_POST["function"][$idf]; - $value = $_POST["fields"][$idf]; - if ($field["type"] == "enum" ? $value == -1 : $function == "orig") { - return false; - } elseif ($field["type"] == "enum" || $field["auto_increment"] ? !strlen($value) : $function == "NULL") { - return "NULL"; - } elseif ($field["type"] == "enum") { - return (isset($_GET["default"]) ? "'" . $dbh->escape_string($value) . "'" : intval($value)); - } elseif ($field["type"] == "set") { - return (isset($_GET["default"]) ? "'" . implode(",", array_map(array($dbh, 'escape_string'), (array) $value)) . "'" : array_sum((array) $value)); - } elseif (preg_match('~binary|blob~', $field["type"])) { - $file = get_file($idf); - if (!is_string($file)) { - return false; //! report errors - } - return "_binary'" . (is_string($file) ? $dbh->escape_string($file) : "") . "'"; - } elseif ($field["type"] == "timestamp" && $value == "CURRENT_TIMESTAMP") { - return $value; - } elseif (preg_match('~^(now|uuid)$~', $function)) { - return "$function()"; - } elseif (preg_match('~^(\\+|-)$~', $function)) { - return idf_escape($name) . " $function '" . $dbh->escape_string($value) . "'"; - } elseif (preg_match('~^(md5|sha1|password)$~', $function)) { - return "$function('" . $dbh->escape_string($value) . "')"; - } else { - return "'" . $dbh->escape_string($value) . "'"; - } -} - -function edit_type($key, $field, $collations) { - global $types, $unsigned, $inout; - ?> - -" size="3" /> -' . optionlist($collations, $field["collation"]) . '' . ($unsigned ? " ' : ''); ?> -escape_string($field["collation"]) . "'" : "") - ; -} - -function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0) { - global $inout; - $column_comments = false; - foreach ($fields as $field) { - if (strlen($field["comment"])) { - $column_comments = true; - } - } - ?> - - - - - - - - - -