From 3699980419fa763c5d204a09c6129b89f813b30b Mon Sep 17 00:00:00 2001 From: fusionate Date: Fri, 26 Sep 2025 14:46:22 -0600 Subject: [PATCH] Authentication - Database: Fix user contact query. --- .../resources/classes/plugins/database.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/authentication/resources/classes/plugins/database.php b/core/authentication/resources/classes/plugins/database.php index 36fc95d98c..19637f5551 100644 --- a/core/authentication/resources/classes/plugins/database.php +++ b/core/authentication/resources/classes/plugins/database.php @@ -288,19 +288,19 @@ class plugin_database { //get the user contact details if ($contacts_exists) { + unset($parameters); $sql = "select "; $sql .= " c.contact_organization, "; $sql .= " c.contact_name_given, "; $sql .= " c.contact_name_family, "; - $sql .= " a.contact_attachment_uuid, "; + $sql .= " a.contact_attachment_uuid "; $sql .= "from v_contacts as c "; - $sql .= "where contact_uuid = :contact_uuid "; - $sql .= "left join v_contact_attachments as a "; - $sql .= " on c.contact_uuid = a.contact_uuid "; + $sql .= "left join v_contact_attachments as a on c.contact_uuid = a.contact_uuid "; + $sql .= "where c.contact_uuid = :contact_uuid "; + $sql .= "and c.domain_uuid = :domain_uuid "; $sql .= "and a.attachment_primary = true "; $sql .= "and a.attachment_filename is not null "; $sql .= "and a.attachment_content is not null "; - $sql .= "and c.domain_uuid = :domain_uuid "; $parameters['domain_uuid'] = $this->domain_uuid; $parameters['contact_uuid'] = $this->contact_uuid; $contact = $settings->database()->select($sql, $parameters, 'row');