Update of /cvsroot/meshdb/www/db2
In directory sc8-pr-cvs1:/tmp/cvs-serv12501
Modified Files:
submit.php
Log Message:
Inform users they should let the DB admin know of any vandalism to their records.
Send notifications to the admin of all updates to allow abuse to be detected and rectified earlier.
Index: submit.php
===================================================================
RCS file: /cvsroot/meshdb/www/db2/submit.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- submit.php 2 Nov 2003 02:07:00 -0000 1.4
+++ submit.php 27 Nov 2003 04:53:55 -0000 1.5
@@ -7,7 +7,7 @@
/* send mail to the OLD contactemail if the entry changes */
function notify($db, $verb, $nodeid) {
- global $admin;
+ global $admin, $DBADMIN, $PREF;
$result = mysql_query("SELECT contactemail,mailonupdate"
." FROM contact,admin"
." WHERE contact.nodeid = $nodeid"
@@ -16,14 +16,33 @@
$row = mysql_fetch_row($result);
$to = $row[0];
$send = intquote($admin["mailonupdate"]) or $row[1];
+
+ $who = $_SERVER["REMOTE_ADDR"];
+ if (isset($_SERVER["REMOTE_HOST"]))
+ $who .= " [" . $_SERVER["REMOTE_HOST"] . "]";
+ if ($PREF["myid"])
+ $idstring = " (cookie: " . $PREF["myid"] . ")";
+ else
+ $idstring = "";
+
+ $pageloc = $_SERVER["SCRIPT_URI"];
+ $dbloc = substr($pageloc, 0, strrpos($pageloc, "/"));
+ if ($DBADMIN != "")
+ mail($DBADMIN,
+ "Mesh DB: Node $nodeid $verb",
+ "Node entry $nodeid has been $verb by $who$idstring\n\n".
+ " $dbloc/view.php?nodeid=$nodeid\n",
+ "From: Brisbane Mesh Database <own...@it...>\n".
+ "Return-Path: own...@it...\n"
+ );
if (!$send || $to == "")
return;
- $who = $_SERVER["REMOTE_ADDR"];
mail($to,
- "Mesh db notification: node $nodeid $verb",
+ "Mesh DB: Node $nodeid $verb",
"Node entry $nodeid has been $verb by $who\n\n".
- "http://www.itee.uq.edu.au/~mesh/db2/view.php?nodeid=$nodeid".
- "\n",
+ " $dbloc/view.php?nodeid=$nodeid\n\n\n".
+ "Note: If you believe this change was malicious please contact\n".
+ "$DBADMIN with the details in this mail.\n",
"From: Brisbane Mesh Database <own...@it...>\n".
"Return-Path: own...@it...\n"
);
|