diff options
Diffstat (limited to 'apps/files_trashbin/lib/trash.php')
-rw-r--r-- | apps/files_trashbin/lib/trash.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index 35a2e1a8a1e..9efb041bb9d 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -337,6 +337,22 @@ class Trashbin { } /** + * @brief deletes used space for trash bin in db if user was deleted + * + * @param type $uid id of deleted user + * @return result of db delete operation + */ + public static function deleteUser($uid) { + $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?'); + $result = $query->execute(array($uid)); + if ($result) { + $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trashsize` WHERE `user`=?'); + return $query->execute(array($uid)); + } + return false; + } + + /** * clean up the trash bin * @param max. available disk space for trashbin */ |