forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 email => Topic started by: jmcreis on September 22, 2011, 06:27:27 pm
-
Hi guys
It is possible to have an email notification to admin when users closes his own account, similar to the notification made when a new registration happens ?
Thanks
-
Maybe I just can't remember, but is it possible that a (regular) user deletes his own account at all?
-
Hi André
Yes, it is possible if the option is enable in configuration panel.
See the help: "When enabled, users can delete their user accounts. This option has been added in cpg1.5.x because of legal requirements in some countries."
-
Open delete.php, find
foreach ($users_scheduled_for_action as $key) {
if ($key != USER_ID) { // a user can only delete his own account
cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
}
delete_user($key);
}
and replace with
foreach ($users_scheduled_for_action as $key) {
if ($key != USER_ID) { // a user can only delete his own account
cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
}
delete_user($key);
cpg_mail($CONFIG['gallery_admin_email'], 'A user deleted his account', 'User "'.$cpg_udb->get_user_name($key).'" deleted his account');
}
-
Thank you very much André. I will try and send you a feedback.
-
Hi Andre,
I find this option suitable for my gallery. I've added the code in delete.php but no mail is sent to the admin email.
foreach ($users_scheduled_for_action as $key) {
if ($key != USER_ID) { // a user can only delete his own account
cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
}
delete_user($key);
// 8 Dec 2011 - start
cpg_mail($CONFIG['gallery_admin_email'], 'A user deleted his account', 'User "'.$cpg_udb->get_user_name($key).'" deleted his account');
// jimmy 8 Dec 2011 - end
}
Could you help?