Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 105 lines (101 sloc) 3.676 kb
667bfec4 » jakubvrana
2007-07-02 Decomposition
1 <?php
1fe2f33e » jakubvrana
2009-06-08 Rename to Adminer
2 /** Adminer - Compact MySQL management
3 * @link http://www.adminer.org/
60cac2e4 » jakubvrana
2009-05-31 Move to www.phpminadmin.net
4 * @author Jakub Vrana, http://php.vrana.cz/
9f230bbc » jakubvrana
2007-08-06 phpDocumentor header
5 * @copyright 2007 Jakub Vrana
6 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
7 */
1fb9063c » jakubvrana
2007-07-05 Copyright
8
ab489769 » jakubvrana
2009-07-03 Separate bootstrap
9 include "./include/bootstrap.inc.php";
041fb2e8 » jakubvrana
2009-05-29 Separate include
10 include "./include/version.inc.php";
11 include "./include/functions.inc.php";
12 include "./include/lang.inc.php";
438ca058 » jakubvrana
2007-07-26 Separate languages
13 include "./lang/$LANG.inc.php";
2c445a86 » jakubvrana
2009-07-03 Extensibility basics
14 include "./include/adminer.inc.php";
08755184 » jakubvrana
2009-06-03 Separate echo
15 include "./include/design.inc.php";
91156d1a » jakubvrana
2009-06-24 Coverage uses the same cookie so must live in the same directory
16 if (isset($_GET["coverage"])) {
17 include "./coverage.inc.php";
18 }
041fb2e8 » jakubvrana
2009-05-29 Separate include
19 include "./include/pdo.inc.php";
20 include "./include/mysql.inc.php";
21 include "./include/auth.inc.php";
22 include "./include/connect.inc.php";
23 include "./include/editing.inc.php";
24 include "./include/export.inc.php";
667bfec4 » jakubvrana
2007-07-02 Decomposition
25
2c445a86 » jakubvrana
2009-07-03 Extensibility basics
26 $adminer = (class_exists("Adminer") ? new Adminer : new AdminerBase);
481e838b » jakubvrana
2009-06-18 Simplify includes
27 $on_actions = array("RESTRICT", "CASCADE", "SET NULL", "NO ACTION");
28 $enum_length = '\'(?:\'\'|[^\'\\\\]+|\\\\.)*\'|"(?:""|[^"\\\\]+|\\\\.)*"';
29 $inout = array("IN", "OUT", "INOUT");
30 $confirm = " onclick=\"return confirm('" . lang('Are you sure?') . "');\"";
31 $error = "";
32
80bc4b30 » jakubvrana
2008-06-20 Prepare customizable export
33 if (isset($_GET["download"])) {
430034c3 » jakubvrana
2007-07-09 Cottage homework
34 include "./download.inc.php";
481e838b » jakubvrana
2009-06-18 Simplify includes
35 } elseif (isset($_GET["table"])) {
36 include "./table.inc.php";
37 } elseif (isset($_GET["view"])) {
38 include "./view.inc.php";
39 } elseif (isset($_GET["schema"])) {
40 include "./schema.inc.php";
41 } elseif (isset($_GET["dump"])) {
42 include "./dump.inc.php";
43 } elseif (isset($_GET["privileges"])) {
44 include "./privileges.inc.php";
45 } else { // uses CSRF token
46 $token = $_SESSION["tokens"][$_GET["server"]];
47 if ($_POST) {
48 if ($_POST["token"] != $token) {
49 $error = lang('Invalid CSRF token. Send the form again.');
667bfec4 » jakubvrana
2007-07-02 Decomposition
50 }
481e838b » jakubvrana
2009-06-18 Simplify includes
51 } elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
64ba9242 » jakubvrana
2009-06-21 Comments
52 // posted form with no data means exceeded post_max_size because Adminer always sends token at least
481e838b » jakubvrana
2009-06-18 Simplify includes
53 $error = lang('Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.');
54 }
55 if (isset($_GET["default"])) {
64ba9242 » jakubvrana
2009-06-21 Comments
56 // edit form is used for default values and distinguished by checking isset($_GET["default"]) in edit.inc.php
481e838b » jakubvrana
2009-06-18 Simplify includes
57 $_GET["edit"] = $_GET["default"];
58 }
59 if (isset($_GET["select"]) && $_POST && (!$_POST["delete"] && !$_POST["export"] && !$_POST["import"] && !$_POST["save"])) {
64ba9242 » jakubvrana
2009-06-21 Comments
60 // POST form on select page is used to edit or clone data
481e838b » jakubvrana
2009-06-18 Simplify includes
61 $_GET["edit"] = $_GET["select"];
62 }
63 if (isset($_GET["callf"])) {
64 $_GET["call"] = $_GET["callf"];
65 }
66 if (isset($_GET["function"])) {
67 $_GET["procedure"] = $_GET["function"];
68 }
69 if (isset($_GET["sql"])) {
70 include "./sql.inc.php";
71 } elseif (isset($_GET["edit"])) {
72 include "./edit.inc.php";
73 } elseif (isset($_GET["create"])) {
74 include "./create.inc.php";
75 } elseif (isset($_GET["indexes"])) {
76 include "./indexes.inc.php";
77 } elseif (isset($_GET["database"])) {
78 include "./database.inc.php";
79 } elseif (isset($_GET["call"])) {
80 include "./call.inc.php";
81 } elseif (isset($_GET["foreign"])) {
82 include "./foreign.inc.php";
83 } elseif (isset($_GET["createv"])) {
84 include "./createv.inc.php";
85 } elseif (isset($_GET["event"])) {
86 include "./event.inc.php";
87 } elseif (isset($_GET["procedure"])) {
88 include "./procedure.inc.php";
89 } elseif (isset($_GET["trigger"])) {
90 include "./trigger.inc.php";
91 } elseif (isset($_GET["user"])) {
92 include "./user.inc.php";
93 } elseif (isset($_GET["processlist"])) {
94 include "./processlist.inc.php";
95 } elseif (isset($_GET["select"])) {
96 include "./select.inc.php";
97 } elseif (isset($_GET["variables"])) {
98 include "./variables.inc.php";
99 } else {
100 include "./db.inc.php";
667bfec4 » jakubvrana
2007-07-02 Decomposition
101 }
102 }
4ad71802 » jakubvrana
2009-06-26 Disable filter.default
103
64ba9242 » jakubvrana
2009-06-21 Comments
104 // each page calls its own page_header(), if the footer should not be called then the page exits
481e838b » jakubvrana
2009-06-18 Simplify includes
105 page_footer();
Something went wrong with that request. Please try again.