* finish task #7802.

This commit is contained in:
z
2020-09-07 10:09:59 +08:00
parent fa2690d046
commit c5a6cfd5aa
9 changed files with 23 additions and 6 deletions
+6
View File
@@ -135,6 +135,12 @@ $config->charsets['vi']['GBK'] = 'GBK';
/* IP white list settings.*/
$config->ipWhiteList = '*';
/* Switch for zentao features. */
$config->features = new stdclass();
$config->features->apiGetModel = false;
$config->features->apiSQL = false;
$config->features->cronSystemCall = false;
/* Define the tables. */
define('TABLE_COMPANY', '`' . $config->db->prefix . 'company`');
define('TABLE_DEPT', '`' . $config->db->prefix . 'dept`');
+4
View File
@@ -37,6 +37,8 @@ class api extends control
*/
public function getModel($moduleName, $methodName, $params = '')
{
if(!$this->config->features->apiGetModel) die();
$params = explode(',', $params);
$newParams = array_shift($params);
foreach($params as $param)
@@ -105,6 +107,8 @@ class api extends control
*/
public function sql($keyField = '')
{
if(!$this->config->features->apiSQL) die();
$sql = isset($_POST['sql']) ? $this->post->sql : '';
$this->view->results = $this->api->sql($sql, $keyField);
die($this->display());
+2
View File
@@ -94,6 +94,8 @@ class apiModel extends model
*/
public function sql($sql, $keyField = '')
{
if(!$this->config->features->apiGetSQL) return false;
$sql = trim($sql);
if(strpos($sql, ';') !== false) $sql = substr($sql, 0, strpos($sql, ';'));
a($sql);
+2 -1
View File
@@ -30,7 +30,8 @@ $lang->cron->statusList['running'] = 'Läuft';
$lang->cron->statusList['stop'] = 'Gestoppt';
$lang->cron->typeList['zentao'] = 'Selbstaufruf';
$lang->cron->typeList['system'] = 'System Kommando';
global $config;
if($config->features->cronSystemCall) $lang->cron->typeList['system'] = 'System Kommando';
$lang->cron->toggleList['start'] = 'Aktivieren';
$lang->cron->toggleList['stop'] = 'Deaktivieren';
+2 -1
View File
@@ -30,7 +30,8 @@ $lang->cron->statusList['running'] = 'Running';
$lang->cron->statusList['stop'] = 'Stop';
$lang->cron->typeList['zentao'] = 'Self Call';
$lang->cron->typeList['system'] = 'System Command';
global $config;
if($config->features->cronSystemCall) $lang->cron->typeList['system'] = 'System Command';
$lang->cron->toggleList['start'] = 'Activate';
$lang->cron->toggleList['stop'] = 'Deactivate';
+2 -1
View File
@@ -30,7 +30,8 @@ $lang->cron->statusList['running'] = 'Running';
$lang->cron->statusList['stop'] = 'Stop';
$lang->cron->typeList['zentao'] = 'Self Call';
$lang->cron->typeList['system'] = 'Command Système';
global $config;
if($config->features->cronSystemCall) $lang->cron->typeList['system'] = 'Command Système';
$lang->cron->toggleList['start'] = 'Activer';
$lang->cron->toggleList['stop'] = 'Désactiver';
+2 -1
View File
@@ -30,7 +30,8 @@ $lang->cron->statusList['running'] = 'Đang chạy';
$lang->cron->statusList['stop'] = 'Dừng';
$lang->cron->typeList['zentao'] = 'Tự gọi';
$lang->cron->typeList['system'] = 'Câu lệnh hệ thống';
global $config;
if($config->features->cronSystemCall) $lang->cron->typeList['system'] = 'Câu lệnh hệ thống';
$lang->cron->toggleList['start'] = 'Kích hoạt';
$lang->cron->toggleList['stop'] = 'Vô hiệu';
+2 -1
View File
@@ -30,7 +30,8 @@ $lang->cron->statusList['running'] = '运行中';
$lang->cron->statusList['stop'] = '停止';
$lang->cron->typeList['zentao'] = '禅道自调用';
$lang->cron->typeList['system'] = '操作系统命令';
global $config;
if($config->features->cronSystemCall) $lang->cron->typeList['system'] = '操作系统命令';
$lang->cron->toggleList['start'] = '激活';
$lang->cron->toggleList['stop'] = '禁用';
+1 -1
View File
@@ -59,7 +59,7 @@
</tr>
<tr>
<th><?php echo $lang->cron->type;?></th>
<td><?php echo html::select('type', $lang->cron->typeList, 'system', "class='form-control'")?></td>
<td><?php echo html::select('type', $lang->cron->typeList, 'zentao', "class='form-control'")?></td>
</tr>
<tr>
<td colspan='3' class='text-center'><?php echo html::submitButton()?></td>