summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/user_ldap.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-03-28 12:18:24 +0100
committerArthur Schiwon <blizzz@owncloud.com>2014-03-28 12:18:24 +0100
commit7dd34b12126483a24ef6370b23ec9e87cc988c8c (patch)
tree5c3a374b99bd4a96b5b0c97bf44f8e64938031c7 /apps/user_ldap/user_ldap.php
parent24274acd6a236152d97e2b74346efd4b5bedd037 (diff)
downloadnextcloud-server-7dd34b12126483a24ef6370b23ec9e87cc988c8c.tar.gz
nextcloud-server-7dd34b12126483a24ef6370b23ec9e87cc988c8c.zip
LDAP: Read email and quota when mapping user, fixes #7785
Diffstat (limited to 'apps/user_ldap/user_ldap.php')
-rw-r--r--apps/user_ldap/user_ldap.php35
1 files changed, 2 insertions, 33 deletions
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index c993a1de4aa..f2353dfa0db 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -31,42 +31,11 @@ use OCA\user_ldap\lib\BackendUtility;
class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
private function updateQuota($dn) {
- $quota = null;
- $quotaDefault = $this->access->connection->ldapQuotaDefault;
- $quotaAttribute = $this->access->connection->ldapQuotaAttribute;
- if(!empty($quotaDefault)) {
- $quota = $quotaDefault;
- }
- if(!empty($quotaAttribute)) {
- $aQuota = $this->access->readAttribute($dn, $quotaAttribute);
-
- if($aQuota && (count($aQuota) > 0)) {
- $quota = $aQuota[0];
- }
- }
- if(!is_null($quota)) {
- \OCP\Config::setUserValue( $this->access->dn2username($dn),
- 'files',
- 'quota',
- \OCP\Util::computerFileSize($quota));
- }
+ $this->access->updateQuota($dn);
}
private function updateEmail($dn) {
- $email = null;
- $emailAttribute = $this->access->connection->ldapEmailAttribute;
- if(!empty($emailAttribute)) {
- $aEmail = $this->access->readAttribute($dn, $emailAttribute);
- if($aEmail && (count($aEmail) > 0)) {
- $email = $aEmail[0];
- }
- if(!is_null($email)) {
- \OCP\Config::setUserValue( $this->access->dn2username($dn),
- 'settings',
- 'email',
- $email);
- }
- }
+ $this->access->updateEmail($dn);
}
/**