* Hide password and token of instance view page.

This commit is contained in:
zhaoke
2023-08-29 13:24:55 +08:00
parent 8adee143c7
commit d22a23745c
16 changed files with 193 additions and 10 deletions
+1
View File
@@ -42,6 +42,7 @@ class account extends control
$this->view->title = $this->lang->account->common;
$this->view->accountList = $accountList;
$this->view->users = $this->loadModel('user')->getPairs('noletter,noempty,noclosed');
$this->view->pager = $pager;
$this->view->param = $param;
$this->view->orderBy = $orderBy;
+1 -1
View File
@@ -31,7 +31,7 @@ jsVar('sortLink', helper::createLink('account', 'browse', "browseType=$browseTyp
dtable
(
set::userMap($accountList),
set::userMap($users),
set::cols(array_values($config->account->dtable->fieldList)),
set::data($tableData),
set::sortLink(jsRaw('createSortLink')),
+30 -5
View File
@@ -33,11 +33,36 @@ window.afterPageUpdate = function()
if($('#statusTD').data('reload') === true || $('#memoryRate').data('load') == true)
{
reloadTimes++;
fetchContent({url: $.createLink('instance', 'view', 'id=' + instanceID),
selector: '#instanceInfoContainer',
id: 'instanceInfoContainer',
target: '#instanceInfoContainer',
});
fetchContent
({
url: $.createLink('instance', 'view', 'id=' + instanceID),
selector: '#instanceInfoContainer',
id: 'instanceInfoContainer',
target: '#instanceInfoContainer',
});
}
}, 4000);
}
$('.copy-btn').on('click', function()
{
var copyText = $(this).parent().find('input');
copyText.show();
copyText[0].select();
document.execCommand("Copy");
copyText.hide();
var that = this;
$(that).tooltip
({
trigger: 'click',
placement: 'bottom',
title: copied,
tipClass: 'success',
show:true
});
setTimeout(function()
{
$(that).tooltip('hide');
}, 2000)
})
+4
View File
@@ -57,6 +57,10 @@ $lang->instance->installAt = 'Creation time';
$lang->instance->runDuration = 'Running';
$lang->instance->defaultAccount = 'Default User';
$lang->instance->defaultPassword = 'Default Password';
$lang->instance->account = 'User';
$lang->instance->password = 'Password';
$lang->instance->token = 'Token';
$lang->instance->copied = 'Copy successful';
$lang->instance->operationLog = 'Operation Record';
$lang->instance->installedService = 'Installed Service';
$lang->instance->runningService = 'Running Service';
+4
View File
@@ -57,6 +57,10 @@ $lang->instance->installAt = 'Creation time';
$lang->instance->runDuration = 'Running';
$lang->instance->defaultAccount = 'Default User';
$lang->instance->defaultPassword = 'Default Password';
$lang->instance->account = 'User';
$lang->instance->password = 'Password';
$lang->instance->token = 'Token';
$lang->instance->copied = 'Copy successful';
$lang->instance->operationLog = 'Operation Record';
$lang->instance->installedService = 'Installed Service';
$lang->instance->runningService = 'Running Service';
+4
View File
@@ -57,6 +57,10 @@ $lang->instance->installAt = 'Creation time';
$lang->instance->runDuration = 'Running';
$lang->instance->defaultAccount = 'Default User';
$lang->instance->defaultPassword = 'Default Password';
$lang->instance->account = 'User';
$lang->instance->password = 'Password';
$lang->instance->token = 'Token';
$lang->instance->copied = 'Copy successful';
$lang->instance->operationLog = 'Operation Record';
$lang->instance->installedService = 'Installed Service';
$lang->instance->runningService = 'Running Service';
+4
View File
@@ -58,6 +58,10 @@ $lang->instance->installAt = '创建时间';
$lang->instance->runDuration = '已运行';
$lang->instance->defaultAccount = '默认用户';
$lang->instance->defaultPassword = '默认密码';
$lang->instance->account = '用户名';
$lang->instance->password = '密码';
$lang->instance->token = 'Token';
$lang->instance->copied = '复制成功';
$lang->instance->operationLog = '操作记录';
$lang->instance->installedService = '已安装服务';
$lang->instance->runningService = '运行中的服务';
+26 -4
View File
@@ -13,12 +13,24 @@ declare(strict_types=1);
namespace zin;
jsVar('copied', $lang->instance->copied);
jsVar('instanceID', $instance->id);
$cpuInfo = $this->instance->printCpuUsage($instance, $instanceMetric->cpu, 'array');
$memoryInfo = $this->instance->printMemUsage($instance, $instanceMetric->memory, 'array');
$actions = $this->loadModel('common')->buildOperateMenu($instance);
if($type !== 'store')
{
$defaultAccount = new stdclass();
$defaultAccount->username = $instance->account;
$defaultAccount->password = $instance->password;
$defaultAccount->token = $instance->token;
$lang->instance->defaultAccount = $lang->instance->account;
$lang->instance->defaultPassword = $lang->instance->password;
}
$dbListWg = array();
foreach($dbList as $db)
{
@@ -149,8 +161,9 @@ div
h::th($lang->instance->installBy),
h::th($lang->instance->installAt),
$type !== 'store' ? null : h::th($lang->instance->runDuration),
$defaultAccount ? h::th($lang->instance->defaultAccount) : null,
$defaultAccount ? h::th($lang->instance->defaultPassword) : null,
!empty($defaultAccount->username) ? h::th($lang->instance->defaultAccount) : null,
!empty($defaultAccount->password) ? h::th($lang->instance->defaultPassword) : null,
!empty($defaultAccount->token) ? h::th($lang->instance->token) : null,
$type === 'store' ? null : h::th($lang->instance->browseProject),
),
h::tr
@@ -170,8 +183,17 @@ div
h::td(zget($users, $instance->createdBy, '')),
h::td(substr($instance->createdAt, 0, 16)),
$type !== 'store' ? null : h::td(common::printDuration($instance->runDuration)),
$defaultAccount ? h::td($defaultAccount->username) : null,
$defaultAccount ? h::td($defaultAccount->password) : null,
!empty($defaultAccount->username) ? h::td($defaultAccount->username) : null,
!empty($defaultAccount->password) ? h::td
(
input(set::type('text'), set::value($defaultAccount->password), set::name('password'), setStyle('display', 'none')),
btn(set::class('copy-btn ghost'),set::icon('copy'))
): null,
!empty($defaultAccount->token) ? h::td
(
input(set::type('text'), set::value($defaultAccount->token), set::name('token'), setStyle('display', 'none')),
btn(set::class('copy-btn ghost'),set::icon('copy'))
): null,
$type === 'store' ? null : h::td
(
btn
+36
View File
@@ -0,0 +1,36 @@
<?php
/**
* The install router file of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package ZenTaoPMS
* @version $Id: install.php 4677 2013-04-26 06:23:58Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
error_reporting(0);
define('IN_INSTALL', true);
/* Load the framework. */
include '../framework/router.class.php';
include '../framework/control.class.php';
include '../framework/model.class.php';
include '../framework/helper.class.php';
/* Instance the app. */
$app = router::createApp('pms', dirname(dirname(__FILE__)), 'router');
/* Check installed or not. */
if(!isset($_SESSION['installing']) and isset($config->installed) and $config->installed) die(header('location: index.php'));
/* Reset the config params to make sure the install program will be lauched. */
$config->set('requestType', 'GET');
$config->set('default.module', 'install');
$app->setDebug();
/* During the installation, if the database params is setted, auto connect the db. */
if(isset($config->installed) and $config->installed) $app->connectDB();
$app->parseRequest();
$app->loadModule();
Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

+83
View File
@@ -0,0 +1,83 @@
<?php
/**
* The upgrade router file of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package ZenTaoPMS
* @version $Id: upgrade.php 4677 2013-04-26 06:23:58Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
/* Judge my.php exists or not. */
define('IN_UPGRADE', true);
$basePath = dirname(dirname(__FILE__));
$dbConfig = $basePath . '/config/db.php';
$myConfig = $basePath . '/config/my.php';
if(file_exists($dbConfig))
{
if(file_exists($myConfig))
{
$myContent = trim(file_get_contents($myConfig));
$myContent = str_replace('<?php', '', $myContent);
}
if(!@rename($dbConfig, $myConfig))
{
$configDir = $basePath . '/config/';
echo "请执行命令 chmod 777 $configDir 来修改权限,保证禅道在该目录有操作文件权限" . "<br />";
echo "Please execute the command 'chmod 777 $configDir' to modify the permissions to ensure that the ZenTao has operating file permissions in this directory";
exit;
}
if(!empty($myContent))
{
$myContent = file_get_contents($myConfig) . "\n" . $myContent;
file_put_contents($myConfig, $myContent);
}
}
if(!file_exists($myConfig)) die(header('location: install.php'));
if(file_exists("{$basePath}/config/ext/secret.php") and !unlink("{$basePath}/config/ext/secret.php"))
{
echo "请删除文件 {$basePath}/config/ext/secret.php,后刷新页面<br />";
echo "Please delete {$basePath}/config/ext/secret.php and refresh.";
exit;
}
error_reporting(0);
/* Load the framework. */
include '../framework/router.class.php';
include '../framework/control.class.php';
include '../framework/model.class.php';
include '../framework/helper.class.php';
/* Instance the app. */
$app = router::createApp('pms', dirname(dirname(__FILE__)), 'router');
$common = $app->loadCommon();
/* Reset the config params to make sure the install program will be lauched. */
$config->set('requestType', 'GET');
$config->set('default.module', 'upgrade');
$app->setDebug();
/* Check the installed version is the latest or not. */
$config->installedVersion = $common->loadModel('setting')->getVersion();
if(($config->version[0] == $config->installedVersion[0] or (is_numeric($config->version[0]) and is_numeric($config->installedVersion[0]))) and version_compare($config->version, $config->installedVersion) <= 0) die(header('location: index.php'));
/* If run in container, upgrade automatically. */
if($app->isContainer())
{
$upgradeModel = $common->loadModel('upgrade');
$alterSQL = $upgradeModel->checkConsistency();
if(!empty($alterSQL)) $upgradeModel->dao->query("SET @@sql_mode= '';" . $alterSQL);
$config->set('default.method', 'execute');
$app->session->set('upgrading', true);
$app->session->set('step', '');
$app->post->set('fromVersion', str_replace( '.', '_', strtolower($config->installedVersion)));
}
/* Run it. */
$app->parseRequest();
if($common->checkUpgradeStatus()) $app->loadModule();