diff options
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/files/storage/wrapper/encryption.php | 4 | ||||
-rw-r--r-- | lib/private/repair/repairinvalidshares.php | 24 | ||||
-rw-r--r-- | lib/private/util.php | 1 |
3 files changed, 21 insertions, 8 deletions
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php index 14d3b15bbae..26905dfb388 100644 --- a/lib/private/files/storage/wrapper/encryption.php +++ b/lib/private/files/storage/wrapper/encryption.php @@ -260,6 +260,10 @@ class Encryption extends Wrapper { $this->unencryptedSize[$target] = $this->unencryptedSize[$source]; } $this->keyStorage->renameKeys($source, $target); + $module = $this->getEncryptionModule($path2); + if ($module) { + $module->update($target, $this->uid, []); + } } } diff --git a/lib/private/repair/repairinvalidshares.php b/lib/private/repair/repairinvalidshares.php index ee8b23906e5..beef5e37798 100644 --- a/lib/private/repair/repairinvalidshares.php +++ b/lib/private/repair/repairinvalidshares.php @@ -30,6 +30,8 @@ use OC\Hooks\BasicEmitter; */ class RepairInvalidShares extends BasicEmitter implements \OC\RepairStep { + const CHUNK_SIZE = 200; + /** * @var \OCP\IConfig */ @@ -83,18 +85,24 @@ class RepairInvalidShares extends BasicEmitter implements \OC\RepairStep { ->where($query->expr()->isNotNull('s1.parent')) ->andWhere($query->expr()->isNull('s2.id')) ->leftJoin('s1', 'share', 's2', $query->expr()->eq('s1.parent', 's2.id')) - ->groupBy('s1.parent'); + ->groupBy('s1.parent') + ->setMaxResults(self::CHUNK_SIZE); $deleteQuery = $this->connection->getQueryBuilder(); $deleteQuery->delete('share') - ->where($query->expr()->eq('parent', $deleteQuery->createParameter('parent'))); - - $result = $query->execute(); - while ($row = $result->fetch()) { - $deletedEntries += $deleteQuery->setParameter('parent', (int) $row['parent']) - ->execute(); + ->where($deleteQuery->expr()->eq('parent', $deleteQuery->createParameter('parent'))); + + $deletedInLastChunk = self::CHUNK_SIZE; + while ($deletedInLastChunk === self::CHUNK_SIZE) { + $deletedInLastChunk = 0; + $result = $query->execute(); + while ($row = $result->fetch()) { + $deletedInLastChunk++; + $deletedEntries += $deleteQuery->setParameter('parent', (int) $row['parent']) + ->execute(); + } + $result->closeCursor(); } - $result->closeCursor(); if ($deletedEntries) { $this->emit('\OC\Repair', 'info', array('Removed ' . $deletedEntries . ' shares where the parent did not exist')); diff --git a/lib/private/util.php b/lib/private/util.php index 6e15d742bed..6ad668dedaa 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -969,6 +969,7 @@ class OC_Util { $parameters['alt_login'] = OC_App::getAlternativeLogIns(); $parameters['rememberLoginAllowed'] = self::rememberLoginAllowed(); + $parameters['rememberLoginState'] = isset($_POST['remember_login']) ? $_POST['remember_login'] : 0; \OC_Hook::emit('OC_Util', 'pre_displayLoginPage', array('parameters' => $parameters)); OC_Template::printGuestPage("", "login", $parameters); } |