* @package repo * @version 1 * @link https://www.zentao.net */ class gitlabWebhookEntry extends baseEntry { /** * Repo webhook. * * @access public * @return string */ public function post() { $headers = getallheaders(); /* Fetch all HTTP request headers. */ $event = isset($headers['X-Gitlab-Event']) ? $headers['X-Gitlab-Event'] : ''; if(empty($event)) return; $repoID = $this->param('repoID'); if(empty($repoID)) return; $this->app->user = new stdclass(); $this->app->user->account = ''; $this->app->user->admin = false; $this->app->user->rights['rights'] = array(); $this->app->user->rights['acls'] = array(); $repo = $this->loadModel('repo')->getByID($repoID); if(empty($repo)) return; $this->loadController('user', 'login'); $this->repo->handleWebhook($event, $this->requestBody, $repo); } }