Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Send notifications to only specific admins - PART II  (Read 15914 times)

0 Members and 1 Guest are viewing this topic.

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Send notifications to only specific admins - PART II
« on: September 25, 2012, 03:28:22 am »

In my first post I asked if there was a way to not have emails for new registrations and photo approvals go to all admins, but only to a select couple. I received the suggestion to:

Quote
Or try
In register.php
find:

Code: [Select]
$result = cpg_db_query("SELECT user_id, user_email, user_language FROM {$CONFIG['TABLE_USERS']} WHERE user_group = 1");
replace with:

Code: [Select]
$result = cpg_db_query("SELECT user_id, user_email, user_language FROM {$CONFIG['TABLE_USERS']} WHERE user_name = 'username_of_the_admin'");
Quote

Anyone know what file I would modify to do the same for photo approvals?

Thanks.
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Send notifications to only specific admins - PART II
« Reply #1 on: September 25, 2012, 03:56:47 am »

http://belvederecommunityfoundation.com/photocontest/
Anyone know what file I would modify to do the same for photo approvals?

There are several options.
You can edit mailer.inc.php
find
Code: [Select]
$result = cpg_db_query("SELECT user_email FROM {$CONFIG['TABLE_USERS']} WHERE user_group = 1");
and change as suggested above. This would change the way emails are sent to the admin anywhere the cpg_mail() function is called using 'admin' as the $to parameter.

A way to change it without affecting the entire gallery.
In db_input.php
find
Code: [Select]
cpg_mail('admin', sprintf($lang_db_input_php['notify_admin_email_subject'], $CONFIG['gallery_name']), make_clickable(sprintf($lang_db_input_php['notify_admin_email_body'], USER_NAME, $CONFIG['ecards_more_pic_target'].(substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .'editpics.php?mode=upload_approval')));
replace with
Code: [Select]
cpg_mail('email_of_admin@email.com', sprintf($lang_db_input_php['notify_admin_email_subject'], $CONFIG['gallery_name']), make_clickable(sprintf($lang_db_input_php['notify_admin_email_body'], USER_NAME, $CONFIG['ecards_more_pic_target'].(substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .'editpics.php?mode=upload_approval')));

Additionally you can try changing it here
In notifyupload.php
find
Code: [Select]
cpg_mail('admin', sprintf($lang_db_input_php['notify_admin_email_subject'], $CONFIG['gallery_name']), make_clickable(sprintf($lang_db_input_php['notify_admin_email_body'], USER_NAME, $CONFIG['ecards_more_pic_target'].(substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .'editpics.php?mode=upload_approval')));
replace with
Code: [Select]
cpg_mail('email_of_admin@email.com', sprintf($lang_db_input_php['notify_admin_email_subject'], $CONFIG['gallery_name']), make_clickable(sprintf($lang_db_input_php['notify_admin_email_body'], USER_NAME, $CONFIG['ecards_more_pic_target'].(substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .'editpics.php?mode=upload_approval')));

All code untested and you may be required to edit multiple files to get it to work completely. Please report any problems.
« Last Edit: September 25, 2012, 04:11:34 am by Jeff Bailey »
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Send notifications to only specific admins - PART II
« Reply #2 on: September 25, 2012, 05:23:33 pm »

Thanks! The overall option would be best but my hunch is the others could override it. I'll test my way through it but I don't foresee a problem. I'll let you know if I do.

Thanks again for your help.
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Send notifications to only specific admins - PART II
« Reply #3 on: September 25, 2012, 08:39:04 pm »

The db_input.php and notifyupload.php files will not override mailer.inc.php unless you change the first parameter, 'admin' to something different.

No problem. Please resolve your thread if you find everything works correctly.
http://forum.coppermine-gallery.net/index.php/topic,55415.msg270631.html#msg270631
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 19 queries.