diff options
Diffstat (limited to 'modules-available/sysconfig/addmodule_ldapauth.inc.php')
-rw-r--r-- | modules-available/sysconfig/addmodule_ldapauth.inc.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/modules-available/sysconfig/addmodule_ldapauth.inc.php b/modules-available/sysconfig/addmodule_ldapauth.inc.php index 62120b48..a193f779 100644 --- a/modules-available/sysconfig/addmodule_ldapauth.inc.php +++ b/modules-available/sysconfig/addmodule_ldapauth.inc.php @@ -9,7 +9,7 @@ class LdapAuth_Start extends AddModule_Base protected function renderInternal() { - $LDAPAUTH_COMMON_FIELDS = array('title', 'server', 'searchbase', 'binddn', 'bindpw', 'home', 'ssl', 'fixnumeric', 'certificate'); + $LDAPAUTH_COMMON_FIELDS = array('title', 'server', 'searchbase', 'binddn', 'bindpw', 'home', 'homeattr', 'ssl', 'fixnumeric', 'certificate', 'mapping'); $data = array(); if ($this->edit !== false) { moduleToArray($this->edit, $data, $LDAPAUTH_COMMON_FIELDS); @@ -23,7 +23,12 @@ class LdapAuth_Start extends AddModule_Base if (isset($data['server']) && preg_match('/^(.*)\:(636|389)$/', $data['server'], $out)) { $data['server'] = $out[1]; } + if (isset($data['homeattr']) && !isset($data['mapping']['homemount'])) { + $data['mapping']['homemount'] = $data['homeattr']; + } $data['step'] = 'LdapAuth_CheckConnection'; + $data['map_empty'] = true; + $data['mapping'] = ConfigModuleBaseLdap::getMapping(isset($data['mapping']) ? $data['mapping'] : false, $data['map_empty']); Render::addDialog(Dictionary::translateFile('config-module', 'ldapAuth_title'), false, 'ldap-start', $data); } @@ -77,7 +82,8 @@ class LdapAuth_CheckConnection extends AddModule_Base 'ssl' => Request::post('ssl'), 'fixnumeric' => Request::post('fixnumeric'), 'certificate' => Request::post('certificate', ''), - 'taskid' => $this->scanTask['id'] + 'taskid' => $this->scanTask['id'], + 'mapping' => ConfigModuleBaseLdap::getMapping(Request::post('mapping', false, 'array')), ); $data['prev'] = 'LdapAuth_Start'; $data['next'] = 'LdapAuth_CheckCredentials'; @@ -123,6 +129,7 @@ class LdapAuth_CheckCredentials extends AddModule_Base 'binddn' => $binddn, 'bindpw' => $bindpw, 'plainldap' => true, + 'mapping' => Request::post('mapping', false, 'array'), )); if (!isset($ldapSearch['id'])) { AddModule_Base::setStep('LdapAuth_Start'); // Continues with LdapAuth_Start for render() @@ -131,8 +138,6 @@ class LdapAuth_CheckCredentials extends AddModule_Base $this->taskIds = array( 'tm-search' => $ldapSearch['id'] ); - if (isset($selfSearch['id'])) - $this->taskIds['self-search'] = $selfSearch['id']; } protected function renderInternal() @@ -149,8 +154,9 @@ class LdapAuth_CheckCredentials extends AddModule_Base 'fixnumeric' => Request::post('fixnumeric'), 'fingerprint' => Request::post('fingerprint'), 'certificate' => Request::post('certificate', ''), + 'mapping' => ConfigModuleBaseLdap::getMapping(Request::post('mapping', false, 'array')), 'prev' => 'LdapAuth_Start', - 'next' => 'LdapAuth_HomeDir' + 'next' => 'LdapAuth_HomeDir', )) ); } @@ -184,14 +190,14 @@ class LdapAuth_HomeDir extends AddModule_Base 'binddn' => Request::post('binddn'), 'bindpw' => Request::post('bindpw'), 'home' => Request::post('home'), - 'homeattr' => Request::post('homeattr'), 'ssl' => Request::post('ssl') === 'on', 'fixnumeric' => Request::post('fixnumeric'), 'fingerprint' => Request::post('fingerprint'), 'certificate' => Request::post('certificate', ''), 'originalbinddn' => Request::post('originalbinddn'), + 'mapping' => ConfigModuleBaseLdap::getMapping(Request::post('mapping', false, 'array')), 'prev' => 'LdapAuth_Start', - 'next' => 'LdapAuth_Finish' + 'next' => 'LdapAuth_Finish', ); if ($this->edit !== false) { foreach (self::getAttributes() as $key) { @@ -249,6 +255,7 @@ class LdapAuth_Finish extends AddModule_Base $module->setData('home', Request::post('home')); $module->setData('certificate', Request::post('certificate')); $module->setData('ssl', $ssl); + $module->setData('mapping', Request::post('mapping', false, 'array')); $module->setData('fixnumeric', Request::post('fixnumeric', '', 'string')); foreach (LdapAuth_HomeDir::getAttributes() as $key) { $value = Request::post($key); |