Honour do_not_sync_from_ldap when sync'ing group members

This had been working as a side effect of the way the SQL insert
statement was working, but better to be explict about skipping them.
This commit is contained in:
Andrew Ruthven committed 2024-02-17 02:25:25 +00:00
1 parent 9494256f03
commit eb4d120bbf
4 files changed
+14 -9

No files matched your search

+7
View File
@@ -708,6 +708,13 @@ function sync_LDAP_groups(){
$c->messages[] = sprintf(i18n('- adding %s to group : %s'),join(', ', $add_users ), $group);
foreach ( $add_users as $member ) {
if ( isset($c->do_not_sync_from_ldap)
&& isset($c->do_not_sync_from_ldap[$member]) ) {
dbg_error_log( "ERROR", "drivers_ldap : Skipped adding %s to %s", $member, $group);
continue;
}
$qry = new AwlQuery( "
INSERT INTO group_member
SELECT g.principal_id AS group_id, u.principal_id AS member_id