From bb7e0b9fc6709d04ee8ad06b6238f5a46fca722a Mon Sep 17 00:00:00 2001 From: liyuchun Date: Fri, 21 Jan 2022 09:52:27 +0800 Subject: [PATCH] * Finish task #48095. --- module/gitlab/control.php | 6 ++++++ module/gitlab/lang/en.php | 1 + module/gitlab/lang/zh-cn.php | 1 + 3 files changed, 8 insertions(+) diff --git a/module/gitlab/control.php b/module/gitlab/control.php index f06fbc76e0..cb995fc59e 100644 --- a/module/gitlab/control.php +++ b/module/gitlab/control.php @@ -606,6 +606,12 @@ class gitlab extends control */ public function browseProject($gitlabID, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1) { + if(!$this->app->user->admin) + { + $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); + if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); + } + $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); $keyword = fixer::input('post')->setDefault('keyword', '')->get('keyword'); // Fix bug#16741. diff --git a/module/gitlab/lang/en.php b/module/gitlab/lang/en.php index dda54c7e78..8fd68f46ca 100644 --- a/module/gitlab/lang/en.php +++ b/module/gitlab/lang/en.php @@ -72,6 +72,7 @@ $lang->gitlab->tokenFirst = 'When the Token is not empty, the Token will be u $lang->gitlab->tips = 'When using a password, please disable the "Prevent cross-site request forgery" option in the GitLab global security settings.'; $lang->gitlab->emptyError = " cannot be empty"; $lang->gitlab->createSuccess = "Create success"; +$lang->gitlab->mustBindUser = 'You have not registered the GitLab account, please contact the administrator to register.'; $lang->gitlab->placeholder = new stdclass; $lang->gitlab->placeholder->name = ''; diff --git a/module/gitlab/lang/zh-cn.php b/module/gitlab/lang/zh-cn.php index 82da87fc2c..617f815aba 100644 --- a/module/gitlab/lang/zh-cn.php +++ b/module/gitlab/lang/zh-cn.php @@ -72,6 +72,7 @@ $lang->gitlab->tokenFirst = 'Token不为空时,优先使用Token。'; $lang->gitlab->tips = '使用密码时,请在GitLab全局安全设置中禁用"防止跨站点请求伪造"选项。'; $lang->gitlab->emptyError = "不能为空"; $lang->gitlab->createSuccess = "创建成功"; +$lang->gitlab->mustBindUser = '您还未绑定GitLab用户,请联系管理员进行绑定'; $lang->gitlab->placeholder = new stdclass; $lang->gitlab->placeholder->name = '';