From 54066ddd049217934e4771a9dfd8364801b450c9 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 21 Mar 2024 16:15:37 +0800 Subject: [PATCH] * Adjust bind user tip for gitlab and gitfox. --- module/gitfox/control.php | 4 ++-- module/gitlab/control.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/gitfox/control.php b/module/gitfox/control.php index 32bb5754e1..09804f672a 100644 --- a/module/gitfox/control.php +++ b/module/gitfox/control.php @@ -134,8 +134,8 @@ class gitfox extends control { $userPairs = $this->loadModel('user')->getPairs('noclosed|noletter'); - $user = $this->gitfox->apiGetCurrentUser($gitfoxID); - if(!isset($user->admin) or !$user->admin) return $this->sendError($this->lang->gitfox->tokenLimit, $this->createLink('gitfox', 'edit', array('gitfoxID' => $gitfoxID))); + $user = $this->gitfox->apiGetCurrentUser($gitfoxID); + if(empty($user->admin)) return $this->send(array('result' => 'fail', 'load' => array('alert' => $this->lang->gitfox->tokenLimit, 'modal' => $this->createLink('gitfox', 'edit', array('gitfoxID' => $gitfoxID))))); $zentaoUsers = $this->dao->select('account,email,realname')->from(TABLE_USER)->where('deleted')->eq('0')->fetchAll('account'); diff --git a/module/gitlab/control.php b/module/gitlab/control.php index e4f654be13..c8fd774cfb 100644 --- a/module/gitlab/control.php +++ b/module/gitlab/control.php @@ -156,7 +156,7 @@ class gitlab extends control $gitlab = $this->gitlab->getByID($gitlabID); $user = $this->gitlab->apiGetCurrentUser($gitlab->url, $gitlab->token); - if(!isset($user->is_admin) or !$user->is_admin) return $this->send(array('result' => 'fail', 'message' => $this->lang->gitlab->tokenLimit, 'locate' => $this->createLink('gitlab', 'edit', array('gitlabID' => $gitlabID)))); + if(empty($user->is_admin)) return $this->send(array('result' => 'fail', 'load' => array('alert' => $this->lang->gitlab->tokenLimit, 'modal' => $this->createLink('gitlab', 'edit', array('gitlabID' => $gitlabID))))); $zentaoUsers = $this->dao->select('account,email,realname')->from(TABLE_USER)->where('deleted')->eq('0')->fetchAll('account');