summaryrefslogtreecommitdiffstats
path: root/inc/configmodule/adauth.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/configmodule/adauth.inc.php')
-rw-r--r--inc/configmodule/adauth.inc.php74
1 files changed, 0 insertions, 74 deletions
diff --git a/inc/configmodule/adauth.inc.php b/inc/configmodule/adauth.inc.php
deleted file mode 100644
index efc8afd7..00000000
--- a/inc/configmodule/adauth.inc.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-
-ConfigModule::registerModule(
- 'AdAuth', // ID
- Dictionary::translate('config-module', 'adAuth_title'), // Title
- Dictionary::translate('config-module', 'adAuth_description'), // Description
- Dictionary::translate('config-module', 'group_authentication'), // Group
- true // Only one per config?
-);
-
-class ConfigModule_AdAuth extends ConfigModule
-{
-
- const VERSION = 1;
-
- private static $REQUIRED_FIELDS = array('server', 'searchbase', 'binddn');
- private static $OPTIONAL_FIELDS = array('bindpw', 'home', 'ssl', 'fingerprint', 'certificate', 'homeattr');
-
- protected function generateInternal($tgz, $parent)
- {
- Trigger::ldadp($this->id(), $parent);
- $config = $this->moduleData;
- if (isset($config['certificate']) && !is_string($config['certificate'])) {
- unset($config['certificate']);
- }
- if (preg_match('/^([^\:]+)\:(\d+)$/', $config['server'], $out)) {
- $config['server'] = $out[1];
- $config['adport'] = $out[2];
- } else {
- if (isset($config['certificate'])) {
- $config['adport'] = 636;
- } else {
- $config['adport'] = 389;
- }
- }
- $config['parentTask'] = $parent;
- $config['failOnParentFail'] = false;
- $config['proxyip'] = Property::getServerIp();
- $config['proxyport'] = 3100 + $this->id();
- $config['filename'] = $tgz;
- $config['moduleid'] = $this->id();
- return Taskmanager::submit('CreateLdapConfig', $config);
- }
-
- protected function moduleVersion()
- {
- return self::VERSION;
- }
-
- protected function validateConfig()
- {
- // Check if required fields are filled
- return Util::hasAllKeys($this->moduleData, self::$REQUIRED_FIELDS);
- }
-
- public function setData($key, $value)
- {
- if (!in_array($key, self::$REQUIRED_FIELDS) && !in_array($key, self::$OPTIONAL_FIELDS))
- return false;
- $this->moduleData[$key] = $value;
- return true;
- }
-
- // ############## Callbacks #############################
-
- /**
- * Server IP changed - rebuild all AD modules.
- */
- public function event_serverIpChanged()
- {
- $this->generate(false);
- }
-
-}