From: Neil S. <sir...@us...> - 2003-08-12 09:20:55
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-08-12 09:07:02 UTC Modified files: edit_record.php edit_template_record.php functions.jss new_record.php new_template_record.php docs/CHANGELOG docs/TODO lib/header.php Log message: Author: SiRVulcaN <sir...@si...> Log message: - Disable prio field if a record type isnt MX. - deny loading publicdnsadmin index.php if config and term files are missing or permissions arnt correct. - added some things to TODO i had in a txt file. ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.28 publicdnsadmin/docs/CHANGELOG:1.29 --- publicdnsadmin/docs/CHANGELOG:1.28 Wed Aug 6 06:17:40 2003 +++ publicdnsadmin/docs/CHANGELOG Tue Aug 12 02:06:52 2003 @@ -10,3 +10,5 @@ thus gfxcheck was likely to fail. - Fixed problem that some records/templates could not be updated or created using postgres. This was coz prio was empty. +SiRVulcaN <sir...@si...> - 12/08/2003 - Disable prio field if a record type isnt MX. + - deny loading publicdnsadmin index.php if config and term files are missing Index: publicdnsadmin/docs/TODO diff -u publicdnsadmin/docs/TODO:1.14 publicdnsadmin/docs/TODO:1.15 --- publicdnsadmin/docs/TODO:1.14 Wed Aug 6 06:17:40 2003 +++ publicdnsadmin/docs/TODO Tue Aug 12 02:06:52 2003 @@ -1,3 +1,12 @@ - Some sort of maintenence news system (displayed on the main login page). - Syntax check records for validity to make it more fool proof. -- Make the mouseoverthingie mozilla proof as well. (sucky on Firebird) +- Make the mouseoverthingie mozilla proof as well. (sucky on Firebird) (working fine still for me -sirv) +- poweradmin record validation dns.inc.php +- use a error code system + -- client_message(CODE, TYPE); + - ERR_TYPE, ie ERR_INVPASS (invalid pass) + - TYPE as in "general", "error", "critical" etc, each type has diff types of output styles +- multilanguage, use a code based system like the error codes which read off a file, lang.XX.php, then combine errors into the language file + -- language table (language codes) "1" "English", users choose the code in config for default lang + - users can choose to use another lang when opening the main page +- install.php - databases + configuration Index: publicdnsadmin/edit_record.php diff -u publicdnsadmin/edit_record.php:1.6 publicdnsadmin/edit_record.php:1.7 --- publicdnsadmin/edit_record.php:1.6 Sat Jul 19 06:46:31 2003 +++ publicdnsadmin/edit_record.php Tue Aug 12 02:06:51 2003 @@ -38,7 +38,7 @@ } ?> -<form action="update_record.php?id=<?php echo $recordid; ?>" method="post"> +<form action="update_record.php?id=<?php echo $recordid; ?>" method="post" name="recform"> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td><b>Record:</b></td> @@ -80,7 +80,11 @@ </tr> <tr> <td><b>Prio:</b></td> + <? if ($row["type"] != "MX") { ?> + <td><input type="text" name="prio" disabled="true" size="5" maxlength="11" value="<?php if ($row["prio"]) { echo htmlentities($row["prio"]); } ?>"></td> + <? } else { ?> <td><input type="text" name="prio" size="5" maxlength="11" value="<?php if ($row["prio"]) { echo htmlentities($row["prio"]); } ?>"></td> + <? } ?> </tr> <tr> <td><b>Content:</b></td> Index: publicdnsadmin/edit_template_record.php diff -u publicdnsadmin/edit_template_record.php:1.4 publicdnsadmin/edit_template_record.php:1.5 --- publicdnsadmin/edit_template_record.php:1.4 Fri Jul 18 08:14:23 2003 +++ publicdnsadmin/edit_template_record.php Tue Aug 12 02:06:52 2003 @@ -33,7 +33,7 @@ $record_name = preg_replace("/\.+$/", "", $record_name); ?> -<form action="update_template_record.php?id=<?php echo $recordid; ?>" method="post"> +<form action="update_template_record.php?id=<?php echo $recordid; ?>" method="post" name="recform"> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td><b>Record:</b></td> @@ -63,7 +63,11 @@ </tr> <tr> <td><b>Prio:</b></td> + <? if ($row["type"] != "MX") { ?> + <td><input type="text" name="prio" disabled="true" size="5" maxlength="11" value="<?php if ($row["prio"]) { echo htmlentities($row["prio"]); } ?>"></td> + <? } else { ?> <td><input type="text" name="prio" size="5" maxlength="11" value="<?php if ($row["prio"]) { echo htmlentities($row["prio"]); } ?>"></td> + <? } ?> </tr> <tr> <td><b>Content:</b></td> Index: publicdnsadmin/functions.jss diff -u publicdnsadmin/functions.jss:1.3 publicdnsadmin/functions.jss:1.4 --- publicdnsadmin/functions.jss:1.3 Sat Jul 19 06:46:31 2003 +++ publicdnsadmin/functions.jss Tue Aug 12 02:06:52 2003 @@ -10,6 +10,16 @@ } else { textObj.data = "@"; } + + for(var e=0;e<document.recform.elements.length;e++) { + currentField = document.recform.elements[e]; + if ((currentField.name == "prio") && (objchange == "MX")) { + document.recform.elements["prio"].disabled = false; + } else if ((currentField.name == "prio") && (objchange != "MX")) { + document.recform.elements["prio"].disabled = true; + document.recform.elements["prio"].value = "0"; + } + } } function checkCount() Index: publicdnsadmin/lib/header.php diff -u publicdnsadmin/lib/header.php:1.16 publicdnsadmin/lib/header.php:1.17 --- publicdnsadmin/lib/header.php:1.16 Wed Aug 6 06:17:40 2003 +++ publicdnsadmin/lib/header.php Tue Aug 12 02:06:52 2003 @@ -7,7 +7,7 @@ Distributed under the GPL license, see LICENSE for more information - $Id: header.php,v 1.16 2003/08/06 13:17:40 key2peace Exp $ + $Id: header.php,v 1.17 2003/08/12 09:06:52 sirvulcan Exp $ */ ?> @@ -83,3 +83,33 @@ </td></tr><tr><td align="right"> <font face="verdana" size=1>Public DNS Administrator v1.3</font> </td></tr></table> + + <? + + $config_check = 1; + $terms_check = 1; + $path = realpath("."); + + if (file_exists("$path/lib/config.php")) { + if (!is_readable("$path/lib/config.php")) { + $config_check = 0; + } + } else { + $config_check = 0; + } + + if (file_exists("$path/lib/terms.php")) { + if (!is_readable("$path/lib/terms.php")) { + $config_check = 0; + } + } else { + $config_check = 0; + } + + if (($config_check == 0) || ($terms_check = 0)) { + echo "<p class=\"error\">config.php and/or terms.php cannot be accessed, please make sure they exist and are readable by the webserver"; + require("lib/footer.php"); + die(); + } + + ?> Index: publicdnsadmin/new_record.php diff -u publicdnsadmin/new_record.php:1.5 publicdnsadmin/new_record.php:1.6 --- publicdnsadmin/new_record.php:1.5 Fri Jul 18 08:14:23 2003 +++ publicdnsadmin/new_record.php Tue Aug 12 02:06:52 2003 @@ -31,7 +31,7 @@ global $default_ttl; ?> -<form action="create_record.php?zone=<?php echo $zoneid; ?>" method="post"> +<form action="create_record.php?zone=<?php echo $zoneid; ?>" method="post" name="recform"> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td><b>Record:</b></td> @@ -57,7 +57,11 @@ </tr> <tr> <td><b>Prio:</b></td> + <? if ($row["type"] != "MX") { ?> + <td><input type="text" name="prio" disabled="true" size="5" maxlength="11" value=""></td> + <? } else { ?> <td><input type="text" name="prio" size="5" maxlength="11" value=""></td> + <? } ?> </tr> <tr> <td><b>Content:</b></td> Index: publicdnsadmin/new_template_record.php diff -u publicdnsadmin/new_template_record.php:1.4 publicdnsadmin/new_template_record.php:1.5 --- publicdnsadmin/new_template_record.php:1.4 Fri Jul 18 08:14:23 2003 +++ publicdnsadmin/new_template_record.php Tue Aug 12 02:06:52 2003 @@ -29,7 +29,7 @@ global $default_ttl; ?> -<form action="create_template_record.php?zone=<?php echo $zoneid; ?>" method="post"> +<form action="create_template_record.php?zone=<?php echo $zoneid; ?>" method="post" name="recform"> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td><b>Record:</b></td> @@ -55,7 +55,11 @@ </tr> <tr> <td><b>Prio:</b></td> + <? if ($row["type"] != "MX") { ?> + <td><input type="text" name="prio" disabled="true" size="5" maxlength="11" value=""></td> + <? } else { ?> <td><input type="text" name="prio" size="5" maxlength="11" value=""></td> + <? } ?> </tr> <tr> <td><b>Content:</b></td> ----------------------- End of diff ----------------------- |