summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/settings.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-08-28 14:24:31 +0200
committerArthur Schiwon <blizzz@owncloud.com>2012-08-28 14:24:50 +0200
commit42a996930481783af1a5a3fbbae18dc1201fbb0b (patch)
tree87198f8d4e39e89610d97f7396b70fe27f5c6156 /apps/user_ldap/settings.php
parent549f69cbc1aafa13be6f011554ee82d26d814e52 (diff)
downloadnextcloud-server-42a996930481783af1a5a3fbbae18dc1201fbb0b.tar.gz
nextcloud-server-42a996930481783af1a5a3fbbae18dc1201fbb0b.zip
LDAP: implement getHome() function, use either username (default) or specify an LDAP attribute value to use
Diffstat (limited to 'apps/user_ldap/settings.php')
-rw-r--r--apps/user_ldap/settings.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php
index 39aa3296265..23018890eac 100644
--- a/apps/user_ldap/settings.php
+++ b/apps/user_ldap/settings.php
@@ -20,7 +20,7 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
-$params = array('ldap_host', 'ldap_port', 'ldap_dn', 'ldap_agent_password', 'ldap_base', 'ldap_base_users', 'ldap_base_groups', 'ldap_userlist_filter', 'ldap_login_filter', 'ldap_group_filter', 'ldap_display_name', 'ldap_group_display_name', 'ldap_tls', 'ldap_turn_off_cert_check', 'ldap_nocase', 'ldap_quota_def', 'ldap_quota_attr', 'ldap_email_attr', 'ldap_group_member_assoc_attribute', 'ldap_cache_ttl');
+$params = array('ldap_host', 'ldap_port', 'ldap_dn', 'ldap_agent_password', 'ldap_base', 'ldap_base_users', 'ldap_base_groups', 'ldap_userlist_filter', 'ldap_login_filter', 'ldap_group_filter', 'ldap_display_name', 'ldap_group_display_name', 'ldap_tls', 'ldap_turn_off_cert_check', 'ldap_nocase', 'ldap_quota_def', 'ldap_quota_attr', 'ldap_email_attr', 'ldap_group_member_assoc_attribute', 'ldap_cache_ttl', 'home_folder_naming_rule');
OCP\Util::addscript('user_ldap', 'settings');
OCP\Util::addstyle('user_ldap', 'settings');
@@ -36,6 +36,9 @@ if ($_POST) {
$ldap->clearCache();
OCP\Config::setAppValue('user_ldap', $param, $_POST[$param]);
}
+ } elseif('home_folder_naming_rule' == $param) {
+ $value = empty($_POST[$param]) ? 'opt:username' : 'attr:'.$_POST[$param];
+ OCP\Config::setAppValue('user_ldap', $param, $value);
} else {
OCP\Config::setAppValue('user_ldap', $param, $_POST[$param]);
}
@@ -67,5 +70,8 @@ $tmpl->assign( 'ldap_group_display_name', OCP\Config::getAppValue('user_ldap', '
$tmpl->assign( 'ldap_group_member_assoc_attribute', OCP\Config::getAppValue('user_ldap', 'ldap_group_member_assoc_attribute', 'uniqueMember'));
$tmpl->assign( 'ldap_agent_password', base64_decode(OCP\Config::getAppValue('user_ldap', 'ldap_agent_password')));
$tmpl->assign( 'ldap_cache_ttl', OCP\Config::getAppValue('user_ldap', 'ldap_cache_ttl', '600'));
+$hfnr = OCP\Config::getAppValue('user_ldap', 'home_folder_naming_rule', 'opt:username');
+$hfnr = ($hfnr == 'opt:username') ? '' : substr($hfnr, strlen('attr:'));
+$tmpl->assign( 'home_folder_naming_rule', $hfnr, '');
return $tmpl->fetchPage();