From 24ad5cc3d8f245a66148a579ecc4d6a8417a70b4 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Fri, 27 Apr 2018 23:23:57 +0200 Subject: [PATCH] Set $reset_by_sms even if password reset is disabled ... to avoid an "undefined variable" warning --- model/AdminHandler.php | 8 +++----- model/MailboxHandler.php | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/model/AdminHandler.php b/model/AdminHandler.php index db559a17..1d2f3cf3 100644 --- a/model/AdminHandler.php +++ b/model/AdminHandler.php @@ -36,11 +36,9 @@ class AdminHandler extends PFAHandler { $passwordReset = Config::read('forgotten_admin_password_reset'); - if ($passwordReset) { - $reset_by_sms = 0; - if (Config::read('sms_send_function')) { - $reset_by_sms = 1; - } + $reset_by_sms = 0; + if ($passwordReset && Config::read('sms_send_function')) { + $reset_by_sms = 1; } $this->struct=array( diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php index b073b38f..e28548f1 100644 --- a/model/MailboxHandler.php +++ b/model/MailboxHandler.php @@ -13,11 +13,9 @@ class MailboxHandler extends PFAHandler { # init $this->struct, $this->db_table and $this->id_field protected function initStruct() { $passwordReset = Config::read('forgotten_user_password_reset'); - if ($passwordReset) { - $reset_by_sms = 0; - if (Config::read('sms_send_function')) { - $reset_by_sms = 1; - } + $reset_by_sms = 0; + if ($passwordReset && Config::read('sms_send_function')) { + $reset_by_sms = 1; } $this->struct=array(