1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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');
}
}
|