From 05ed28bbcbe9abe242c19fc7088cfd383db52588 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 18 Sep 2015 16:59:23 +0200 Subject: [ldap/ad] Figure out proper spelling of search base --- modules/sysconfig/addmodule_ldapauth.inc.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'modules/sysconfig/addmodule_ldapauth.inc.php') diff --git a/modules/sysconfig/addmodule_ldapauth.inc.php b/modules/sysconfig/addmodule_ldapauth.inc.php index d00ff41c..44dbcca1 100644 --- a/modules/sysconfig/addmodule_ldapauth.inc.php +++ b/modules/sysconfig/addmodule_ldapauth.inc.php @@ -80,8 +80,8 @@ class LdapAuth_CheckConnection extends AddModule_Base 'edit' => Request::post('edit'), 'title' => Request::post('title'), 'server' => $this->server, - 'searchbase' => Request::post('searchbase'), - 'binddn' => Request::post('binddn'), + 'searchbase' => Util::normalizeDn(Request::post('searchbase')), + 'binddn' => Util::normalizeDn(Request::post('binddn')), 'bindpw' => Request::post('bindpw'), 'home' => Request::post('home'), 'ssl' => Request::post('ssl'), @@ -177,6 +177,13 @@ class LdapAuth_Finish extends AddModule_Base $module = ConfigModule::getInstance('LdapAuth'); else $module = $this->edit; + $somedn = Request::post('somedn', false); + if (!empty($somedn)) { + $i = stripos($somedn, $searchbase); + if ($i !== false) { + $searchbase = substr($somedn, $i, strlen($searchbase)); + } + } $ssl = Request::post('ssl', 'off') === 'on'; $module->setData('server', Request::post('server')); $module->setData('searchbase', $searchbase); -- cgit v1.2.3-55-g7522