summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/User/User.php
diff options
context:
space:
mode:
authorJuan Pablo Villafáñez <jvillafanez@solidgear.es>2017-03-17 12:56:27 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-03-29 13:32:16 +0200
commit3676189e05d3b51e3162c4410b30ea7268048c48 (patch)
treebfaa5d2b6ba4a04cb7d9ba2b8518b25505bec0e4 /apps/user_ldap/lib/User/User.php
parentebd1a7d4b2fca32edb9fd17ebfeaaa646cbbe495 (diff)
downloadnextcloud-server-3676189e05d3b51e3162c4410b30ea7268048c48.tar.gz
nextcloud-server-3676189e05d3b51e3162c4410b30ea7268048c48.zip
Add comments in the updateQuota method to explain the behavior
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib/User/User.php')
-rw-r--r--apps/user_ldap/lib/User/User.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index 392cb2e51ba..5d4af1fd09c 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -459,6 +459,20 @@ class User {
}
/**
+ * Overall process goes as follow:
+ * 1. fetch the quota from LDAP and check if it's parseable with the "verifyQuotaValue" function
+ * 2. if the value can't be fetched, is empty or not parseable, use the default LDAP quota
+ * 3. if the default LDAP quota can't be parsed, use the ownCloud's default quota (use 'default')
+ * 4. check if the target user exists and set the quota for the user.
+ *
+ * In order to improve performance and prevent an unwanted extra LDAP call, the $valueFromLDAP
+ * parameter can be passed with the value of the attribute. This value will be considered as the
+ * quota for the user coming from the LDAP server (step 1 of the process) It can be useful to
+ * fetch all the user's attributes in one call and use the fetched values in this function.
+ * The expected value for that parameter is a string describing the quota for the user. Valid
+ * values are 'none' (unlimited), 'default' (the ownCloud's default quota), '1234' (quota in
+ * bytes), '1234 MB' (quota in MB - check the \OC_Helper::computerFileSize method for more info)
+ *
* fetches the quota from LDAP and stores it as ownCloud user value
* @param string $valueFromLDAP the quota attribute's value can be passed,
* to save the readAttribute request