Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AD / LDAP Authentication
#2
in modules/Users/Users.php

Code:
public function doLogin($user_password) {
        $authType = GlobalVariable::getVariable('User_AuthenticationType', 'SQL');
        if ($this->is_admin) {
            $authType = 'SQL'; // admin users always login locally
        }

        $usr_name = $this->column_fields["user_name"];

        switch (strtoupper($authType)) {

$authType = GlobalVariable::getVariable('User_AuthenticationType', 'SQL');
Always returns the default value of 'SQL' because there is noone logged in yet.

If I hardcode $authType = 'AD'; I can log in successfully using Active Directory - YAY!

But, I lose ability to login as local admin because if ($this->is_admin) { does not work until after login!

So I ended up with :

Code:
public function doLogin($user_password) {
        $authType = "AD";
        $usr_name = strtolower($this->column_fields["user_name"]);

        if ($usr_name == 'admin') {
            $authType = 'SQL'; // admin users always login locally
        }

        switch (strtoupper($authType)) {

Currently I have Global variable 'User_AuthenticationType' set to 'LDAP', so that I can use the user import feature - which still does not work perfectly, I will look at that next...
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: 3 Guest(s)