Browse Source

Merge pull request #5549 from owncloud/encryption-insertmigrationentrywhenmissing

Fixed encryption migration when entry is missing in DB
remotes/origin/stable6
Vincent Petry 12 years ago
parent
commit
d21a5b45f3
  1. 13
      apps/files_encryption/lib/util.php

13
apps/files_encryption/lib/util.php

@ -205,7 +205,7 @@ class Util {
$this->userId,
'server-side',
0,
0
self::MIGRATION_OPEN
);
$query = \OCP\DB::prepare($sql);
$query->execute($args);
@ -1285,6 +1285,17 @@ class Util {
// If no record is found
if (empty($migrationStatus)) {
\OCP\Util::writeLog('Encryption library', "Could not get migration status for " . $this->userId . ", no record found", \OCP\Util::ERROR);
// insert missing entry in DB with status open
$sql = 'INSERT INTO `*PREFIX*encryption` (`uid`,`mode`,`recovery_enabled`,`migration_status`) VALUES (?,?,?,?)';
$args = array(
$this->userId,
'server-side',
0,
self::MIGRATION_OPEN
);
$query = \OCP\DB::prepare($sql);
$query->execute($args);
return self::MIGRATION_OPEN;
// If a record is found
} else {

Loading…
Cancel
Save