summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-03-16 17:19:59 +0100
committerAndreas Gohr <andi@splitbrain.org>2015-03-16 17:19:59 +0100
commit43d45fd5a6522de02938136a7120874bd4abada8 (patch)
tree1058f5cd717461762f1eda842e58d4173404864e /lib
parentf39cc3cb7ee042e2e3fde60dae4335da1d9a8c2d (diff)
parent84f66e9f97ebf4d78ffaaad7a0b44f5c0180bfc9 (diff)
downloadrpg-43d45fd5a6522de02938136a7120874bd4abada8.tar.gz
rpg-43d45fd5a6522de02938136a7120874bd4abada8.tar.bz2
Merge pull request #1073 from sklrrzn/master
Add two config options to authldap
Diffstat (limited to 'lib')
-rw-r--r--lib/plugins/authldap/auth.php5
-rw-r--r--lib/plugins/authldap/conf/default.php4
-rw-r--r--lib/plugins/authldap/conf/metadata.php4
-rw-r--r--lib/plugins/authldap/lang/de/settings.php2
-rw-r--r--lib/plugins/authldap/lang/en/settings.php2
5 files changed, 13 insertions, 4 deletions
diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php
index 50735882f..9d031c049 100644
--- a/lib/plugins/authldap/auth.php
+++ b/lib/plugins/authldap/auth.php
@@ -37,7 +37,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
}
// Add the capabilities to change the password
- $this->cando['modPass'] = true;
+ $this->cando['modPass'] = $this->getConf('modPass');
}
/**
@@ -360,8 +360,9 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
$sr = ldap_search($this->con, $this->getConf('usertree'), $all_filter);
$entries = ldap_get_entries($this->con, $sr);
$users_array = array();
+ $userkey = $this->getConf('userkey');
for($i = 0; $i < $entries["count"]; $i++) {
- array_push($users_array, $entries[$i]["uid"][0]);
+ array_push($users_array, $entries[$i][$userkey][0]);
}
asort($users_array);
$result = $users_array;
diff --git a/lib/plugins/authldap/conf/default.php b/lib/plugins/authldap/conf/default.php
index c2e462c5c..116cb9d3f 100644
--- a/lib/plugins/authldap/conf/default.php
+++ b/lib/plugins/authldap/conf/default.php
@@ -16,5 +16,7 @@ $conf['bindpw'] = '';
//$conf['mapping']['grps'] unsupported in config manager
$conf['userscope'] = 'sub';
$conf['groupscope'] = 'sub';
+$conf['userkey'] = 'uid';
$conf['groupkey'] = 'cn';
-$conf['debug'] = 0; \ No newline at end of file
+$conf['debug'] = 0;
+$conf['modPass'] = 1;
diff --git a/lib/plugins/authldap/conf/metadata.php b/lib/plugins/authldap/conf/metadata.php
index 4649ba5bf..a67b11ca6 100644
--- a/lib/plugins/authldap/conf/metadata.php
+++ b/lib/plugins/authldap/conf/metadata.php
@@ -15,5 +15,7 @@ $meta['bindpw'] = array('password','_caution' => 'danger');
//$meta['mapping']['grps'] unsupported in config manager
$meta['userscope'] = array('multichoice','_choices' => array('sub','one','base'),'_caution' => 'danger');
$meta['groupscope'] = array('multichoice','_choices' => array('sub','one','base'),'_caution' => 'danger');
+$meta['userkey'] = array('string','_caution' => 'danger');
$meta['groupkey'] = array('string','_caution' => 'danger');
-$meta['debug'] = array('onoff','_caution' => 'security'); \ No newline at end of file
+$meta['debug'] = array('onoff','_caution' => 'security');
+$meta['modPass'] = array('onoff');
diff --git a/lib/plugins/authldap/lang/de/settings.php b/lib/plugins/authldap/lang/de/settings.php
index d788da876..933189c40 100644
--- a/lib/plugins/authldap/lang/de/settings.php
+++ b/lib/plugins/authldap/lang/de/settings.php
@@ -20,7 +20,9 @@ $lang['binddn'] = 'DN eines optionalen Benutzers, wenn der anonym
$lang['bindpw'] = 'Passwort des angegebenen Benutzers.';
$lang['userscope'] = 'Die Suchweite nach Benutzeraccounts.';
$lang['groupscope'] = 'Die Suchweite nach Benutzergruppen.';
+$lang['userkey'] = 'Attribut, das den Benutzernamen enthält; muss konsistent zum userfilter sein.';
$lang['groupkey'] = 'Gruppieren der Benutzeraccounts anhand eines beliebigen Benutzerattributes z. B. Telefonnummer oder Abteilung, anstelle der Standard-Gruppen).';
+$lang['modPass'] = 'Darf über Dokuwiki das LDAP-Passwort geändert werden?';
$lang['debug'] = 'Debug-Informationen beim Auftreten von Fehlern anzeigen?';
$lang['deref_o_0'] = 'LDAP_DEREF_NEVER';
$lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING';
diff --git a/lib/plugins/authldap/lang/en/settings.php b/lib/plugins/authldap/lang/en/settings.php
index 951901ccc..a4194b00a 100644
--- a/lib/plugins/authldap/lang/en/settings.php
+++ b/lib/plugins/authldap/lang/en/settings.php
@@ -13,7 +13,9 @@ $lang['binddn'] = 'DN of an optional bind user if anonymous bind is not suf
$lang['bindpw'] = 'Password of above user';
$lang['userscope'] = 'Limit search scope for user search';
$lang['groupscope'] = 'Limit search scope for group search';
+$lang['userkey'] = 'Attribute denoting the username; must be consistent to userfilter.';
$lang['groupkey'] = 'Group membership from any user attribute (instead of standard AD groups) e.g. group from department or telephone number';
+$lang['modPass'] = 'Can the LDAP password be changed via dokuwiki?';
$lang['debug'] = 'Display additional debug information on errors';