From 6b9e81026e7727409bc0628e7f2ef034cc005e38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 May 2025 17:37:17 +0200 Subject: [PATCH] Lang --- htdocs/langs/en_US/website.lang | 2 +- htdocs/societe/class/societeaccount.class.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index deb2186bf52..0e5edb778e0 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -192,7 +192,7 @@ WEBPORTAL_INVOICE_LIST_ACCESS=Enable access to the invoices WEBPORTAL_USER_LOGGED=Select an anonymous user WebPortalUserLoggedHelp=This user is used to update cards WebPortalHomeTitle=Welcome -WebPortalHomeDesc=Welcome to the public interface +WebPortalHomeDesc=Welcome to your private portal WebPortalPropalListMenu=Proposals WebPortalPropalListTitle=Proposals WebPortalPropalListDesc=You will find here all your proposals diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 5e45efeb4d5..260a48efd7e 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -277,6 +277,24 @@ class SocieteAccount extends CommonObject } } + if ($this->site == 'dolibarr_portal') { + // Check that entry does not already exists + $sql = "SELECT sa.rowid, sa.entity"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe_account as sa"; + $sql .= " WHERE sa.login = '".$this->db->escape($this->login)."'"; + $sql .= " AND sa.entity IN (".getEntity('societe').")"; + $sql .= " AND sa.site = 'dolibarr_portal'"; + $sql .= " ORDER BY sa.rowid DESC"; // To always get the same order + + $result = $this->db->query($sql); + if ($result) { + if ($this->db->num_rows($result)) { + $this->error = 'ErrorLoginAlreadyExists'; + return -2; + } + } + } + return $this->createCommon($user, $notrigger); }