diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-15 16:04:17 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-15 16:04:17 +0100 |
commit | f7140294f26f7966aa00cfdd49c76a14d39df04e (patch) | |
tree | d23c2037d02b3243d38323bf46e41a3bf0551c0a /lib/private | |
parent | 27760ae54e3e28a894ebb610c859fbd3bb8682cc (diff) | |
parent | 0aa83511a1ee7813a3a55a8901b6f146d51fef01 (diff) | |
download | nextcloud-server-f7140294f26f7966aa00cfdd49c76a14d39df04e.tar.gz nextcloud-server-f7140294f26f7966aa00cfdd49c76a14d39df04e.zip |
Merge pull request #23157 from owncloud/remove-share-prop-entries
remove old share propagation entries from appconfig
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/repair.php | 2 | ||||
-rw-r--r-- | lib/private/repair/sharepropagation.php | 52 |
2 files changed, 54 insertions, 0 deletions
diff --git a/lib/private/repair.php b/lib/private/repair.php index d40c6464e14..779f09d42ec 100644 --- a/lib/private/repair.php +++ b/lib/private/repair.php @@ -36,6 +36,7 @@ use OC\Repair\Collation; use OC\Repair\DropOldJobs; use OC\Repair\OldGroupMembershipShares; use OC\Repair\RemoveGetETagEntries; +use OC\Repair\SharePropagation; use OC\Repair\SqliteAutoincrement; use OC\Repair\DropOldTables; use OC\Repair\FillETags; @@ -114,6 +115,7 @@ class Repair extends BasicEmitter { new RemoveGetETagEntries(\OC::$server->getDatabaseConnection()), new UpdateOutdatedOcsIds(\OC::$server->getConfig()), new RepairInvalidShares(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection()), + new SharePropagation(\OC::$server->getConfig()), ]; } diff --git a/lib/private/repair/sharepropagation.php b/lib/private/repair/sharepropagation.php new file mode 100644 index 00000000000..26d7a9e128c --- /dev/null +++ b/lib/private/repair/sharepropagation.php @@ -0,0 +1,52 @@ +<?php +/** + * @author Georg Ehrke <georg@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\Repair; + +use OC\Hooks\BasicEmitter; +use OCP\IConfig; + +class SharePropagation extends BasicEmitter implements \OC\RepairStep { + /** @var IConfig */ + private $config; + + /** + * SharePropagation constructor. + * + * @param IConfig $config + */ + public function __construct(IConfig $config) { + $this->config = $config; + } + + public function getName() { + return 'Remove old share propagation app entries'; + } + + public function run() { + $keys = $this->config->getAppKeys('files_sharing'); + + foreach ($keys as $key) { + if (is_numeric($key)) { + $this->config->deleteAppValue('files_sharing', $key); + } + } + } +} |