From 35d72f80e77e1df4f6efde7f9aca6e68e6092ffb Mon Sep 17 00:00:00 2001 From: aaronchen2k <462826@qq.com> Date: Tue, 14 Jan 2020 10:48:37 +0800 Subject: [PATCH] support username/password credential --- module/ci/lang/zh-cn.php | 1 + module/ci/model.php | 8 ++++---- module/ci/view/createjenkins.html.php | 2 +- module/ci/view/editjenkins.html.php | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/module/ci/lang/zh-cn.php b/module/ci/lang/zh-cn.php index d0136cd008..bb797084e9 100644 --- a/module/ci/lang/zh-cn.php +++ b/module/ci/lang/zh-cn.php @@ -49,6 +49,7 @@ $lang->jenkins->username = '用户名'; $lang->jenkins->password = '密码'; $lang->jenkins->token = 'Token'; $lang->jenkins->desc = '描述'; +$lang->jenkins->tips = '选择用户名密码类型凭证时,请在Jenkins全局安全设置中禁用"防止跨站点请求伪造"选项。'; $lang->jenkins->typeList['token'] = 'Token'; $lang->jenkins->typeList['credential'] = '凭证'; diff --git a/module/ci/model.php b/module/ci/model.php index 13ee638eca..281606d92e 100644 --- a/module/ci/model.php +++ b/module/ci/model.php @@ -708,7 +708,7 @@ class ciModel extends model { $credentials = $this->dao->select('id, name')->from(TABLE_CREDENTIALS) ->where('deleted')->eq('0') - ->beginIF(!empty(whr))->andWhere($whr)->fi() + ->beginIF(!empty(whr))->andWhere('(' . $whr . ')')->fi() ->orderBy(id) ->fetchPairs(); $credentials[''] = ''; @@ -724,7 +724,7 @@ class ciModel extends model { $repos = $this->dao->select('id, name')->from(TABLE_REPO) ->where('deleted')->eq('0') - ->beginIF(!empty(whr))->andWhere($whr)->fi() + ->beginIF(!empty(whr))->andWhere('(' . $whr . ')')->fi() ->orderBy(id) ->fetchPairs(); $repos[''] = ''; @@ -740,7 +740,7 @@ class ciModel extends model { $repos = $this->dao->select('*')->from(TABLE_REPO) ->where('deleted')->eq('0') - ->beginIF(!empty(whr))->andWhere($whr)->fi() + ->beginIF(!empty(whr))->andWhere('(' . $whr . ')')->fi() ->orderBy(id) ->fetchAll(); $repos[''] = ''; @@ -756,7 +756,7 @@ class ciModel extends model { $repos = $this->dao->select('id, name')->from(TABLE_JENKINS) ->where('deleted')->eq('0') - ->beginIF(!empty(whr))->andWhere($whr)->fi() + ->beginIF(!empty(whr))->andWhere('(' . $whr . ')')->fi() ->orderBy(id) ->fetchPairs(); $repos[''] = ''; diff --git a/module/ci/view/createjenkins.html.php b/module/ci/view/createjenkins.html.php index e904c4705e..987da3ba2f 100644 --- a/module/ci/view/createjenkins.html.php +++ b/module/ci/view/createjenkins.html.php @@ -37,7 +37,7 @@