aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/share/hooks.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-04-13 15:00:12 +0200
committerRoeland Jago Douma <rullzer@owncloud.com>2016-04-13 15:00:12 +0200
commit6144ced7a09356a0aaa70cdc359613d3abf8d28e (patch)
tree53f4a3586cae4d4320141e71677e2b3dfc435052 /lib/private/share/hooks.php
parent15397a9c910925ac368001545ab96509a12cb0ad (diff)
downloadnextcloud-server-6144ced7a09356a0aaa70cdc359613d3abf8d28e.tar.gz
nextcloud-server-6144ced7a09356a0aaa70cdc359613d3abf8d28e.zip
Move post_removeFromGroup to shareManager
The last sharing hook to be moved over. * Added unit tests * Removed old tests that relied on old behaviour * Removed old hooks.php
Diffstat (limited to 'lib/private/share/hooks.php')
-rw-r--r--lib/private/share/hooks.php46
1 files changed, 0 insertions, 46 deletions
diff --git a/lib/private/share/hooks.php b/lib/private/share/hooks.php
deleted file mode 100644
index 5faf81c5e9b..00000000000
--- a/lib/private/share/hooks.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * @author Björn Schießle <schiessle@owncloud.com>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin McCorkell <robin@mccorkell.me.uk>
- * @author Roeland Jago Douma <rullzer@owncloud.com>
- *
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OC\Share;
-
-class Hooks extends \OC\Share\Constants {
- /**
- * Function that is called after a user is removed from a group. Shares are cleaned up.
- * @param array $arguments
- */
- public static function post_removeFromGroup($arguments) {
- $sql = 'SELECT `id`, `share_type` FROM `*PREFIX*share`'
- .' WHERE (`share_type` = ? AND `share_with` = ?) OR (`share_type` = ? AND `share_with` = ?)';
- $result = \OC_DB::executeAudited($sql, array(self::SHARE_TYPE_GROUP, $arguments['gid'],
- self::$shareTypeGroupUserUnique, $arguments['uid']));
- while ($item = $result->fetchRow()) {
- if ($item['share_type'] == self::SHARE_TYPE_GROUP) {
- // Delete all reshares by this user of the group share
- Helper::delete($item['id'], true, $arguments['uid']);
- } else {
- Helper::delete($item['id']);
- }
- }
- }
-}