08-28-2019, 08:44 AM
thank you for catching this bug. I made this change:
can you validate it works before I commit it?
I would also invite you to join the corebos gitter channel, there is at least one user there who has LDAP working so you can discuss the changes he made.
I will try to help all I can.
Code:
diff --git a/modules/Users/Users.php b/modules/Users/Users.php
index dad64c4c2..6b65a9e73 100644
--- a/modules/Users/Users.php
+++ b/modules/Users/Users.php
@@ -280,7 +280,14 @@ class Users extends CRMEntity {
* @return true if the user is authenticated, false otherwise
*/
public function doLogin($user_password) {
- $authType = GlobalVariable::getVariable('User_AuthenticationType', 'SQL');
+ $result = $this->db->pquery('select id from vtiger_users where user_name=?', array($this->column_fields['user_name']));
+ if ($result && $this->db->num_rows($result)==1) {
+ $row = $this->db->fetchByAssoc($result);
+ $userid = $row['id'];
+ } else {
+ return false;
+ }
+ $authType = GlobalVariable::getVariable('User_AuthenticationType', 'SQL', 'Users', $userid);
if ($this->is_admin) {
$authType = 'SQL'; // admin users always login locally
}
can you validate it works before I commit it?
I would also invite you to join the corebos gitter channel, there is at least one user there who has LDAP working so you can discuss the changes he made.
I will try to help all I can.
Joe
TSolucio
TSolucio