aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-11-22 04:41:25 +0000
committerrvelices <rv-github@modusoptimus.com>2006-11-22 04:41:25 +0000
commit5de8aeafad74a35be113fd34917d66a5b10fce1e (patch)
tree56cb2caacdb76b74fbfbb21c07da340ac6830429 /include
parentf3db3ef388192e4f004e5c36524608e7e300cb47 (diff)
feature 440: send mail to admin when comment is entered
git-svn-id: http://piwigo.org/svn/trunk@1617 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/config_default.inc.php3
-rw-r--r--include/picture_comment.inc.php25
2 files changed, 25 insertions, 3 deletions
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index d43323a4b..a8a439a9c 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -515,9 +515,6 @@ $conf['nbm_max_treatment_timeout_percent'] = 0.8;
// nbm_treatment_timeout_default is used by default
$conf['nbm_treatment_timeout_default'] = 20;
-// Send an email to the webmaster when a new user registers
-$conf['email_admin_on_new_user']=false;
-
// +-----------------------------------------------------------------------+
// | Set default admin layout |
// +-----------------------------------------------------------------------+
diff --git a/include/picture_comment.inc.php b/include/picture_comment.inc.php
index ed8818ff4..38c91c167 100644
--- a/include/picture_comment.inc.php
+++ b/include/picture_comment.inc.php
@@ -193,6 +193,31 @@ if ( $page['show_comments'] and isset( $_POST['content'] ) )
}
$template->assign_block_vars('information',
array('INFORMATION'=>$message));
+ if ( ($comment_action=='validate' and $conf['email_admin_on_comment'])
+ or $conf['email_admin_on_comment_validation'] )
+ {
+ include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
+
+ $del_url = get_host_url().cookie_path()
+ .'comments.php?delete='.$comm['id'];
+
+ $content =
+ 'Author: '.$comm['author']."\n"
+ .'Comment: '.$comm['content']."\n"
+ .'IP: '.$comm['ip']."\n"
+ .'Browser: '.$comm['agent']."\n\n"
+ .'Delete: '.$del_url."\n";
+ if ($comment_action!='validate')
+ {
+ $content .=
+ 'Validate: '.get_host_url().cookie_path()
+ .'comments.php?validate='.$comm['id'];
+ }
+ pwg_mail( get_webmaster_mail_address(), '',
+ 'PWG comment by '.$comm['author'],
+ $content
+ );
+ }
}
else
{