summaryrefslogtreecommitdiffstats
path: root/apps/testing/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-12-22 15:21:09 +0100
committerLukas Reschke <lukas@statuscode.ch>2016-12-23 12:38:04 +0100
commit504a1f0d5710ea37361c805ebb2afe88f4654620 (patch)
tree6aa0bf90b49ed7d8d76abac0e222b22d5c361475 /apps/testing/lib
parent91c87d3a7a219101abdb14c096a15587b79e5bea (diff)
downloadnextcloud-server-504a1f0d5710ea37361c805ebb2afe88f4654620.tar.gz
nextcloud-server-504a1f0d5710ea37361c805ebb2afe88f4654620.zip
Testing app switch to force-enable test user backend
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'apps/testing/lib')
-rw-r--r--apps/testing/lib/Application.php14
1 files changed, 13 insertions, 1 deletions
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));
+ }
}
}