Fixed overwriting of existing mail settings
authorMarcel Werk <burntime@woltlab.com>
Wed, 9 Nov 2016 12:22:04 +0000 (13:22 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 9 Nov 2016 12:22:04 +0000 (13:22 +0100)
wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_post_sql.php

index 4d3dd5c3cd79b733248673a053661370c79865b3..8138f7b43d0451a93316ebcf87742f77e8a4c4a2 100644 (file)
@@ -46,18 +46,15 @@ $sql = "UPDATE      wcf".WCF_N."_option
        SET     optionValue = ?
        WHERE   optionName = ?";
 $statement = WCF::getDB()->prepareStatement($sql);
-$statement->execute([
-       WCF::getUser()->username,
-       'mail_from_name'
-]);
-$statement->execute([
-       WCF::getUser()->email,
-       'mail_from_address'
-]);
-$statement->execute([
-       WCF::getUser()->email,
-       'mail_admin_address'
-]);
+if (!MAIL_FROM_NAME) {
+       $statement->execute([WCF::getUser()->username, 'mail_from_name']);
+}
+if (!MAIL_FROM_ADDRESS) {
+       $statement->execute([WCF::getUser()->email, 'mail_from_address']);
+}
+if (!MAIL_ADMIN_ADDRESS) {
+       $statement->execute([WCF::getUser()->email, 'mail_admin_address']);
+}
 
 // Generate signature_secret
 try {