summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery_event.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-09-01 23:19:43 -0700
committerTim Almdal <tnalmdal@shaw.ca>2010-09-01 23:19:43 -0700
commit04f6646b0637d9cb221159b4931b184449a4dc1d (patch)
treeb81aac924c347b64103c547ac51db28de965470e /modules/gallery/helpers/gallery_event.php
parent1f621d9827040d9730946a5804dd3d7269198ccc (diff)
Hopefully the third and final patch for #1216. Set the default from and reply-to addresses to an empty string. The first time the user model is saved, set the sendmail from and reply-to addresses. Requires an update to gallery version 38.
Diffstat (limited to 'modules/gallery/helpers/gallery_event.php')
-rw-r--r--modules/gallery/helpers/gallery_event.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index 66b250e9..8344c11c 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -550,10 +550,13 @@ class gallery_event_Core {
}
- static function user_change_email_form_completed($user, $form) {
- if ($user->admin) {
- module::set_var("gallery", "email_from", $user->email);
- module::set_var("gallery", "email_reply_to", $user->email);
+ static function user_updated($original_user, $updated_user) {
+ if ($updated_user->admin) {
+ $email = module::get_var("gallery", "email_from", "");
+ if (empty($email)) {
+ module::set_var("gallery", "email_from", $updated_user->email);
+ module::set_var("gallery", "email_reply_to", $updated_user->email);
+ }
}
}
}