1) user invitation 2) app access control 3) txn quota guard

This commit is contained in:
Thanakorn S
2026-05-21 11:42:47 +07:00
parent 8ec2e89f79
commit 6eeebfeacb
50 changed files with 1062 additions and 113 deletions
+11 -1
View File
@@ -148,7 +148,17 @@ class ContactManager {
*/
public function saveContactType(array $data, array $logging): void
{
$id = (int)($data['id'] ?? 0);
$id = (int)($data['id'] ?? 0);
$name = (string)($data['contact_type'] ?? '');
$dupSth = $this->pdo->prepare(
"SELECT id FROM md_contact_type
WHERE company_id = :cid AND contact_type = :name" . ($id > 0 ? " AND id != :id" : "") . " LIMIT 1"
);
$dupParams = [':cid' => $this->company_id, ':name' => $name];
if ($id > 0) $dupParams[':id'] = $id;
$dupSth->execute($dupParams);
if ($dupSth->fetchColumn()) throw new Exception("A contact type with this name already exists.");
$sth = $this->pdo->prepare(
"SELECT `log` FROM md_contact_type