Merge pull request #19113 from owncloud/issue-19106-fix-singleuser-config-name-encryption

Fix the singleuser config casing in new encryption code
This commit is contained in:
Thomas Müller 2015-09-17 10:32:38 +02:00
commit c9397dffea
4 changed files with 12 additions and 12 deletions

View File

@ -77,13 +77,13 @@ class DecryptAll extends Command {
$this->questionHelper = $questionHelper;
$this->wasTrashbinEnabled = $this->appManager->isEnabledForUser('files_trashbin');
$this->wasSingleUserModeEnabled = $this->config->getSystemValue('singleUser', false);
$this->config->setSystemValue('singleUser', true);
$this->wasSingleUserModeEnabled = $this->config->getSystemValue('singleuser', false);
$this->config->setSystemValue('singleuser', true);
$this->appManager->disableApp('files_trashbin');
}
public function __destruct() {
$this->config->setSystemValue('singleUser', $this->wasSingleUserModeEnabled);
$this->config->setSystemValue('singleuser', $this->wasSingleUserModeEnabled);
if ($this->wasTrashbinEnabled) {
$this->appManager->enableApp('files_trashbin');
}

View File

@ -68,13 +68,13 @@ class EncryptAll extends Command {
$this->config = $config;
$this->questionHelper = $questionHelper;
$this->wasTrashbinEnabled = $this->appManager->isEnabledForUser('files_trashbin');
$this->wasSingleUserModeEnabled = $this->config->getSystemValue('singleUser', false);
$this->config->setSystemValue('singleUser', true);
$this->wasSingleUserModeEnabled = $this->config->getSystemValue('singleuser', false);
$this->config->setSystemValue('singleuser', true);
$this->appManager->disableApp('files_trashbin');
}
public function __destruct() {
$this->config->setSystemValue('singleUser', $this->wasSingleUserModeEnabled);
$this->config->setSystemValue('singleuser', $this->wasSingleUserModeEnabled);
if ($this->wasTrashbinEnabled) {
$this->appManager->enableApp('files_trashbin');
}

View File

@ -71,7 +71,7 @@ class DecryptAllTest extends TestCase {
$this->config->expects($this->any())
->method('getSystemValue')
->with('singleUser', false)
->with('singleuser', false)
->willReturn(false);
$this->appManager->expects($this->any())
->method('isEnabledForUser')
@ -83,7 +83,7 @@ class DecryptAllTest extends TestCase {
// on construct we enable single-user-mode and disable the trash bin
$this->config->expects($this->at(1))
->method('setSystemValue')
->with('singleUser', true);
->with('singleuser', true);
$this->appManager->expects($this->once())
->method('disableApp')
->with('files_trashbin');
@ -91,7 +91,7 @@ class DecryptAllTest extends TestCase {
// on destruct wi disable single-user-mode again and enable the trash bin
$this->config->expects($this->at(2))
->method('setSystemValue')
->with('singleUser', false);
->with('singleuser', false);
$this->appManager->expects($this->once())
->method('enableApp')
->with('files_trashbin');

View File

@ -81,9 +81,9 @@ class EncryptAllTest extends TestCase {
$this->appManager->expects($this->once())->method('disableApp')->with('files_trashbin');
// enable single user mode to avoid that other user login during encryption
// destructor should disable the single user mode again
$this->config->expects($this->once())->method('getSystemValue')->with('singleUser', false)->willReturn(false);
$this->config->expects($this->at(1))->method('setSystemValue')->with('singleUser', true);
$this->config->expects($this->at(2))->method('setSystemValue')->with('singleUser', false);
$this->config->expects($this->once())->method('getSystemValue')->with('singleuser', false)->willReturn(false);
$this->config->expects($this->at(1))->method('setSystemValue')->with('singleuser', true);
$this->config->expects($this->at(2))->method('setSystemValue')->with('singleuser', false);
new EncryptAll($this->encryptionManager, $this->appManager, $this->config, $this->questionHelper);
}