summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-09-01 23:52:19 -0700
committerBharat Mediratta <bharat@menalto.com>2010-09-01 23:52:19 -0700
commit23b566e5921d5b8bd5a957ecd2d601e556f658a0 (patch)
tree04d36610929958abfbaa5aed851ca46c1bb0136e /modules
parent7477f0119c39a71e05d3e6b2caad8418a7d41c83 (diff)
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/helpers/gallery_event.php7
1 files changed, 4 insertions, 3 deletions
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);
}