* Adjust check is bind user.
This commit is contained in:
@@ -42,18 +42,17 @@ class gitlab extends control
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Admin user don't need bind. */
|
||||
$isBindUser = (int)$this->app->user->admin;
|
||||
$gitlabList = $this->gitlab->getList($orderBy, $pager);
|
||||
$myGitLabs = $this->gitlab->getGitLabListByAccount();
|
||||
|
||||
foreach($gitlabList as $gitlab)
|
||||
{
|
||||
$token = $this->gitlab->apiGetCurrentUser($gitlab->url, $gitlab->token);
|
||||
$gitlab->isAdminToken = (isset($token->is_admin) and $token->is_admin);
|
||||
|
||||
if(!$isBindUser) $isBindUser = (int)$this->gitlab->getUserIDByZentaoAccount($gitlab->id, $this->app->user->account);
|
||||
$gitlab->isBindUser = $isBindUser;
|
||||
$gitlab->isBindUser = true;
|
||||
if(!$this->app->user->admin and !isset($myGitLabs[$gitlab->id])) $gitlab->isBindUser = false;
|
||||
}
|
||||
|
||||
|
||||
$this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browse;
|
||||
$this->view->gitlabList = $gitlabList;
|
||||
$this->view->orderBy = $orderBy;
|
||||
|
||||
Reference in New Issue
Block a user