summaryrefslogtreecommitdiffstats
path: root/modules/sysconfig/addmodule_ldapauth.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2015-09-18 16:59:23 +0200
committerSimon Rettberg2015-09-18 16:59:23 +0200
commit05ed28bbcbe9abe242c19fc7088cfd383db52588 (patch)
tree1ff589012cc5d58a9d98957ce8486ceefd7da6f3 /modules/sysconfig/addmodule_ldapauth.inc.php
parentChange some wording, add deletion reminder to main page (diff)
downloadslx-admin-05ed28bbcbe9abe242c19fc7088cfd383db52588.tar.gz
slx-admin-05ed28bbcbe9abe242c19fc7088cfd383db52588.tar.xz
slx-admin-05ed28bbcbe9abe242c19fc7088cfd383db52588.zip
[ldap/ad] Figure out proper spelling of search base
Diffstat (limited to 'modules/sysconfig/addmodule_ldapauth.inc.php')
-rw-r--r--modules/sysconfig/addmodule_ldapauth.inc.php11
1 files changed, 9 insertions, 2 deletions
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);