Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AD / LDAP Authentication
#3
thank you for catching this bug. I made this change:

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
Reply


Messages In This Thread
AD / LDAP Authentication - gaardam - 08-26-2019, 02:53 AM
RE: AD / LDAP Authentication - gaardam - 08-28-2019, 01:22 AM
RE: AD / LDAP Authentication - joebordes - 08-28-2019, 08:44 AM
RE: AD / LDAP Authentication - gaardam - 08-28-2019, 10:58 PM
RE: AD / LDAP Authentication - joebordes - 08-28-2019, 11:24 PM
RE: AD / LDAP Authentication - gaardam - 08-28-2019, 11:34 PM
RE: AD / LDAP Authentication - joebordes - 08-28-2019, 11:25 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)