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_adauth.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'modules/sysconfig/addmodule_adauth.inc.php') diff --git a/modules/sysconfig/addmodule_adauth.inc.php b/modules/sysconfig/addmodule_adauth.inc.php index 1b04eab0..251ee5d6 100644 --- a/modules/sysconfig/addmodule_adauth.inc.php +++ b/modules/sysconfig/addmodule_adauth.inc.php @@ -80,8 +80,8 @@ class AdAuth_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'), @@ -206,6 +206,14 @@ class AdAuth_Finish extends AddModule_Base if ($i === false) $i = -1; $searchbase = mb_substr($binddn, $i + 1); + } else { + $somedn = Request::post('somedn', false); + if (!empty($somedn)) { + $i = stripos($somedn, $searchbase); + if ($i !== false) { + $searchbase = substr($somedn, $i, strlen($searchbase)); + } + } } $title = Request::post('title'); if (empty($title)) -- cgit v1.2.3-55-g7522