Booked Scheduler Community Support
December 14, 2018, 09:16:07 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
   Home   Help Login Register  
Pages: [1]
Author Topic: Setting prevent.clean.username isn't in option array inside LdapOptions class  (Read 425 times)

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

$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):
$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:

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]
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!