Merge branch 'jihu'

This commit is contained in:
Guan Xiying
2021-07-14 09:48:58 +08:00
84 changed files with 3798 additions and 225 deletions
+2 -1
View File
@@ -38,6 +38,7 @@ $lang->user = new stdclass();
$lang->report = new stdclass();
$lang->repo = new stdclass();
$lang->jenkins = new stdclass();
$lang->gitlab = new stdclass();
$lang->compile = new stdclass();
$lang->job = new stdclass();
$lang->svn = new stdclass();
@@ -150,4 +151,4 @@ $lang->icons['unlock'] = 'unlock-alt';
$lang->icons['confirmStoryChange'] = 'search';
$lang->icons['score'] = 'tint';
$lang->noMenuModule = array('report', 'my', 'todo', 'effort', 'program', 'product', 'execution', 'task', 'build', 'productplan', 'project', 'projectrelease', 'projectstory', 'story', 'branch', 'release', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'custom', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'pssp', 'sms', 'message', 'webhook', 'search', 'score', 'stage', 'entry', 'jenkins');
$lang->noMenuModule = array('report', 'my', 'todo', 'effort', 'program', 'product', 'execution', 'task', 'build', 'productplan', 'project', 'projectrelease', 'projectstory', 'story', 'branch', 'release', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'custom', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'pssp', 'sms', 'message', 'webhook', 'search', 'score', 'stage', 'entry', 'jenkins','gitlab');
+3
View File
@@ -319,12 +319,14 @@ $lang->devops->menu = new stdclass();
$lang->devops->menu->code = array('link' => "{$lang->repo->common}|repo|browse|repoID=%s", 'alias' => 'diff,view,revision,log,blame,showsynccomment');
$lang->devops->menu->compile = array('link' => "{$lang->devops->compile}|job|browse", 'subModule' => 'compile,job');
$lang->devops->menu->jenkins = array('link' => "Jenkins|jenkins|browse", 'alias' => 'create,edit');
$lang->devops->menu->gitlab = array('link' => "Gitlab|gitlab|browse", 'alias' => 'create,edit');
$lang->devops->menu->maintain = array('link' => "{$lang->devops->repo}|repo|maintain", 'alias' => 'create,edit');
$lang->devops->menu->rules = array('link' => "{$lang->devops->rules}|repo|setrules");
$lang->devops->menuOrder[5] = 'code';
$lang->devops->menuOrder[10] = 'compile';
$lang->devops->menuOrder[15] = 'jenkins';
$lang->devops->menuOrder[14] = 'gitlab';
$lang->devops->menuOrder[20] = 'maintain';
$lang->devops->menuOrder[25] = 'rules';
@@ -521,6 +523,7 @@ $lang->navGroup->devops = 'devops';
$lang->navGroup->repo = 'devops';
$lang->navGroup->job = 'devops';
$lang->navGroup->jenkins = 'devops';
$lang->navGroup->gitlab = 'devops';
$lang->navGroup->compile = 'devops';
$lang->navGroup->ci = 'devops';
$lang->navGroup->svn = 'devops';
+11 -22
View File
@@ -178,23 +178,9 @@ class commonModel extends model
*/
public function isOpenMethod($module, $method)
{
if($module == 'upgrade' and $method == 'ajaxupdatefile') return true;
if($module == 'user' and strpos('login|logout|deny|reset|refreshrandom', $method) !== false) return true;
if($module == 'api' and $method == 'getsessionid') return true;
if($module == 'misc' and $method == 'checktable') return true;
if($module == 'misc' and $method == 'qrcode') return true;
if($module == 'misc' and $method == 'about') return true;
if($module == 'misc' and $method == 'checkupdate') return true;
if($module == 'misc' and $method == 'ping') return true;
if($module == 'misc' and $method == 'captcha') return true;
if($module == 'sso' and $method == 'login') return true;
if($module == 'sso' and $method == 'logout') return true;
if($module == 'sso' and $method == 'bind') return true;
if($module == 'sso' and $method == 'gettodolist') return true;
if(in_array("$module.$method", $this->config->openMethods)) return true;
if($module == 'block' and $method == 'main' and isset($_GET['hash'])) return true;
if($module == 'file' and $method == 'read') return true;
if($module == 'index' and $method == 'changelog') return true;
if($module == 'my' and $method == 'preference') return true;
if($this->loadModel('user')->isLogon() or ($this->app->company->guest and $this->app->user->account == 'guest'))
{
@@ -2038,6 +2024,8 @@ EOD;
*/
public function checkEntry()
{
if($this->isOpenMethod($_GET[$this->config->moduleVar], $_GET[$this->config->methodVar])) return true;
$this->loadModel('entry');
if($this->session->valid_entry)
{
@@ -2050,10 +2038,10 @@ EOD;
if(!$this->get->token) $this->response('PARAM_TOKEN_MISSING');
$entry = $this->entry->getByCode($this->get->code);
if(!$entry) $this->response('EMPTY_ENTRY');
if(!$entry->key) $this->response('EMPTY_KEY');
if(!$this->checkIP($entry->ip)) $this->response('IP_DENIED');
if(!$this->checkEntryToken($entry)) $this->response('INVALID_TOKEN');
if(!$entry) $this->response('EMPTY_ENTRY');
if(!$entry->key) $this->response('EMPTY_KEY');
if(!$this->checkIP($entry->ip)) $this->response('IP_DENIED');
if(!$this->checkEntryToken($entry)) $this->response('INVALID_TOKEN');
if($entry->freePasswd == 0 and empty($entry->account)) $this->response('ACCOUNT_UNBOUND');
$isFreepasswd = ($_GET['m'] == 'user' and strtolower($_GET['f']) == 'apilogin' and $_GET['account'] and $entry->freePasswd);
@@ -2253,14 +2241,15 @@ EOD;
if(!empty($data))
{
if(is_object($data)) $data = (array) $data;
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
if($options) curl_setopt_array($curl, $options);
$response = curl_exec($curl);
$errors = curl_error($curl);
curl_close($curl);
$logFile = $app->getLogRoot() . 'saas.'. date('Ymd') . '.log.php';