2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Laurent Destailleur
2025-05-27 17:37:17 +02:00
parent 9dfc560b5c
commit 6b9e81026e
2 changed files with 19 additions and 1 deletions

View File

@@ -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

View File

@@ -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);
}