From bfcfad780bc1b4ae080c98814308883c8313b5cb Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Fri, 16 Jun 2023 10:56:06 +0200 Subject: [PATCH 1/3] [Email] Added email address option --- application/controllers/Options.php | 8 ++++++++ application/controllers/Oqrs.php | 2 +- application/controllers/User.php | 2 +- application/language/english/options_lang.php | 1 + application/views/options/email.php | 6 ++++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/application/controllers/Options.php b/application/controllers/Options.php index 849f8d8a..1c503663 100644 --- a/application/controllers/Options.php +++ b/application/controllers/Options.php @@ -232,6 +232,14 @@ class Options extends CI_Controller { $this->session->set_flashdata('success', $this->lang->line('options_smtp_encryption_changed_to').$this->input->post('smtpEncryption')); } + // Update smtpHost choice within the options system + $emailAddressupdate = $this->optionslib->update('emailAddress', $this->input->post('emailAddress'), 'yes'); + + // If smtpHost update is complete set a flashsession with a success note + if($emailAddressupdate == TRUE) { + $this->session->set_flashdata('success', $this->lang->line('options_email_address_changed_to').$this->input->post('emailAddress')); + } + // Update smtpHost choice within the options system $smtpHostupdate = $this->optionslib->update('smtpHost', $this->input->post('smtpHost'), 'yes'); diff --git a/application/controllers/Oqrs.php b/application/controllers/Oqrs.php index 51d8522c..fe8411ce 100644 --- a/application/controllers/Oqrs.php +++ b/application/controllers/Oqrs.php @@ -182,7 +182,7 @@ class Oqrs extends CI_Controller { $message = $this->load->view('email/oqrs_request', $data, TRUE); - $this->email->from('noreply@cloudlog.co.uk', 'Cloudlog'); + $this->email->from($this->optionslib->get_option('emailAddress'), 'Cloudlog OQRS'); $this->email->to($email); $this->email->reply_to($this->security->xss_clean($postdata['email']), strtoupper($data['callsign'])); diff --git a/application/controllers/User.php b/application/controllers/User.php index bdddf958..ca2aedef 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -608,7 +608,7 @@ class User extends CI_Controller { $message = $this->load->view('email/forgot_password', $this->data, TRUE); - $this->email->from('noreply@cloudlog.co.uk', 'Cloudlog'); + $this->email->from($this->optionslib->get_option('emailAddress'), 'Cloudlog'); $this->email->to($this->input->post('email', true)); $this->email->subject('Cloudlog Account Password Reset'); diff --git a/application/language/english/options_lang.php b/application/language/english/options_lang.php index 4098192d..a99702d8 100644 --- a/application/language/english/options_lang.php +++ b/application/language/english/options_lang.php @@ -32,6 +32,7 @@ $lang['options_radio_timeout_warning_changed_to'] = 'Radio Timeout Warning chang $lang['options_email'] = 'Email'; $lang['options_outgoing_protocol'] = 'Outgoing Protocol'; $lang['options_smtp_encryption'] = 'SMTP Encryption'; +$lang['options_email_address'] = 'Email Address'; $lang['options_smtp_host'] = 'SMTP Host'; $lang['options_smtp_port'] = 'SMTP Port'; $lang['options_smtp_username'] = 'SMTP Username'; diff --git a/application/views/options/email.php b/application/views/options/email.php index 1204c1f3..b69e3076 100644 --- a/application/views/options/email.php +++ b/application/views/options/email.php @@ -51,6 +51,12 @@ +
+ +
+ optionslib->get_option('emailAddress'); } ?>"> +
+
From 020fd96ef9d4c95814b40d569412ef8cab51896b Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 17 Jun 2023 09:03:00 +0200 Subject: [PATCH 2/3] [Email] Added email sender name --- application/controllers/Options.php | 12 ++++++++++-- application/controllers/Oqrs.php | 4 ++-- application/controllers/User.php | 2 +- application/language/english/options_lang.php | 3 +++ application/language/german/options_lang.php | 4 ++++ application/views/options/email.php | 7 +++++++ 6 files changed, 27 insertions(+), 5 deletions(-) diff --git a/application/controllers/Options.php b/application/controllers/Options.php index 1c503663..21a74b60 100644 --- a/application/controllers/Options.php +++ b/application/controllers/Options.php @@ -232,10 +232,18 @@ class Options extends CI_Controller { $this->session->set_flashdata('success', $this->lang->line('options_smtp_encryption_changed_to').$this->input->post('smtpEncryption')); } - // Update smtpHost choice within the options system + // Update email sender name within the options system + $emailSenderNameupdate = $this->optionslib->update('emailSenderName', $this->input->post('emailSenderName'), 'yes'); + + // If email address update is complete set a flashsession with a success note + if($emailSenderNameupdate == TRUE) { + $this->session->set_flashdata('success', $this->lang->line('options_email_sender_name_changed_to').$this->input->post('emailSenderName')); + } + + // Update email address choice within the options system $emailAddressupdate = $this->optionslib->update('emailAddress', $this->input->post('emailAddress'), 'yes'); - // If smtpHost update is complete set a flashsession with a success note + // If email address update is complete set a flashsession with a success note if($emailAddressupdate == TRUE) { $this->session->set_flashdata('success', $this->lang->line('options_email_address_changed_to').$this->input->post('emailAddress')); } diff --git a/application/controllers/Oqrs.php b/application/controllers/Oqrs.php index fe8411ce..bc7ce099 100644 --- a/application/controllers/Oqrs.php +++ b/application/controllers/Oqrs.php @@ -181,8 +181,8 @@ class Oqrs extends CI_Controller { $data['usermessage'] = $this->security->xss_clean($postdata['message']); $message = $this->load->view('email/oqrs_request', $data, TRUE); - - $this->email->from($this->optionslib->get_option('emailAddress'), 'Cloudlog OQRS'); + + $this->email->from($this->optionslib->get_option('emailAddress'), $this->optionslib->get_option('emailSenderName')); $this->email->to($email); $this->email->reply_to($this->security->xss_clean($postdata['email']), strtoupper($data['callsign'])); diff --git a/application/controllers/User.php b/application/controllers/User.php index ca2aedef..2d89e0ad 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -608,7 +608,7 @@ class User extends CI_Controller { $message = $this->load->view('email/forgot_password', $this->data, TRUE); - $this->email->from($this->optionslib->get_option('emailAddress'), 'Cloudlog'); + $this->email->from($this->optionslib->get_option('emailAddress'), $this->optionslib->get_option('emailSenderName')); $this->email->to($this->input->post('email', true)); $this->email->subject('Cloudlog Account Password Reset'); diff --git a/application/language/english/options_lang.php b/application/language/english/options_lang.php index a99702d8..af31fe80 100644 --- a/application/language/english/options_lang.php +++ b/application/language/english/options_lang.php @@ -33,6 +33,7 @@ $lang['options_email'] = 'Email'; $lang['options_outgoing_protocol'] = 'Outgoing Protocol'; $lang['options_smtp_encryption'] = 'SMTP Encryption'; $lang['options_email_address'] = 'Email Address'; +$lang['options_email_sender_name'] = 'Email Sender Name'; $lang['options_smtp_host'] = 'SMTP Host'; $lang['options_smtp_port'] = 'SMTP Port'; $lang['options_smtp_username'] = 'SMTP Username'; @@ -41,6 +42,8 @@ $lang['options_crlf'] = 'CRLF'; $lang['options_newline'] = 'Newline'; $lang['options_outgoing_email_protocol_changed_to'] = 'Outgoing Email Protocol changed to '; $lang['options_smtp_encryption_changed_to'] = 'SMTP Encryption changed to '; +$lang['options_email_address_changed_to'] = 'Email Address changed to '; +$lang['options_email_sender_name_changed_to'] = 'Email Sender Name changed to '; $lang['options_smtp_host_changed_to'] = 'SMTP Host changed to '; $lang['options_smtp_port_changed_to'] = 'SMTP Post changed to '; $lang['options_smtp_username_changed_to'] = 'SMTP Username changed to '; diff --git a/application/language/german/options_lang.php b/application/language/german/options_lang.php index 71c15b37..50032646 100644 --- a/application/language/german/options_lang.php +++ b/application/language/german/options_lang.php @@ -32,6 +32,8 @@ $lang['options_radio_timeout_warning_changed_to'] = 'Radio Timeout Warnung geän $lang['options_email'] = 'Email'; $lang['options_outgoing_protocol'] = 'Protokoll für ausgehende Emails'; $lang['options_smtp_encryption'] = 'SMTP Verschlüsselung'; +$lang['options_email_address'] = 'Emailaddresse'; +$lang['options_email_sender_name'] = 'Email Absendername'; $lang['options_smtp_host'] = 'SMTP Host'; $lang['options_smtp_port'] = 'SMTP Port'; $lang['options_smtp_username'] = 'SMTP Benutzername'; @@ -40,6 +42,8 @@ $lang['options_crlf'] = 'CRLF'; $lang['options_newline'] = 'Zeilenvorschub'; $lang['options_outgoing_email_protocol_changed_to'] = 'Protokoll für ausgehende Emails geändert zu '; $lang['options_smtp_encryption_changed_to'] = 'SMTP Verschlüsselung geändert zu '; +$lang['options_email_address_changed_to'] = 'Emailadresse geändert zu '; +$lang['options_email_sender_name_changed_to'] = 'Email Absendername geändert zu '; $lang['options_smtp_host_changed_to'] = 'SMTP Host geändert zu '; $lang['options_smtp_port_changed_to'] = 'SMTP Post changed to '; $lang['options_smtp_username_changed_to'] = 'SMTP Benutzername geändert zu '; diff --git a/application/views/options/email.php b/application/views/options/email.php index b69e3076..c62fcc3b 100644 --- a/application/views/options/email.php +++ b/application/views/options/email.php @@ -51,6 +51,13 @@
+
+ +
+ optionslib->get_option('emailSenderName'); } ?>"> +
+
+
From d5196ed829921fa14a2e30f5c2031dc4281246d7 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 17 Jun 2023 09:14:56 +0200 Subject: [PATCH 3/3] [Email] Added default email sender name --- application/views/options/email.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/options/email.php b/application/views/options/email.php index c62fcc3b..9a11bd6a 100644 --- a/application/views/options/email.php +++ b/application/views/options/email.php @@ -54,7 +54,7 @@
- optionslib->get_option('emailSenderName'); } ?>"> + optionslib->get_option('emailSenderName'));?>">