diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-07-26 11:13:43 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-07-26 11:14:29 +0200 |
commit | a00cff7c0543a8860b839a0bf345478e99bc6c18 (patch) | |
tree | a4d256f02dca12026d021db1b46363157c5689da /apps/files_trashbin/lib | |
parent | 96e175ffbf6f209274395309e5b55ed724c5c2da (diff) | |
download | nextcloud-server-a00cff7c0543a8860b839a0bf345478e99bc6c18.tar.gz nextcloud-server-a00cff7c0543a8860b839a0bf345478e99bc6c18.zip |
disable "deleted files" button if trash bin is empty
Diffstat (limited to 'apps/files_trashbin/lib')
-rw-r--r-- | apps/files_trashbin/lib/trash.php | 15 |
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; + } } |