Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 36 lines (32 sloc) 1.128 kb
6420c58 Schema support for PostgreSQL
jakubvrana authored
1 <?php
2 if ($_POST && !$error) {
3 $link = preg_replace('~ns=[^&]*&~', '', ME) . "ns=";
4 if ($_POST["drop"]) {
5 query_redirect("DROP SCHEMA " . idf_escape($_GET["ns"]), $link, lang('Schema has been dropped.'));
6 } else {
7 $link .= urlencode($_POST["name"]);
8 if ($_GET["ns"] == "") {
9 query_redirect("CREATE SCHEMA " . idf_escape($_POST["name"]), $link, lang('Schema has been created.'));
10 } elseif ($_GET["ns"] != $_POST["name"]) {
11 query_redirect("ALTER SCHEMA " . idf_escape($_GET["ns"]) . " RENAME TO " . idf_escape($_POST["name"]), $link, lang('Schema has been altered.'));
12 } else {
13 redirect($link);
14 }
15 }
16 }
17
18 page_header($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema'), $error);
19
20 $row = array("name" => $_GET["ns"]);
21 if ($_POST) {
22 $row = $_POST;
23 }
24 ?>
25
26 <form action="" method="post">
27 <p><input name="name" value="<?php echo h($row["name"]); ?>">
28 <input type="hidden" name="token" value="<?php echo $token; ?>">
29 <input type="submit" value="<?php echo lang('Save'); ?>">
30 <?php
31 if ($_GET["ns"] != "") {
32 echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
33 }
34 ?>
35 </form>
Something went wrong with that request. Please try again.