Skip to content

Commit

Permalink
Merge pull request #4228 from RestyaPlatform/issue/4227
Browse files Browse the repository at this point in the history
Fixes #4227: While trying to login as normal user with LDAP app enabled, PHP warning errors thrown issue fixed
  • Loading branch information
rrjanbiah authored Jan 13, 2021
2 parents e96d2e3 + 6098be3 commit c5068e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/php/R/r.php
Original file line number Diff line number Diff line change
Expand Up @@ -2753,13 +2753,13 @@ function r_post($r_resource_cmd, $r_resource_vars, $r_resource_filters, $r_post)
$where = 'LOWER(username)=LOWER($1)';
}
$log_user = executeQuery('SELECT id, role_id, password, is_ldap::boolean::int FROM users WHERE ' . $where, $val_arr);
if (is_plugin_enabled('r_ldap_login')) {
if (is_plugin_enabled('r_ldap_login') && (empty($log_user) || $log_user['is_ldap'] == 1)) {
require_once PLUGIN_PATH . DS . 'LdapLogin' . DS . 'functions.php';
$ldap_response = ldapUpdateUser($log_user, $r_post);
$ldap_error = $ldap_response['ldap_error'];
$user = $ldap_response['user'];
}
if (is_plugin_enabled('r_multiple_ldap_login')) {
if (is_plugin_enabled('r_multiple_ldap_login') && (empty($log_user) || $log_user['is_ldap'] == 1)) {
require_once PLUGIN_PATH . DS . 'MultipleLdapLogin' . DS . 'functions.php';
$ldap_response = ldapUpdateUser($log_user, $r_post);
$ldap_error = $ldap_response['ldap_error'];
Expand Down

0 comments on commit c5068e7

Please sign in to comment.