From 8eb739bb910fb91737c6ce65f244eb9a3ac8f35c Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 23 Aug 2015 13:15:59 -0400 Subject: Add Gitlab authentication --- app/Model/Acl.php | 2 +- app/Model/User.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'app/Model') 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 @@ -138,6 +138,22 @@ class User extends Base return $this->db->table(self::TABLE)->eq('github_id', $github_id)->findOne(); } + /** + * 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 * -- cgit v1.2.3