diff options
author | Robin Appelman <robin@icewind.nl> | 2017-01-26 16:21:47 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-01-26 19:24:55 +0100 |
commit | c76fe2b4f552e7ad4fadaaff356ece0d215f8a6e (patch) | |
tree | 2d67b47522335eac70d2aa9e7a9abc419128828f /lib | |
parent | 3a603ab8b421b306373e06b9d1210e6013093a99 (diff) | |
download | nextcloud-server-c76fe2b4f552e7ad4fadaaff356ece0d215f8a6e.tar.gz nextcloud-server-c76fe2b4f552e7ad4fadaaff356ece0d215f8a6e.zip |
remote now unneeded AvatarPermissions repair step
Avatars are now stored in appdata
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 1 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 1 | ||||
-rw-r--r-- | lib/private/Repair.php | 2 | ||||
-rw-r--r-- | lib/private/Repair/AvatarPermissions.php | 116 |
4 files changed, 0 insertions, 120 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 84b5dc637bc..5e00b31ae41 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -666,7 +666,6 @@ return array( 'OC\\Repair' => $baseDir . '/lib/private/Repair.php', 'OC\\RepairException' => $baseDir . '/lib/private/RepairException.php', 'OC\\Repair\\AssetCache' => $baseDir . '/lib/private/Repair/AssetCache.php', - 'OC\\Repair\\AvatarPermissions' => $baseDir . '/lib/private/Repair/AvatarPermissions.php', 'OC\\Repair\\CleanTags' => $baseDir . '/lib/private/Repair/CleanTags.php', 'OC\\Repair\\Collation' => $baseDir . '/lib/private/Repair/Collation.php', 'OC\\Repair\\DropOldJobs' => $baseDir . '/lib/private/Repair/DropOldJobs.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 01edabe6889..040a1e0d2d3 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -696,7 +696,6 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Repair' => __DIR__ . '/../../..' . '/lib/private/Repair.php', 'OC\\RepairException' => __DIR__ . '/../../..' . '/lib/private/RepairException.php', 'OC\\Repair\\AssetCache' => __DIR__ . '/../../..' . '/lib/private/Repair/AssetCache.php', - 'OC\\Repair\\AvatarPermissions' => __DIR__ . '/../../..' . '/lib/private/Repair/AvatarPermissions.php', 'OC\\Repair\\CleanTags' => __DIR__ . '/../../..' . '/lib/private/Repair/CleanTags.php', 'OC\\Repair\\Collation' => __DIR__ . '/../../..' . '/lib/private/Repair/Collation.php', 'OC\\Repair\\DropOldJobs' => __DIR__ . '/../../..' . '/lib/private/Repair/DropOldJobs.php', diff --git a/lib/private/Repair.php b/lib/private/Repair.php index f1bf586b49d..e8d466cd844 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -31,7 +31,6 @@ namespace OC; use OC\Repair\AssetCache; -use OC\Repair\AvatarPermissions; use OC\Repair\CleanTags; use OC\Repair\Collation; use OC\Repair\DropOldJobs; @@ -142,7 +141,6 @@ class Repair implements IOutput{ new RepairInvalidShares(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection()), new SharePropagation(\OC::$server->getConfig()), new RemoveOldShares(\OC::$server->getDatabaseConnection()), - new AvatarPermissions(\OC::$server->getDatabaseConnection()), new RemoveRootShares(\OC::$server->getDatabaseConnection(), \OC::$server->getUserManager(), \OC::$server->getLazyRootFolder()), new RepairUnmergedShares( \OC::$server->getConfig(), diff --git a/lib/private/Repair/AvatarPermissions.php b/lib/private/Repair/AvatarPermissions.php deleted file mode 100644 index 9d75062358c..00000000000 --- a/lib/private/Repair/AvatarPermissions.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @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 Doctrine\DBAL\Platforms\OraclePlatform; -use OCP\IDBConnection; -use OCP\Migration\IOutput; -use OCP\Migration\IRepairStep; - -/** - * Class AvatarPermissions - * - * @package OC\Repair - */ -class AvatarPermissions implements IRepairStep { - /** @var IDBConnection */ - private $connection; - - /** - * AvatarPermissions constructor. - * - * @param IDBConnection $connection - */ - public function __construct(IDBConnection $connection) { - $this->connection = $connection; - } - - /** - * @return string - */ - public function getName() { - return 'Fix permissions so avatars can be stored again'; - } - - /** - * @param IOutput $output - */ - public function run(IOutput $output) { - $output->startProgress(2); - $this->fixUserRootPermissions(); - $output->advance(); - $this->fixAvatarPermissions(); - $output->finishProgress(); - } - - /** - * Make sure all user roots have permissions 23 (all but share) - */ - protected function fixUserRootPermissions() { - $qb = $this->connection->getQueryBuilder(); - $qb2 = $this->connection->getQueryBuilder(); - - $qb->select('numeric_id') - ->from('storages') - ->where($qb->expr()->like('id', $qb2->createParameter('like'))); - - if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) { - // '' is null on oracle - $path = $qb2->expr()->isNull('path'); - } else { - $path = $qb2->expr()->eq('path', $qb2->createNamedParameter('')); - } - - $qb2->update('filecache') - ->set('permissions', $qb2->createNamedParameter(23)) - ->where($path) - ->andWhere($qb2->expr()->in('storage', $qb2->createFunction($qb->getSQL()))) - ->andWhere($qb2->expr()->neq('permissions', $qb2->createNamedParameter(23))) - ->setParameter('like', 'home::%'); - - - $qb2->execute(); - } - - /** - * Make sure all avatar files in the user roots have permission 27 - */ - protected function fixAvatarPermissions() { - $qb = $this->connection->getQueryBuilder(); - $qb2 = $this->connection->getQueryBuilder(); - - $qb->select('numeric_id') - ->from('storages') - ->where($qb->expr()->like('id', $qb2->createParameter('like'))); - - $qb2->update('filecache') - ->set('permissions', $qb2->createNamedParameter(27)) - ->where($qb2->expr()->like('path', $qb2->createNamedParameter('avatar.%'))) - ->andWhere($qb2->expr()->in('storage', $qb2->createFunction($qb->getSQL()))) - ->andWhere($qb2->expr()->neq('permissions', $qb2->createNamedParameter(27))) - ->setParameter('like', 'home::%'); - - $qb2->execute(); - } - -} - |