summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--inc/configmodule/adauth.inc.php4
-rw-r--r--modules/sysconfig/addmodule_adauth.inc.php18
-rw-r--r--templates/sysconfig/ad-checkcredentials.html1
3 files changed, 17 insertions, 6 deletions
diff --git a/inc/configmodule/adauth.inc.php b/inc/configmodule/adauth.inc.php
index 998dcea1..64937aa8 100644
--- a/inc/configmodule/adauth.inc.php
+++ b/inc/configmodule/adauth.inc.php
@@ -20,6 +20,10 @@ class ConfigModule_AdAuth extends ConfigModule
{
Trigger::ldadp($this->id(), $parent);
$config = $this->moduleData;
+ if (preg_match('/^([^\:]+)\:(\d+)$/', $config['server'], $out)) {
+ $config['server'] = $out[1];
+ $config['adport'] = $out[2];
+ }
$config['parentTask'] = $parent;
$config['failOnParentFail'] = false;
$config['proxyip'] = Property::getServerIp();
diff --git a/modules/sysconfig/addmodule_adauth.inc.php b/modules/sysconfig/addmodule_adauth.inc.php
index f293c2e4..c9b42ee5 100644
--- a/modules/sysconfig/addmodule_adauth.inc.php
+++ b/modules/sysconfig/addmodule_adauth.inc.php
@@ -41,27 +41,28 @@ class AdAuth_CheckConnection extends AddModule_Base
{
private $scanTask;
+ private $server;
protected function preprocessInternal()
{
- $server = Request::post('server');
+ $this->server = Request::post('server');
$binddn = Request::post('binddn');
$ssl = Request::post('ssl', 'off') === 'on';
- if (empty($server) || empty($binddn)) {
+ if (empty($this->server) || empty($binddn)) {
Message::addError('empty-field');
AddModule_Base::setStep('AdAuth_Start'); // Continues with AdAuth_Start for render()
return;
}
- if (preg_match('/^([^\:]+)\:(\d+)$/', $server, $out)) {
+ if (preg_match('/^([^\:]+)\:(\d+)$/', $this->server, $out)) {
$ports = array($out[2]);
- $server = $out[1];
+ $this->server = $out[1];
} elseif ($ssl) {
$ports = array(636, 3269);
} else {
$ports = array(389, 3268);
}
$this->scanTask = Taskmanager::submit('PortScan', array(
- 'host' => $server,
+ 'host' => $this->server,
'ports' => $ports
));
if (!isset($this->scanTask['id'])) {
@@ -75,7 +76,7 @@ class AdAuth_CheckConnection extends AddModule_Base
$data = array(
'edit' => Request::post('edit'),
'title' => Request::post('title'),
- 'server' => Request::post('server'),
+ 'server' => $this->server,
'searchbase' => Request::post('searchbase'),
'binddn' => Request::post('binddn'),
'bindpw' => Request::post('bindpw'),
@@ -103,6 +104,11 @@ class AdAuth_CheckCredentials extends AddModule_Base
$binddn = Request::post('binddn');
$bindpw = Request::post('bindpw');
$ssl = Request::post('ssl', 'off') === 'on';
+ if ($ssl && !Request::post('fingerprint')) {
+ Message::addError('error-read', 'fingerprint');
+ AddModule_Base::setStep('AdAuth_Start'); // Continues with AdAuth_Start for render()
+ return;
+ }
if (empty($server) || empty($binddn) || empty($port)) {
Message::addError('empty-field');
AddModule_Base::setStep('AdAuth_Start'); // Continues with AdAuth_Start for render()
diff --git a/templates/sysconfig/ad-checkcredentials.html b/templates/sysconfig/ad-checkcredentials.html
index e8b472c1..e1d15678 100644
--- a/templates/sysconfig/ad-checkcredentials.html
+++ b/templates/sysconfig/ad-checkcredentials.html
@@ -35,6 +35,7 @@
{{#ssl}}
<input name="ssl" value="on" type="hidden">
{{/ssl}}
+ <input name="fingerprint" value="{{fingerprint}}" type="hidden">
<input name="originalbinddn" value="{{binddn}}" type="hidden">
<button id="nextbutton" type="submit" class="btn btn-primary" style="display:none">{{lang_skip}} &raquo;</button>
</form>