Update of /cvsroot/meshdb/www/db2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28957/www/db2
Modified Files:
submit.php view.inc.php
Log Message:
Require a node name (before creating the node), contact name, contact phone or
email and a suburb for each new node.
Index: submit.php
===================================================================
RCS file: /cvsroot/meshdb/www/db2/submit.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- submit.php 18 Sep 2004 06:08:11 -0000 1.14
+++ submit.php 3 Feb 2005 10:30:57 -0000 1.15
@@ -170,6 +170,19 @@
$result = mysql_query("BEGIN");
if ($operation == "insert") {
+ if (empty($VAR["admin"]["nodename"]))
+ die("node name cannot be empty");
+ elseif (empty($VAR["contact"]["contactname"]))
+ die("contact name cannot be empty");
+ elseif (empty($VAR["contact"]["contactemail"])
+ && empty($VAR["contact"]["contactphone"]))
+ die("contact email and phone cannot both be empty");
+ elseif (!empty($VAR["contact"]["contactemail"])
+ && !ereg("^[^@]+@([^.]+\.)+[^.]*$", $VAR["contact"]["contactemail"]))
+ die("contact email does not look valid");
+ elseif (empty($VAR["physaddr"]["suburb"]))
+ die("suburb cannot be empty");
+
$result = mysql_query("INSERT INTO admin SET "
. " created = NOW()"
. ",updated = NOW()"
Index: view.inc.php
===================================================================
RCS file: /cvsroot/meshdb/www/db2/view.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- view.inc.php 25 Feb 2004 07:11:13 -0000 1.3
+++ view.inc.php 3 Feb 2005 10:30:57 -0000 1.4
@@ -112,7 +112,7 @@
<tr>
<th>Suburb:</th>
<td><?=val("physaddr[suburb]")?></td>
- <?=edithelp("e.g. Coopers Plains")?>
+ <?=edithelp("e.g. Coopers Plains (<strong>required</strong>)")?>
</tr>
<tr>
|