LDAP: set also quota, when there is no explicit default value

This commit is contained in:
Arthur Schiwon 2012-03-01 14:31:06 +01:00
parent b192f86d84
commit fa6ad6ba68
1 changed files with 6 additions and 2 deletions

View File

@ -81,7 +81,11 @@ class OC_USER_LDAP extends OC_User_Backend {
if( !$this->ldap_dc )
return false;
$quota = $this->ldap_dc[strtolower($this->ldap_quota_attr)][0];
if(!empty($this->ldap_quota_attr)) {
$quota = $this->ldap_dc[strtolower($this->ldap_quota_attr)][0];
} else {
$quota = false;
}
$quota = $quota != -1 ? $quota : $this->ldap_quota_def;
OC_Preferences::setValue($uid, 'files', 'quota', OC_Helper::computerFileSize($quota));
}
@ -154,7 +158,7 @@ class OC_USER_LDAP extends OC_User_Backend {
return false;
}
if(!empty($this->ldap_quota_attr) && !empty($this->ldap_quota_def)) {
if(!empty($this->ldap_quota_attr) || !empty($this->ldap_quota_def)) {
$this->setQuota($uid);
}