Skip to content
Snippets Groups Projects
Commit c4a594b7 authored by Lukas Reschke's avatar Lukas Reschke Committed by GitHub
Browse files

Merge pull request #2844 from nextcloud/testing-altbackend-switch

Testing app switch to force-enable test user backend
parents bfdc55c8 504a1f0d
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,6 @@ ...@@ -10,6 +10,6 @@
<nextcloud min-version="12" max-version="12" /> <nextcloud min-version="12" max-version="12" />
</dependencies> </dependencies>
<types> <types>
<type>prelogin</type> <authentication/>
</types> </types>
</info> </info>
...@@ -22,9 +22,21 @@ ...@@ -22,9 +22,21 @@
namespace OCA\Testing; namespace OCA\Testing;
use OCP\AppFramework\App; use OCP\AppFramework\App;
use OCA\Testing\AlternativeHomeUserBackend;
class Application extends App { class Application extends App {
public function __construct (array $urlParams = array()) { 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));
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment