[phpwebapp-commits] CVS: top10/templates/proj_details/comments comments.php,1.6,1.6.2.1 comments.db,
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2004-01-14 16:26:05
|
Update of /cvsroot/phpwebapp/top10/templates/proj_details/comments In directory sc8-pr-cvs1:/tmp/cvs-serv4744/templates/proj_details/comments Modified Files: Tag: maisp comments.php comments.db Log Message: removed some sourceforge references etc. Index: comments.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/comments/comments.php,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** comments.php 5 Jan 2004 14:41:59 -0000 1.6 --- comments.php 14 Jan 2004 16:25:59 -0000 1.6.2.1 *************** *** 46,49 **** --- 46,71 ---- $date = $rs->Field("date"); + //get the email of the user + $username = WebApp::getSVar("username", compact("username")); + $rs = WebApp::openRS("get_user"); + if ($rs->EOF()) //no such user + { + //show an error message to the user + WebApp::message("User '$username' does not exist."); + //send a notification message to admin + $ip = $_SERVER["REMOTE_ADDR"]; + $message = " + Somebody from [$ip] tried to delete the following + comment from project '$proj_id': + + Title: $title + Comment: $comment + "; + $subject = "Top10: Delete Comment"; + mail(ADMIN_EMAIL, $subject, $message); + return; + } + $to = $rs->Field("email"); + //get a unique id $request_id = md5(uniqid(rand())); *************** *** 55,60 **** //send a notification e-mail to the user - $to = "dasho"; - //$to = $username."@users.sourceforge.net"; $subject = "Top10: Delete Comment"; $top10_site = "http://" . $_SERVER["HTTP_HOST"] . APP_URL; --- 77,80 ---- *************** *** 82,86 **** //display a confirmation message $msg = "A confirmation e-mail has been sent \n" ! . "to $use...@us... .\n" . "If you don't confirm the delete request in 24 hours, \n" . "it will be discarded."; --- 102,106 ---- //display a confirmation message $msg = "A confirmation e-mail has been sent \n" ! . "to $to .\n" . "If you don't confirm the delete request in 24 hours, \n" . "it will be discarded."; Index: comments.db =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/comments/comments.db,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** comments.db 5 Jan 2004 14:41:59 -0000 1.6 --- comments.db 14 Jan 2004 16:25:59 -0000 1.6.2.1 *************** *** 44,47 **** --- 44,54 ---- </Recordset> + <Recordset ID="get_user"> + <Query> + SELECT * FROM users + WHERE username = '{{username}}' + </Query> + </Recordset> + <dbCommand ID="insert_request"> <Query> |