Booked Scheduler Community Support
July 20, 2018, 04:34:00 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Booked is proud to recommend Shift Capsule in the employee shift scheduling space www.ShiftCapsule.com
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Setting prevent.clean.username isn't in option array inside LdapOptions class  (Read 58 times)
maluco-beleza
Newbie
*

Karma: 0
Posts: 1


« on: July 04, 2018, 12:47:38 PM »

The setting "prevent.clean.username" defined in the plugins/Authentication/Ldap/Ldap.config.php

Code:
$conf['settings']['prevent.clean.username'] = 'true';

is not being set to the private property $_options = array(); of the the LdapOptions class (plugins/Authentication/Ldap/LdapOptions.php).

So when the method CleanUsername() is called inside the Ldap class's method Validate($username, $password) (plugins/Authentication/Ldap/Ldap.php):
Code:
$username = $this->CleanUsername($username);

 the Username always is cleaned because the index $this->_options[LdapConfig::PREVENT_CLEAN_USERNAME] is null.

In order to fix it for me, I replaced the use of the $this->_options by $this->GetConfig:

Code:
public function CleanUsername()
    {
        $converter = new BooleanConverter();
        #REMOVED LINE: return !$converter->Convert($this->_options[LdapConfig::PREVENT_CLEAN_USERNAME]);
        return !$converter->Convert($this->GetConfig(LdapConfig::PREVENT_CLEAN_USERNAME));
    }

So now the setting prevent.clean.username is working fine.
I'm using Booked Scheduler v2.7.1.
« Last Edit: July 04, 2018, 12:49:42 PM by maluco-beleza » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!