From 615127aceb1dd7bd54b4cc7f17c06e708d999e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB=20=D0=93=D0=B2=D0=BE=D0=B7?= =?UTF-8?q?=D0=B4=D1=8C?= Date: Mon, 13 Sep 2021 13:41:04 +0600 Subject: [PATCH] Update ticketqueue.class.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Поправлено использование поля `email` у объекта `TicketQueue`. Код был написан так, что оно никогда не используется. Иначе зачем это поле вообще?.. --- .../tickets/model/tickets/ticketqueue.class.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/components/tickets/model/tickets/ticketqueue.class.php b/core/components/tickets/model/tickets/ticketqueue.class.php index 0bf7509..af941f7 100644 --- a/core/components/tickets/model/tickets/ticketqueue.class.php +++ b/core/components/tickets/model/tickets/ticketqueue.class.php @@ -24,14 +24,15 @@ public function Send() $this->xpdo->getOption('tickets.mail_from_name', null, $this->xpdo->getOption('site_name'), true) ); - if ($user = $this->getOne('User')) { - $profile = $user->getOne('Profile'); - if (!$user->get('active') || $profile->get('blocked')) { - return 'This user is not active.'; + $email = $this->get('email'); + if (empty($email)) { + if ($user = $this->getOne('User')) { + $profile = $user->getOne('Profile'); + if (!$user->get('active') || $profile->get('blocked')) { + return 'This user is not active.'; + } + $email = $profile->get('email'); } - $email = $profile->get('email'); - } else { - $email = $this->get('email'); } if (empty($email)) { @@ -52,4 +53,4 @@ public function Send() return true; } -} \ No newline at end of file +}