summaryrefslogtreecommitdiff
path: root/app/User/DatabaseUserProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/User/DatabaseUserProvider.php')
-rw-r--r--app/User/DatabaseUserProvider.php144
1 files changed, 144 insertions, 0 deletions
diff --git a/app/User/DatabaseUserProvider.php b/app/User/DatabaseUserProvider.php
new file mode 100644
index 00000000..b6d41186
--- /dev/null
+++ b/app/User/DatabaseUserProvider.php
@@ -0,0 +1,144 @@
+<?php
+
+namespace Kanboard\User;
+
+use Kanboard\Core\User\UserProviderInterface;
+use Kanboard\Core\Security\Role;
+
+/**
+ * Database User Provider
+ *
+ * @package user
+ * @author Frederic Guillot
+ */
+class DatabaseUserProvider implements UserProviderInterface
+{
+ /**
+ * User properties
+ *
+ * @access private
+ * @var array
+ */
+ private $user = array();
+
+ /**
+ * Constructor
+ *
+ * @access public
+ * @param array $user
+ */
+ public function __construct(array $user)
+ {
+ $this->user = $user;
+ }
+
+ /**
+ * Return true to allow automatic user creation
+ *
+ * @access public
+ * @return boolean
+ */
+ public function isUserCreationAllowed()
+ {
+ return false;
+ }
+
+ /**
+ * Get internal id
+ *
+ * @access public
+ * @return string
+ */
+ public function getInternalId()
+ {
+ return $this->user['id'];
+ }
+
+ /**
+ * Get external id column name
+ *
+ * @access public
+ * @return string
+ */
+ public function getExternalIdColumn()
+ {
+ return '';
+ }
+
+ /**
+ * Get external id
+ *
+ * @access public
+ * @return string
+ */
+ public function getExternalId()
+ {
+ return '';
+ }
+
+ /**
+ * Get user role
+ *
+ * @access public
+ * @return string
+ */
+ public function getRole()
+ {
+ return '';
+ }
+
+ /**
+ * Get username
+ *
+ * @access public
+ * @return string
+ */
+ public function getUsername()
+ {
+ return '';
+ }
+
+ /**
+ * Get full name
+ *
+ * @access public
+ * @return string
+ */
+ public function getName()
+ {
+ return '';
+ }
+
+ /**
+ * Get user email
+ *
+ * @access public
+ * @return string
+ */
+ public function getEmail()
+ {
+ return '';
+ }
+
+ /**
+ * Get external group ids
+ *
+ * @access public
+ * @return array
+ */
+ public function getExternalGroupIds()
+ {
+ return array();
+ }
+
+ /**
+ * Get extra user attributes
+ *
+ * @access public
+ * @return array
+ */
+ public function getExtraAttributes()
+ {
+ return array();
+ }
+}