2013-01-18 07:11:29 -05:00
|
|
|
<?php
|
2013-02-22 11:21:57 -05:00
|
|
|
/**
|
2024-06-02 09:26:54 -04:00
|
|
|
* SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2013-01-18 07:11:29 -05:00
|
|
|
*/
|
2013-02-07 07:14:45 -05:00
|
|
|
namespace OCA\Files_Trashbin;
|
2013-01-18 07:11:29 -05:00
|
|
|
|
|
|
|
|
class Hooks {
|
|
|
|
|
|
2013-04-11 06:37:52 -04:00
|
|
|
/**
|
2014-05-19 11:50:53 -04:00
|
|
|
* clean up user specific settings if user gets deleted
|
2014-05-15 08:19:32 -04:00
|
|
|
* @param array $params array with uid
|
2013-04-11 06:37:52 -04:00
|
|
|
*
|
|
|
|
|
* 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) {
|
2017-10-23 17:47:06 -04:00
|
|
|
$uid = $params['uid'];
|
|
|
|
|
Trashbin::deleteUser($uid);
|
2013-04-11 06:37:52 -04:00
|
|
|
}
|
2014-05-19 11:50:53 -04:00
|
|
|
|
2013-07-26 05:45:38 -04:00
|
|
|
public static function post_write_hook($params) {
|
2021-02-16 05:56:07 -05:00
|
|
|
$user = \OC_User::getUser();
|
2016-02-16 10:29:07 -05:00
|
|
|
if (!empty($user)) {
|
|
|
|
|
Trashbin::resizeTrash($user);
|
|
|
|
|
}
|
2013-07-26 05:45:38 -04:00
|
|
|
}
|
2013-01-18 07:11:29 -05:00
|
|
|
}
|