From 0c4fd6b007ee7ab4ee67d02622cb9c7c440a9b19 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Thu, 23 Nov 2023 09:43:11 +0100
Subject: [PATCH] update user authenticate()

---
 public_html/deployment/classes/user.class.php | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/public_html/deployment/classes/user.class.php b/public_html/deployment/classes/user.class.php
index 33ac0c66..187bbdd5 100644
--- a/public_html/deployment/classes/user.class.php
+++ b/public_html/deployment/classes/user.class.php
@@ -145,7 +145,6 @@ class user {
      */
     public function authenticate(){
         global $aConfig, $aParams;
-        //print_r($aConfig);
         if(!isset($aConfig['auth']) || !is_array($aConfig['auth']) || !count($aConfig['auth']) || !isset($aParams['user'])){
             return false;
         }
@@ -173,6 +172,10 @@ class user {
                 $this->setUser($sUser);
                 return true;
             }
+            // if authentication fails then continue and try next method
+            if(!$oUserAuth){
+                echo "DEBUG: ERROR oUserAuth waasn't initialized for [$sAuthMethod].<br>";
+            }
         }
         return false;
     }
@@ -241,14 +244,14 @@ class user {
     }
     /**
      * get a flat array with roles of the current user
-     * @return string
+     * @return array
      */
     public function getUserGroups(){
         return $this->_aUserGroups;
     }
     /**
      * get a flat array with roles of the current user
-     * @return string
+     * @return array
      */
     public function getUserPermission(){
         return $this->_aUserPermmissions;
-- 
GitLab