summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-12-02 11:39:53 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2013-12-02 11:50:55 +0100
commit8ce3ea3e2c0fba2073cc9f279ab14f9d2bdbfdc4 (patch)
tree355788276794ca5ff7555f1c323fe26dc82449aa /apps/files_trashbin/lib
parent71589e65d24657a6d61fc22b3c67d5a1f5b1404a (diff)
downloadnextcloud-server-8ce3ea3e2c0fba2073cc9f279ab14f9d2bdbfdc4.tar.gz
nextcloud-server-8ce3ea3e2c0fba2073cc9f279ab14f9d2bdbfdc4.zip
fix delete files from trash bin
Diffstat (limited to 'apps/files_trashbin/lib')
-rw-r--r--apps/files_trashbin/lib/trashbin.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index bb6bdd547a0..48d43b059fa 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -565,6 +565,21 @@ class Trashbin {
}
/**
+ * @brief delete all files from the trash
+ */
+ public static function deleteAll() {
+ $user = \OCP\User::getUser();
+ $view = new \OC\Files\View('/' . $user);
+ $view->deleteAll('files_trashbin');
+ self::setTrashbinSize($user, 0);
+ $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?');
+ $query->execute(array($user));
+
+ return true;
+ }
+
+
+ /**
* @brief delete file from trash bin permanently
*
* @param $filename path to the file