From: Neil S. <sir...@us...> - 2003-05-24 04:43:28
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-05-24 04:33:24 UTC Modified files: create_template_record.php Log message: Author: SiRVu|caN Log message: Fixed PRIO-bug ---------------------- diff included ---------------------- Index: publicdnsadmin/create_template_record.php diff -u publicdnsadmin/create_template_record.php:1.1.1.1 publicdnsadmin/create_template_record.php:1.2 --- publicdnsadmin/create_template_record.php:1.1.1.1 Wed Apr 16 00:19:03 2003 +++ publicdnsadmin/create_template_record.php Fri May 23 21:33:14 2003 @@ -43,7 +43,7 @@ if (!$prio or !is_numeric($prio)) { $prio = 10; } - } elseif ($prio) { + } elseif (!$prio) { $prio = 0; } ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-13 10:57:49
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-13 10:57:46 UTC Modified files: style.css Log message: Author: SiRVu|caN Log message: preparing for release, css fix ---------------------- diff included ---------------------- Index: publicdnsadmin/style.css diff -u publicdnsadmin/style.css:1.1.1.1 publicdnsadmin/style.css:1.2 --- publicdnsadmin/style.css:1.1.1.1 Wed Apr 16 00:19:06 2003 +++ publicdnsadmin/style.css Fri Jun 13 03:57:35 2003 @@ -146,9 +146,6 @@ } -A:link {text-decoration: none; color:#C6D3FF;} -A:active {text-decoration: none} - .PAGE { height: 600px; ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-13 13:29:16
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-13 13:29:10 UTC Modified files: create_record.php create_template_record.php edit_record.php edit_zone.php index.php new_record.php update_record.php update_template_record.php lib/footer.php lib/header.php lib/permission.inc.php lib/records.inc.php lib/zones.inc.php Log message: Author: SiRVu|caN Log message: Allow the use of $DOMAIN in content field of template records. Users with granted access of other domains can now create/edit records in them. ---------------------- diff included ---------------------- Index: publicdnsadmin/create_record.php diff -u publicdnsadmin/create_record.php:1.1.1.1 publicdnsadmin/create_record.php:1.2 --- publicdnsadmin/create_record.php:1.1.1.1 Wed Apr 16 00:19:03 2003 +++ publicdnsadmin/create_record.php Fri Jun 13 06:28:57 2003 @@ -26,7 +26,7 @@ if (!$dbh->isError($result) && $result->numRows()) { $row = $result->fetchRow(); - if ($perms["edit_other"] or ($perms["edit_own"] and $row["user_id"] == $_SESSION["_UID"])) { + if ($perms["edit_other"] or userHasZoneAccess($_SESSION["_UID"], $zoneid) or ($perms["edit_own"] and $row["user_id"] == $_SESSION["_UID"])) { global $default_ttl; $record = trim(addslashes($_POST["record"])); Index: publicdnsadmin/create_template_record.php diff -u publicdnsadmin/create_template_record.php:1.2 publicdnsadmin/create_template_record.php:1.3 --- publicdnsadmin/create_template_record.php:1.2 Fri May 23 21:33:14 2003 +++ publicdnsadmin/create_template_record.php Fri Jun 13 06:28:57 2003 @@ -51,7 +51,7 @@ $ttl = $default_ttl; } - if (!validateRecordContent($type, $content, true)) { + if (!validateTemRecordContent($type, $content, true)) { echo "<p class=\"error\">· Invalid content for pointer type</p>\n"; } elseif (!validateRecordData($type, $record, true)) { echo "<p class=\"error\">· Invalid record data for pointer type</p>\n"; Index: publicdnsadmin/edit_record.php diff -u publicdnsadmin/edit_record.php:1.1.1.1 publicdnsadmin/edit_record.php:1.2 --- publicdnsadmin/edit_record.php:1.1.1.1 Wed Apr 16 00:19:04 2003 +++ publicdnsadmin/edit_record.php Fri Jun 13 06:28:58 2003 @@ -16,6 +16,7 @@ $perms = getUserPermissions($_SESSION["_UID"]); $recordid = trim(addslashes($_GET["id"])); + $zoneid = getZoneFromRecord($recordid); ?> <h3>Edit domain » edit record</h3> @@ -24,9 +25,8 @@ $dbh = db_connect(); $result = $dbh->query("SELECT records.*, domain_owners.user_id, domains.name AS domain_name FROM domains, domain_owners, records WHERE records.id = '$recordid' AND domain_owners.domain_id = records.domain_id AND domains.id = domain_owners.domain_id AND records.type <> 'SOA'"); if (!$dbh->isError($result) && $result->numRows()) { - $row = $result->fetchRow(); - if ($perms["edit_other"] or ($perms["edit_own"] and $row["user_id"] == $_SESSION["_UID"])) { + if ($perms["edit_other"] or userHasZoneAccess($_SESSION["_UID"], $zoneid) or ($perms["edit_own"] and $row["user_id"] == $_SESSION["_UID"])) { $preg_dom = preg_quote($row["domain_name"], "/"); $record_name = preg_replace("/^(.*)$preg_dom$/", '\1', $row["name"]); Index: publicdnsadmin/edit_zone.php diff -u publicdnsadmin/edit_zone.php:1.1.1.1 publicdnsadmin/edit_zone.php:1.2 --- publicdnsadmin/edit_zone.php:1.1.1.1 Wed Apr 16 00:19:04 2003 +++ publicdnsadmin/edit_zone.php Fri Jun 13 06:28:58 2003 @@ -31,7 +31,7 @@ if (!$dbh->isError($result) && $result->numRows()) { $row = $result->fetchRow(); - if ($perms["edit_other"] or ($perms["edit_own"] and $row["user_id"] == $_SESSION["_UID"])) { + if ($perms["edit_other"] or userHasZoneAccess($_SESSION["_UID"], $zoneid) or ($perms["edit_own"] and $row["user_id"] == $_SESSION["_UID"])) { $records = getRecords($zoneid); echo "<p>· <a href=\"new_record.php?zone=$zoneid\">New record</a></p>\n"; @@ -49,11 +49,19 @@ echo "<tr>\n"; if (htmlentities($record["type"]) != "PTR") { - echo "<td class=\"row$row_id\">".htmlentities($record["name"])."</td>\n"; + if ($record["type"] != "SOA") { + echo "<td class=\"row$row_id\"><a href=\"edit_record.php?id=".$record["id"]."\">".htmlentities($record["name"])."</a></td>\n"; + } else { + echo "<td class=\"row$row_id\">".htmlentities($record["name"])."</td>\n"; + } } else { - $expaddy = explode(".", htmlentities($record["name"])); $dispaddy = $expaddy[3].".".$expaddy[2].".".$expaddy[1].".".$expaddy[0]; - echo "<td class=\"row$row_id\">".$dispaddy."</td>\n"; + $expaddy = explode(".", htmlentities($record["name"])); + if ($record["type"] != "SOA") { + echo "<td class=\"row$row_id\"><a href=\"edit_record.php?id=".$record["id"]."\">".$dispaddy."</a></td>\n"; + } else { + echo "<td class=\"row$row_id\">".$dispaddy."</td>\n"; + } } echo "<td class=\"row$row_id\" align=\"center\">".htmlentities($record["type"])."</td>\n"; echo "<td class=\"row$row_id\">".htmlentities($record["content"])."</td>\n"; Index: publicdnsadmin/index.php diff -u publicdnsadmin/index.php:1.1.1.1 publicdnsadmin/index.php:1.2 --- publicdnsadmin/index.php:1.1.1.1 Wed Apr 16 00:19:05 2003 +++ publicdnsadmin/index.php Fri Jun 13 06:28:58 2003 @@ -101,9 +101,6 @@ </tr> </table> </form> -<br> -<b>This System Is BETA, Report Any Errors To <a href="mailto:vu...@li...">vu...@li...</a></b> -<br> <?php } Index: publicdnsadmin/lib/footer.php diff -u publicdnsadmin/lib/footer.php:1.1.1.1 publicdnsadmin/lib/footer.php:1.2 --- publicdnsadmin/lib/footer.php:1.1.1.1 Wed Apr 16 00:19:07 2003 +++ publicdnsadmin/lib/footer.php Fri Jun 13 06:28:59 2003 @@ -7,12 +7,11 @@ Distributed under the GPL license, see LICENSE for more information - $Id: footer.php,v 1.1.1.1 2003/04/16 07:19:07 sirvulcan Exp $ + $Id: footer.php,v 1.2 2003/06/13 13:28:59 sirvulcan Exp $ */ ?> -<center> -<a href="http://www.sourceforge.net/projects/publicdnsadmin/">Public DNS Administrator<a/> -</center> +<br> +Powered By <a href="http://www.sirvulcan.org/">Public DNS Administrator<a/> </td> </table> Index: publicdnsadmin/lib/header.php diff -u publicdnsadmin/lib/header.php:1.1.1.1 publicdnsadmin/lib/header.php:1.2 --- publicdnsadmin/lib/header.php:1.1.1.1 Wed Apr 16 00:19:07 2003 +++ publicdnsadmin/lib/header.php Fri Jun 13 06:29:00 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: header.php,v 1.1.1.1 2003/04/16 07:19:07 sirvulcan Exp $ + $Id: header.php,v 1.2 2003/06/13 13:29:00 sirvulcan Exp $ */ ?> @@ -21,8 +21,6 @@ </head> <body> -<img src="images/logo.gif"><br><br> - <table border="0" cellspacing="1" cellpadding="5" width="100%"> <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;"> @@ -56,3 +54,4 @@ </td> <td> </td> <td valign="top" width="100%"> + <img src="images/logo.gif"><br> Index: publicdnsadmin/lib/permission.inc.php diff -u publicdnsadmin/lib/permission.inc.php:1.1.1.1 publicdnsadmin/lib/permission.inc.php:1.2 --- publicdnsadmin/lib/permission.inc.php:1.1.1.1 Wed Apr 16 00:19:07 2003 +++ publicdnsadmin/lib/permission.inc.php Fri Jun 13 06:29:00 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: permission.inc.php,v 1.1.1.1 2003/04/16 07:19:07 sirvulcan Exp $ + $Id: permission.inc.php,v 1.2 2003/06/13 13:29:00 sirvulcan Exp $ */ function displayNoAccess() { @@ -30,6 +30,24 @@ } } +} + +function userHasZoneAccess($userid, $zoneid) { + + $dbh = db_connect(); + $result = $dbh->query("SELECT id FROM domains WHERE id = '$zoneid'"); + if (!$dbh->isError($result) && $result->numRows()) { + $result = $dbh->query("SELECT id FROM users WHERE id = '$userid'"); + if (!$dbh->isError($result) && $result->numRows()) { + $result = $dbh->query("SELECT domain_id, user_id FROM domain_owners WHERE domain_id = '$zoneid' AND user_id = '$userid'"); + if (!$dbh->isError($result) && $result->numRows()) { + return true; + } else { + return false; + } + } + } + $dbh->disconnect(); } function getUserPermissions($userid) { Index: publicdnsadmin/lib/records.inc.php diff -u publicdnsadmin/lib/records.inc.php:1.1.1.1 publicdnsadmin/lib/records.inc.php:1.2 --- publicdnsadmin/lib/records.inc.php:1.1.1.1 Wed Apr 16 00:19:08 2003 +++ publicdnsadmin/lib/records.inc.php Fri Jun 13 06:29:00 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: records.inc.php,v 1.1.1.1 2003/04/16 07:19:08 sirvulcan Exp $ + $Id: records.inc.php,v 1.2 2003/06/13 13:29:00 sirvulcan Exp $ */ function getRecords($zoneid) { @@ -160,6 +160,57 @@ return $ok; +} + +function validateTemRecordContent($type, $content, $template = false) { + + $ok = 1; + + /* TODO: Better validation :) */ + if ($type == "NS") { + if (!preg_match("/^[a-zA-Z0-9-_\.]+/", $content)) { + if ($template and preg_match("/\\\$DOMAIN/", $content)) { + $ok = 1; + } else { + $ok = 0; + } + } + } elseif ($type == "MX") { + if (!preg_match("/^[a-zA-Z0-9-_\.]+/", $content)) { + if ($template and preg_match("/\\\$DOMAIN/", $content)) { + $ok = 1; + } else { + $ok = 0; + } + } + } elseif ($type == "A") { + if (!preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/", $content)) { + $ok = 0; + } + } elseif ($type == "AAAA") { + if (!preg_match("/^[0-9a-f\:]+/", $content)) { + $ok = 0; + } + } elseif ($type == "PTR") { + if (!preg_match("/^[a-zA-Z0-9-_\.]+/", $content)) { + $ok = 0; + } + } elseif ($type == "CNAME") { + if (!preg_match("/^[a-zA-Z0-9-_\.]+/", $content)) { + if ($template and preg_match("/\\\$DOMAIN/", $content)) { + $ok = 1; + } else { + $ok = 0; + } + } + } elseif ($type == "TXT") { + if (!$content) { + $ok = 0; + } + } + + return $ok; + } function validateRecordData($type, $record, $template = false) { Index: publicdnsadmin/lib/zones.inc.php diff -u publicdnsadmin/lib/zones.inc.php:1.1.1.1 publicdnsadmin/lib/zones.inc.php:1.2 --- publicdnsadmin/lib/zones.inc.php:1.1.1.1 Wed Apr 16 00:19:08 2003 +++ publicdnsadmin/lib/zones.inc.php Fri Jun 13 06:29:00 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: zones.inc.php,v 1.1.1.1 2003/04/16 07:19:08 sirvulcan Exp $ + $Id: zones.inc.php,v 1.2 2003/06/13 13:29:00 sirvulcan Exp $ */ function createZone($name, $template, $owner) { @@ -148,6 +148,46 @@ } $dbh->disconnect(); + +} + +function getZoneFromRecord($recid) { + $dbh = db_connect(); + $result = $dbh->query("SELECT id, domain_id FROM records WHERE id = '$recid'"); + if (!$dbh->isError($result) && $result->numRows()) { + $row = $result->fetchRow(); + $zoneid = $row["domain_id"]; + } + + $dbh->disconnect(); + return $zoneid; + +} + +function getZoneFromTemplateRecord($id) { + $dbh = db_connect(); + $result = $dbh->query("SELECT id, template_id FROM template_records WHERE id = '$id'"); + if (!$dbh->isError($result) && $result->numRows()) { + $row = $result->fetchRow(); + $zoneid = $row["template_id"]; + } + + $dbh->disconnect(); + return $zoneid; + +} + + +function getZoneNameFromID($zoneid) { + $dbh = db_connect(); + $result = $dbh->query("SELECT id, name FROM domains WHERE id = '$id'"); + if (!$dbh->isError($result) && $result->numRows()) { + $row = $result->fetchRow(); + $zonename = $row["name"]; + } + + $dbh->disconnect(); + return $zonename; } Index: publicdnsadmin/new_record.php diff -u publicdnsadmin/new_record.php:1.1.1.1 publicdnsadmin/new_record.php:1.2 --- publicdnsadmin/new_record.php:1.1.1.1 Wed Apr 16 00:19:05 2003 +++ publicdnsadmin/new_record.php Fri Jun 13 06:28:58 2003 @@ -26,7 +26,7 @@ if (!$dbh->isError($result) && $result->numRows()) { $row = $result->fetchRow(); - if ($perms["edit_other"] or ($perms["edit_own"] and $row["user_id"] == $_SESSION["_UID"])) { + if ($perms["edit_other"] or userHasZoneAccess($_SESSION["_UID"], $zoneid) or ($perms["edit_own"] and $row["user_id"] == $_SESSION["_UID"])) { global $default_ttl; Index: publicdnsadmin/update_record.php diff -u publicdnsadmin/update_record.php:1.1.1.1 publicdnsadmin/update_record.php:1.2 --- publicdnsadmin/update_record.php:1.1.1.1 Wed Apr 16 00:19:06 2003 +++ publicdnsadmin/update_record.php Fri Jun 13 06:28:58 2003 @@ -16,6 +16,7 @@ $perms = getUserPermissions($_SESSION["_UID"]); $recordid = trim(addslashes($_GET["id"])); + $zoneid = getZoneFromRecord($recordid); ?> <h3>Edit domain » edit record</h3> @@ -26,7 +27,7 @@ if (!$dbh->isError($result) && $result->numRows()) { $row = $result->fetchRow(); - if ($perms["edit_other"] or ($perms["edit_own"] and $row["user_id"] == $_SESSION["_UID"])) { + if ($perms["edit_other"] or userHasZoneAccess($_SESSION["_UID"], $zoneid) or ($perms["edit_own"] and $row["user_id"] == $_SESSION["_UID"])) { global $default_ttl; $record = trim(addslashes($_POST["record"])); Index: publicdnsadmin/update_template_record.php diff -u publicdnsadmin/update_template_record.php:1.1.1.1 publicdnsadmin/update_template_record.php:1.2 --- publicdnsadmin/update_template_record.php:1.1.1.1 Wed Apr 16 00:19:06 2003 +++ publicdnsadmin/update_template_record.php Fri Jun 13 06:28:58 2003 @@ -51,7 +51,9 @@ $ttl = $default_ttl; } - if (!validateRecordContent($type, $content)) { + + + if (!validateTemRecordContent($type, $content)) { echo "<p class=\"error\">· Invalid content for pointer type</p>\n"; } elseif (!validateRecordData($type, $record)) { echo "<p class=\"error\">· Invalid record data for pointer type</p>\n"; ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-13 13:39:34
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-13 13:39:30 UTC Modified files: docs/CHANGELOG Log message: Author: SiRVu|caN Log message: Gotta remember to keep the CHANGELOG up to date ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.1.1.1 publicdnsadmin/docs/CHANGELOG:1.2 --- publicdnsadmin/docs/CHANGELOG:1.1.1.1 Wed Apr 16 00:19:07 2003 +++ publicdnsadmin/docs/CHANGELOG Fri Jun 13 06:39:19 2003 @@ -1,3 +1,8 @@ $Id: -SiRVu|caN <sir...@si...> - 4/16/2003 - initial project release +SiRVu|caN <sir...@si...> - 4/16/2003 - initial project release. +SiRVu|caN <sir...@si...> - 24/5/2003 - Fixed PRIO-bug. +SiRVu|caN <sir...@si...> - 13/6/2003 - CSS HTML link color fix. +SiRVu|caN <sir...@si...> - 13/6/2003 - Allow the use of $DOMAIN in content field of template records. +SiRVu|caN <sir...@si...> - 13/6/2003 - Users with granted access of other domains can now create/edit + records in them. ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-13 14:09:47
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-13 14:09:38 UTC Modified files: dbbackup.php docs/CHANGELOG docs/INSTALL Log message: Author: SiRVu|caN Log message: Fixed formatting issue on dbbackup page. Added documentation for the dbbackup setup into INSTALL, i will improve the way it works later. Fixed path for .gz backup download link. ---------------------- diff included ---------------------- Index: publicdnsadmin/dbbackup.php diff -u publicdnsadmin/dbbackup.php:1.1.1.1 publicdnsadmin/dbbackup.php:1.2 --- publicdnsadmin/dbbackup.php:1.1.1.1 Wed Apr 16 00:19:03 2003 +++ publicdnsadmin/dbbackup.php Fri Jun 13 07:09:27 2003 @@ -11,17 +11,16 @@ */ require("lib/prepend.php"); include("lib/header.php"); - +echo "<Br>"; if (userHasAccess($_SESSION["_UID"], "users")) { $date = date("mdy-hia"); -$dbname = "lbdns"; -$filename = "/usr/local/powerdnsadmin/data/lbdns-$date.sql"; +$filename = "/path/to/publicdnsadmin/data/lbdns-$date.sql"; $dbhost = "127.0.0.1"; -$dbuser = "root"; -$dbpass = ""; -$dbname = "pdns"; +$dbuser = "dbuser"; +$dbpass = "dbpass"; +$dbname = "dbname"; passthru("mysqldump --opt -h$dbhost -u$dbuser $dbname >$filename"); $zipline = "gzip ".$filename.""; @@ -30,10 +29,11 @@ $filename2 = $filename.".gz"; $filesmall = "lbdns-$date.sql.gz"; -echo "<a href=\"/data/".$filesmall."\">Download Backup ($date)</a>"; +echo "<a href=\"data/".$filesmall."\">Download Backup ($date)</a>"; } else { displayNoAccess(); } +echo "<br><br>"; include("lib/footer.php"); ?> Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.2 publicdnsadmin/docs/CHANGELOG:1.3 --- publicdnsadmin/docs/CHANGELOG:1.2 Fri Jun 13 06:39:19 2003 +++ publicdnsadmin/docs/CHANGELOG Fri Jun 13 07:09:28 2003 @@ -4,5 +4,9 @@ SiRVu|caN <sir...@si...> - 24/5/2003 - Fixed PRIO-bug. SiRVu|caN <sir...@si...> - 13/6/2003 - CSS HTML link color fix. SiRVu|caN <sir...@si...> - 13/6/2003 - Allow the use of $DOMAIN in content field of template records. -SiRVu|caN <sir...@si...> - 13/6/2003 - Users with granted access of other domains can now create/edit - records in them. + - Users with granted access of other domains can now create/edit + records in them. +SiRVu|caN <sir...@si...> - 14/6/2003 - Fixed formatting issue on dbbackup page. + - Added documentation for the dbbackup setup into INSTALL, i + will improve the way it works later. + - Fixed path for .gz backup download link. Index: publicdnsadmin/docs/INSTALL diff -u publicdnsadmin/docs/INSTALL:1.1.1.1 publicdnsadmin/docs/INSTALL:1.2 --- publicdnsadmin/docs/INSTALL:1.1.1.1 Wed Apr 16 00:19:07 2003 +++ publicdnsadmin/docs/INSTALL Fri Jun 13 07:09:28 2003 @@ -16,3 +16,12 @@ PowerDNS, you must add some tables for Public DNS Administration to work properly. The required structure data can be found in mysql.sql and postgresql.sql in the same directory as this INSTALL-file. + + Edit dbbackup.php in the Public DNS Administrator root dir, change thse values: + + $filename = "/path/to/publicdnsadmin/data/lbdns-$date.sql"; + $dbhost = "dbhost"; + $dbuser = "dbuser"; + $dbpass = "dbpass"; + $dbname = "dbname"; + ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-13 15:19:26
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-13 15:19:22 UTC Modified files: users.php docs/CHANGELOG Added files: delete_user.php Log message: Author: SiRVu|caN Log message: We can now delete users. ---------------------- diff included ---------------------- Index: publicdnsadmin/delete_user.php diff -u /dev/null publicdnsadmin/delete_user.php:1.1 --- /dev/null Fri Jun 13 08:19:22 2003 +++ publicdnsadmin/delete_user.php Fri Jun 13 08:19:11 2003 @@ -0,0 +1,71 @@ +<?php +/* + Public DNS Administator + Originally Written by Trond Arve Nordheim <tr...@no...> + Modified By Neil Spierling <sir...@si...> + + Distributed under the GPL license, see LICENSE for + more information + + $Id: +*/ + +require("lib/prepend.php"); +require("lib/header.php"); + +if (userHasAccess($_SESSION["_UID"], "users") && ($_GET["id"] != 1)) { + + $perms = getUserPermissions($_SESSION["_UID"]); + $userid = trim(addslashes($_GET["id"])); + $dbh = db_connect(); + $getuser = $dbh->query("SELECT username FROM users where id='$userid'"); + if (!$dbh->isError($getuser) && $getuser->numRows()) { + $urow = $getuser->fetchRow(); + $username = $urow["username"]; + } else { + echo "<h3>Delete user</h3>"; + echo "<p>Fatal Error, User Does Not Exist Most Likely</p>"; + $dbh->disconnect(); + require("lib/footer.php"); + die(); + } + +?> +<h3>Delete user</h3> +<?php + if ($_GET["confirm"]) { + + $result = $dbh->query("SELECT user_id, domain_id FROM domain_owners WHERE user_id = '$id'"); + if (!$dbh->isError($result) && $result->numRows()) { + while ($row = $result->fetchRow()) { + $checkdomain = $row["domain_id"]; + $domcheck = $dbh->query("SELECT user_id, domain_id FROM domain_owners WHERE domain_id='$checkdomain'"); + if (!$dbh->isError($domcheck) && $domcheck->numRows()) { + if ($domcheck->numRows() == 1) { + $dbh->query("DELETE FROM domains WHERE id = '$checkdomain'"); + $dbh->query("DELETE FROM domain_owners WHERE domain_id = 'checkdomain'"); + $dbh->query("DELETE FROM records WHERE domain_id = '$checkdomain'"); + } else { + $dbh->query("DELETE FROM domain_owners WHERE domain_id = '$checkdomain'"); + } + } + } + } + + $dbh->query("DELETE FROM users WHERE id = '$id'"); + echo "<p>$username and all their domains/records were successfully deleted</p>\n"; + } else { + echo "<p>Are you sure you wish to delete $username?</p>\n"; + echo "<p><input type=\"button\" value=\"Yes\" onClick=\"javascript:document.location.href='delete_user.php?id=$userid&confirm=1';\"> <input type=\"button\" value=\"No\" onClick=\"javascript:history.go(-1);\"></p>\n"; + } + + + $dbh->disconnect(); +} else { + displayNoAccess(); +} + +require("lib/footer.php"); + +?> + Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.3 publicdnsadmin/docs/CHANGELOG:1.4 --- publicdnsadmin/docs/CHANGELOG:1.3 Fri Jun 13 07:09:28 2003 +++ publicdnsadmin/docs/CHANGELOG Fri Jun 13 08:19:12 2003 @@ -10,3 +10,4 @@ - Added documentation for the dbbackup setup into INSTALL, i will improve the way it works later. - Fixed path for .gz backup download link. +SiRVu|caN <sir...@si...> - 14/6/2003 - Added delete_user.php for deleting users. Index: publicdnsadmin/users.php diff -u publicdnsadmin/users.php:1.1.1.1 publicdnsadmin/users.php:1.2 --- publicdnsadmin/users.php:1.1.1.1 Wed Apr 16 00:19:07 2003 +++ publicdnsadmin/users.php Fri Jun 13 08:19:11 2003 @@ -23,7 +23,7 @@ $result = $dbh->query("SELECT * FROM users ORDER BY username"); if (!$dbh->isError($result) && $result->numRows()) { - echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"background: #000000;\"><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><th>Username</th><th>Name</th><th>E-mail</th><th>Company</th><th>Domains</th></tr>\n"; + echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"background: #000000;\"><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><th>Username</th><th>Name</th><th>E-mail</th><th>Company</th><th>Domains</th><th></th></tr>\n"; $row_id = 0; while ($row = $result->fetchRow()) { @@ -43,6 +43,11 @@ echo "<td class=\"row$row_id\"><a href=\"mailto:".htmlentities($row["email"])."\">".htmlentities($row["email"])."</a></td>\n"; echo "<td class=\"row$row_id\">".htmlentities($row["company"])."</td>\n"; echo "<td class=\"row$row_id\" align=\"center\">$domain_count</td>\n"; + if ($row["id"] != 1) { + echo "<td class=\"row$row_id\" align=\"center\"><a href=\"delete_user.php?id=".$row["id"]."\"><img src=\"images/trash.png\" alt=\"Delete User\" border=0></a></td>\n"; + } else { + echo "<td class=\"row$row_id\" align=\"center\"></td>\n"; + } echo "</tr>\n"; if ($row_id == 2) { $row_id = 0; } ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-13 15:57:52
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-13 15:57:50 UTC Modified files: style.css docs/CHANGELOG lib/footer.php lib/header.php Log message: Author: SiRVu|caN Log message: Layout change. ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.4 publicdnsadmin/docs/CHANGELOG:1.5 --- publicdnsadmin/docs/CHANGELOG:1.4 Fri Jun 13 08:19:12 2003 +++ publicdnsadmin/docs/CHANGELOG Fri Jun 13 08:57:40 2003 @@ -11,3 +11,4 @@ will improve the way it works later. - Fixed path for .gz backup download link. SiRVu|caN <sir...@si...> - 14/6/2003 - Added delete_user.php for deleting users. +SiRVu|caN <sir...@si...> - 14/6/2003 - Layout change. Index: publicdnsadmin/lib/footer.php diff -u publicdnsadmin/lib/footer.php:1.2 publicdnsadmin/lib/footer.php:1.3 --- publicdnsadmin/lib/footer.php:1.2 Fri Jun 13 06:28:59 2003 +++ publicdnsadmin/lib/footer.php Fri Jun 13 08:57:40 2003 @@ -7,13 +7,19 @@ Distributed under the GPL license, see LICENSE for more information - $Id: footer.php,v 1.2 2003/06/13 13:28:59 sirvulcan Exp $ + $Id: footer.php,v 1.3 2003/06/13 15:57:40 sirvulcan Exp $ */ ?> -<br> -Powered By <a href="http://www.sirvulcan.org/">Public DNS Administrator<a/> </td> </table> +<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: + <a href="mailto:sir...@si...">sir...@si...</a>. + </td> +</tr> +</table> </body> </html> Index: publicdnsadmin/lib/header.php diff -u publicdnsadmin/lib/header.php:1.2 publicdnsadmin/lib/header.php:1.3 --- publicdnsadmin/lib/header.php:1.2 Fri Jun 13 06:29:00 2003 +++ publicdnsadmin/lib/header.php Fri Jun 13 08:57:40 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: header.php,v 1.2 2003/06/13 13:29:00 sirvulcan Exp $ + $Id: header.php,v 1.3 2003/06/13 15:57:40 sirvulcan Exp $ */ ?> @@ -21,10 +21,10 @@ </head> <body> -<table border="0" cellspacing="1" cellpadding="5" width="100%"> +<table border="0" cellspacing="1" cellpadding="5" width="100%" height="95%"> <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;"> - + <div align="center" class="menu"><b>Menu</b></div><br> <?php if ($_SESSION["_UID"]) { ?> · <a href="index.php" class="menu">My domains</a><br> <?php if (userHasAccess($_SESSION["_UID"], "edit_template")) { ?>· <a href="templates.php" class="menu">My templates</a><br><?php } ?><br> Index: publicdnsadmin/style.css diff -u publicdnsadmin/style.css:1.2 publicdnsadmin/style.css:1.3 --- publicdnsadmin/style.css:1.2 Fri Jun 13 03:57:35 2003 +++ publicdnsadmin/style.css Fri Jun 13 08:57:39 2003 @@ -98,13 +98,13 @@ background: #C7DDF4; color: #666666; font-family: Tahoma, Arial, sans-serif; - font-size: 10px; + font-size: 12px; } a.menu:link { color: #666666; font-family: Tahoma, Arial, sans-serif; - font-size: 10px; + font-size: 12px; font-weight: bold; text-decoration: none; } @@ -112,7 +112,7 @@ a.menu:active { color: #666666; font-family: Tahoma, Arial, sans-serif; - font-size: 10px; + font-size: 12px; font-weight: bold; text-decoration: none; } @@ -120,7 +120,7 @@ a.menu:visited { color: #666666; font-family: Tahoma, Arial, sans-serif; - font-size: 10px; + font-size: 12px; font-weight: bold; text-decoration: none; } @@ -128,7 +128,7 @@ a.menu:hover { color: #666666; font-family: Tahoma, Arial, sans-serif; - font-size: 10px; + font-size: 12px; font-weight: bold; text-decoration: none; } ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-13 16:04:03
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-13 16:04:02 UTC Modified files: docs/CHANGELOG Added files: docs/TODO Log message: Author: SiRVu|caN Log message: Added TODO file ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.5 publicdnsadmin/docs/CHANGELOG:1.6 --- publicdnsadmin/docs/CHANGELOG:1.5 Fri Jun 13 08:57:40 2003 +++ publicdnsadmin/docs/CHANGELOG Fri Jun 13 09:03:51 2003 @@ -12,3 +12,4 @@ - Fixed path for .gz backup download link. SiRVu|caN <sir...@si...> - 14/6/2003 - Added delete_user.php for deleting users. SiRVu|caN <sir...@si...> - 14/6/2003 - Layout change. +SiRVu|caN <sir...@si...> - 14/6/2003 - Added TODO file in docs/. Index: publicdnsadmin/docs/TODO diff -u /dev/null publicdnsadmin/docs/TODO:1.1 --- /dev/null Fri Jun 13 09:04:02 2003 +++ publicdnsadmin/docs/TODO Fri Jun 13 09:03:51 2003 @@ -0,0 +1,2 @@ +- Some sort of maintenence news system (displayed on the main login page). +- Graphical code check upon signup (and possibly login). ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-13 16:31:37
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-13 16:31:36 UTC Modified files: docs/TODO Log message: Author: SiRVu|caN Log message: couple of things added ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/TODO diff -u publicdnsadmin/docs/TODO:1.1 publicdnsadmin/docs/TODO:1.2 --- publicdnsadmin/docs/TODO:1.1 Fri Jun 13 09:03:51 2003 +++ publicdnsadmin/docs/TODO Fri Jun 13 09:31:25 2003 @@ -1,2 +1,4 @@ - Some sort of maintenence news system (displayed on the main login page). - Graphical code check upon signup (and possibly login). +- Improve dbbackup.php. +- Improve nsstats.php. ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-18 08:06:04
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-18 08:05:57 UTC Modified files: signup.php docs/INSTALL docs/TODO docs/mysql.sql docs/postgresql.sql lib/config.php-dist lib/prepend.php Added files: gfx_code.php docs/gfxcode.update.sql images/b5.ttf images/bg_gfx_code.jpg images/rans.ttf images/tile_dw.jpg images/tile_dw_small.jpg images/tile_up.jpg images/tile_up_small.jpg lib/gfx_code.inc.php Log message: Author: SiRVu|caN Log message: gfxcode addition ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/INSTALL diff -u publicdnsadmin/docs/INSTALL:1.2 publicdnsadmin/docs/INSTALL:1.3 --- publicdnsadmin/docs/INSTALL:1.2 Fri Jun 13 07:09:28 2003 +++ publicdnsadmin/docs/INSTALL Wed Jun 18 01:05:47 2003 @@ -17,6 +17,9 @@ properly. The required structure data can be found in mysql.sql and postgresql.sql in the same directory as this INSTALL-file. + If you are upgrading from a CVS version, make sure you run the *.update.sql + scripts. + Edit dbbackup.php in the Public DNS Administrator root dir, change thse values: $filename = "/path/to/publicdnsadmin/data/lbdns-$date.sql"; Index: publicdnsadmin/docs/TODO diff -u publicdnsadmin/docs/TODO:1.2 publicdnsadmin/docs/TODO:1.3 --- publicdnsadmin/docs/TODO:1.2 Fri Jun 13 09:31:25 2003 +++ publicdnsadmin/docs/TODO Wed Jun 18 01:05:47 2003 @@ -1,4 +1,4 @@ - Some sort of maintenence news system (displayed on the main login page). -- Graphical code check upon signup (and possibly login). +- Graphical code check upon signup (and possibly login). -signup done - Improve dbbackup.php. - Improve nsstats.php. Index: publicdnsadmin/docs/gfxcode.update.sql diff -u /dev/null publicdnsadmin/docs/gfxcode.update.sql:1.1 --- /dev/null Wed Jun 18 01:05:57 2003 +++ publicdnsadmin/docs/gfxcode.update.sql Wed Jun 18 01:05:47 2003 @@ -0,0 +1,7 @@ +CREATE TABLE gfxcodes ( + code VARCHAR(25) NOT NULL, + crc VARCHAR(128) NOT NULL, + expire INT NOT NULL +); + +CREATE INDEX gfxcodes_idx ON gfxcodes(code,crc,expire); Index: publicdnsadmin/docs/mysql.sql diff -u publicdnsadmin/docs/mysql.sql:1.1.1.1 publicdnsadmin/docs/mysql.sql:1.2 --- publicdnsadmin/docs/mysql.sql:1.1.1.1 Wed Apr 16 00:19:07 2003 +++ publicdnsadmin/docs/mysql.sql Wed Jun 18 01:05:47 2003 @@ -37,4 +37,13 @@ PRIMARY KEY (id), KEY username (username,password) ) TYPE=MyISAM; + +CREATE TABLE gfxcodes ( + code VARCHAR(25) NOT NULL, + crc VARCHAR(128) NOT NULL, + expire INT NOT NULL +); + +CREATE INDEX gfxcodes_idx ON gfxcodes(code,crc,expire); + INSERT INTO users VALUES (1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'DNS Administrator', 'hos...@ex...', '', '2'); Index: publicdnsadmin/docs/postgresql.sql diff -u publicdnsadmin/docs/postgresql.sql:1.1.1.1 publicdnsadmin/docs/postgresql.sql:1.2 --- publicdnsadmin/docs/postgresql.sql:1.1.1.1 Wed Apr 16 00:19:07 2003 +++ publicdnsadmin/docs/postgresql.sql Wed Jun 18 01:05:47 2003 @@ -40,4 +40,13 @@ 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, + crc VARCHAR(128) NOT NULL, + expire INT NOT NULL +); + +CREATE INDEX gfxcodes_idx ON gfxcodes(code,crc,expire); + INSERT INTO "users" ("id", "username", "password", "name", "email", "company", "permission") VALUES(1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'DNS Administrator', 'ad...@ex...', '', 2); Index: publicdnsadmin/gfx_code.php diff -u /dev/null publicdnsadmin/gfx_code.php:1.1 --- /dev/null Wed Jun 18 01:05:57 2003 +++ publicdnsadmin/gfx_code.php Wed Jun 18 01:05:46 2003 @@ -0,0 +1,50 @@ +<?php +/* + Public DNS Administator + Originally Written by Trond Arve Nordheim <tr...@no...> + Modified By Neil Spierling <sir...@si...> + + Distributed under the GPL license, see LICENSE for + more information + + $Id: +*/ + +require("lib/prepend.php"); + +global $ALLOWED_EXT,$DEFAULT_BG_COLOR,$DEFAULT_FG_COLOR,$DEFAULT_FONT_SIZE,$FONT_PATH,$GFX_SECURE_MODE; +global $ENABLE_ANGLE_VARIATION,$DEFAULT_LINES_COLOR,$DEFAULT_DOTS_COLOR,$DEFAULT_NUM_LINES,$DEFAULT_NUM_DOTS; +global $ENABLE_H_LINES,$ENABLE_V_LINES,$ENABLE_DOTS,$SPECIFIC_FONT2,$TILE_UP,$TILE_DW,$RANDOM_UP_DW,$NEWUSERS_GFXCHECK; +global $JPEG_OUT_QUALITY,$SPECIFIC_FONT; + +if (!extension_loaded("gd")) { // checking if LibGD is present in apache/php + $SHOW_GFXUSRCHK = 0; + } else { + $SHOW_GFXUSRCHK = 1; +} + +if ($SHOW_GFXUSRCHK && $NEWUSERS_GFXCHECK) { + $dbh = db_connect(); + if (!extension_loaded("gd")) { die("GD Library not present !"); } + $ENABLE_COOKIE_TABLE = 1; + + $fontList = get_font_face_list(); + unset($dFID); $dFID = rand(0,(count($fontList)-1)); // random available font face + + $dbh->query("DELETE FROM gfxcodes WHERE expire<now()::abstime::int4"); + $r = $dbh->query("SELECT code FROM gfxcodes WHERE crc='" . $_GET["crc"] . "'"); + if ($o = $r->fetchRow()) { + $code_gen = $o["code"]; + // generate the picture + if ($GFX_SECURE_MODE==1) { + img_label($code_gen,$SPECIFIC_FONT); + } else { + img_label2($code_gen,$SPECIFIC_FONT2); + } + } else { + img_label("INVALID CRC !!!",$SPECIFIC_FONT,24,"#ff1111","#ffffff"); + } +} else { + die("Page is disabled."); +} +?> Index: publicdnsadmin/images/b5.ttf Index: publicdnsadmin/images/bg_gfx_code.jpg Index: publicdnsadmin/images/rans.ttf Index: publicdnsadmin/images/tile_dw.jpg Index: publicdnsadmin/images/tile_dw_small.jpg Index: publicdnsadmin/images/tile_up.jpg Index: publicdnsadmin/images/tile_up_small.jpg Index: publicdnsadmin/lib/config.php-dist diff -u publicdnsadmin/lib/config.php-dist:1.1.1.1 publicdnsadmin/lib/config.php-dist:1.2 --- publicdnsadmin/lib/config.php-dist:1.1.1.1 Wed Apr 16 00:19:08 2003 +++ publicdnsadmin/lib/config.php-dist Wed Jun 18 01:05:47 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: config.php-dist,v 1.1.1.1 2003/04/16 07:19:08 sirvulcan Exp $ + $Id: config.php-dist,v 1.2 2003/06/18 08:05:47 sirvulcan Exp $ */ /* @@ -45,5 +45,34 @@ $ns2port = "8081"; $ns2user = "admin"; $ns2pass = "password"; + +/* Graphical code check options, You need libgd enabled in your PHP */ +$NEWUSERS_GFXCHECK = 0; + +$ALLOWED_EXT = ".ttf"; +$DEFAULT_BG_COLOR = "#FFFFFF"; +$DEFAULT_FG_COLOR = "#CACACA"; +$DEFAULT_FONT_SIZE = 36; +$FONT_PATH = "/path/to/publicdnsadmin/images/"; + +$GFX_SECURE_MODE = 2; +$ENABLE_ANGLE_VARIATION = 1; +$JPEG_OUT_QUALITY = 60; + +/* GFX_SECURE_MODE == 1 */ +$DEFAULT_LINES_COLOR = "#CACACA"; +$DEFAULT_DOTS_COLOR = "#CACACA"; +$DEFAULT_NUM_LINES = 10; +$DEFAULT_NUM_DOTS = 2000; +$ENABLE_H_LINES = 1; +$ENABLE_V_LINES = 1; +$ENABLE_DOTS = 0; +$SPECIFIC_FONT = "rans.ttf"; + +/* GFX_SECURE_MODE == 2 */ +$SPECIFIC_FONT2 = "b5.ttf"; +$TILE_UP = "tile_up_small.jpg"; +$TILE_DW = "tile_dw_small.jpg"; +$RANDOM_UP_DW = 1; ?> Index: publicdnsadmin/lib/gfx_code.inc.php diff -u /dev/null publicdnsadmin/lib/gfx_code.inc.php:1.1 --- /dev/null Wed Jun 18 01:05:57 2003 +++ publicdnsadmin/lib/gfx_code.inc.php Wed Jun 18 01:05:47 2003 @@ -0,0 +1,185 @@ +<?php +/* + Public DNS Administator + Originally Written by Trond Arve Nordheim <tr...@no...> + Modified By Neil Spierling <sir...@si...> + + Distributed under the GPL license, see LICENSE for + more information + + $Id: gfx_code.inc.php,v 1.1 2003/06/18 08:05:47 sirvulcan Exp $ +*/ + +include("lib/config.php"); + +/* GFX code check functions */ +function ImgNewColor($image_id,$hex_notation) { + if (!preg_match("/^#[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]$/",$hex_notation)) { return 0; } + $r_col = substr($hex_notation,1,2);$g_col = substr($hex_notation,3,2);$b_col = substr($hex_notation,5,2); + $r_dec = hexdec($r_col);$g_dec = hexdec($g_col);$b_dec = hexdec($b_col); + return ImageColorAllocate($image_id,$r_dec,$g_dec,$b_dec); +} +function get_font_face_list() { + global $ALLOWED_EXT,$DEFAULT_BG_COLOR,$DEFAULT_FG_COLOR,$DEFAULT_FONT_SIZE,$FONT_PATH,$GFX_SECURE_MODE; + global $ENABLE_ANGLE_VARIATION,$DEFAULT_LINES_COLOR,$DEFAULT_DOTS_COLOR,$DEFAULT_NUM_LINES,$DEFAULT_NUM_DOTS; + global $ENABLE_H_LINES,$ENABLE_V_LINES,$ENABLE_DOTS,$SPECIFIC_FONT2,$TILE_UP,$TILE_DW,$RANDOM_UP_DW,$NEWUSERS_GFXCHECK; + global $JPEG_OUT_QUALITY,$SPECIFIC_FONT; + + // returns an array containing all valid FONT FACE (file names) + $retVal = Array(); + if ($handle = opendir($FONT_PATH)) { + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != ".." && ereg($ALLOWED_EXT,strtolower($file))) { + $retVal[] = $file; + } + } + closedir($handle); + sort($retVal); + return $retVal; + } else { + return $retVal; + } +} +function img_label($text_label) { + global $fontList,$dFID; + global $ALLOWED_EXT,$DEFAULT_BG_COLOR,$DEFAULT_FG_COLOR,$DEFAULT_FONT_SIZE,$FONT_PATH,$GFX_SECURE_MODE; + global $ENABLE_ANGLE_VARIATION,$DEFAULT_LINES_COLOR,$DEFAULT_DOTS_COLOR,$DEFAULT_NUM_LINES,$DEFAULT_NUM_DOTS; + global $ENABLE_H_LINES,$ENABLE_V_LINES,$ENABLE_DOTS,$SPECIFIC_FONT2,$TILE_UP,$TILE_DW,$RANDOM_UP_DW,$NEWUSERS_GFXCHECK; + global $JPEG_OUT_QUALITY,$SPECIFIC_FONT; + + $font_name = $SPECIFIC_FONT; + $font_size = $DEFAULT_FONT_SIZE; + $font_path = $FONT_PATH; + $fg_color = $DEFAULT_FG_COLOR; + $bg_color = $DEFAULT_BG_COLOR; + + if (substr($FONT_PATH,(strlen($FONT_PATH)-1),1)!="/") { $ff = $FONT_PATH . "/"; } else { $ff = $FONT_PATH; } + + // this function will only work if nothing was output before its call. + // it will completely generate the image text label from scratch to the 'die' clause. + + if ($font_name == "") { $font_name = $fontList[$dFID]; } // if no specified font_name, pick a random one in those TTFs available in FONT_PATH. + header("Content-type: image/jpeg"); + + // load the bg image + $bg_IMG = ImageCreateFromJPEG($ff . "bg_gfx_code.jpg"); // image is in FONT_PATH + $bg_W = ImageSX($bg_IMG); $bg_H = ImageSY($bg_IMG); + + // calculate image size for chosen text + if ($ENABLE_ANGLE_VARIATION) { srand(); $da_angle = rand(-5,5); } else { $da_angle = 0; } + list($pos_blx, $pos_bly, $pos_brx, $pos_bry, $pos_trx, $pos_try, $pos_tlx, $pos_tly) = ImageTTFBBox($font_size, $da_angle, $ff . $font_name, $text_label); + $text_w = $pos_brx - $pos_blx; + $text_h = $pos_bly - $pos_tly; + + // create empty template of final size and define colors + $newIm = ImageCreate($text_w+50,$text_h+50); + $bgCol = ImgNewColor($newIm,$bg_color); $fgCol = ImgNewColor($newIm,$fg_color); + if ($ENABLE_H_LINES || $ENABLE_V_LINES) { $gridCol = ImgNewColor($newIm,$DEFAULT_LINES_COLOR); } + if ($ENABLE_DOTS) { $dotzCol = ImgNewColor($newIm,$DEFAULT_DOTS_COLOR); } + + // copy a resized version of BG image into final picture + ImageCopyResampled($newIm,$bg_IMG,0,0,0,0,$text_w+50,$text_h+50,$bg_W,$bg_H); + + // write the text into the picture + ImageTTFText($newIm,$font_size,$da_angle,20,$text_h+20,$fgCol,$ff . $font_name,$text_label); + + + // add some various configurable garbage to make it even harder to do picture recognition + if ($ENABLE_H_LINES){ + for ($x=0;$x<$DEFAULT_NUM_LINES;$x++) { + srand(); + $r_y = rand(1,(ImageSY($newIm)-1)); + ImageLine($newIm,0,$r_y,ImageSX($newIm),$r_y,$gridCol); + } + } + if ($ENABLE_V_LINES) { + for ($x=0;$x<$DEFAULT_NUM_LINES;$x++) { + srand(); + $r_x = rand(1,(ImageSX($newIm)-1)); + ImageLine($newIm,$r_x,0,$r_x,ImageSY($newIm),$gridCol); + } + } + if ($ENABLE_DOTS) { + for ($x=0;$x<$DEFAULT_NUM_DOTS;$x++) { + srand(); + $r_x = rand(1,(ImageSX($newIm)-1)); + $r_y = rand(1,(ImageSY($newIm)-1)); + ImageSetPixel($newIm,$r_x,$r_y,$dotzCol); + } + } + // output the picture + ImageJPEG($newIm,"",$JPEG_OUT_QUALITY); // JPEG Quality + die; +} + +function img_label2($text_label) { + global $fontList,$dFID; + global $ALLOWED_EXT,$DEFAULT_BG_COLOR,$DEFAULT_FG_COLOR,$DEFAULT_FONT_SIZE,$FONT_PATH,$GFX_SECURE_MODE; + global $ENABLE_ANGLE_VARIATION,$DEFAULT_LINES_COLOR,$DEFAULT_DOTS_COLOR,$DEFAULT_NUM_LINES,$DEFAULT_NUM_DOTS; + global $ENABLE_H_LINES,$ENABLE_V_LINES,$ENABLE_DOTS,$SPECIFIC_FONT2,$TILE_UP,$TILE_DW,$RANDOM_UP_DW,$NEWUSERS_GFXCHECK; + global $JPEG_OUT_QUALITY,$SPECIFIC_FONT; + + $font_name = $SPECIFIC_FONT2; + $font_size = $DEFAULT_FONT_SIZE; + $font_path = $FONT_PATH; + $fg_color = $DEFAULT_FG_COLOR; + $bg_color = $DEFAULT_BG_COLOR; + + if (substr($FONT_PATH,(strlen($FONT_PATH)-1),1)!="/") { $ff = $FONT_PATH . "/"; } else { $ff = $FONT_PATH; } + + // this function will only work if nothing was output before its call. + // it will completely generate the image text label from scratch to the 'die' clause. + + if ($font_name == "") { $font_name = $fontList[$dFID]; } // if no specified font_name, pick a random one in those TTFs available in FONT_PATH. + header("Content-type: image/jpeg"); + + + // calculate image size for chosen text + if ($ENABLE_ANGLE_VARIATION) { srand(); $da_angle = rand(-5,5); } else { $da_angle = 0; } + list($pos_blx, $pos_bly, $pos_brx, $pos_bry, $pos_trx, $pos_try, $pos_tlx, $pos_tly) = ImageTTFBBox($font_size, $da_angle, $ff . $font_name, $text_label); + $text_w = $pos_brx - $pos_blx; $text_h = $pos_bly - $pos_tly; + + // load the TILE UP/DOWN images + if ($RANDOM_UP_DW) { + srand(); + $rnum = rand(5000,10000); + if ($rnum>=7500) { + $tile_up_IMG = ImageCreateFromJPEG($ff . $TILE_UP); // image is in FONT_PATH + $tile_down_IMG = ImageCreateFromJPEG($ff . $TILE_DW); // image is in FONT_PATH + } else { + $tile_up_IMG = ImageCreateFromJPEG($ff . $TILE_DW); // image is in FONT_PATH + $tile_down_IMG = ImageCreateFromJPEG($ff . $TILE_UP); // image is in FONT_PATH + } + } else { + $tile_up_IMG = ImageCreateFromJPEG($ff . $TILE_UP); // image is in FONT_PATH + $tile_down_IMG = ImageCreateFromJPEG($ff . $TILE_DW); // image is in FONT_PATH + } + + // create empty template of final size and define colors + $newIm = ImageCreate($text_w+70,$text_h+70); + $bgCol = ImgNewColor($newIm,$bg_color); + $fgCol = ImgNewColor($newIm,$fg_color); + ImageSetTile($newIm,$tile_up_IMG); + ImageFilledRectangle($newIm,0,0,$text_w+70,$text_h+70,IMG_COLOR_TILED); + + + // create the text image + $t_IMG = ImageCreate($text_w+70,$text_h+70); + $TbgCol = ImgNewColor($t_IMG,"#ffffff"); + $TfgCol = ImgNewColor($t_IMG,"#000000"); + $TTTCol = ImgNewColor($t_IMG,"#ffffff"); + ImageSetTile($t_IMG,$tile_down_IMG); + ImageFilledRectangle($t_IMG,0,0,$text_w+70,$text_h+70,IMG_COLOR_TILED); + $transp_t = ImageColorTransparent($t_IMG,$TTTCol); + + // write the text into the picture + ImageTTFText($t_IMG,$font_size,$da_angle,35,$text_h+35,-$TTTCol,$ff . $font_name,$text_label); + + // copy transparent text on final picture + ImageCopy($newIm,$t_IMG,0,0,0,0,$text_w+70,$text_h+70); + + // output the picture + ImageJPEG($newIm,"",$JPEG_OUT_QUALITY); // JPEG Quality + die; +} +?> Index: publicdnsadmin/lib/prepend.php diff -u publicdnsadmin/lib/prepend.php:1.1.1.1 publicdnsadmin/lib/prepend.php:1.2 --- publicdnsadmin/lib/prepend.php:1.1.1.1 Wed Apr 16 00:19:08 2003 +++ publicdnsadmin/lib/prepend.php Wed Jun 18 01:05:47 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: prepend.php,v 1.1.1.1 2003/04/16 07:19:08 sirvulcan Exp $ + $Id: prepend.php,v 1.2 2003/06/18 08:05:47 sirvulcan Exp $ */ /* Start session */ @@ -19,6 +19,7 @@ /* Internal dependencies */ require("config.php"); require("db.inc.php"); +require("gfx_code.inc.php"); require("permission.inc.php"); require("templates.inc.php"); require("zones.inc.php"); Index: publicdnsadmin/signup.php diff -u publicdnsadmin/signup.php:1.1.1.1 publicdnsadmin/signup.php:1.2 --- publicdnsadmin/signup.php:1.1.1.1 Wed Apr 16 00:19:06 2003 +++ publicdnsadmin/signup.php Wed Jun 18 01:05:47 2003 @@ -19,6 +19,40 @@ $password = trim(addslashes($_POST["password"])); $pass_confirm = trim(addslashes($_POST["pass_confirm"])); +$dbh = db_connect(); + +if (!extension_loaded("gd")) { // checking if LibGD is present in apache/php + $SHOW_GFXUSRCHK = 0; + } else { + $SHOW_GFXUSRCHK = 1; +} + +if ($SHOW_GFXUSRCHK && $NEWUSERS_GFXCHECK) { + if ($clic == 1 && ($gfxcode_crc != md5( $gfxcode_ts . $_SERVER["HTTP_USER_AGENT"] . CRC_SALT_0010 . strtoupper($gfxcode_val) . CRC_SALT_0008))) { + $failed = 1; + if ($first_error) { echo "<center>"; $first_error=0; } + echo "<p>You entered an invalid code from the picture. <a href=\"signup.php\">Please try again</a>.</p>"; + } else { + if ($clic == 1) { + $ENABLE_COOKIE_TABLE = 1; + $dbh->query("DELETE FROM gfxcodes WHERE expire<now()::abstime::int4"); + $r = $dbh->query("SELECT expire FROM gfxcodes WHERE crc='" . $gfxcode_crc . "' AND code='" . strtoupper($gfxcode_val) . "'"); + if ($r->numRows()==0) { + $failed = 1; + if ($first_error) { echo "<center>"; $first_error=0; } + echo "<p>You entered an invalid/expired code from the picture. <a href=\"newuser.php\">Please try again</a>.</p>"; + } else { + } + } + $ENABLE_COOKIE_TABLE = 0; + if ($failed==0) { + $ENABLE_COOKIE_TABLE = 1; + $dbh->query("DELETE FROM gfxcodes WHERE crc='" . $gfxcode_crc . "' AND code='" . strtoupper($gfxcode_val) . "'"); + $ENABLE_COOKIE_TABLE = 0; + } + } +} + ?> <h3>Signup</h3> <? @@ -29,8 +63,6 @@ } if ($douser == 1) { - $dbh = db_connect(); - // terms and agreement check if ($terms == 1) { echo "<p class=\"error\">You Didnt Agree To The Terms and Conditions.</p>"; @@ -244,6 +276,28 @@ <tr><td>Company:</td><td><input type="text" name="company" size="40" maxlength="40"></td><td>40 Chars Max</td></tr> <tr><td>Domains:</td><Td><textarea rows="5" cols="40" name="ldomains"></textarea></td><td>1 Domain Per Line</td></tr> <tr><td></td><td colspan="2">NOTE: Each Domain must use ns1.linux-boxen.org and ns2.linux-boxen.org for its nameservers, signup will be denied if the domains dont match to ns1.linux-boxen.org and ns2.linux-boxen.org</td></tr> + +<? + if ($SHOW_GFXUSRCHK && $NEWUSERS_GFXCHECK) { + $code_length = 10; // generated code number of chars + $code_base = md5( CRC_SALT_0001 . time() . microtime() . CRC_SALT_0009 . uniqid(1) ); // base of code ( with strlen(this)>$code_length ! ). + $code = strtoupper(substr(str_replace("1","",str_replace("i","",str_replace("I","",str_replace("o","",str_replace("O","",str_replace("l","",str_replace("L","",str_replace("0","",$code_base)))))))),0,$code_length)); + $ts = time()+1800; // expires 30 mins after page load. + $crckey = md5( $ts . $_SERVER["HTTP_USER_AGENT"] . CRC_SALT_0010 . $code . CRC_SALT_0008 ); + echo "<input type=hidden name=gfxcode_crc value=\"" . $crckey . "\">\n"; + echo "<input type=hidden name=gfxcode_ts value=\"" . $ts . "\">\n"; + $ENABLE_COOKIE_TABLE = 1; + $dbh->query("INSERT INTO gfxcodes VALUES ('" . $code . "','" . $crckey . "','" . $ts . "')"); + $ENABLE_COOKIE_TABLE = 0; + echo "<tr><td></td><Td>"; + echo "<input type=text size=35 maxlength=$code_length name=gfxcode_val value=\"\">"; + echo "</td><td>"; + echo "<img src=\"gfx_code.php?crc=" . $crckey . "\" border=0 alt=\"Type Code in Box\">"; + echo "</td></tr>"; + +} +?> + <tr><td></td><td width="250"><input type="checkbox" name="terms">Do You Agree To The <a href="terms.php" target="new">Terms And Conditions</a></td><td></td></tr> <tr><td></td><td></td><td align="right"><input type="reset" value="Reset"><input type="submit" value="Signup"></td><td></td></tr> ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-18 10:20:36
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-18 10:20:35 UTC Modified files: index.php login.php signup.php lib/gfx_code.inc.php Log message: Author: SiRVu|caN Log message: few changes, gfx check on login now ---------------------- diff included ---------------------- Index: publicdnsadmin/index.php diff -u publicdnsadmin/index.php:1.2 publicdnsadmin/index.php:1.3 --- publicdnsadmin/index.php:1.2 Fri Jun 13 06:28:58 2003 +++ publicdnsadmin/index.php Wed Jun 18 03:20:24 2003 @@ -12,6 +12,12 @@ require("lib/prepend.php"); require("lib/header.php"); +if (!extension_loaded("gd")) { // checking if LibGD is present in apache/php + $SHOW_GFXUSRCHK = 0; + } else { + $SHOW_GFXUSRCHK = 1; +} + if ($_SESSION["_UID"]) { ?> @@ -84,17 +90,51 @@ ?> <h3>Login</h3> -<?php if ($_GET["error"] == 1) { ?><p class="error">Login failed: invalid username/password</p> -<?php } elseif ($_GET["logout"] == 1) { ?><p>You have been logged out</p><?php } ?> +<?php +if ($_GET["error"] == 1) { + if ($NEWUSERS_GFXCHECK) { + echo "<p class=\"error\">Login failed: invalid username/password/gfx code</p>"; + } else { + echo "<p class=\"error\">Login failed: invalid username/password</p>"; + } +} elseif ($_GET["logout"] == 1) { + echo "<p>You have been logged out</p>"; +} +?> <form action="login.php" method="post"> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td><b>Username:</b></td> - <td><input type="text" name="username" size="20" maxlength="15" value=""></td> + <td><input type="text" name="username" size="25" maxlength="15" value=""></td> </tr> <tr> <td><b>Password:</b></td> - <td><input type="password" name="password" size="20" maxlength="15" value=""></td> + <td><input type="password" name="password" size="25" maxlength="15" value=""></td> +</tr> +<? +if ($SHOW_GFXUSRCHK && $NEWUSERS_GFXCHECK) { +?> +<tr> + <td><b>Security Check:</b></td> +<td> +<? + $dbh = db_connect(); + $code_length = 10; + $code_base = md5( CRC_SALT_0001 . time() . microtime() . CRC_SALT_0009 . uniqid(1) ); + $code = strtoupper(substr(str_replace("1","",str_replace("i","",str_replace("I","",str_replace("o","",str_replace("O","",str_replace("l","",str_replace("L","",str_replace("0","",$code_base)))))))),0,$code_length)); + $ts = time()+1800; + $crckey = md5( $ts . $_SERVER["HTTP_USER_AGENT"] . CRC_SALT_0010 . $code . CRC_SALT_0008 ); + echo "<input type=hidden name=gfxcode_crc value=\"" . $crckey . "\">\n"; + echo "<input type=hidden name=gfxcode_ts value=\"" . $ts . "\">\n"; + $dbh->query("INSERT INTO gfxcodes VALUES ('" . $code . "','" . $crckey . "','" . $ts . "')"); + echo "<img src=\"gfx_code.php?crc=" . $crckey . "\" width=150 height=50 border=0 alt=\"Type Code in Box\"></td></tr>"; + echo "<tr><td></td><td><input type=text size=25 maxlength=$code_length name=gfxcode_val value=\"\"></td>"; + $dbh->disconnect(); +?> +</tr> +<? +} +?> </tr> <tr> <td colspan="2" align="right"><input type="reset" value="Reset"> <input type="submit" value="Login"></td> Index: publicdnsadmin/lib/gfx_code.inc.php diff -u publicdnsadmin/lib/gfx_code.inc.php:1.1 publicdnsadmin/lib/gfx_code.inc.php:1.2 --- publicdnsadmin/lib/gfx_code.inc.php:1.1 Wed Jun 18 01:05:47 2003 +++ publicdnsadmin/lib/gfx_code.inc.php Wed Jun 18 03:20:25 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: gfx_code.inc.php,v 1.1 2003/06/18 08:05:47 sirvulcan Exp $ + $Id: gfx_code.inc.php,v 1.2 2003/06/18 10:20:25 sirvulcan Exp $ */ include("lib/config.php"); @@ -181,5 +181,26 @@ // output the picture ImageJPEG($newIm,"",$JPEG_OUT_QUALITY); // JPEG Quality die; +} + +function check_code($gfxcode_ts, $gfxcode_crc, $gfxcode_val) { + global $gfxcode_ts, $gfxcode_crc, $gfxcode_val; + $dbh = db_connect(); + + $c = $dbh->query("SELECT expire FROM gfxcodes"); + while ($d = $c->fetchRow()) { + if ($d["expire"] < time()) { + $dbh->query("DELETE FROM gfxcodes WHERE expire='" . $d["expire"] . "'"); + } + } + + $r = $dbh->query("SELECT expire FROM gfxcodes WHERE crc='" . $gfxcode_crc . "' AND code='" . strtoupper($gfxcode_val) . "'"); + if ($r->numRows() == 0) { + return 0; + } else { + $dbh->query("DELETE FROM gfxcodes WHERE crc='" . $gfxcode_crc . "' AND code='" . strtoupper($gfxcode_val) . "'"); + return 1; + } + $dbh->disconnect(); } ?> Index: publicdnsadmin/login.php diff -u publicdnsadmin/login.php:1.1.1.1 publicdnsadmin/login.php:1.2 --- publicdnsadmin/login.php:1.1.1.1 Wed Apr 16 00:19:05 2003 +++ publicdnsadmin/login.php Wed Jun 18 03:20:24 2003 @@ -13,22 +13,44 @@ $username = trim(addslashes($_POST["username"])); $password = addslashes(md5($_POST["password"])); +$gfxcode_ts = $_POST["gfxcode_ts"]; +$gfxcode_crc = $_POST["gfxcode_crc"]; +$gfxcode_val = $_POST["gfxcode_val"]; $dbh = db_connect(); $login_ok = 0; -$result = $dbh->query("SELECT * FROM users WHERE username = '$username' AND password = '$password'"); -if (!$dbh->isError($result) && $result->numRows()) { - $row = $result->fetchRow(); - $_SESSION["_UID"] = $row["id"]; - $login_ok = 1; - +if (!extension_loaded("gd")) { // checking if LibGD is present in apache/php + $SHOW_GFXUSRCHK = 0; + } else { + $SHOW_GFXUSRCHK = 1; +} + +if ($SHOW_GFXUSRCHK && $NEWUSERS_GFXCHECK) { + $gfx_ok = 0; + $gfx_ok = check_code($gfxcode_ts, $gfxcode_crc, $gfxcode_val); + if ($gfx_ok != 0) { + $result = $dbh->query("SELECT * FROM users WHERE username = '$username' AND password = '$password'"); + if (!$dbh->isError($result) && $result->numRows()) { + $row = $result->fetchRow(); + $_SESSION["_UID"] = $row["id"]; + $login_ok = 1; + } + } +} else { + $gfx_ok = 1; + $result = $dbh->query("SELECT * FROM users WHERE username = '$username' AND password = '$password'"); + if (!$dbh->isError($result) && $result->numRows()) { + $row = $result->fetchRow(); + $_SESSION["_UID"] = $row["id"]; + $login_ok = 1; + } } $dbh->disconnect(); -if ($login_ok) { +if ($login_ok && $gfx_ok) { header("Location: index.php"); } else { header("Location: index.php?error=1"); Index: publicdnsadmin/signup.php diff -u publicdnsadmin/signup.php:1.2 publicdnsadmin/signup.php:1.3 --- publicdnsadmin/signup.php:1.2 Wed Jun 18 01:05:47 2003 +++ publicdnsadmin/signup.php Wed Jun 18 03:20:24 2003 @@ -18,6 +18,9 @@ $company = trim(addslashes($_POST["company"])); $password = trim(addslashes($_POST["password"])); $pass_confirm = trim(addslashes($_POST["pass_confirm"])); +$gfxcode_ts = $_POST["gfxcode_ts"]; +$gfxcode_crc = $_POST["gfxcode_crc"]; +$gfxcode_val = $_POST["gfxcode_val"]; $dbh = db_connect(); @@ -27,32 +30,6 @@ $SHOW_GFXUSRCHK = 1; } -if ($SHOW_GFXUSRCHK && $NEWUSERS_GFXCHECK) { - if ($clic == 1 && ($gfxcode_crc != md5( $gfxcode_ts . $_SERVER["HTTP_USER_AGENT"] . CRC_SALT_0010 . strtoupper($gfxcode_val) . CRC_SALT_0008))) { - $failed = 1; - if ($first_error) { echo "<center>"; $first_error=0; } - echo "<p>You entered an invalid code from the picture. <a href=\"signup.php\">Please try again</a>.</p>"; - } else { - if ($clic == 1) { - $ENABLE_COOKIE_TABLE = 1; - $dbh->query("DELETE FROM gfxcodes WHERE expire<now()::abstime::int4"); - $r = $dbh->query("SELECT expire FROM gfxcodes WHERE crc='" . $gfxcode_crc . "' AND code='" . strtoupper($gfxcode_val) . "'"); - if ($r->numRows()==0) { - $failed = 1; - if ($first_error) { echo "<center>"; $first_error=0; } - echo "<p>You entered an invalid/expired code from the picture. <a href=\"newuser.php\">Please try again</a>.</p>"; - } else { - } - } - $ENABLE_COOKIE_TABLE = 0; - if ($failed==0) { - $ENABLE_COOKIE_TABLE = 1; - $dbh->query("DELETE FROM gfxcodes WHERE crc='" . $gfxcode_crc . "' AND code='" . strtoupper($gfxcode_val) . "'"); - $ENABLE_COOKIE_TABLE = 0; - } - } -} - ?> <h3>Signup</h3> <? @@ -97,6 +74,17 @@ require("lib/footer.php"); die(); } // email checks + + // gfx code checks + if ($SHOW_GFXUSRCHK && $NEWUSERS_GFXCHECK && $gfxcode_ts && $gfxcode_crc && $gfxcode_val) { + $gfx_ok = 0; + $gfx_ok = check_code($gfxcode_ts, $gfxcode_crc, $gfxcode_val); + if ($gfx_ok == 0) { + echo "<p class=\"error\">Invalid GFX Code.</p>"; + require("lib/footer.php"); + die(); + } + } // gfx code checks $usercheck = $dbh->query("SELECT username FROM users WHERE username='".$username."'"); if (!$dbh->isError($usercheck) && ($usercheck->numRows() > 0)) { ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-18 10:27:10
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-18 10:27:08 UTC Modified files: gfx_code.php index.php login.php lib/config.php-dist Log message: Author: SiRVu|caN Log message: $LOGIN_GFXCHECK added, can now disabled the gfxcheck for login and optionally leave it enabled for signup. ---------------------- diff included ---------------------- Index: publicdnsadmin/gfx_code.php diff -u publicdnsadmin/gfx_code.php:1.1 publicdnsadmin/gfx_code.php:1.2 --- publicdnsadmin/gfx_code.php:1.1 Wed Jun 18 01:05:46 2003 +++ publicdnsadmin/gfx_code.php Wed Jun 18 03:26:58 2003 @@ -23,7 +23,7 @@ $SHOW_GFXUSRCHK = 1; } -if ($SHOW_GFXUSRCHK && $NEWUSERS_GFXCHECK) { +if ($SHOW_GFXUSRCHK && ($NEWUSERS_GFXCHECK || $LOGIN_GFXCHECK)) { $dbh = db_connect(); if (!extension_loaded("gd")) { die("GD Library not present !"); } $ENABLE_COOKIE_TABLE = 1; Index: publicdnsadmin/index.php diff -u publicdnsadmin/index.php:1.3 publicdnsadmin/index.php:1.4 --- publicdnsadmin/index.php:1.3 Wed Jun 18 03:20:24 2003 +++ publicdnsadmin/index.php Wed Jun 18 03:26:58 2003 @@ -92,7 +92,7 @@ <h3>Login</h3> <?php if ($_GET["error"] == 1) { - if ($NEWUSERS_GFXCHECK) { + if ($LOGIN_GFXCHECK) { echo "<p class=\"error\">Login failed: invalid username/password/gfx code</p>"; } else { echo "<p class=\"error\">Login failed: invalid username/password</p>"; @@ -112,7 +112,7 @@ <td><input type="password" name="password" size="25" maxlength="15" value=""></td> </tr> <? -if ($SHOW_GFXUSRCHK && $NEWUSERS_GFXCHECK) { +if ($SHOW_GFXUSRCHK && $LOGIN_GFXCHECK) { ?> <tr> <td><b>Security Check:</b></td> Index: publicdnsadmin/lib/config.php-dist diff -u publicdnsadmin/lib/config.php-dist:1.2 publicdnsadmin/lib/config.php-dist:1.3 --- publicdnsadmin/lib/config.php-dist:1.2 Wed Jun 18 01:05:47 2003 +++ publicdnsadmin/lib/config.php-dist Wed Jun 18 03:26:58 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: config.php-dist,v 1.2 2003/06/18 08:05:47 sirvulcan Exp $ + $Id: config.php-dist,v 1.3 2003/06/18 10:26:58 sirvulcan Exp $ */ /* @@ -48,6 +48,7 @@ /* Graphical code check options, You need libgd enabled in your PHP */ $NEWUSERS_GFXCHECK = 0; +$LOGIN_GFXCHECK = 0; $ALLOWED_EXT = ".ttf"; $DEFAULT_BG_COLOR = "#FFFFFF"; Index: publicdnsadmin/login.php diff -u publicdnsadmin/login.php:1.2 publicdnsadmin/login.php:1.3 --- publicdnsadmin/login.php:1.2 Wed Jun 18 03:20:24 2003 +++ publicdnsadmin/login.php Wed Jun 18 03:26:58 2003 @@ -27,7 +27,7 @@ $SHOW_GFXUSRCHK = 1; } -if ($SHOW_GFXUSRCHK && $NEWUSERS_GFXCHECK) { +if ($SHOW_GFXUSRCHK && $LOGIN_GFXCHECK) { $gfx_ok = 0; $gfx_ok = check_code($gfxcode_ts, $gfxcode_crc, $gfxcode_val); if ($gfx_ok != 0) { ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-18 10:29:46
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-18 10:29:45 UTC Modified files: docs/CHANGELOG docs/TODO Log message: Author: SiRVu|caN Log message: changelog and todo updated ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.6 publicdnsadmin/docs/CHANGELOG:1.7 --- publicdnsadmin/docs/CHANGELOG:1.6 Fri Jun 13 09:03:51 2003 +++ publicdnsadmin/docs/CHANGELOG Wed Jun 18 03:29:35 2003 @@ -12,4 +12,5 @@ - Fixed path for .gz backup download link. SiRVu|caN <sir...@si...> - 14/6/2003 - Added delete_user.php for deleting users. SiRVu|caN <sir...@si...> - 14/6/2003 - Layout change. -SiRVu|caN <sir...@si...> - 14/6/2003 - Added TODO file in docs/. +SiRVu|caN <sir...@si...> - 14/6/2003 - Added TODO file in docs. +SiRVu|caN <sir...@si...> - 18/6/2003 - Added in a graphical check for signup and/or login. Index: publicdnsadmin/docs/TODO diff -u publicdnsadmin/docs/TODO:1.3 publicdnsadmin/docs/TODO:1.4 --- publicdnsadmin/docs/TODO:1.3 Wed Jun 18 01:05:47 2003 +++ publicdnsadmin/docs/TODO Wed Jun 18 03:29:35 2003 @@ -1,4 +1,4 @@ - Some sort of maintenence news system (displayed on the main login page). -- Graphical code check upon signup (and possibly login). -signup done +- Graphical code check upon signup (and possibly login). -DONE - Improve dbbackup.php. - Improve nsstats.php. ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-18 11:26:49
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-18 11:26:47 UTC Modified files: docs/CHANGELOG lib/config.php-dist lib/header.php Log message: Author: SiRVu|caN Log message: made the Contact address changeable in config.php. ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.7 publicdnsadmin/docs/CHANGELOG:1.8 --- publicdnsadmin/docs/CHANGELOG:1.7 Wed Jun 18 03:29:35 2003 +++ publicdnsadmin/docs/CHANGELOG Wed Jun 18 04:26:37 2003 @@ -14,3 +14,4 @@ SiRVu|caN <sir...@si...> - 14/6/2003 - Layout change. SiRVu|caN <sir...@si...> - 14/6/2003 - Added TODO file in docs. SiRVu|caN <sir...@si...> - 18/6/2003 - Added in a graphical check for signup and/or login. +SiRVu|caN <sir...@si...> - 18/6/2003 - Made the Contact email address changable in config.php. Index: publicdnsadmin/lib/config.php-dist diff -u publicdnsadmin/lib/config.php-dist:1.3 publicdnsadmin/lib/config.php-dist:1.4 --- publicdnsadmin/lib/config.php-dist:1.3 Wed Jun 18 03:26:58 2003 +++ publicdnsadmin/lib/config.php-dist Wed Jun 18 04:26:37 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: config.php-dist,v 1.3 2003/06/18 10:26:58 sirvulcan Exp $ + $Id: config.php-dist,v 1.4 2003/06/18 11:26:37 sirvulcan Exp $ */ /* @@ -34,6 +34,9 @@ /* Default template used for when users signup- must exist */ $signup_template = "user-domains"; + +/* Contact email address */ +$contact_addy = "dns...@do..."; /* NS Server Addresses / Access Data, You Need Webserver Enabled On PowerDNS */ $ns1addy = "ns1.server.com"; Index: publicdnsadmin/lib/header.php diff -u publicdnsadmin/lib/header.php:1.3 publicdnsadmin/lib/header.php:1.4 --- publicdnsadmin/lib/header.php:1.3 Fri Jun 13 08:57:40 2003 +++ publicdnsadmin/lib/header.php Wed Jun 18 04:26:37 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: header.php,v 1.3 2003/06/13 15:57:40 sirvulcan Exp $ + $Id: header.php,v 1.4 2003/06/18 11:26:37 sirvulcan Exp $ */ ?> @@ -48,7 +48,11 @@ · <a href="forgotten_pass.php" class="menu">Forgotten Pass</a><br> · <a href="stats.php" class="menu">Statistics</a><br> · <a href="terms.php" class="menu">Terms</a><br><br> - · <a href="mailto:vu...@li..." class="menu">Contact</a><br> +<? + echo "· <a href=\"mailto:"; + echo $contact_addy; + echo "\" class=\"menu\">Contact</a><br>"; +?> <?php } ?> </td> ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-18 12:50:34
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-18 12:50:33 UTC Modified files: docs/CHANGELOG lib/footer.php lib/header.php Added files: images/server.jpg Log message: Author: SiRVu|caN Log message: Added a small image to fill up some of the white space. ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.8 publicdnsadmin/docs/CHANGELOG:1.9 --- publicdnsadmin/docs/CHANGELOG:1.8 Wed Jun 18 04:26:37 2003 +++ publicdnsadmin/docs/CHANGELOG Wed Jun 18 05:50:23 2003 @@ -15,3 +15,4 @@ SiRVu|caN <sir...@si...> - 14/6/2003 - Added TODO file in docs. SiRVu|caN <sir...@si...> - 18/6/2003 - Added in a graphical check for signup and/or login. SiRVu|caN <sir...@si...> - 18/6/2003 - Made the Contact email address changable in config.php. +SiRVu|caN <sir...@si...> - 19/6/2003 - Added a small image to fill up some of the white space. Index: publicdnsadmin/images/server.jpg Index: publicdnsadmin/lib/footer.php diff -u publicdnsadmin/lib/footer.php:1.3 publicdnsadmin/lib/footer.php:1.4 --- publicdnsadmin/lib/footer.php:1.3 Fri Jun 13 08:57:40 2003 +++ publicdnsadmin/lib/footer.php Wed Jun 18 05:50:23 2003 @@ -7,10 +7,15 @@ Distributed under the GPL license, see LICENSE for more information - $Id: footer.php,v 1.3 2003/06/13 15:57:40 sirvulcan Exp $ + $Id: footer.php,v 1.4 2003/06/18 12:50:23 sirvulcan Exp $ */ ?> </td> +<td width="20%" valign="top"> +<div style="LEFT: 82%; position: absolute; TOP: 77%; bottom: 10%; z-index:-1"> +<img src="images/server.jpg" width="141" height="111"> +</td> +</tr> </table> <table border="0" cellspacing="1" cellpadding="5" width="100%" height="5%"> Index: publicdnsadmin/lib/header.php diff -u publicdnsadmin/lib/header.php:1.4 publicdnsadmin/lib/header.php:1.5 --- publicdnsadmin/lib/header.php:1.4 Wed Jun 18 04:26:37 2003 +++ publicdnsadmin/lib/header.php Wed Jun 18 05:50:23 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: header.php,v 1.4 2003/06/18 11:26:37 sirvulcan Exp $ + $Id: header.php,v 1.5 2003/06/18 12:50:23 sirvulcan Exp $ */ ?> @@ -15,7 +15,6 @@ <html> <head> <title>[ Public DNS Administrator ]</title> -<LINK REL=stylesheet HREF="style.css" TYPE="text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="style.css"> </head> @@ -57,5 +56,6 @@ </td> <td> </td> - <td valign="top" width="100%"> + <td valign="top" width="80%"> <img src="images/logo.gif"><br> + ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-19 04:32:09
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-19 04:32:08 UTC Modified files: lib/config.php-dist Log message: Author: SiRVu|caN Log message: woops ---------------------- diff included ---------------------- Index: publicdnsadmin/lib/config.php-dist diff -u publicdnsadmin/lib/config.php-dist:1.4 publicdnsadmin/lib/config.php-dist:1.5 --- publicdnsadmin/lib/config.php-dist:1.4 Wed Jun 18 04:26:37 2003 +++ publicdnsadmin/lib/config.php-dist Wed Jun 18 21:31:58 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: config.php-dist,v 1.4 2003/06/18 11:26:37 sirvulcan Exp $ + $Id: config.php-dist,v 1.5 2003/06/19 04:31:58 sirvulcan Exp $ */ /* @@ -15,7 +15,7 @@ Only supports "mysql" and "pgsql"-types at the moment Replace XXsql to either mysql or pgsql! */ -$connection_string = "XXsql://user:@database-address/database-name"; +$connection_string = "XXsql://user:pass@database-address/database-name"; /* Master-value for the "domains"-table. See PowerDNS-docs for more info about this */ $default_master = ""; ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-19 06:04:49
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-19 06:04:48 UTC Modified files: dbbackup.php docs/CHANGELOG docs/INSTALL docs/TODO lib/config.php-dist lib/db.inc.php Log message: Author: SiRVu|caN Log message: improved dbbackup.php ---------------------- diff included ---------------------- Index: publicdnsadmin/dbbackup.php diff -u publicdnsadmin/dbbackup.php:1.2 publicdnsadmin/dbbackup.php:1.3 --- publicdnsadmin/dbbackup.php:1.2 Fri Jun 13 07:09:27 2003 +++ publicdnsadmin/dbbackup.php Wed Jun 18 23:04:38 2003 @@ -10,30 +10,19 @@ $Id: */ require("lib/prepend.php"); -include("lib/header.php"); -echo "<Br>"; if (userHasAccess($_SESSION["_UID"], "users")) { $date = date("mdy-hia"); -$filename = "/path/to/publicdnsadmin/data/lbdns-$date.sql"; -$dbhost = "127.0.0.1"; -$dbuser = "dbuser"; -$dbpass = "dbpass"; -$dbname = "dbname"; +$path = realpath("."); +$filename = "$path/data/lbdns-$date.sql"; -passthru("mysqldump --opt -h$dbhost -u$dbuser $dbname >$filename"); +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"); -echo "<a href=\"data/".$filesmall."\">Download Backup ($date)</a>"; - -} else { - displayNoAccess(); -} -echo "<br><br>"; -include("lib/footer.php"); ?> Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.9 publicdnsadmin/docs/CHANGELOG:1.10 --- publicdnsadmin/docs/CHANGELOG:1.9 Wed Jun 18 05:50:23 2003 +++ publicdnsadmin/docs/CHANGELOG Wed Jun 18 23:04:38 2003 @@ -16,3 +16,4 @@ SiRVu|caN <sir...@si...> - 18/6/2003 - Added in a graphical check for signup and/or login. SiRVu|caN <sir...@si...> - 18/6/2003 - Made the Contact email address changable in config.php. SiRVu|caN <sir...@si...> - 19/6/2003 - Added a small image to fill up some of the white space. +SiRVu|caN <sir...@si...> - 19/6/2003 - Improved dbbackup.php, now doesnt require seperate conf. Index: publicdnsadmin/docs/INSTALL diff -u publicdnsadmin/docs/INSTALL:1.3 publicdnsadmin/docs/INSTALL:1.4 --- publicdnsadmin/docs/INSTALL:1.3 Wed Jun 18 01:05:47 2003 +++ publicdnsadmin/docs/INSTALL Wed Jun 18 23:04:38 2003 @@ -17,14 +17,8 @@ properly. The required structure data can be found in mysql.sql and postgresql.sql in the same directory as this INSTALL-file. + Make sure the "data" dir is world writeable, so that backups of the database + can be written there. + If you are upgrading from a CVS version, make sure you run the *.update.sql scripts. - - Edit dbbackup.php in the Public DNS Administrator root dir, change thse values: - - $filename = "/path/to/publicdnsadmin/data/lbdns-$date.sql"; - $dbhost = "dbhost"; - $dbuser = "dbuser"; - $dbpass = "dbpass"; - $dbname = "dbname"; - Index: publicdnsadmin/docs/TODO diff -u publicdnsadmin/docs/TODO:1.4 publicdnsadmin/docs/TODO:1.5 --- publicdnsadmin/docs/TODO:1.4 Wed Jun 18 03:29:35 2003 +++ publicdnsadmin/docs/TODO Wed Jun 18 23:04:38 2003 @@ -1,4 +1,4 @@ - Some sort of maintenence news system (displayed on the main login page). - Graphical code check upon signup (and possibly login). -DONE -- Improve dbbackup.php. +- Improve dbbackup.php. -DONE - Improve nsstats.php. Index: publicdnsadmin/lib/config.php-dist diff -u publicdnsadmin/lib/config.php-dist:1.5 publicdnsadmin/lib/config.php-dist:1.6 --- publicdnsadmin/lib/config.php-dist:1.5 Wed Jun 18 21:31:58 2003 +++ publicdnsadmin/lib/config.php-dist Wed Jun 18 23:04:38 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: config.php-dist,v 1.5 2003/06/19 04:31:58 sirvulcan Exp $ + $Id: config.php-dist,v 1.6 2003/06/19 06:04:38 sirvulcan Exp $ */ /* @@ -15,7 +15,11 @@ Only supports "mysql" and "pgsql"-types at the moment Replace XXsql to either mysql or pgsql! */ -$connection_string = "XXsql://user:pass@database-address/database-name"; +$database_type = "XXsql"; +$database_user = "username"; +$database_pass = "password"; +$database_host = "database-address"; +$database_name = "database-name"; /* Master-value for the "domains"-table. See PowerDNS-docs for more info about this */ $default_master = ""; @@ -37,6 +41,9 @@ /* Contact email address */ $contact_addy = "dns...@do..."; + +/* Path to site (without a trailing fowardslash */ +$site_address = "http://www.site.com/publicdnsadmin"; /* NS Server Addresses / Access Data, You Need Webserver Enabled On PowerDNS */ $ns1addy = "ns1.server.com"; Index: publicdnsadmin/lib/db.inc.php diff -u publicdnsadmin/lib/db.inc.php:1.1.1.1 publicdnsadmin/lib/db.inc.php:1.2 --- publicdnsadmin/lib/db.inc.php:1.1.1.1 Wed Apr 16 00:19:07 2003 +++ publicdnsadmin/lib/db.inc.php Wed Jun 18 23:04:38 2003 @@ -7,12 +7,15 @@ Distributed under the GPL license, see LICENSE for more information - $Id: db.inc.php,v 1.1.1.1 2003/04/16 07:19:07 sirvulcan Exp $ + $Id: db.inc.php,v 1.2 2003/06/19 06:04:38 sirvulcan Exp $ */ function db_connect() { - global $connection_string; + global $database_type, $database_user, $database_pass, $database_host, $database_name; + + $connection_string = "$database_type://$database_user:$database_pass@$database_host/$database_name"; + $dbh =& DB::connect($connection_string); if (DB::isError($dbh)) { @@ -27,7 +30,9 @@ function db_type() { - global $connection_string; + global $database_type, $database_user, $database_pass, $database_host, $database_name; + + $connection_string = "$database_type://$database_user:$database_pass@$database_host/$database_name"; if (preg_match("/^mysql/", $connection_string)) { return "mysql"; ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-19 07:45:32
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-19 07:45:31 UTC Modified files: index.php style.css docs/CHANGELOG Log message: Author: SiRVu|caN Log message: Added a offset system, 10 domains displayed per page. ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.10 publicdnsadmin/docs/CHANGELOG:1.11 --- publicdnsadmin/docs/CHANGELOG:1.10 Wed Jun 18 23:04:38 2003 +++ publicdnsadmin/docs/CHANGELOG Thu Jun 19 00:45:21 2003 @@ -17,3 +17,4 @@ SiRVu|caN <sir...@si...> - 18/6/2003 - Made the Contact email address changable in config.php. SiRVu|caN <sir...@si...> - 19/6/2003 - Added a small image to fill up some of the white space. SiRVu|caN <sir...@si...> - 19/6/2003 - Improved dbbackup.php, now doesnt require seperate conf. +SiRVu|caN <sir...@si...> - 19/6/2003 - Added a offset system, 10 domains displayed per page. Index: publicdnsadmin/index.php diff -u publicdnsadmin/index.php:1.4 publicdnsadmin/index.php:1.5 --- publicdnsadmin/index.php:1.4 Wed Jun 18 03:26:58 2003 +++ publicdnsadmin/index.php Thu Jun 19 00:45:20 2003 @@ -36,11 +36,16 @@ if (count($zones)) { $dbh = db_connect(); - echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"background: #000000;\"><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><th>Domain</th><th>Current serial</th><th>Owner</th><th>Records</th><th> </th></tr>\n"; $row_id = 0; + $row_count = 0; + $offsetmin = $offset; + $offsetmax = $offset + 10; + + echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"background: #000000;\"><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><th>Domain</th><th>Current serial</th><th>Owner</th><th>Records</th><th> </th></tr>\n"; foreach ($zones as $zone) { $row_id++; + $row_count++; $serial = getZoneSerial($zone["id"]); $records = 0; @@ -57,29 +62,50 @@ $owner = htmlentities($tmprow["username"]); } - echo "<tr>\n"; - echo "<td class=\"row$row_id\"><a href=\"edit_zone.php?id=".$zone["id"]."\">".htmlentities($zone["name"])."</a></td>\n"; - echo "<td class=\"row$row_id\" align=\"right\">$serial</td>\n"; - echo "<td class=\"row$row_id\" align=\"right\">$owner</td>\n"; - echo "<td class=\"row$row_id\" align=\"right\">$records</td>\n"; - echo "<td class=\"row$row_id\" align=\"center\">"; - - if ($zone["delete"]) { - echo " <a href=\"delete_zone.php?id=".$zone["id"]."\"><img src=\"images/trash.png\" alt=\"Delete zone\" border=\"0\"></a> "; - echo " <a href=\"whois.php?id=".$zone["id"]."\"><img src=\"images/whois.gif\" height=20 width=20 alt=\"WHOIS Domain\" border=\"0\"></a> "; - } else { - echo " <a href=\"whois.php?id=".$zone["id"]."\"><img src=\"images/whois.gif\" height=20 width=20 alt=\"WHOIS Domain\" border=\"0\"></a> "; -// echo " "; - } - - echo "</td>\n"; - echo "</tr>\n"; + if (($row_count >= $offsetmin) && ($row_count <= $offsetmax)) { + echo "<tr>\n"; + echo "<td class=\"row$row_id\"><a href=\"edit_zone.php?id=".$zone["id"]."\">".htmlentities($zone["name"])."</a></td>\n"; + echo "<td class=\"row$row_id\" align=\"right\">$serial</td>\n"; + echo "<td class=\"row$row_id\" align=\"right\">$owner</td>\n"; + echo "<td class=\"row$row_id\" align=\"right\">$records</td>\n"; + echo "<td class=\"row$row_id\" align=\"center\">"; + + if ($zone["delete"]) { + echo " <a href=\"delete_zone.php?id=".$zone["id"]."\"><img src=\"images/trash.png\" alt=\"Delete zone\" border=\"0\"></a> "; + echo " <a href=\"whois.php?id=".$zone["id"]."\"><img src=\"images/whois.gif\" height=20 width=20 alt=\"WHOIS Domain\" border=\"0\"></a> "; + } else { + echo " <a href=\"whois.php?id=".$zone["id"]."\"><img src=\"images/whois.gif\" height=20 width=20 alt=\"WHOIS Domain\" border=\"0\"></a> "; + } + echo "</td>\n"; + echo "</tr>\n"; + } if ($row_id == 2) { $row_id = 0; } } + if ($row_count > 10) { + $offsettop = $row_count - 10; + $nums = round($row_count / 10); + $num_count = 0; + echo "<tr><td class=\"rowsearch\" colspan=5><center>"; + echo "<a href=\"index.php?offset=1\"><<</a> | "; + $prev = $offset - 10; + if ($prev < 0) { + echo "< | "; + } else { + echo "<a href=\"index.php?offset=$prev\"><</a> | "; + } + while ($num_count < $nums) { + $num_count++; + $off = $num_count * 10 - 10; + echo "<a href=\"index.php?offset=$off\">$num_count</a> "; + } + $next = $offset + 10; + echo "| <a href=\"index.php?offset=$next\">></a> | "; + echo "<a href=\"index.php?offset=$offsettop\">>></a>"; + echo "</center></th></tr>"; + } echo "</table></td></tr></table>\n"; - $dbh->disconnect(); } else { echo "<p>No zones available</p>\n"; Index: publicdnsadmin/style.css diff -u publicdnsadmin/style.css:1.3 publicdnsadmin/style.css:1.4 --- publicdnsadmin/style.css:1.3 Fri Jun 13 08:57:39 2003 +++ publicdnsadmin/style.css Thu Jun 19 00:45:20 2003 @@ -86,6 +86,13 @@ text-decoration: underline; } +.rowsearch { + background: #C7DDF4; + color: #AEAEAE; + font-family: Tahoma, Arial, sans-serif; + font-size: 11px; +} + .row1 { background: #e6ebef; } ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-19 07:59:08
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-19 07:59:06 UTC Modified files: index.php lib/config.php-dist Log message: Author: SiRVu|caN Log message: Allow the main admin to change the amount of domains listed per page. ---------------------- diff included ---------------------- Index: publicdnsadmin/index.php diff -u publicdnsadmin/index.php:1.5 publicdnsadmin/index.php:1.6 --- publicdnsadmin/index.php:1.5 Thu Jun 19 00:45:20 2003 +++ publicdnsadmin/index.php Thu Jun 19 00:58:56 2003 @@ -39,7 +39,7 @@ $row_id = 0; $row_count = 0; $offsetmin = $offset; - $offsetmax = $offset + 10; + $offsetmax = $offset + $domains_per_page; echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"background: #000000;\"><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><th>Domain</th><th>Current serial</th><th>Owner</th><th>Records</th><th> </th></tr>\n"; foreach ($zones as $zone) { @@ -83,13 +83,13 @@ if ($row_id == 2) { $row_id = 0; } } - if ($row_count > 10) { - $offsettop = $row_count - 10; - $nums = round($row_count / 10); + if ($row_count > $domains_per_page) { + $offsettop = $row_count - $domains_per_page; + $nums = round($row_count / $domains_per_page); $num_count = 0; echo "<tr><td class=\"rowsearch\" colspan=5><center>"; echo "<a href=\"index.php?offset=1\"><<</a> | "; - $prev = $offset - 10; + $prev = $offset - $domains_per_page; if ($prev < 0) { echo "< | "; } else { @@ -97,10 +97,10 @@ } while ($num_count < $nums) { $num_count++; - $off = $num_count * 10 - 10; + $off = $num_count * $domains_per_page - $domains_per_page; echo "<a href=\"index.php?offset=$off\">$num_count</a> "; } - $next = $offset + 10; + $next = $offset + $domains_per_page; echo "| <a href=\"index.php?offset=$next\">></a> | "; echo "<a href=\"index.php?offset=$offsettop\">>></a>"; echo "</center></th></tr>"; Index: publicdnsadmin/lib/config.php-dist diff -u publicdnsadmin/lib/config.php-dist:1.6 publicdnsadmin/lib/config.php-dist:1.7 --- publicdnsadmin/lib/config.php-dist:1.6 Wed Jun 18 23:04:38 2003 +++ publicdnsadmin/lib/config.php-dist Thu Jun 19 00:58:56 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: config.php-dist,v 1.6 2003/06/19 06:04:38 sirvulcan Exp $ + $Id: config.php-dist,v 1.7 2003/06/19 07:58:56 sirvulcan Exp $ */ /* @@ -35,6 +35,9 @@ /* Default TTL for domains/pointers */ $default_ttl = 86400; + +/* Number of domains listed per page */ +$domains_per_page = 10; /* Default template used for when users signup- must exist */ $signup_template = "user-domains"; ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-19 09:28:33
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-19 09:28:26 UTC Modified files: docs/CHANGELOG lib/header.php Log message: Author: SiRVu|caN Log message: Added version number ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.11 publicdnsadmin/docs/CHANGELOG:1.12 --- publicdnsadmin/docs/CHANGELOG:1.11 Thu Jun 19 00:45:21 2003 +++ publicdnsadmin/docs/CHANGELOG Thu Jun 19 02:28:16 2003 @@ -18,3 +18,5 @@ SiRVu|caN <sir...@si...> - 19/6/2003 - Added a small image to fill up some of the white space. SiRVu|caN <sir...@si...> - 19/6/2003 - Improved dbbackup.php, now doesnt require seperate conf. SiRVu|caN <sir...@si...> - 19/6/2003 - Added a offset system, 10 domains displayed per page. +SiRVu|caN <sir...@si...> - 19/6/2003 - Version number added below the logo. + Index: publicdnsadmin/lib/header.php diff -u publicdnsadmin/lib/header.php:1.5 publicdnsadmin/lib/header.php:1.6 --- publicdnsadmin/lib/header.php:1.5 Wed Jun 18 05:50:23 2003 +++ publicdnsadmin/lib/header.php Thu Jun 19 02:28:16 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: header.php,v 1.5 2003/06/18 12:50:23 sirvulcan Exp $ + $Id: header.php,v 1.6 2003/06/19 09:28:16 sirvulcan Exp $ */ ?> @@ -57,5 +57,8 @@ </td> <td> </td> <td valign="top" width="80%"> + <table><tr><td> <img src="images/logo.gif"><br> - + </td></tr><tr><td align="right"> + <font face="verdana" size=1>v1.0dev</font> + </td></tr></table> ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-19 09:44:02
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-19 09:44:00 UTC Modified files: signup.php docs/CHANGELOG lib/config.php-dist lib/header.php Log message: Author: SiRVu|caN Log message: Admins can now restrict signups. ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.12 publicdnsadmin/docs/CHANGELOG:1.13 --- publicdnsadmin/docs/CHANGELOG:1.12 Thu Jun 19 02:28:16 2003 +++ publicdnsadmin/docs/CHANGELOG Thu Jun 19 02:43:50 2003 @@ -19,4 +19,4 @@ SiRVu|caN <sir...@si...> - 19/6/2003 - Improved dbbackup.php, now doesnt require seperate conf. SiRVu|caN <sir...@si...> - 19/6/2003 - Added a offset system, 10 domains displayed per page. SiRVu|caN <sir...@si...> - 19/6/2003 - Version number added below the logo. - +SiRVu|caN <sir...@si...> - 19/6/2003 - Admins can now restrict signups. Index: publicdnsadmin/lib/config.php-dist diff -u publicdnsadmin/lib/config.php-dist:1.7 publicdnsadmin/lib/config.php-dist:1.8 --- publicdnsadmin/lib/config.php-dist:1.7 Thu Jun 19 00:58:56 2003 +++ publicdnsadmin/lib/config.php-dist Thu Jun 19 02:43:50 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: config.php-dist,v 1.7 2003/06/19 07:58:56 sirvulcan Exp $ + $Id: config.php-dist,v 1.8 2003/06/19 09:43:50 sirvulcan Exp $ */ /* @@ -47,6 +47,9 @@ /* Path to site (without a trailing fowardslash */ $site_address = "http://www.site.com/publicdnsadmin"; + +/* Restrict new user signups, admins can still add users via the interface when logged in */ +$allow_newusers = 1; /* NS Server Addresses / Access Data, You Need Webserver Enabled On PowerDNS */ $ns1addy = "ns1.server.com"; Index: publicdnsadmin/lib/header.php diff -u publicdnsadmin/lib/header.php:1.6 publicdnsadmin/lib/header.php:1.7 --- publicdnsadmin/lib/header.php:1.6 Thu Jun 19 02:28:16 2003 +++ publicdnsadmin/lib/header.php Thu Jun 19 02:43:50 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: header.php,v 1.6 2003/06/19 09:28:16 sirvulcan Exp $ + $Id: header.php,v 1.7 2003/06/19 09:43:50 sirvulcan Exp $ */ ?> @@ -43,7 +43,13 @@ <br>· <a href="logout.php" class="menu">Log out</a> <?php } else { ?> · <a href="index.php" class="menu">Login</a><br><br> - · <a href="signup.php" class="menu">Signup</a><br> + <? + if ($allow_newusers != 0) { + ?> + · <a href="signup.php" class="menu">Signup</a><br> + <? + } + ?> · <a href="forgotten_pass.php" class="menu">Forgotten Pass</a><br> · <a href="stats.php" class="menu">Statistics</a><br> · <a href="terms.php" class="menu">Terms</a><br><br> @@ -60,5 +66,5 @@ <table><tr><td> <img src="images/logo.gif"><br> </td></tr><tr><td align="right"> - <font face="verdana" size=1>v1.0dev</font> + <font face="verdana" size=1>Public DNS Administrator v1.0dev</font> </td></tr></table> Index: publicdnsadmin/signup.php diff -u publicdnsadmin/signup.php:1.3 publicdnsadmin/signup.php:1.4 --- publicdnsadmin/signup.php:1.3 Wed Jun 18 03:20:24 2003 +++ publicdnsadmin/signup.php Thu Jun 19 02:43:50 2003 @@ -39,6 +39,12 @@ die(); } +if ($allow_newusers == 0) { + echo "<p class=\"error\">New user signups are disabled, see an Administrator for further info.</p>"; + require("lib/footer.php"); + die(); +} + if ($douser == 1) { // terms and agreement check if ($terms == 1) { ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-19 13:38:56
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-19 13:38:54 UTC Modified files: lib/header.php Added files: images/apache.gif images/mysql.gif images/pgsql.gif images/php.gif Log message: Author: SiRVu|caN Log message: Cosmetic changes- powered by images ---------------------- diff included ---------------------- Index: publicdnsadmin/images/apache.gif Index: publicdnsadmin/images/mysql.gif Index: publicdnsadmin/images/pgsql.gif Index: publicdnsadmin/images/php.gif Index: publicdnsadmin/lib/header.php diff -u publicdnsadmin/lib/header.php:1.7 publicdnsadmin/lib/header.php:1.8 --- publicdnsadmin/lib/header.php:1.7 Thu Jun 19 02:43:50 2003 +++ publicdnsadmin/lib/header.php Thu Jun 19 06:38:44 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: header.php,v 1.7 2003/06/19 09:43:50 sirvulcan Exp $ + $Id: header.php,v 1.8 2003/06/19 13:38:44 sirvulcan Exp $ */ ?> @@ -53,13 +53,21 @@ · <a href="forgotten_pass.php" class="menu">Forgotten Pass</a><br> · <a href="stats.php" class="menu">Statistics</a><br> · <a href="terms.php" class="menu">Terms</a><br><br> -<? + <?php echo "· <a href=\"mailto:"; echo $contact_addy; echo "\" class=\"menu\">Contact</a><br>"; -?> - <?php } ?> - + echo "<br><br><center>"; + echo "<a href=\"http://httpd.apache.org\"><img src=\"images/apache.gif\" border=0></a><br><br>"; + echo "<a href=\"http://www.php.net\"><img src=\"images/php.gif\" border=0></a><br><br>"; + if ($database_type == mysql) { + echo "<a href=\"http://www.mysql.com\"><img src=\"images/mysql.gif\" border=0></a><br>"; + } else { + echo "<a href=\"http://www.postgresql.org\"><img src=\"images/pgsql.gif\" border=0></a><br>"; + } + echo "</center>"; + } + ?> </td> <td> </td> <td valign="top" width="80%"> ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-19 13:47:59
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-19 13:47:58 UTC Modified files: index.php docs/CHANGELOG lib/header.php Log message: Author: SiRVu|caN Log message: Couple of bug fixes- fixed an issue with powered by images not displaying when logged in. - fixed an issue with offsets where it would allow users to go above the amout of domains they have. ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.13 publicdnsadmin/docs/CHANGELOG:1.14 --- publicdnsadmin/docs/CHANGELOG:1.13 Thu Jun 19 02:43:50 2003 +++ publicdnsadmin/docs/CHANGELOG Thu Jun 19 06:47:48 2003 @@ -20,3 +20,4 @@ SiRVu|caN <sir...@si...> - 19/6/2003 - Added a offset system, 10 domains displayed per page. SiRVu|caN <sir...@si...> - 19/6/2003 - Version number added below the logo. SiRVu|caN <sir...@si...> - 19/6/2003 - Admins can now restrict signups. +SiRVu|caN <sir...@si...> - 19/6/2003 - Added powered by images. Index: publicdnsadmin/index.php diff -u publicdnsadmin/index.php:1.6 publicdnsadmin/index.php:1.7 --- publicdnsadmin/index.php:1.6 Thu Jun 19 00:58:56 2003 +++ publicdnsadmin/index.php Thu Jun 19 06:47:48 2003 @@ -101,7 +101,12 @@ echo "<a href=\"index.php?offset=$off\">$num_count</a> "; } $next = $offset + $domains_per_page; - echo "| <a href=\"index.php?offset=$next\">></a> | "; + $check = $row_count - $next; + if ($check <= 0) { + echo "| > | "; + } else { + echo "| <a href=\"index.php?offset=$next\">></a> | "; + } echo "<a href=\"index.php?offset=$offsettop\">>></a>"; echo "</center></th></tr>"; } Index: publicdnsadmin/lib/header.php diff -u publicdnsadmin/lib/header.php:1.8 publicdnsadmin/lib/header.php:1.9 --- publicdnsadmin/lib/header.php:1.8 Thu Jun 19 06:38:44 2003 +++ publicdnsadmin/lib/header.php Thu Jun 19 06:47:48 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: header.php,v 1.8 2003/06/19 13:38:44 sirvulcan Exp $ + $Id: header.php,v 1.9 2003/06/19 13:47:48 sirvulcan Exp $ */ ?> @@ -40,7 +40,7 @@ <?php if (userHasAccess($_SESSION["_UID"], "users")) { ?><br>· <a href="nsstats.php?serv=1" class="menu">NS1 stats</a><br><?php } ?> <?php if (userHasAccess($_SESSION["_UID"], "users")) { ?>· <a href="nsstats.php?serv=2" class="menu">NS2 stats</a><br><?php } ?> - <br>· <a href="logout.php" class="menu">Log out</a> + <br>· <a href="logout.php" class="menu">Log out</a><br> <?php } else { ?> · <a href="index.php" class="menu">Login</a><br><br> <? @@ -57,16 +57,16 @@ echo "· <a href=\"mailto:"; echo $contact_addy; echo "\" class=\"menu\">Contact</a><br>"; - echo "<br><br><center>"; - echo "<a href=\"http://httpd.apache.org\"><img src=\"images/apache.gif\" border=0></a><br><br>"; - echo "<a href=\"http://www.php.net\"><img src=\"images/php.gif\" border=0></a><br><br>"; - if ($database_type == mysql) { - echo "<a href=\"http://www.mysql.com\"><img src=\"images/mysql.gif\" border=0></a><br>"; - } else { - echo "<a href=\"http://www.postgresql.org\"><img src=\"images/pgsql.gif\" border=0></a><br>"; - } - echo "</center>"; - } + } + echo "<br><br><center>"; + echo "<a href=\"http://httpd.apache.org\"><img src=\"images/apache.gif\" border=0></a><br><br>"; + echo "<a href=\"http://www.php.net\"><img src=\"images/php.gif\" border=0></a><br><br>"; + if ($database_type == mysql) { + echo "<a href=\"http://www.mysql.com\"><img src=\"images/mysql.gif\" border=0></a><br>"; + } else { + echo "<a href=\"http://www.postgresql.org\"><img src=\"images/pgsql.gif\" border=0></a><br>"; + } + echo "</center>"; ?> </td> <td> </td> ----------------------- End of diff ----------------------- |
From: Neil S. <sir...@us...> - 2003-06-20 05:57:56
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-20 05:57:50 UTC Modified files: docs/INSTALL docs/README docs/postgresql.sql lib/header.php Log message: Author: SiRVu|caN Log message: preparing for release ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/INSTALL diff -u publicdnsadmin/docs/INSTALL:1.4 publicdnsadmin/docs/INSTALL:1.5 --- publicdnsadmin/docs/INSTALL:1.4 Wed Jun 18 23:04:38 2003 +++ publicdnsadmin/docs/INSTALL Thu Jun 19 22:57:39 2003 @@ -12,6 +12,9 @@ Copy lib/terms.php-dist to lib/terms.php and modify the file with your conditions and terms + IMPORTANT: backup any database you are modifying with the new data before + you go and insert the new data. + Assuming you have already prepared the MySQL/PostgreSQL-database for PowerDNS, you must add some tables for Public DNS Administration to work properly. The required structure data can be found in mysql.sql and Index: publicdnsadmin/docs/README diff -u publicdnsadmin/docs/README:1.1.1.1 publicdnsadmin/docs/README:1.2 --- publicdnsadmin/docs/README:1.1.1.1 Wed Apr 16 00:19:07 2003 +++ publicdnsadmin/docs/README Thu Jun 19 22:57:39 2003 @@ -3,8 +3,9 @@ Using "Public DNS Administator" for the first time -------------------------------------------------- -You can log into Public DNS Administrator by using the username "admin" and the password "admin". The first thing you -should do is enter the User Administration to change the password and profile information about this user. +You can log into Public DNS Administrator by using the username "administrator" and the password "admin". +The first thing you should do is enter the User Administration to change the password and profile information +about this user. Then, you should create a template containing _AT LEAST_ the nameservers you want to use for your new domains. Public DNS Administator adds nothing more to a new domain than the SOA-record, any NS-records or other records must be defined Index: publicdnsadmin/docs/postgresql.sql diff -u publicdnsadmin/docs/postgresql.sql:1.2 publicdnsadmin/docs/postgresql.sql:1.3 --- publicdnsadmin/docs/postgresql.sql:1.2 Wed Jun 18 01:05:47 2003 +++ publicdnsadmin/docs/postgresql.sql Thu Jun 19 22:57:39 2003 @@ -49,4 +49,4 @@ CREATE INDEX gfxcodes_idx ON gfxcodes(code,crc,expire); -INSERT INTO "users" ("id", "username", "password", "name", "email", "company", "permission") VALUES(1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'DNS Administrator', 'ad...@ex...', '', 2); +INSERT INTO "users" ("id", "username", "password", "name", "email", "company", "permission") VALUES(1, 'administrator', '21232f297a57a5a743894a0e4a801fc3', 'DNS Administrator', 'ad...@ex...', '', 2); Index: publicdnsadmin/lib/header.php diff -u publicdnsadmin/lib/header.php:1.9 publicdnsadmin/lib/header.php:1.10 --- publicdnsadmin/lib/header.php:1.9 Thu Jun 19 06:47:48 2003 +++ publicdnsadmin/lib/header.php Thu Jun 19 22:57:40 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: header.php,v 1.9 2003/06/19 13:47:48 sirvulcan Exp $ + $Id: header.php,v 1.10 2003/06/20 05:57:40 sirvulcan Exp $ */ ?> @@ -74,5 +74,5 @@ <table><tr><td> <img src="images/logo.gif"><br> </td></tr><tr><td align="right"> - <font face="verdana" size=1>Public DNS Administrator v1.0dev</font> + <font face="verdana" size=1>Public DNS Administrator v1.0</font> </td></tr></table> ----------------------- End of diff ----------------------- |
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 ----------------------- |