summaryrefslogtreecommitdiff
path: root/app/ServiceProvider/UserProvider.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-11-09 15:09:54 -0800
committerFrederic Guillot <fred@kanboard.net>2017-11-09 15:09:54 -0800
commit44aa24bab16bdc2545b08594386adb24ead3aa9e (patch)
tree4ca2c4632d9657f8babfb7781b5aadc0d3e30238 /app/ServiceProvider/UserProvider.php
parent95b2a36886a763242e11b4b27998a0d5c51ca7f4 (diff)
Add user backend provider system
Diffstat (limited to 'app/ServiceProvider/UserProvider.php')
-rw-r--r--app/ServiceProvider/UserProvider.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/app/ServiceProvider/UserProvider.php b/app/ServiceProvider/UserProvider.php
new file mode 100644
index 00000000..c80a2aeb
--- /dev/null
+++ b/app/ServiceProvider/UserProvider.php
@@ -0,0 +1,35 @@
+<?php
+
+namespace Kanboard\ServiceProvider;
+
+use Kanboard\Core\User\UserManager;
+use Kanboard\User\DatabaseBackendUserProvider;
+use Pimple\Container;
+use Pimple\ServiceProviderInterface;
+
+/**
+ * User Provider
+ *
+ * @package Kanboard\ServiceProvider
+ * @author Frederic Guillot
+ */
+class UserProvider implements ServiceProviderInterface
+{
+ /**
+ * Register providers
+ *
+ * @access public
+ * @param \Pimple\Container $container
+ * @return \Pimple\Container
+ */
+ public function register(Container $container)
+ {
+ $container['userManager'] = new UserManager();
+
+ if (DB_USER_PROVIDER) {
+ $container['userManager']->register(new DatabaseBackendUserProvider($container));
+ }
+
+ return $container;
+ }
+}