From d5d79bb9dcbcd9f64d03721c0a1fece0d615f486 Mon Sep 17 00:00:00 2001 From: Sujith H Date: Fri, 12 Apr 2019 19:13:08 +0530 Subject: [PATCH 1/4] Fix minor wording corrections in command Fix minor wording corrections in the command. Signed-off-by: Sujith H --- lib/Command/FixEncryptedVersion.php | 18 +++++++++--------- tests/unit/Command/FixEncryptedVersionTest.php | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/Command/FixEncryptedVersion.php b/lib/Command/FixEncryptedVersion.php index 181ef847..3fb90e2f 100644 --- a/lib/Command/FixEncryptedVersion.php +++ b/lib/Command/FixEncryptedVersion.php @@ -51,12 +51,12 @@ protected function configure() { parent::configure(); $this - ->setName('encryption:fixencryptedversion') + ->setName('encryption:fix-encrypted-version') ->setDescription('Fix the encrypted version if the encrypted file(s) are not downloadable.') ->addArgument( 'user', InputArgument::REQUIRED, - 'The user id whose files needs fix' + 'The id of the user whose files need fixing' ); } @@ -64,11 +64,11 @@ protected function execute(InputInterface $input, OutputInterface $output) { $user = $input->getArgument('user'); if ($user === null) { - $output->writeln("No user provided.\n"); + $output->writeln("No user id provided.\n"); } if ($this->userManager->get($user) === null) { - $output->writeln("User $user does not exist. Please provide a valid user id"); + $output->writeln("User id $user does not exist. Please provide a valid user id"); return 1; } $this->walkUserFolder($user, $output); @@ -142,7 +142,7 @@ private function correctEncryptedVersion($path, OutputInterface $output) { $fileCache = $cache->get($fileId); if ($storage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) { - $output->writeln("The file: $path is a share. Hence kindly fix this by running the script under the owner of share"); + $output->writeln("The file: $path is a share. Hence kindly fix this by running the script for the owner of share"); return true; } @@ -154,17 +154,17 @@ private function correctEncryptedVersion($path, OutputInterface $output) { $cache->put($fileCache->getPath(), $cacheInfo); $output->writeln("Decrement the encrypted version to $encryptedVersion"); if ($this->verifyFileContent($path, $output, false) === true) { - $output->writeln("Fixed the file $path with version " . $encryptedVersion . ""); + $output->writeln("Fixed the file: $path with version " . $encryptedVersion . ""); return true; } $encryptedVersion--; } - //So decrementing did not worked. Now lets increment. Max increment is till 5 + //So decrementing did not work. Now lets increment. Max increment is till 5 $increment = 1; while ($increment <= 5) { /** - * The wrongEncryptedVersion would not be incremented so nothing to worry here. + * The wrongEncryptedVersion would not be incremented so nothing to worry about here. * Only the newEncryptedVersion is incremented. * For example if the wrong encrypted version is 4 then * cycle1 -> newEncryptedVersion = 5 ( 4 + 1) @@ -177,7 +177,7 @@ private function correctEncryptedVersion($path, OutputInterface $output) { $cache->put($fileCache->getPath(), $cacheInfo); $output->writeln("Increment the encrypted version to $newEncryptedVersion"); if ($this->verifyFileContent($path, $output, false) === true) { - $output->writeln("Fixed the file $path with version " . $newEncryptedVersion . ""); + $output->writeln("Fixed the file: $path with version " . $newEncryptedVersion . ""); return true; } $increment++; diff --git a/tests/unit/Command/FixEncryptedVersionTest.php b/tests/unit/Command/FixEncryptedVersionTest.php index bcc0dc84..bf09a1d9 100644 --- a/tests/unit/Command/FixEncryptedVersionTest.php +++ b/tests/unit/Command/FixEncryptedVersionTest.php @@ -102,7 +102,7 @@ public function setUp() { * In this test the encrypted version is set to zero whereas it should have been * set to a positive non zero number. */ - public function testEncryptedVersionZero() { + public function testEncryptedVersionIsNotZero() { \OC::$server->getUserSession()->login(self::TEST_ENCRYPTION_VERSION_AFFECTED_USER, 'foo'); $view = new View("/" . self::TEST_ENCRYPTION_VERSION_AFFECTED_USER . "/files"); @@ -130,7 +130,7 @@ public function testEncryptedVersionZero() { Attempting to fix the path: /test_enc_version_affected_user1/files/hello.txt Increment the encrypted version to 1 The file /test_enc_version_affected_user1/files/hello.txt is: OK -Fixed the file /test_enc_version_affected_user1/files/hello.txt with version 1 +Fixed the file: /test_enc_version_affected_user1/files/hello.txt with version 1 Verifying the content of file /test_enc_version_affected_user1/files/ownCloud Manual.pdf The file /test_enc_version_affected_user1/files/ownCloud Manual.pdf is: OK Verifying the content of file /test_enc_version_affected_user1/files/world.txt @@ -208,7 +208,7 @@ public function testEncryptedVersionLessThanOriginalValue() { Increment the encrypted version to 5 Increment the encrypted version to 6 The file /test_enc_version_affected_user1/files/hello.txt is: OK -Fixed the file /test_enc_version_affected_user1/files/hello.txt with version 6 +Fixed the file: /test_enc_version_affected_user1/files/hello.txt with version 6 Verifying the content of file /test_enc_version_affected_user1/files/ownCloud Manual.pdf The file /test_enc_version_affected_user1/files/ownCloud Manual.pdf is: OK Verifying the content of file /test_enc_version_affected_user1/files/world.txt @@ -218,7 +218,7 @@ public function testEncryptedVersionLessThanOriginalValue() { Increment the encrypted version to 4 Increment the encrypted version to 5 The file /test_enc_version_affected_user1/files/world.txt is: OK -Fixed the file /test_enc_version_affected_user1/files/world.txt with version 5 +Fixed the file: /test_enc_version_affected_user1/files/world.txt with version 5 Verifying the content of file /test_enc_version_affected_user1/files/Photos/Paris.jpg The file /test_enc_version_affected_user1/files/Photos/Paris.jpg is: OK Verifying the content of file /test_enc_version_affected_user1/files/Photos/San Francisco.jpg @@ -291,7 +291,7 @@ public function testEncryptedVersionGreaterThanOriginalValue() { Decrement the encrypted version to 10 Decrement the encrypted version to 9 The file /test_enc_version_affected_user1/files/hello.txt is: OK -Fixed the file /test_enc_version_affected_user1/files/hello.txt with version 9 +Fixed the file: /test_enc_version_affected_user1/files/hello.txt with version 9 Verifying the content of file /test_enc_version_affected_user1/files/ownCloud Manual.pdf The file /test_enc_version_affected_user1/files/ownCloud Manual.pdf is: OK Verifying the content of file /test_enc_version_affected_user1/files/world.txt @@ -303,7 +303,7 @@ public function testEncryptedVersionGreaterThanOriginalValue() { Decrement the encrypted version to 10 Decrement the encrypted version to 9 The file /test_enc_version_affected_user1/files/world.txt is: OK -Fixed the file /test_enc_version_affected_user1/files/world.txt with version 9 +Fixed the file: /test_enc_version_affected_user1/files/world.txt with version 9 Verifying the content of file /test_enc_version_affected_user1/files/Photos/Paris.jpg The file /test_enc_version_affected_user1/files/Photos/Paris.jpg is: OK Verifying the content of file /test_enc_version_affected_user1/files/Photos/San Francisco.jpg From 3143311d66450554db0dc0a32df2a4dc381ce98a Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sat, 13 Apr 2019 11:18:26 +0545 Subject: [PATCH 2/4] Bump all ownCloud copyright consistently to 2019 --- .phan/config.php | 2 +- appinfo/Migrations/Version20170913113840.php | 2 +- appinfo/app.php | 2 +- appinfo/routes.php | 2 +- css/settings-admin.css | 2 +- lib/AppInfo/Application.php | 2 +- lib/Command/HSMDaemon.php | 2 +- lib/Command/MigrateKeys.php | 2 +- lib/Command/RecreateMasterKey.php | 2 +- lib/Command/SelectEncryptionType.php | 2 +- lib/Controller/RecoveryController.php | 2 +- lib/Controller/SettingsController.php | 2 +- lib/Controller/StatusController.php | 2 +- lib/Crypto/Crypt.php | 2 +- lib/Crypto/CryptHSM.php | 2 +- lib/Crypto/DecryptAll.php | 2 +- lib/Crypto/EncryptAll.php | 2 +- lib/Crypto/Encryption.php | 2 +- lib/Exceptions/MultiKeyDecryptException.php | 2 +- lib/Exceptions/MultiKeyEncryptException.php | 2 +- lib/Exceptions/PrivateKeyMissingException.php | 2 +- lib/Exceptions/PublicKeyMissingException.php | 2 +- lib/HookManager.php | 2 +- lib/Hooks/Contracts/IHook.php | 2 +- lib/Hooks/UserHooks.php | 2 +- lib/JWT.php | 2 +- lib/KeyManager.php | 2 +- lib/Migration.php | 2 +- lib/Panels/Admin.php | 2 +- lib/Panels/Personal.php | 2 +- lib/Recovery.php | 2 +- lib/Session.php | 2 +- lib/Users/Setup.php | 2 +- lib/Util.php | 2 +- tests/unit/Command/RecreateMasterKeyTest.php | 2 +- tests/unit/Command/TestEnableMasterKey.php | 2 +- tests/unit/Command/TestEnableUserKey.php | 2 +- tests/unit/Controller/RecoveryControllerTest.php | 2 +- tests/unit/Controller/SettingsControllerTest.php | 2 +- tests/unit/Controller/StatusControllerTest.php | 2 +- tests/unit/Crypto/CryptTest.php | 2 +- tests/unit/Crypto/DecryptAllTest.php | 2 +- tests/unit/Crypto/EncryptAllTest.php | 2 +- tests/unit/Crypto/EncryptionTest.php | 2 +- tests/unit/HookManagerTest.php | 2 +- tests/unit/Hooks/UserHooksTest.php | 2 +- tests/unit/KeyManagerTest.php | 2 +- tests/unit/MigrationTest.php | 2 +- tests/unit/Panels/AdminTest.php | 2 +- tests/unit/Panels/PersonalTest.php | 2 +- tests/unit/RecoveryTest.php | 2 +- tests/unit/SessionTest.php | 2 +- tests/unit/Users/SetupTest.php | 2 +- tests/unit/UtilTest.php | 2 +- tests/unit/bootstrap.php | 2 +- 55 files changed, 55 insertions(+), 55 deletions(-) diff --git a/.phan/config.php b/.phan/config.php index 6004d6e1..92f2361c 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -2,7 +2,7 @@ /** * @author Patrick Jahns * - * @copyright Copyright (c) 2018, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license GPL-2.0 * * This program is free software; you can redistribute it and/or modify it diff --git a/appinfo/Migrations/Version20170913113840.php b/appinfo/Migrations/Version20170913113840.php index 23e6f1d5..1b985652 100644 --- a/appinfo/Migrations/Version20170913113840.php +++ b/appinfo/Migrations/Version20170913113840.php @@ -2,7 +2,7 @@ /** * @author Sujith Haridasan * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/appinfo/app.php b/appinfo/app.php index 053f80a0..cb20edb1 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -4,7 +4,7 @@ * @author Clark Tomlinson * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/appinfo/routes.php b/appinfo/routes.php index 5fb3ebfe..82e4ccc1 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -4,7 +4,7 @@ * @author Clark Tomlinson * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/css/settings-admin.css b/css/settings-admin.css index 47360e6b..db8edab3 100644 --- a/css/settings-admin.css +++ b/css/settings-admin.css @@ -1,7 +1,7 @@ /** * @author Björn Schießle * - * @copyright Copyright (c) 2015, ownCloud, Inc. + * @copyright Copyright (c) 2019, ownCloud, GbmH. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 0598f3cd..c0f7ff14 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -4,7 +4,7 @@ * @author Clark Tomlinson * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Command/HSMDaemon.php b/lib/Command/HSMDaemon.php index 9f3889e2..270b3283 100644 --- a/lib/Command/HSMDaemon.php +++ b/lib/Command/HSMDaemon.php @@ -2,7 +2,7 @@ /** * @author Jörn Friedrich Dreyer * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Command/MigrateKeys.php b/lib/Command/MigrateKeys.php index 6de08890..0b805140 100644 --- a/lib/Command/MigrateKeys.php +++ b/lib/Command/MigrateKeys.php @@ -3,7 +3,7 @@ * @author Björn Schießle * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Command/RecreateMasterKey.php b/lib/Command/RecreateMasterKey.php index 08827302..11d3d31c 100644 --- a/lib/Command/RecreateMasterKey.php +++ b/lib/Command/RecreateMasterKey.php @@ -2,7 +2,7 @@ /** * @author Sujith Haridasan * -* @copyright Copyright (c) 2017, ownCloud GmbH +* @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Command/SelectEncryptionType.php b/lib/Command/SelectEncryptionType.php index 3dcffc1f..5276112a 100644 --- a/lib/Command/SelectEncryptionType.php +++ b/lib/Command/SelectEncryptionType.php @@ -2,7 +2,7 @@ /** * @author Björn Schießle * -* @copyright Copyright (c) 2017, ownCloud GmbH +* @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Controller/RecoveryController.php b/lib/Controller/RecoveryController.php index 987f45a9..5f4609c9 100644 --- a/lib/Controller/RecoveryController.php +++ b/lib/Controller/RecoveryController.php @@ -4,7 +4,7 @@ * @author Clark Tomlinson * @author Lukas Reschke * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 7674262b..dfdc2d6d 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -3,7 +3,7 @@ * @author Björn Schießle * @author Joas Schilling * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Controller/StatusController.php b/lib/Controller/StatusController.php index cd992212..e8a2ef67 100644 --- a/lib/Controller/StatusController.php +++ b/lib/Controller/StatusController.php @@ -3,7 +3,7 @@ * @author Björn Schießle * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Crypto/Crypt.php b/lib/Crypto/Crypt.php index 36b12741..96358a87 100644 --- a/lib/Crypto/Crypt.php +++ b/lib/Crypto/Crypt.php @@ -6,7 +6,7 @@ * @author Lukas Reschke * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Crypto/CryptHSM.php b/lib/Crypto/CryptHSM.php index 0714c634..1e227b38 100644 --- a/lib/Crypto/CryptHSM.php +++ b/lib/Crypto/CryptHSM.php @@ -6,7 +6,7 @@ * @author Lukas Reschke * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Crypto/DecryptAll.php b/lib/Crypto/DecryptAll.php index 83d3de15..59f674b3 100644 --- a/lib/Crypto/DecryptAll.php +++ b/lib/Crypto/DecryptAll.php @@ -2,7 +2,7 @@ /** * @author Björn Schießle * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Crypto/EncryptAll.php b/lib/Crypto/EncryptAll.php index 78de757a..51e58eac 100644 --- a/lib/Crypto/EncryptAll.php +++ b/lib/Crypto/EncryptAll.php @@ -4,7 +4,7 @@ * @author Roeland Jago Douma * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Crypto/Encryption.php b/lib/Crypto/Encryption.php index a56d38e7..1f407281 100644 --- a/lib/Crypto/Encryption.php +++ b/lib/Crypto/Encryption.php @@ -7,7 +7,7 @@ * @author Lukas Reschke * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Exceptions/MultiKeyDecryptException.php b/lib/Exceptions/MultiKeyDecryptException.php index 4032c56a..8fda346c 100644 --- a/lib/Exceptions/MultiKeyDecryptException.php +++ b/lib/Exceptions/MultiKeyDecryptException.php @@ -2,7 +2,7 @@ /** * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Exceptions/MultiKeyEncryptException.php b/lib/Exceptions/MultiKeyEncryptException.php index 6752c5ee..5aeab906 100644 --- a/lib/Exceptions/MultiKeyEncryptException.php +++ b/lib/Exceptions/MultiKeyEncryptException.php @@ -2,7 +2,7 @@ /** * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Exceptions/PrivateKeyMissingException.php b/lib/Exceptions/PrivateKeyMissingException.php index 4f3e9271..5e638f55 100644 --- a/lib/Exceptions/PrivateKeyMissingException.php +++ b/lib/Exceptions/PrivateKeyMissingException.php @@ -4,7 +4,7 @@ * @author Clark Tomlinson * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Exceptions/PublicKeyMissingException.php b/lib/Exceptions/PublicKeyMissingException.php index 949fab0f..13332d80 100644 --- a/lib/Exceptions/PublicKeyMissingException.php +++ b/lib/Exceptions/PublicKeyMissingException.php @@ -2,7 +2,7 @@ /** * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/HookManager.php b/lib/HookManager.php index 2ecb529d..778c34bd 100644 --- a/lib/HookManager.php +++ b/lib/HookManager.php @@ -3,7 +3,7 @@ * @author Björn Schießle * @author Clark Tomlinson * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Hooks/Contracts/IHook.php b/lib/Hooks/Contracts/IHook.php index ffd1bc35..7c503c48 100644 --- a/lib/Hooks/Contracts/IHook.php +++ b/lib/Hooks/Contracts/IHook.php @@ -2,7 +2,7 @@ /** * @author Clark Tomlinson * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Hooks/UserHooks.php b/lib/Hooks/UserHooks.php index fd1ed1d7..b6ff0939 100644 --- a/lib/Hooks/UserHooks.php +++ b/lib/Hooks/UserHooks.php @@ -5,7 +5,7 @@ * @author Thomas Müller * @author Vincent Petry * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/JWT.php b/lib/JWT.php index 9d2e20aa..2cf15d9e 100644 --- a/lib/JWT.php +++ b/lib/JWT.php @@ -2,7 +2,7 @@ /** * @author Jörn Friedrich Dreyer * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/KeyManager.php b/lib/KeyManager.php index 1d61ab6a..7bbfff58 100644 --- a/lib/KeyManager.php +++ b/lib/KeyManager.php @@ -6,7 +6,7 @@ * @author Thomas Müller * @author Vincent Petry * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Migration.php b/lib/Migration.php index a22c71f6..7a9968ce 100644 --- a/lib/Migration.php +++ b/lib/Migration.php @@ -5,7 +5,7 @@ * @author Robin Appelman * @author Vincent Petry * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Panels/Admin.php b/lib/Panels/Admin.php index 5f341ddb..98f32247 100644 --- a/lib/Panels/Admin.php +++ b/lib/Panels/Admin.php @@ -2,7 +2,7 @@ /** * @author Tom Needham * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Panels/Personal.php b/lib/Panels/Personal.php index 39dcc532..c224dbd0 100644 --- a/lib/Panels/Personal.php +++ b/lib/Panels/Personal.php @@ -2,7 +2,7 @@ /** * @author Tom Needham * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Recovery.php b/lib/Recovery.php index 99a810f7..0e416282 100644 --- a/lib/Recovery.php +++ b/lib/Recovery.php @@ -5,7 +5,7 @@ * @author Lukas Reschke * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Session.php b/lib/Session.php index 08541699..12bd554d 100644 --- a/lib/Session.php +++ b/lib/Session.php @@ -4,7 +4,7 @@ * @author Clark Tomlinson * @author Lukas Reschke * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Users/Setup.php b/lib/Users/Setup.php index 5ae6af09..6815d34b 100644 --- a/lib/Users/Setup.php +++ b/lib/Users/Setup.php @@ -5,7 +5,7 @@ * @author Lukas Reschke * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Util.php b/lib/Util.php index 98b37966..4f797a7a 100644 --- a/lib/Util.php +++ b/lib/Util.php @@ -4,7 +4,7 @@ * @author Clark Tomlinson * @author Phil Davis * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Command/RecreateMasterKeyTest.php b/tests/unit/Command/RecreateMasterKeyTest.php index 1b31f6f7..4d320aa9 100644 --- a/tests/unit/Command/RecreateMasterKeyTest.php +++ b/tests/unit/Command/RecreateMasterKeyTest.php @@ -2,7 +2,7 @@ /** * @author Sujith Haridasan * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Command/TestEnableMasterKey.php b/tests/unit/Command/TestEnableMasterKey.php index cd697f0b..382959fe 100644 --- a/tests/unit/Command/TestEnableMasterKey.php +++ b/tests/unit/Command/TestEnableMasterKey.php @@ -3,7 +3,7 @@ * @author Björn Schießle * @author Joas Schilling * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Command/TestEnableUserKey.php b/tests/unit/Command/TestEnableUserKey.php index f7346b12..c567de66 100644 --- a/tests/unit/Command/TestEnableUserKey.php +++ b/tests/unit/Command/TestEnableUserKey.php @@ -2,7 +2,7 @@ /** * @author Sujith H * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Controller/RecoveryControllerTest.php b/tests/unit/Controller/RecoveryControllerTest.php index 6f7365c2..99099a8f 100644 --- a/tests/unit/Controller/RecoveryControllerTest.php +++ b/tests/unit/Controller/RecoveryControllerTest.php @@ -3,7 +3,7 @@ * @author Clark Tomlinson * @author Joas Schilling * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Controller/SettingsControllerTest.php b/tests/unit/Controller/SettingsControllerTest.php index 78f940d5..a717e48b 100644 --- a/tests/unit/Controller/SettingsControllerTest.php +++ b/tests/unit/Controller/SettingsControllerTest.php @@ -4,7 +4,7 @@ * @author Joas Schilling * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Controller/StatusControllerTest.php b/tests/unit/Controller/StatusControllerTest.php index 037d6bd8..86dbe51f 100644 --- a/tests/unit/Controller/StatusControllerTest.php +++ b/tests/unit/Controller/StatusControllerTest.php @@ -4,7 +4,7 @@ * @author Joas Schilling * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Crypto/CryptTest.php b/tests/unit/Crypto/CryptTest.php index 94690030..b82a7436 100644 --- a/tests/unit/Crypto/CryptTest.php +++ b/tests/unit/Crypto/CryptTest.php @@ -5,7 +5,7 @@ * @author Lukas Reschke * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Crypto/DecryptAllTest.php b/tests/unit/Crypto/DecryptAllTest.php index b3907489..cec842cc 100644 --- a/tests/unit/Crypto/DecryptAllTest.php +++ b/tests/unit/Crypto/DecryptAllTest.php @@ -3,7 +3,7 @@ * @author Björn Schießle * @author Joas Schilling * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Crypto/EncryptAllTest.php b/tests/unit/Crypto/EncryptAllTest.php index 08c8e7a7..5e52f08e 100644 --- a/tests/unit/Crypto/EncryptAllTest.php +++ b/tests/unit/Crypto/EncryptAllTest.php @@ -4,7 +4,7 @@ * @author Joas Schilling * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Crypto/EncryptionTest.php b/tests/unit/Crypto/EncryptionTest.php index 1b72cb96..cedae4d2 100644 --- a/tests/unit/Crypto/EncryptionTest.php +++ b/tests/unit/Crypto/EncryptionTest.php @@ -4,7 +4,7 @@ * @author Joas Schilling * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/HookManagerTest.php b/tests/unit/HookManagerTest.php index 1f293377..b4d9e300 100644 --- a/tests/unit/HookManagerTest.php +++ b/tests/unit/HookManagerTest.php @@ -4,7 +4,7 @@ * @author Joas Schilling * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Hooks/UserHooksTest.php b/tests/unit/Hooks/UserHooksTest.php index 0f58257e..20b52014 100644 --- a/tests/unit/Hooks/UserHooksTest.php +++ b/tests/unit/Hooks/UserHooksTest.php @@ -6,7 +6,7 @@ * @author Thomas Müller * @author Vincent Petry * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/KeyManagerTest.php b/tests/unit/KeyManagerTest.php index b63ade83..9822b795 100644 --- a/tests/unit/KeyManagerTest.php +++ b/tests/unit/KeyManagerTest.php @@ -6,7 +6,7 @@ * @author Lukas Reschke * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/MigrationTest.php b/tests/unit/MigrationTest.php index 4fa4c736..04452a42 100644 --- a/tests/unit/MigrationTest.php +++ b/tests/unit/MigrationTest.php @@ -6,7 +6,7 @@ * @author Roeland Jago Douma * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Panels/AdminTest.php b/tests/unit/Panels/AdminTest.php index 6e73e229..3249c840 100644 --- a/tests/unit/Panels/AdminTest.php +++ b/tests/unit/Panels/AdminTest.php @@ -2,7 +2,7 @@ /** * @author Tom Needham * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Panels/PersonalTest.php b/tests/unit/Panels/PersonalTest.php index c56e2475..1f30984b 100644 --- a/tests/unit/Panels/PersonalTest.php +++ b/tests/unit/Panels/PersonalTest.php @@ -2,7 +2,7 @@ /** * @author Tom Needham * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/RecoveryTest.php b/tests/unit/RecoveryTest.php index c4d74199..a82b67da 100644 --- a/tests/unit/RecoveryTest.php +++ b/tests/unit/RecoveryTest.php @@ -6,7 +6,7 @@ * @author Lukas Reschke * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/SessionTest.php b/tests/unit/SessionTest.php index 9ff558fb..963b8fa9 100644 --- a/tests/unit/SessionTest.php +++ b/tests/unit/SessionTest.php @@ -5,7 +5,7 @@ * @author Joas Schilling * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/Users/SetupTest.php b/tests/unit/Users/SetupTest.php index 3572c44c..c2acfe08 100644 --- a/tests/unit/Users/SetupTest.php +++ b/tests/unit/Users/SetupTest.php @@ -5,7 +5,7 @@ * @author Joas Schilling * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/UtilTest.php b/tests/unit/UtilTest.php index 0e46ef63..ea75cee5 100644 --- a/tests/unit/UtilTest.php +++ b/tests/unit/UtilTest.php @@ -5,7 +5,7 @@ * @author Joas Schilling * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/tests/unit/bootstrap.php b/tests/unit/bootstrap.php index 305d24b3..c90aff93 100644 --- a/tests/unit/bootstrap.php +++ b/tests/unit/bootstrap.php @@ -2,7 +2,7 @@ /** * @author Thomas Müller * - * @copyright Copyright (c) 2017, ownCloud GmbH + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify From 97dc909b728a21a40821590161d50dc0446b5603 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sat, 13 Apr 2019 11:24:19 +0545 Subject: [PATCH 3/4] Fix GmbH typo in copyright --- css/settings-admin.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/settings-admin.css b/css/settings-admin.css index db8edab3..b8a692dd 100644 --- a/css/settings-admin.css +++ b/css/settings-admin.css @@ -1,7 +1,7 @@ /** * @author Björn Schießle * - * @copyright Copyright (c) 2019, ownCloud, GbmH. + * @copyright Copyright (c) 2019, ownCloud GmbH * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify From dff6920ce129f7ba04605489ce0d2f07f99c6e50 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sat, 13 Apr 2019 12:00:45 +0545 Subject: [PATCH 4/4] Adjust encryption code format to match what is in core stable10 --- lib/Controller/SettingsController.php | 4 ++-- lib/Crypto/EncryptAll.php | 11 ++++++++++- lib/Crypto/Encryption.php | 2 +- lib/Hooks/UserHooks.php | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index dfdc2d6d..bfd1fb07 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -140,11 +140,11 @@ public function updatePrivateKeyPassword($oldPassword, $newPassword) { if ($result === true) { $this->session->setStatus(Session::INIT_SUCCESSFUL); return new DataResponse( - ['message' => (string)$this->l->t('Private key password successfully updated.')] + ['message' => (string) $this->l->t('Private key password successfully updated.')] ); } else { return new DataResponse( - ['message' => (string)$errorMessage], + ['message' => (string) $errorMessage], Http::STATUS_BAD_REQUEST ); } diff --git a/lib/Crypto/EncryptAll.php b/lib/Crypto/EncryptAll.php index 51e58eac..24513bd9 100644 --- a/lib/Crypto/EncryptAll.php +++ b/lib/Crypto/EncryptAll.php @@ -289,7 +289,7 @@ protected function encryptUsersFiles($uid, ProgressBar $progress, $userCount) { */ protected function encryptFile($path) { $source = $path; - $target = $path . '.encrypted.' . \time() . '.part'; + $target = $path . '.encrypted.' . $this->getTimeStamp() . '.part'; try { $version = $this->keyManager->getVersion($source, $this->rootView); @@ -381,6 +381,15 @@ protected function setupUserFS($uid) { \OC_Util::setupFS($uid); } + /** + * get current timestamp + * + * @return int + */ + protected function getTimeStamp() { + return \time(); + } + /** * generate one time password for the user and store it in a array * diff --git a/lib/Crypto/Encryption.php b/lib/Crypto/Encryption.php index 1f407281..3a8b7933 100644 --- a/lib/Crypto/Encryption.php +++ b/lib/Crypto/Encryption.php @@ -162,7 +162,7 @@ public function getDisplayName() { * @param array $header contains the header data read from the file * @param array $accessList who has access to the file contains the key 'users' and 'public' * @param string|null $sourceFileOfRename Either false or the name of source file to be renamed. - * This is helpful for revision increment during move operation between storage. + * This is helpful for revision increment during move operation between storage. * * @return array $header contain data as key-value pairs which should be * written to the header, in case of a write operation diff --git a/lib/Hooks/UserHooks.php b/lib/Hooks/UserHooks.php index b6ff0939..811dfd77 100644 --- a/lib/Hooks/UserHooks.php +++ b/lib/Hooks/UserHooks.php @@ -240,7 +240,7 @@ public function preSetPassphrase($params) { public function setPassphrase($params) { $privateKey = null; $user = null; - //Check if a session is there or not + //Check if the session is there or not if ($this->user->getUser() !== null) { // Get existing decrypted private key $privateKey = $this->session->getPrivateKey();