* Modify root token check.

This commit is contained in:
caoyanyi
2022-01-25 08:23:28 +00:00
parent 3fee6f256d
commit 42c0a2f115
4 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -248,7 +248,7 @@ class gitlab extends control
if(strpos($gitlabURL, 'http') !== 0) return $this->send(array('result' => 'fail', 'message' => array('url' => array($this->lang->gitlab->hostError))));
if(!$token) return $this->send(array('result' => 'fail', 'message' => array('token' => array($this->lang->gitlab->tokenError))));
$user = $this->gitlab->apiGetCurrentUser($gitlabURL, $token);
$user = $this->gitlab->apiGetCurrentUser($gitlabURL, $token, true);
if(!is_object($user)) return $this->send(array('result' => 'fail', 'message' => array('url' => array($this->lang->gitlab->hostError))));
if(!isset($user->is_admin) or !$user->is_admin) return $this->send(array('result' => 'fail', 'message' => array('token' => array($this->lang->gitlab->tokenError))));