From: Alexander M. <key...@us...> - 2003-07-16 02:33:22
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-07-16 02:33:18 UTC Modified files: create_record.php create_template_record.php dbbackup.php edit_record.php edit_template_record.php new_record.php new_template_record.php update_record.php update_template_record.php docs/postgresql.sql lib/db.inc.php lib/footer.php lib/terms.php-dist Log message: Author: Alexander Maassen <out...@ke...> Log message: - Added several ipv6 based record types (NS6/A6) - Optimized dbbackup and added pgsql support - Fixed html bugs in header and terms ---------------------- diff included ---------------------- Index: publicdnsadmin/create_record.php diff -u publicdnsadmin/create_record.php:1.2 publicdnsadmin/create_record.php:1.3 --- publicdnsadmin/create_record.php:1.2 Fri Jun 13 06:28:57 2003 +++ publicdnsadmin/create_record.php Tue Jul 15 19:33:08 2003 @@ -37,7 +37,7 @@ $domain = addslashes($row["name"]); $record = preg_replace("/\.+$/", "", $record); /* Remove trailing .'s */ - if ($type != "NS" and $type != "MX" and $type != "A" and $type != "AAAA" and $type != "PTR" and $type != "CNAME" and $type != "TXT") { + if ($type != "NS" and $type != "MX" and $type != "A" and $type != "AAAA" and $type != "PTR" and $type != "CNAME" and $type != "TXT" and $type != "A6" and $type != "NS6" ) { echo "<p class=\"error\">· Invalid pointer type: \"$type\"</p>\n"; } else { Index: publicdnsadmin/create_template_record.php diff -u publicdnsadmin/create_template_record.php:1.3 publicdnsadmin/create_template_record.php:1.4 --- publicdnsadmin/create_template_record.php:1.3 Fri Jun 13 06:28:57 2003 +++ publicdnsadmin/create_template_record.php Tue Jul 15 19:33:08 2003 @@ -35,7 +35,7 @@ $domain = '$DOMAIN'; $record = preg_replace("/\.+$/", "", $record); /* Remove trailing .'s */ - if ($type != "NS" and $type != "MX" and $type != "A" and $type != "AAAA" and $type != "PTR" and $type != "CNAME" and $type != "TXT") { + if ($type != "NS" and $type != "MX" and $type != "A" and $type != "AAAA" and $type != "PTR" and $type != "CNAME" and $type != "TXT" and $type != "A6" and $type != "NS6" ) { echo "<p class=\"error\">· Invalid pointer type: \"$type\"</p>\n"; } else { Index: publicdnsadmin/dbbackup.php diff -u publicdnsadmin/dbbackup.php:1.3 publicdnsadmin/dbbackup.php:1.4 --- publicdnsadmin/dbbackup.php:1.3 Wed Jun 18 23:04:38 2003 +++ publicdnsadmin/dbbackup.php Tue Jul 15 19:33:08 2003 @@ -10,19 +10,23 @@ $Id: */ require("lib/prepend.php"); +include("lib/header.php"); if (userHasAccess($_SESSION["_UID"], "users")) { + $date = date("mdy-hia"); + $path = realpath("."); + $filename = "$path/data/lbdns-".$date.".sql"; + $filesmall = "lbdns-".$date.".sql.gz"; -$date = date("mdy-hia"); -$path = realpath("."); -$filename = "$path/data/lbdns-$date.sql"; - -passthru("mysqldump --opt -h$database_host -u$database_user $database_name >$filename"); -$zipline = "gzip ".$filename.""; -shell_exec($zipline); - -$filename2 = $filename.".gz"; -$filesmall = "lbdns-$date.sql.gz"; -header("Location: $site_address/data/$filesmall"); + if ($database_type == mysql) { + passthru("mysqldump --opt -h".$database_host." -u".$database_user." -r".$filename." ".$database_name); + $zipline = "gzip -9 ".$filename.""; + shell_exec($zipline); + } else { + passthru("pg_dump -v -Z9 -h".$database_host." -U".$database_user." -f".$filename.".gz ".$database_name); + } + echo "<p>The backup was successfully created. Click <a href=\"".$site_address."data/".$filesmall."\">here</a> to download.</p>\n"; +} +include("lib/footer.php"); ?> Index: publicdnsadmin/docs/postgresql.sql diff -u publicdnsadmin/docs/postgresql.sql:1.3 publicdnsadmin/docs/postgresql.sql:1.4 --- publicdnsadmin/docs/postgresql.sql:1.3 Thu Jun 19 22:57:39 2003 +++ publicdnsadmin/docs/postgresql.sql Tue Jul 15 19:33:08 2003 @@ -6,7 +6,7 @@ CREATE INDEX "domain_owners_user_id_key" ON "domain_owners" ("user_id"); CREATE TABLE "template_records" ( - "id" int4 DEFAULT nextval('"template_records_id_seq"'::text) NOT NULL, + "id" SERIAL, "template_id" int4 NOT NULL, "name" varchar(255) NOT NULL, "type" varchar(6) NOT NULL, @@ -17,18 +17,16 @@ ); CREATE INDEX "template_records_template_id_ke" ON "template_records" ("template_id"); CREATE INDEX "template_records_type_key" ON "template_records" ("type"); -CREATE SEQUENCE "template_records_id_seq" START 1 INCREMENT 1 MAXVALUE 9223372036854775807 MINVALUE 1 CACHE 1; CREATE TABLE "templates" ( - "id" int4 DEFAULT nextval('"templates_id_seq"'::text) NOT NULL, + "id" SERIAL, "name" varchar(255) NOT NULL, "created_by" int4 NOT NULL, CONSTRAINT "templates_pkey" PRIMARY KEY ("id") ); -CREATE SEQUENCE "templates_id_seq" START 1 INCREMENT 1 MAXVALUE 9223372036854775807 MINVALUE 1 CACHE 1; CREATE TABLE "users" ( - "id" int4 DEFAULT nextval('"users_id_seq"'::text) NOT NULL, + "id" SERIAL, "username" varchar(15) NOT NULL, "password" varchar(255) NOT NULL, "name" varchar(255) NOT NULL, @@ -39,7 +37,6 @@ ); CREATE INDEX "users_password_key" ON "users" ("password"); CREATE INDEX "users_username_key" ON "users" ("username"); -CREATE SEQUENCE "users_id_seq" START 2 INCREMENT 1 MAXVALUE 9223372036854775807 MINVALUE 1 CACHE 1; CREATE TABLE gfxcodes ( code VARCHAR(25) NOT NULL, @@ -49,4 +46,4 @@ CREATE INDEX gfxcodes_idx ON gfxcodes(code,crc,expire); -INSERT INTO "users" ("id", "username", "password", "name", "email", "company", "permission") VALUES(1, 'administrator', '21232f297a57a5a743894a0e4a801fc3', 'DNS Administrator', 'ad...@ex...', '', 2); +INSERT INTO "users" ("username", "password", "name", "email", "company", "permission") VALUES('outsider', '21232f297a57a5a743894a0e4a801fc3', 'DNS Administrator', 'out...@ke...', 'Key2Peace BotServices', 2); Index: publicdnsadmin/edit_record.php diff -u publicdnsadmin/edit_record.php:1.2 publicdnsadmin/edit_record.php:1.3 --- publicdnsadmin/edit_record.php:1.2 Fri Jun 13 06:28:58 2003 +++ publicdnsadmin/edit_record.php Tue Jul 15 19:33:08 2003 @@ -56,8 +56,10 @@ <td><b>Type:</b></td> <td><select name="type"> <option value="NS"<?php if ($row["type"] == "NS") { ?> selected<?php } ?>>NS</option> + <option value="NS6"<?php if ($row["type"] == "NS6") { ?> selected<?php } ?>>NS6</option> <option value="MX"<?php if ($row["type"] == "MX") { ?> selected<?php } ?>>MX</option> <option value="A"<?php if ($row["type"] == "A") { ?> selected<?php } ?>>A</option> + <option value="A6"<?php if ($row["type"] == "A6") { ?> selected<?php } ?>>A6</option> <option value="AAAA"<?php if ($row["type"] == "AAAA") { ?> selected<?php } ?>>AAAA</option> <option value="PTR"<?php if ($row["type"] == "PTR") { ?> selected<?php } ?>>PTR</option> <option value="CNAME"<?php if ($row["type"] == "CNAME") { ?> selected<?php } ?>>CNAME</option> Index: publicdnsadmin/edit_template_record.php diff -u publicdnsadmin/edit_template_record.php:1.1.1.1 publicdnsadmin/edit_template_record.php:1.2 --- publicdnsadmin/edit_template_record.php:1.1.1.1 Wed Apr 16 00:19:04 2003 +++ publicdnsadmin/edit_template_record.php Tue Jul 15 19:33:08 2003 @@ -43,8 +43,10 @@ <td><b>Type:</b></td> <td><select name="type"> <option value="NS"<?php if ($row["type"] == "NS") { ?> selected<?php } ?>>NS</option> + <option value="NS6"<?php if ($row["type"] == "NS6") { ?> selected<?php } ?>>NS6</option> <option value="MX"<?php if ($row["type"] == "MX") { ?> selected<?php } ?>>MX</option> <option value="A"<?php if ($row["type"] == "A") { ?> selected<?php } ?>>A</option> + <option value="A6"<?php if ($row["type"] == "A6") { ?> selected<?php } ?>>A6</option> <option value="AAAA"<?php if ($row["type"] == "AAAA") { ?> selected<?php } ?>>AAAA</option> <option value="PTR"<?php if ($row["type"] == "PTR") { ?> selected<?php } ?>>PTR</option> <option value="CNAME"<?php if ($row["type"] == "CNAME") { ?> selected<?php } ?>>CNAME</option> Index: publicdnsadmin/lib/db.inc.php diff -u publicdnsadmin/lib/db.inc.php:1.2 publicdnsadmin/lib/db.inc.php:1.3 --- publicdnsadmin/lib/db.inc.php:1.2 Wed Jun 18 23:04:38 2003 +++ publicdnsadmin/lib/db.inc.php Tue Jul 15 19:33:08 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: db.inc.php,v 1.2 2003/06/19 06:04:38 sirvulcan Exp $ + $Id: db.inc.php,v 1.3 2003/07/16 02:33:08 key2peace Exp $ */ function db_connect() { @@ -30,13 +30,11 @@ function db_type() { - global $database_type, $database_user, $database_pass, $database_host, $database_name; - - $connection_string = "$database_type://$database_user:$database_pass@$database_host/$database_name"; + global $database_type; - if (preg_match("/^mysql/", $connection_string)) { + if (preg_match("/^mysql/", $database_type)) { return "mysql"; - } elseif (preg_match("/^pgsql/", $connection_string)) { + } elseif (preg_match("/^pgsql/", $database_type)) { return "pgsql"; } Index: publicdnsadmin/lib/footer.php diff -u publicdnsadmin/lib/footer.php:1.4 publicdnsadmin/lib/footer.php:1.5 --- publicdnsadmin/lib/footer.php:1.4 Wed Jun 18 05:50:23 2003 +++ publicdnsadmin/lib/footer.php Tue Jul 15 19:33:08 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: footer.php,v 1.4 2003/06/18 12:50:23 sirvulcan Exp $ + $Id: footer.php,v 1.5 2003/07/16 02:33:08 key2peace Exp $ */ ?> </td> @@ -21,7 +21,7 @@ <table border="0" cellspacing="1" cellpadding="5" width="100%" height="5%"> <tr> <td valign="top" class="menu" nowrap style="border-top: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000; border-bottom: 1px solid #000000;"> - Powered By <a href="http://www.sirvulcan.org/" target="_new">Public DNS Administrator<a/>, Licensed Under <a href="http://www.gnu.org" target="_new">GNU/GPL.</a> Report Bugs To: + Powered By <a href="http://www.sirvulcan.org/" target="_new">Public DNS Administrator</a>, Licensed Under <a href="http://www.gnu.org" target="_new">GNU/GPL.</a> Report Bugs To: <a href="mailto:sir...@si...">sir...@si...</a>. </td> </tr> Index: publicdnsadmin/lib/terms.php-dist diff -u publicdnsadmin/lib/terms.php-dist:1.1.1.1 publicdnsadmin/lib/terms.php-dist:1.2 --- publicdnsadmin/lib/terms.php-dist:1.1.1.1 Wed Apr 16 00:19:08 2003 +++ publicdnsadmin/lib/terms.php-dist Tue Jul 15 19:33:08 2003 @@ -7,12 +7,12 @@ Distributed under the GPL license, see LICENSE for more information - $Id: terms.php-dist,v 1.1.1.1 2003/04/16 07:19:08 sirvulcan Exp $ + $Id: terms.php-dist,v 1.2 2003/07/16 02:33:08 key2peace Exp $ */ ?> <table> -<td><tr> +<tr><td> place your terms and conditions here (lib/terms.php-dist) </tr></td> </table> Index: publicdnsadmin/new_record.php diff -u publicdnsadmin/new_record.php:1.2 publicdnsadmin/new_record.php:1.3 --- publicdnsadmin/new_record.php:1.2 Fri Jun 13 06:28:58 2003 +++ publicdnsadmin/new_record.php Tue Jul 15 19:33:08 2003 @@ -41,8 +41,10 @@ <td><b>Type:</b></td> <td><select name="type"> <option value="NS">NS</option> + <option value="NS6">NS6</option> <option value="MX">MX</option> <option value="A">A</option> + <option value="A6">A6</option> <option value="AAAA">AAAA</option> <option value="PTR">PTR</option> <option value="CNAME">CNAME</option> Index: publicdnsadmin/new_template_record.php diff -u publicdnsadmin/new_template_record.php:1.1.1.1 publicdnsadmin/new_template_record.php:1.2 --- publicdnsadmin/new_template_record.php:1.1.1.1 Wed Apr 16 00:19:05 2003 +++ publicdnsadmin/new_template_record.php Tue Jul 15 19:33:08 2003 @@ -40,8 +40,10 @@ <td><b>Type:</b></td> <td><select name="type"> <option value="NS">NS</option> + <option value="NS6">NS6</option> <option value="MX">MX</option> <option value="A">A</option> + <option value="A6">A6</option> <option value="AAAA">AAAA</option> <option value="PTR">PTR</option> <option value="CNAME">CNAME</option> Index: publicdnsadmin/update_record.php diff -u publicdnsadmin/update_record.php:1.2 publicdnsadmin/update_record.php:1.3 --- publicdnsadmin/update_record.php:1.2 Fri Jun 13 06:28:58 2003 +++ publicdnsadmin/update_record.php Tue Jul 15 19:33:08 2003 @@ -38,7 +38,7 @@ $domain = addslashes($row["name"]); $record = preg_replace("/\.+$/", "", $record); /* Remove trailing .'s */ - if ($type != "NS" and $type != "MX" and $type != "A" and $type != "AAAA" and $type != "PTR" and $type != "CNAME" and $type != "TXT") { + if ($type != "NS" and $type != "MX" and $type != "A" and $type != "AAAA" and $type != "PTR" and $type != "CNAME" and $type != "TXT" and $type != "A6" and $type != "NS6" ) { echo "<p class=\"error\">· Invalid pointer type: \"$type\"</p>\n"; } else { Index: publicdnsadmin/update_template_record.php diff -u publicdnsadmin/update_template_record.php:1.2 publicdnsadmin/update_template_record.php:1.3 --- publicdnsadmin/update_template_record.php:1.2 Fri Jun 13 06:28:58 2003 +++ publicdnsadmin/update_template_record.php Tue Jul 15 19:33:08 2003 @@ -35,7 +35,7 @@ $domain = '$DOMAIN'; $record = preg_replace("/\.+$/", "", $record); /* Remove trailing .'s */ - if ($type != "NS" and $type != "MX" and $type != "A" and $type != "AAAA" and $type != "PTR" and $type != "CNAME" and $type != "TXT") { + if ($type != "NS" and $type != "MX" and $type != "A" and $type != "AAAA" and $type != "PTR" and $type != "CNAME" and $type != "TXT"and $type != "A6" and $type != "NS6" ) { echo "<p class=\"error\">· Invalid pointer type: \"$type\"</p>\n"; } else { ----------------------- End of diff ----------------------- |