diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-12-23 13:47:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-23 13:47:26 +0100 |
commit | c4a594b78bf0f5ad0a6c8414d157cc8e4ff1f28d (patch) | |
tree | 481c2212f5017e8ded87e366fdab7b3e756e44af | |
parent | bfdc55c80ac2c1c827ec2e894dbee41021fd6c2d (diff) | |
parent | 504a1f0d5710ea37361c805ebb2afe88f4654620 (diff) | |
download | nextcloud-server-c4a594b78bf0f5ad0a6c8414d157cc8e4ff1f28d.tar.gz nextcloud-server-c4a594b78bf0f5ad0a6c8414d157cc8e4ff1f28d.zip |
Merge pull request #2844 from nextcloud/testing-altbackend-switch
Testing app switch to force-enable test user backend
-rw-r--r-- | apps/testing/appinfo/info.xml | 2 | ||||
-rw-r--r-- | apps/testing/lib/Application.php | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/apps/testing/appinfo/info.xml b/apps/testing/appinfo/info.xml index bd64fca2121..caefd1709c5 100644 --- a/apps/testing/appinfo/info.xml +++ b/apps/testing/appinfo/info.xml @@ -10,6 +10,6 @@ <nextcloud min-version="12" max-version="12" /> </dependencies> <types> - <type>prelogin</type> + <authentication/> </types> </info> diff --git a/apps/testing/lib/Application.php b/apps/testing/lib/Application.php index 19eda60acbd..8f42d0442dd 100644 --- a/apps/testing/lib/Application.php +++ b/apps/testing/lib/Application.php @@ -22,9 +22,21 @@ namespace OCA\Testing; use OCP\AppFramework\App; +use OCA\Testing\AlternativeHomeUserBackend; class Application extends App { public function __construct (array $urlParams = array()) { - parent::__construct('testing', $urlParams); + $appName = 'testing'; + parent::__construct($appName, $urlParams); + + $c = $this->getContainer(); + $config = $c->getServer()->getConfig(); + if ($config->getAppValue($appName, 'enable_alt_user_backend', 'no') === 'yes') { + $userManager = $c->getServer()->getUserManager(); + + // replace all user backends with this one + $userManager->clearBackends(); + $userManager->registerBackend($c->query(AlternativeHomeUserBackend::class)); + } } } |