When querying the free space through user management APIs, don't use the
cached quota value. The latter is only there to accelerate PROPFINDs.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Change the quota to int from float, since the quota is a number of bits
and a bits can not be splitted.
Fix #34010
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Move findBinaryFinder and isFunctionEnabled away from OC_Helper
findBinaryFinder is now a service that is still private but with some
minor optimization (remove the hasKey check).
isFunctionEnabled is now in OCP\Util
Both function are still keep but all internal usage in nextcloud/server
were migrated to the new usage, so that we can remove it in 26
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
don't unjail the path when getting the storage info
the original reason for adding it no longer exist.
This was added with #30985 since then the share source storage was also used, however this was changed with #32076
Signed-off-by: Robin Appelman <robin@icewind.nl>
Use the unjailed-path in OC_Helper::getStorageInfo() for files located in SharedStorage.
The current implementation already switches the storage-backend to
$storage->getSourceStorage(). However, it then calls
$rootInfo->getInternalPath() which returns the internal path relative to
the storage where the share is mounted. This is wrong, we need also to
unjail the path. Compare, e.g., with
OCA\Files_Sharing\SharedStorage::file_get/put_contents() for the
"logic".
Signed-off-by: Claus-Justus Heine <himself@claus-justus-heine.de>
Set up FS before querying storage info in settings
The personal info section of the personal settings is querying the
storage quota information. For this it requires the FS to be setup which
is not always guaranteed.
This fixes an issue where refreshing the settings page would cause it to
fail after Redis caches are full. It is likely that when Redis cache is
populated, some code path is initializing the FS, so it works so far.
But when the cache is populated, that code path is skipped so the FS is
not guaranteed to be setup...
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
show better quota warning for group folders and external storage
instead of showing the generic 'Your storage is full' message, better explain that it's the group folder/external storage that is full
Signed-off-by: Robin Appelman <robin@icewind.nl>
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.
This also removes and empty lines from method/function bodies at the
beginning and end.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Dont always use the current users quota when calculating storage info
instead pass the quota as parameter.
Without this fix, when 'quota_include_external_storage' is enabled, the
webui will show the quota configured for the admin for every user
instead of the users quota
Signed-off-by: Robin Appelman <robin@icewind.nl>