Update of /cvsroot/meshdb/www/db2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6130
Modified Files:
submit.php
Log Message:
Send mails to the admin on node creation as well as updates and deletions.
Index: submit.php
===================================================================
RCS file: /cvsroot/meshdb/www/db2/submit.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- submit.php 2 Aug 2004 12:39:24 -0000 1.11
+++ submit.php 18 Sep 2004 05:02:50 -0000 1.12
@@ -40,7 +40,8 @@
$who .= " [" . $_SERVER["REMOTE_HOST"] . "]";
/* Take note of whether the remote host matches the last update. */
- if ($notify_info["updatedip"] != $_SERVER["REMOTE_ADDR"])
+ if (isset($notify_info["updatedip"])
+ && $notify_info["updatedip"] != $_SERVER["REMOTE_ADDR"])
$ipchangedstring = "\nLast updated from different address: ".
$notify_info["updatedip"]."\n";
else
@@ -186,6 +187,8 @@
if ($operation == "replace" || $operation == "delete")
$notify_info = notify_lookup($db, $nodeid);
+ else
+ $notify_info = array();
if ($operation == "insert" || $operation == "replace") {
if (!isset($nodeid))
@@ -415,8 +418,10 @@
or die(mysql_error($db));
}
- if ($operation == "replace")
- notify($notify_info, "updated", $nodeid, $changes);
+ notify($notify_info,
+ $operation == "insert" ? "created" : "updated",
+ $nodeid,
+ $changes);
$result = mysql_query("COMMIT")
or die(mysql_error($db));
|