Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
* #5497 duplicate acl
Browse files Browse the repository at this point in the history
  • Loading branch information
loiclau committed Aug 7, 2017
1 parent a85f823 commit 4cf923d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions www/include/configuration/configObject/contact/DB-Func.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,22 @@ function multipleContactInDB($contacts = array(), $nbrDup = array())
$DBRESULT = $pearDB->query("SELECT MAX(contact_id) FROM contact");
$maxId = $DBRESULT->fetchRow();
if (isset($maxId["MAX(contact_id)"])) {

/*
* ACL update
*/
$query = "SELECT DISTINCT acl_group_id FROM acl_group_contacts_relations " .
"WHERE contact_contact_id = " . (int)$key;
$dbResult = $pearDB->query($query);
$fields["contact_aclRelation"] = "";
while ($aclRelation = $dbResult->fetchRow()) {
$query = "INSERT INTO acl_group_contacts_relations VALUES ('', '" .
$maxId["MAX(contact_id)"] . "', '" . $aclRelation["acl_group_id"] . "')";
$pearDB->query($query);
$fields["contact_aclRelation"] .= $aclRelation["acl_group_id"] . ",";
}
$fields["contact_aclRelation"] = trim($fields["contact_aclRelation"], ",");

/*
* Command update
*/
Expand Down

0 comments on commit 4cf923d

Please sign in to comment.