diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-10-30 07:49:49 -0700 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-10-30 07:49:49 -0700 |
commit | d21a5b45f3f47d27a72d9acee4189eefc8104092 (patch) | |
tree | 0cc7ee8c3d6114d077e2fa95d0527dabebe1c0cb /apps | |
parent | 3059d7d92ee4092c27020ca2a32e2df613c5d37f (diff) | |
parent | e246e2b66973e99226f5db3544af33b5f665c6bb (diff) | |
download | nextcloud-server-d21a5b45f3f47d27a72d9acee4189eefc8104092.tar.gz nextcloud-server-d21a5b45f3f47d27a72d9acee4189eefc8104092.zip |
Merge pull request #5549 from owncloud/encryption-insertmigrationentrywhenmissing
Fixed encryption migration when entry is missing in DB
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_encryption/lib/util.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php index 0d34af043a1..5e855abd973 100644 --- a/apps/files_encryption/lib/util.php +++ b/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 { |