From d30ba24d2f1a36ae1bee4ae5b21533972d424f03 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 4 Dec 2024 09:15:44 +0100 Subject: [PATCH] add config cis_send_profil_update_mails, use it in profil update controllers --- application/config/cis.php | 2 ++ application/controllers/Cis/ProfilUpdate.php | 9 +++++++++ .../controllers/api/frontend/v1/ProfilUpdate.php | 12 ++++++++++++ 3 files changed, 23 insertions(+) diff --git a/application/config/cis.php b/application/config/cis.php index 028e9899a..b7330ef29 100644 --- a/application/config/cis.php +++ b/application/config/cis.php @@ -5,3 +5,5 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); // CMS Content Id for CIS4 Menu Root $config['cis_menu_root_content_id'] = 11066; +// send Mails for ProfilUpdate +$config['cis_send_profil_update_mails'] = true; diff --git a/application/controllers/Cis/ProfilUpdate.php b/application/controllers/Cis/ProfilUpdate.php index 423b0c9c3..c47b7540b 100644 --- a/application/controllers/Cis/ProfilUpdate.php +++ b/application/controllers/Cis/ProfilUpdate.php @@ -36,6 +36,7 @@ class ProfilUpdate extends Auth_Controller 'getTopic' => ['basis/cis:r'], ]); + $this->load->config('cis'); $this->load->model('person/Profil_update_model', 'ProfilUpdateModel'); $this->load->model('person/Kontakt_model', 'KontaktModel'); @@ -111,6 +112,10 @@ class ProfilUpdate extends Auth_Controller private function sendEmail_onProfilUpdate_response($uid, $topic, $status) { + if($this->config->item('cis_send_profil_update_mails') === false) + { + return; + } $this->load->helper('hlp_sancho_helper'); $email = $uid . "@" . DOMAIN; @@ -138,6 +143,10 @@ class ProfilUpdate extends Auth_Controller private function sendEmail_onProfilUpdate_insertion($uid, $profil_update_id, $topic) { + if($this->config->item('cis_send_profil_update_mails') === false) + { + return; + } $this->load->helper('hlp_sancho_helper'); $emails = []; diff --git a/application/controllers/api/frontend/v1/ProfilUpdate.php b/application/controllers/api/frontend/v1/ProfilUpdate.php index 35b7e4e64..c8097a5af 100644 --- a/application/controllers/api/frontend/v1/ProfilUpdate.php +++ b/application/controllers/api/frontend/v1/ProfilUpdate.php @@ -47,6 +47,8 @@ class ProfilUpdate extends FHCAPI_Controller 'show' => self::PERM_LOGGED, ]); + $this->load->config('cis'); + // Load language phrases $this->loadPhrases( array( @@ -504,6 +506,11 @@ class ProfilUpdate extends FHCAPI_Controller private function sendEmail_onProfilUpdate_insertion($uid, $profil_update_id, $topic) { + $this->addMeta('cis_send_profil_update_mails', $this->config->item('cis_send_profil_update_mails')); + if($this->config->item('cis_send_profil_update_mails') === false) + { + return; + } $this->load->helper('hlp_sancho_helper'); $emails = []; @@ -573,6 +580,11 @@ class ProfilUpdate extends FHCAPI_Controller private function sendEmail_onProfilUpdate_response($uid, $topic, $status) { + if($this->config->item('cis_send_profil_update_mails') === false) + { + return; + } + $this->load->helper('hlp_sancho_helper'); $email = $uid . "@" . DOMAIN;