From 444a098130b6a753492d6c5e737f6fc9bee90302 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Sat, 4 Feb 2023 15:14:43 +1300 Subject: [PATCH] Ensure that groups_nothing_done is defined Closes #278. --- inc/drivers_ldap.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inc/drivers_ldap.php b/inc/drivers_ldap.php index 6e8c8089..eec356e2 100644 --- a/inc/drivers_ldap.php +++ b/inc/drivers_ldap.php @@ -476,13 +476,19 @@ function sync_LDAP_groups(){ } $ldap_groups = array_keys($ldap_groups_info); + // users only in ldap $groups_to_create = array_diff($ldap_groups,$db_groups); + // users only in db $groups_to_deactivate = array_diff($db_groups,$ldap_groups); + // users present in ldap and in the db $groups_to_update = array_intersect($db_groups,$ldap_groups); + // groups where nothing was done + $groups_nothing_done[] = null; + if ( sizeof ( $groups_to_create ) ){ $validUserFields = awl_get_fields('usr'); foreach ( $groups_to_create as $k => $group ){