Merge remote-tracking branch 'origin/release-20.0'
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
global $app;
|
||||
$config->gitlab->form = new stdclass();
|
||||
$config->gitlab->form->create = array();
|
||||
$config->gitlab->form->create['appType'] = array('type' => 'string', 'required' => true, 'default' => 'gitlab');
|
||||
@@ -7,7 +6,6 @@ $config->gitlab->form->create['type'] = array('type' => 'string', 'requ
|
||||
$config->gitlab->form->create['name'] = array('type' => 'string', 'required' => true, 'default' => '', 'filter' => 'trim');
|
||||
$config->gitlab->form->create['url'] = array('type' => 'string', 'required' => true, 'default' => '', 'filter' => 'trim');
|
||||
$config->gitlab->form->create['token'] = array('type' => 'string', 'required' => true, 'default' => '', 'filter' => 'trim');
|
||||
$config->gitlab->form->create['createdBy'] = array('type' => 'string', 'required' => false, 'default' => $app->user->account);
|
||||
$config->gitlab->form->create['createdDate'] = array('type' => 'string', 'required' => false, 'default' => helper::now());
|
||||
$config->gitlab->form->create['private'] = array('type' => 'string', 'required' => false, 'default' => uniqid());
|
||||
|
||||
@@ -15,7 +13,6 @@ $config->gitlab->form->edit = array();
|
||||
$config->gitlab->form->edit['name'] = array('type' => 'string', 'required' => true, 'default' => '', 'filter' => 'trim');
|
||||
$config->gitlab->form->edit['url'] = array('type' => 'string', 'required' => true, 'default' => '', 'filter' => 'trim');
|
||||
$config->gitlab->form->edit['token'] = array('type' => 'string', 'required' => true, 'default' => '', 'filter' => 'trim');
|
||||
$config->gitlab->form->edit['editedBy'] = array('type' => 'string', 'required' => false, 'default' => $app->user->account);
|
||||
$config->gitlab->form->edit['editedDate'] = array('type' => 'string', 'required' => false, 'default' => helper::now());
|
||||
|
||||
$config->gitlab->form->user = new stdclass();
|
||||
|
||||
@@ -75,7 +75,9 @@ class gitlab extends control
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$gitlab = form::data($this->config->gitlab->form->create)->get();
|
||||
$gitlab = form::data($this->config->gitlab->form->create)
|
||||
->add('createdBy', $this->app->user->account)
|
||||
->get();
|
||||
$this->checkToken($gitlab);
|
||||
$gitlabID = $this->loadModel('pipeline')->create($gitlab);
|
||||
|
||||
@@ -123,7 +125,9 @@ class gitlab extends control
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$gitlab = form::data($this->config->gitlab->form->edit)->get();
|
||||
$gitlab = form::data($this->config->gitlab->form->edit)
|
||||
->add('editedBy', $this->app->user->account)
|
||||
->get();
|
||||
$this->checkToken($gitlab, $gitlabID);
|
||||
$this->loadModel('pipeline')->update($gitlabID, $gitlab);
|
||||
$gitLab = $this->gitlab->getByID($gitlabID);
|
||||
|
||||
@@ -2332,18 +2332,18 @@ class gitlabModel extends model
|
||||
* @param int $projectID
|
||||
* @param int $repoID
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return string
|
||||
*/
|
||||
public function updateCodePath(int $gitlabID, int $projectID, int $repoID): bool
|
||||
public function updateCodePath(int $gitlabID, int $projectID, int $repoID): string
|
||||
{
|
||||
$project = $this->apiGetSingleProject($gitlabID, $projectID);
|
||||
if(is_object($project) and !empty($project->web_url))
|
||||
{
|
||||
$this->dao->update(TABLE_REPO)->set('path')->eq($project->web_url)->where('id')->eq($repoID)->exec();
|
||||
return true;
|
||||
return $project->web_url;
|
||||
}
|
||||
|
||||
return false;
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2417,6 +2417,7 @@ class gitlabModel extends model
|
||||
if(!$gitlab) return array();
|
||||
|
||||
/* Compatible with HTTP and HTTPS domain. */
|
||||
if(strpos($repo->codePath, '/api/v4/projects')) $repo->codePath = $this->updateCodePath((int)$repo->serviceHost, (int)$repo->serviceProject, $repo->id);
|
||||
$repo->client = str_replace('https://', 'http://', $repo->client);
|
||||
$repo->codePath = str_replace('https://', 'http://', $repo->codePath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user