diff options
| author | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-09-02 22:32:46 +0300 |
|---|---|---|
| committer | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-09-02 22:32:46 +0300 |
| commit | 9572c664d2bfff0877d4f2062eb0ef6665a109cf (patch) | |
| tree | 89c8e2868c1490a0bc578ce4a69c0ed7fae8b5bf /modules/gallery/helpers/gallery_event.php | |
| parent | a0033ce75968b3c134c0e439046f135b1e646550 (diff) | |
| parent | 511826a33cbbf03bf1e3cb151f1a181b8e6723e8 (diff) | |
Merge remote branch 'gallery3/master'
Diffstat (limited to 'modules/gallery/helpers/gallery_event.php')
| -rw-r--r-- | modules/gallery/helpers/gallery_event.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index df5394c9..ec7d1882 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -63,6 +63,8 @@ class gallery_event_Core { ->update("logs") ->set("user_id", $admin->id) ->execute(); + module::set_var("gallery", "email_from", $admin->email); + module::set_var("gallery", "email_reply_to", $admin->email); } static function group_created($group) { @@ -547,4 +549,17 @@ class gallery_event_Core { $data->content[] = (object) array("title" => t("User information"), "view" => $v); } + + static function user_updated($original_user, $updated_user) { + // If the default from/reply-to email address is set to the install time placeholder value + // of unknown@unknown.com then adopt the value from the first admin to set their own email + // address so that we at least have a valid address for the Gallery. + if ($updated_user->admin) { + $email = module::get_var("gallery", "email_from", ""); + if ($email == "unknown@unknown.com") { + module::set_var("gallery", "email_from", $updated_user->email); + module::set_var("gallery", "email_reply_to", $updated_user->email); + } + } + } } |
