diff options
author | Simon Rettberg | 2014-05-19 15:30:59 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-05-19 15:30:59 +0200 |
commit | f6ceaa03052e6878afd53a4bbb7f4429849fe25a (patch) | |
tree | 9f5582c8c275494728f6d6dcf656479714688934 /modules/sysconfig/addmodule_ad.inc.php | |
parent | Working on config.tgz composition through config modules (diff) | |
download | slx-admin-f6ceaa03052e6878afd53a4bbb7f4429849fe25a.tar.gz slx-admin-f6ceaa03052e6878afd53a4bbb7f4429849fe25a.tar.xz slx-admin-f6ceaa03052e6878afd53a4bbb7f4429849fe25a.zip |
OO style modules
Diffstat (limited to 'modules/sysconfig/addmodule_ad.inc.php')
-rw-r--r-- | modules/sysconfig/addmodule_ad.inc.php | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/modules/sysconfig/addmodule_ad.inc.php b/modules/sysconfig/addmodule_ad.inc.php new file mode 100644 index 00000000..abc55df5 --- /dev/null +++ b/modules/sysconfig/addmodule_ad.inc.php @@ -0,0 +1,57 @@ +<?php + +/* + * Wizard for setting up active directory integration for authentication. + */ + +AddModule_Base::addModule('active_directory', 'AdModule_Start', 'Active Directory Authentifizierung', + 'Mit diesem Modul ist die Anmeldung an den Client PCs mit den Benutzerkonten eines Active Directory' + . ' möglich. Je nach Konfiguration ist auch die Nutzung eines Benutzerverzeichnisses auf dem Client möglich.' +); + +class AdModule_Start extends AddModule_Base +{ + + protected function renderInternal() + { + Session::set('ad_stuff', false); + Render::addDialog('Active Directory Authentifizierung', false, 'sysconfig/ad-start', array( + 'step' => 'AdModule_CheckConnection', + 'server' => Request::post('server'), + 'searchbase' => Request::post('searchbase'), + 'binddn' => Request::post('binddn'), + 'bindpw' => Request::post('bindpw'), + )); + } + +} + +class AdModule_CheckConnection extends AddModule_Base +{ + + private $taskId = false; + + protected function preprocessInternal() + { + $server = Request::post('server'); + $searchbase = Request::post('searchbase'); + $binddn = Request::post('binddn'); + $bindpw = Request::post('bindpw'); + if (empty($server) || empty($searchbase) || empty($binddn)) { + Message::addError('empty-field'); + AddModule_Base::setStep('AdModule_Start'); + return; + } + $this->taskId = 'ad_' . mt_rand() . '-' . microtime(true); + Taskmanager::submit('LdapSearch', array( + 'id' => $this->taskId, + 'uri' => '' + ), true); + } + + protected function renderInternal() + { + Message::addInfo('missing-file'); + } + +}
\ No newline at end of file |