diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-08-23 13:15:59 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-08-23 13:15:59 -0400 |
commit | 8eb739bb910fb91737c6ce65f244eb9a3ac8f35c (patch) | |
tree | db615be44d945a8dc1880a1238a381ec6534dfa2 /app/Model | |
parent | 297c11e48e1cf18e5773a7463721d862dfd6063d (diff) |
Add Gitlab authentication
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/Acl.php | 2 | ||||
-rw-r--r-- | app/Model/User.php | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/app/Model/Acl.php b/app/Model/Acl.php index e93bf1d9..8c28cb1a 100644 --- a/app/Model/Acl.php +++ b/app/Model/Acl.php @@ -23,7 +23,7 @@ class Acl extends Base 'webhook' => '*', 'ical' => '*', 'feed' => '*', - 'oauth' => array('google', 'github'), + 'oauth' => array('google', 'github', 'gitlab'), ); /** diff --git a/app/Model/User.php b/app/Model/User.php index 1a7a0666..8a7eff4a 100644 --- a/app/Model/User.php +++ b/app/Model/User.php @@ -139,6 +139,22 @@ class User extends Base } /** + * Get a specific user by the Gitlab id + * + * @access public + * @param string $gitlab_id Gitlab user id + * @return array|boolean + */ + public function getByGitlabId($gitlab_id) + { + if (empty($gitlab_id)) { + return false; + } + + return $this->db->table(self::TABLE)->eq('gitlab_id', $gitlab_id)->findOne(); + } + + /** * Get a specific user by the username * * @access public |