summaryrefslogtreecommitdiff
path: root/lib/plugins/authad/auth.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-03-05 15:39:18 +0100
committerAndreas Gohr <andi@splitbrain.org>2014-03-05 15:39:18 +0100
commitd2fb55d55ccad0166f2443389f52f6c01bb32667 (patch)
treecdc0aa791eae408e0ad40959fcfeb52edda089cf /lib/plugins/authad/auth.php
parent1b876e64690e8bbbdc1eb747d2d29bc19803e745 (diff)
parent85db969ec27b3f6e656d04a114174a630be90d4c (diff)
downloadrpg-d2fb55d55ccad0166f2443389f52f6c01bb32667.tar.gz
rpg-d2fb55d55ccad0166f2443389f52f6c01bb32667.tar.bz2
Merge pull request #541 from splitbrain/multidomainad
Show a domain dropdown when multiple AD domains are configured
Diffstat (limited to 'lib/plugins/authad/auth.php')
-rw-r--r--lib/plugins/authad/auth.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php
index a0fec7b52..0860e5756 100644
--- a/lib/plugins/authad/auth.php
+++ b/lib/plugins/authad/auth.php
@@ -512,6 +512,31 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin {
}
/**
+ * Returns a list of configured domains
+ *
+ * The default domain has an empty string as key
+ *
+ * @return array associative array(key => domain)
+ */
+ public function _getConfiguredDomains() {
+ $domains = array();
+ if(empty($this->conf['account_suffix'])) return $domains; // not configured yet
+
+ // add default domain, using the name from account suffix
+ $domains[''] = ltrim($this->conf['account_suffix'], '@');
+
+ // find additional domains
+ foreach($this->conf as $key => $val) {
+ if(is_array($val) && isset($val['account_suffix'])) {
+ $domains[$key] = ltrim($val['account_suffix'], '@');
+ }
+ }
+ ksort($domains);
+
+ return $domains;
+ }
+
+ /**
* Check provided user and userinfo for matching patterns
*
* The patterns are set up with $this->_constructPattern()