From 501ba13306460f07959726e59db37d92b989b08e Mon Sep 17 00:00:00 2001 From: Tristan <13280348+greenertux@users.noreply.github.com> Date: Sun, 4 Dec 2022 18:09:38 +0100 Subject: [PATCH 1/2] Change parameter order to prevent PHP 8.1 deprecation warning --- oauth/LDAP/LDAP.php | 2 +- oauth/LDAP/LDAPInterface.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/oauth/LDAP/LDAP.php b/oauth/LDAP/LDAP.php index 3d13cfe..2481736 100755 --- a/oauth/LDAP/LDAP.php +++ b/oauth/LDAP/LDAP.php @@ -75,7 +75,7 @@ public function __construct($ldap_host, $ldap_port = 389, $ldap_version = 3, $ld * TRUE if the user is identified and can access to the LDAP server * and FALSE if it isn't */ - public function checkLogin($user, $password = null, $ldap_search_attribute, $ldap_filter = null, $ldap_base_dn, $ldap_bind_dn, $ldap_bind_pass) + public function checkLogin($user, $ldap_search_attribute, $ldap_base_dn, $ldap_bind_dn, $ldap_bind_pass, $password = null, $ldap_filter = null) { if (!is_string($user)) { throw new InvalidArgumentException('First argument to LDAP/checkLogin must be the username or email of a ldap user (string). Ex: jdupont or jdupont@company.com'); diff --git a/oauth/LDAP/LDAPInterface.php b/oauth/LDAP/LDAPInterface.php index 012d836..25ae66e 100755 --- a/oauth/LDAP/LDAPInterface.php +++ b/oauth/LDAP/LDAPInterface.php @@ -27,7 +27,7 @@ interface LDAPInterface * TRUE if the user is identified and can access to the LDAP server * and FALSE if it isn't */ - public function checkLogin($user, $password = null, $ldap_search_attribute, $ldap_filter = null, $ldap_base_dn, $ldap_bind_dn, $ldap_bind_pass); + public function checkLogin($user, $ldap_search_attribute, $ldap_base_dn, $ldap_bind_dn, $ldap_bind_pass, $password = null, $ldap_filter = null); /** * @param string @ldap_base_dn From 7466a219bd0ce19b003985839e50c4866063b288 Mon Sep 17 00:00:00 2001 From: Tristan <13280348+greenertux@users.noreply.github.com> Date: Mon, 5 Dec 2022 09:50:33 +0100 Subject: [PATCH 2/2] Change parameter order according to changes in LDAP function/interface --- oauth/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oauth/index.php b/oauth/index.php index 9a7e804..bcfb7c8 100644 --- a/oauth/index.php +++ b/oauth/index.php @@ -56,7 +56,7 @@ function messageShow($html_template, $message = 'No Msg') { // Check user credential on LDAP try{ - $authenticated = $ldap->checkLogin($user,$password,$ldap_search_attribute,$ldap_filter,$ldap_base_dn,$ldap_bind_dn,$ldap_bind_pass); + $authenticated = $ldap->checkLogin($user,$ldap_search_attribute,$ldap_base_dn,$ldap_bind_dn,$ldap_bind_pass,$password,$ldap_filter); } catch (Exception $e) {