NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

[Web] check if $iam_provider is null on ldap_mbox_login

f9304dcd
FreddleSpl0it <[email protected]> 1 year, 9 months ago
data/web/inc/functions.auth.inc.php | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Diff

diff --git a/data/web/inc/functions.auth.inc.php b/data/web/inc/functions.auth.inc.php
index 943bb164..a0424f3e 100644
--- a/data/web/inc/functions.auth.inc.php
+++ b/data/web/inc/functions.auth.inc.php
@@ -2,7 +2,7 @@
 function check_login($user, $pass, $app_passwd_data = false, $extra = null) {
   global $pdo;
   global $redis;
-  
+
   $is_internal = $extra['is_internal'];
   $role = $extra['role'];
 
@@ -194,7 +194,7 @@ function user_login($user, $pass, $extra = null){
       $result = ldap_mbox_login($user, $pass, $iam_settings, array('is_internal' => $is_internal, 'create' => true));
       if ($result !== false) return $result;
     }
-  } 
+  }
   if ($row['active'] != 1) {
     return false;
   }
@@ -313,7 +313,7 @@ function user_login($user, $pass, $extra = null){
       }
     break;
   }
- 
+
   return false;
 }
 function apppass_login($user, $pass, $app_passwd_data, $extra = null){
@@ -364,7 +364,7 @@ function apppass_login($user, $pass, $app_passwd_data, $extra = null){
     ':user' => $user,
   ));
   $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
-  
+
   foreach ($rows as $row) {
     if ($protocol && $row[$protocol . '_access'] != '1'){
       continue;
@@ -476,7 +476,7 @@ function keycloak_mbox_login_rest($user, $pass, $iam_settings, $extra = null){
 }
 function ldap_mbox_login($user, $pass, $iam_settings, $extra = null){
   global $pdo;
-  
+
   $iam_provider = identity_provider();
   $is_internal = $extra['is_internal'];
   $create = $extra['create'];
@@ -491,6 +491,9 @@ function ldap_mbox_login($user, $pass, $iam_settings, $extra = null){
     }
     return false;
   }
+  if (!$iam_provider) {
+    return false;
+  }
 
   try {
     $ldap_query = $iam_provider->query();