From 23b566e5921d5b8bd5a957ecd2d601e556f658a0 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 1 Sep 2010 23:52:19 -0700 Subject: One more adjustment for ticket #1216. The packaging process forces the default email address for admin to be unknown@unknown.com and when that happens the gallery_event::user_updated() event listener fires and sets the default values. This is hard to work around, so let's just roll with it and use unknown@unknown.com as our default placeholder. So now, if an admin sets their email address and the current values are unknown@unknown.com we adopt the admin's email address for the site's mail_from/reply_to fields. --- modules/gallery/helpers/gallery_event.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules/gallery/helpers/gallery_event.php') diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 5e44caef..ec7d1882 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -551,11 +551,12 @@ class gallery_event_Core { } static function user_updated($original_user, $updated_user) { - // If no default from/reply-to email address is set, 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 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 (empty($email)) { + if ($email == "unknown@unknown.com") { module::set_var("gallery", "email_from", $updated_user->email); module::set_var("gallery", "email_reply_to", $updated_user->email); } -- cgit v1.2.3