summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-07-26 11:13:43 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-07-26 11:14:29 +0200
commita00cff7c0543a8860b839a0bf345478e99bc6c18 (patch)
treea4d256f02dca12026d021db1b46363157c5689da /apps/files_trashbin
parent96e175ffbf6f209274395309e5b55ed724c5c2da (diff)
downloadnextcloud-server-a00cff7c0543a8860b839a0bf345478e99bc6c18.tar.gz
nextcloud-server-a00cff7c0543a8860b839a0bf345478e99bc6c18.zip
disable "deleted files" button if trash bin is empty
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/trash.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index 50fdaccfb1e..cff97418fe4 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -868,5 +868,20 @@ class Trashbin {
//Listen to delete user signal
\OCP\Util::connectHook('OC_User', 'pre_deleteUser', "OCA\Files_Trashbin\Hooks", "deleteUser_hook");
}
+
+ /**
+ * @brief check if trash bin is empty for a given user
+ * @param string $user
+ */
+ public static function isEmpty($user) {
+
+ $trashSize = self::getTrashbinSize($user);
+
+ if ($trashSize !== false && $trashSize > 0) {
+ return false;
+ }
+
+ return true;
+ }
}