0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-02-24 17:06:50 +00:00
nextcloud_server/apps/files_trashbin/lib/Hooks.php
Andy Scherzinger afa48a4e0e
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-06-02 20:00:00 +02:00

29 lines
738 B
PHP

<?php
/**
* SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OCA\Files_Trashbin;
class Hooks {
/**
* clean up user specific settings if user gets deleted
* @param array $params array with uid
*
* This function is connected to the pre_deleteUser signal of OC_Users
* to remove the used space for the trash bin stored in the database
*/
public static function deleteUser_hook($params) {
$uid = $params['uid'];
Trashbin::deleteUser($uid);
}
public static function post_write_hook($params) {
$user = \OC_User::getUser();
if (!empty($user)) {
Trashbin::resizeTrash($user);
}
}
}