From 2469b8cc60bbd8d2d06a13153c1f79b07f84016f Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 20 Aug 2024 09:24:49 +0200 Subject: [PATCH] fix PHP Fatal Error stalling AD Sync: Declaration of Ads::connect($admin=false) must be compatible with Ldap::contect($admin=false, $reconnect=false) --- api/src/Contacts/Ads.php | 9 +++++---- api/src/Contacts/Ldap.php | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/api/src/Contacts/Ads.php b/api/src/Contacts/Ads.php index f995f428bb..b701dd57df 100644 --- a/api/src/Contacts/Ads.php +++ b/api/src/Contacts/Ads.php @@ -150,15 +150,16 @@ class Ads extends Ldap } /** - * connect to LDAP server + * Connect to LDAP server * - * @param boolean $admin =false true (re-)connect with admin not user credentials, eg. to modify accounts + * @param boolean $admin =false true: (re-)connect with admin not user credentials, eg. to modify accounts + * @param boolean $reconnect =false true: force a reconnect */ - function connect($admin=false) + function connect($admin = false, $reconnect=false) { unset($admin); // not used, but required by function signature - $this->ds = $this->accounts_ads->ldap_connection(); + $this->ds = $this->accounts_ads->ldap_connection($reconnect); } /** diff --git a/api/src/Contacts/Ldap.php b/api/src/Contacts/Ldap.php index 11348a0a17..a60a787d10 100644 --- a/api/src/Contacts/Ldap.php +++ b/api/src/Contacts/Ldap.php @@ -400,9 +400,10 @@ class Ldap protected bool $admin_connection; /** - * connect to LDAP server + * Connect to LDAP server * - * @param boolean $admin =false true (re-)connect with admin not user credentials, eg. to modify accounts + * @param boolean $admin =false true: (re-)connect with admin not user credentials, eg. to modify accounts + * @param boolean $reconnect =false true: force a reconnect */ function connect($admin = false, $reconnect=false) {