diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-02-22 22:20:56 -0600 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-02-22 22:35:18 -0600 |
commit | 2bbf3b18d90301e4c1afc8deb5ef0cf9b91a6ff9 (patch) | |
tree | ff6b9d5e9f7f6a16b6f10605ce9aacc779fa1176 /lib/private/Repair/RepairInvalidShares.php | |
parent | c2d3e12e23a0315c2ef14aab9235dfec1f6b9e26 (diff) | |
download | nextcloud-server-2bbf3b18d90301e4c1afc8deb5ef0cf9b91a6ff9.tar.gz nextcloud-server-2bbf3b18d90301e4c1afc8deb5ef0cf9b91a6ff9.zip |
cleanup old and not needed repair steps to speed up the update
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/Repair/RepairInvalidShares.php')
-rw-r--r-- | lib/private/Repair/RepairInvalidShares.php | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/lib/private/Repair/RepairInvalidShares.php b/lib/private/Repair/RepairInvalidShares.php index 04624c910dd..eba66e295c4 100644 --- a/lib/private/Repair/RepairInvalidShares.php +++ b/lib/private/Repair/RepairInvalidShares.php @@ -56,43 +56,6 @@ class RepairInvalidShares implements IRepairStep { } /** - * Past bugs would make it possible to set an expiration date on user shares even - * though it is not supported. This functions removes the expiration date from such entries. - */ - private function removeExpirationDateFromNonLinkShares(IOutput $out) { - $builder = $this->connection->getQueryBuilder(); - $builder - ->update('share') - ->set('expiration', 'null') - ->where($builder->expr()->isNotNull('expiration')) - ->andWhere($builder->expr()->neq('share_type', $builder->expr()->literal(\OC\Share\Constants::SHARE_TYPE_LINK))); - - $updatedEntries = $builder->execute(); - if ($updatedEntries > 0) { - $out->info('Removed invalid expiration date from ' . $updatedEntries . ' shares'); - } - } - - /** - * In the past link shares with public upload enabled were missing the delete permission. - */ - private function addShareLinkDeletePermission(IOutput $out) { - $oldPerms = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE; - $newPerms = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE; - $builder = $this->connection->getQueryBuilder(); - $builder - ->update('share') - ->set('permissions', $builder->expr()->literal($newPerms)) - ->where($builder->expr()->eq('share_type', $builder->expr()->literal(\OC\Share\Constants::SHARE_TYPE_LINK))) - ->andWhere($builder->expr()->eq('permissions', $builder->expr()->literal($oldPerms))); - - $updatedEntries = $builder->execute(); - if ($updatedEntries > 0) { - $out->info('Fixed link share permissions for ' . $updatedEntries . ' shares'); - } - } - - /** * Adjust file share permissions */ private function adjustFileSharePermissions(IOutput $out) { @@ -150,14 +113,6 @@ class RepairInvalidShares implements IRepairStep { public function run(IOutput $out) { $ocVersionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0'); - if (version_compare($ocVersionFromBeforeUpdate, '8.2.0.7', '<')) { - // this situation was only possible before 8.2 - $this->removeExpirationDateFromNonLinkShares($out); - } - if (version_compare($ocVersionFromBeforeUpdate, '9.1.0.9', '<')) { - // this situation was only possible before 9.1 - $this->addShareLinkDeletePermission($out); - } if (version_compare($ocVersionFromBeforeUpdate, '12.0.0.11', '<')) { $this->adjustFileSharePermissions($out); } |