diff options
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 11 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_installer.php | 20 |
2 files changed, 24 insertions, 7 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); + } } } } diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index d5264fcc..c6f19ad0 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -304,12 +304,12 @@ class gallery_installer { module::set_var("gallery", "favicon_url", "lib/images/favicon.ico"); // Sendmail configuration - module::set_var("gallery", "email_from", "admin@example.com"); - module::set_var("gallery", "email_reply_to", "public@example.com"); + module::set_var("gallery", "email_from", ""); + module::set_var("gallery", "email_reply_to", ""); module::set_var("gallery", "email_line_length", 70); module::set_var("gallery", "email_header_separator", serialize("\n")); - module::set_version("gallery", 37); + module::set_version("gallery", 38); } static function upgrade($version) { @@ -611,6 +611,20 @@ class gallery_installer { module::set_var("gallery", "email_header_separator", serialize("\n")); module::set_version("gallery", $version = 37); } + + // Changed our minds and decided that the initial value should be empty + // But don't just reset it blindly, only do it if the value is version 37 default + if ($version == 37) { + $email = module::get_var("gallery", "email_from", ""); + if ($email == "admin@example.com") { + module::set_var("gallery", "email_from", ""); + } + $email = module::get_var("gallery", "email_reply_to", ""); + if ($email == "admin@example.com") { + module::set_var("gallery", "email_reply_to", ""); + } + module::set_version("gallery", $version = 38); + } } static function uninstall() { |