|
31 | 31 |
|
32 | 32 | if (rex_post('btn_save', 'string') != '')
|
33 | 33 | {
|
34 |
| - $file = $REX['INCLUDE_PATH'] .'/addons/phpmailer/classes/class.rex_mailer.inc.php'; |
35 |
| - $message = rex_is_writable($file); |
36 |
| - |
37 |
| - if($message === true) |
| 34 | + $file = rex_path::addonData('phpmailer', 'settings.inc.php'); |
| 35 | + |
| 36 | + $message = $I18N->msg('phpmailer_config_saved_error'); |
| 37 | + |
| 38 | + $content = '<?php |
| 39 | +
|
| 40 | +$this->From = ' . var_export($from, true) . '; |
| 41 | +$this->FromName = ' . var_export($fromname, true) . '; |
| 42 | +$this->ConfirmReadingTo = ' . var_export($confirmto, true) . '; |
| 43 | +$this->AdminBcc = ' . var_export($AdminBcc, true) . '; |
| 44 | +$this->Mailer = ' . var_export($mailer, true) . '; |
| 45 | +$this->Host = ' . var_export($host, true) . '; |
| 46 | +$this->CharSet = ' . var_export($charset, true) . '; |
| 47 | +$this->WordWrap = ' . var_export($wordwrap, true) . '; |
| 48 | +$this->Encoding = ' . var_export($encoding, true) . '; |
| 49 | +$this->Priority = ' . var_export($priority, true) . '; |
| 50 | +$this->SMTPAuth = ' . var_export($smtpauth, true) . '; |
| 51 | +$this->Username = ' . var_export($Username, true) . '; |
| 52 | +$this->Password = ' . var_export($Password, true) . '; |
| 53 | +'; |
| 54 | + |
| 55 | + if(rex_file::put($file, $content) !== false) |
38 | 56 | {
|
39 |
| - $message = $I18N->msg('phpmailer_config_saved_error'); |
40 |
| - |
41 |
| - $content = " |
42 |
| -\$this->From = '". $from ."'; |
43 |
| -\$this->FromName = '". $fromname ."'; |
44 |
| -\$this->ConfirmReadingTo = '". $confirmto ."'; |
45 |
| -\$this->AdminBcc = '". $AdminBcc ."'; |
46 |
| -\$this->Mailer = '". $mailer ."'; |
47 |
| -\$this->Host = '". $host ."'; |
48 |
| -\$this->CharSet = '". $charset ."'; |
49 |
| -\$this->WordWrap = ". $wordwrap ."; |
50 |
| -\$this->Encoding = '". $encoding ."'; |
51 |
| -\$this->Priority = ". $priority ."; |
52 |
| -\$this->SMTPAuth = ". $smtpauth ."; |
53 |
| -\$this->Username = '". $Username ."'; |
54 |
| -\$this->Password = '". $Password ."';"; |
55 |
| - |
56 |
| - if(rex_replace_dynamic_contents($file, $content) !== false) |
57 |
| - { |
58 |
| - $message = $I18N->msg('phpmailer_config_saved_successful'); |
59 |
| - } |
| 57 | + $message = $I18N->msg('phpmailer_config_saved_successful'); |
60 | 58 | }
|
61 | 59 | }
|
62 | 60 |
|
|
0 commit comments