* adjust for check one click package.
This commit is contained in:
@@ -49,7 +49,8 @@ $lang->build->noProduct = " <span style='color:red'>該{$lang->projectCommon
|
||||
$lang->build->noBuild = '暫時沒有版本。';
|
||||
|
||||
$lang->build->notice = new stdclass();
|
||||
$lang->build->notice->changeProduct = "已經關聯{$lang->storyCommon}或Bug的版本,不能修改其所屬產品";
|
||||
$lang->build->notice->changeProduct = "已經關聯{$lang->storyCommon}、Bug或提交測試單的版本,不能修改其所屬{$lang->productCommon}";
|
||||
$lang->build->notice->changeProject = "提交測試單的版本,不能修改其所屬{$lang->projectCommon}";
|
||||
|
||||
$lang->build->finishStories = " 本次共完成 %s 個{$lang->storyCommon}";
|
||||
$lang->build->resolvedBugs = ' 本次共解決 %s 個Bug';
|
||||
|
||||
@@ -60,4 +60,62 @@ class miscModel extends model
|
||||
}
|
||||
return $remind;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check one click package.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function checkOneClickPackage()
|
||||
{
|
||||
$weakSites = array();
|
||||
if(strpos('|/zentao/|/pro/|/biz/|', "|{$this->config->webRoot}|") !== false)
|
||||
{
|
||||
$databases = array('zentao' => 'zentao', 'zentaopro' => 'zentaopro', 'zentaobiz' => 'zentaobiz', 'zentaoep' => 'zentaoep');
|
||||
if($this->config->webRoot == '/zentao/') unset($databases['zentao']);
|
||||
if($this->config->webRoot == '/pro/') unset($databases['zentaopro']);
|
||||
if($this->config->webRoot == '/biz/')
|
||||
{
|
||||
unset($databases['zentaobiz']);
|
||||
unset($databases['zentaoep']);
|
||||
}
|
||||
|
||||
$basePath = dirname($this->app->getBasePath());
|
||||
foreach($databases as $database)
|
||||
{
|
||||
$zentaoDirName = $database;
|
||||
if(!is_dir($basePath . '/' . $zentaoDirName))
|
||||
{
|
||||
if($zentaoDirName == 'zentaobiz' and !is_dir($basePath . '/zentaoep')) continue;
|
||||
if($zentaoDirName == 'zentaoep' and !is_dir($basePath . '/zentaobiz')) continue;
|
||||
if($zentaoDirName == 'zentao' or $zentaoDirName == 'zentaopro') continue;
|
||||
|
||||
if($zentaoDirName == 'zentaobiz') $zentaoDirName = 'zentaoep';
|
||||
if($zentaoDirName == 'zentaoep') $zentaoDirName = 'zentaobiz';
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$webRoot = "/{$database}/";
|
||||
if($database == 'zentao') $webRoot = '/zentao/';
|
||||
if($database == 'zentaopro') $webRoot = '/pro/';
|
||||
if($database == 'zentaobiz') $webRoot = '/biz/';
|
||||
if($database == 'zentaoep') $webRoot = '/biz/';
|
||||
|
||||
$user = $this->dbh->query("select * from {$database}.`zt_user` where account = 'admin' and password='" . md5('123456') . "'")->fetch();
|
||||
if($user)
|
||||
{
|
||||
$site = array();
|
||||
$site['path'] = basename($basePath) . '/' . $zentaoDirName;
|
||||
$site['database'] = $database;
|
||||
$weakSites[$database] = $site;
|
||||
}
|
||||
}
|
||||
catch(Exception $e){}
|
||||
}
|
||||
}
|
||||
|
||||
return $weakSites;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -821,13 +821,14 @@ class user extends control
|
||||
$this->view->demoUsers = $demoUsers;
|
||||
}
|
||||
|
||||
$this->app->loadLang('misc');
|
||||
$this->loadModel('misc');
|
||||
$this->view->noGDLib = sprintf($this->lang->misc->noGDLib, common::getSysURL() . $this->config->webRoot, '', false, true);
|
||||
$this->view->title = $this->lang->user->login;
|
||||
$this->view->referer = $this->referer;
|
||||
$this->view->s = zget($this->config->global, 'sn', '');
|
||||
$this->view->keepLogin = $this->cookie->keepLogin ? $this->cookie->keepLogin : 'off';
|
||||
$this->view->rand = $this->user->updateSessionRandom();
|
||||
$this->view->weakSites = $this->misc->checkOneClickPackage();
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,3 +16,6 @@ html[lang='en'] #loginPanel .table-form > tbody > tr > th {width: 80px;}
|
||||
#langs > .dropdown-menu {min-width: 0; width: 85px;}
|
||||
|
||||
#logo-box img{margin-left:40px; width: 100px;}
|
||||
|
||||
.showNotice{color:yellow;}
|
||||
.showNotice:hover{color:yellow;}
|
||||
|
||||
@@ -65,3 +65,8 @@ $(document).ready(function()
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function showNotice()
|
||||
{
|
||||
if(typeof(process4Safe) == 'string') bootbox.alert(process4Safe)
|
||||
}
|
||||
|
||||
@@ -216,4 +216,6 @@ $lang->user->noticeResetFile = "<h5>Kontaktieren Sie den Administrator um Ihr Pa
|
||||
<li>Die Datei muss leer sein.</li>
|
||||
<li>Wenn die Datei bereits existiert löschen Sie diese und erstellen Sie eine neue.</li>
|
||||
</ol>";
|
||||
$lang->user->notice4Safe = "It is detected that you may be using the one click installation package environment, and other sites in the environment are still using a simple password. For security, please change the password in time. Login address of other sites: <br />%s";
|
||||
$lang->user->notice4Safe = "Warning: one click package security hazard detected";
|
||||
$lang->user->process4DIR = "It is detected that you may be using the one click installation package environment. Other sites in the environment are still using simple passwords. For security reasons, if you do not use other sites, please handle them in time. Delete or rename the %s directory.";
|
||||
$lang->user->process4DB = "It is detected that you may be using the one click installation package environment. Other sites in the environment are still using simple passwords. For security reasons, if you do not use other sites, please handle them in time. Please visit login database and modify password field of zt_user table of %s database.";
|
||||
|
||||
@@ -216,4 +216,6 @@ $lang->user->noticeResetFile = "<h5>Contact the Administrator to reset your pass
|
||||
<li>Keep the file empty.</li>
|
||||
<li>If the file exists, remove it and create it again.</li>
|
||||
</ol>";
|
||||
$lang->user->notice4Safe = "It is detected that you may be using the one click installation package environment, and other sites in the environment are still using a simple password. For security, please change the password in time. Login address of other sites: <br />%s";
|
||||
$lang->user->notice4Safe = "Warning: one click package security hazard detected";
|
||||
$lang->user->process4DIR = "It is detected that you may be using the one click installation package environment. Other sites in the environment are still using simple passwords. For security reasons, if you do not use other sites, please handle them in time. Delete or rename the %s directory.";
|
||||
$lang->user->process4DB = "It is detected that you may be using the one click installation package environment. Other sites in the environment are still using simple passwords. For security reasons, if you do not use other sites, please handle them in time. Please visit login database and modify password field of zt_user table of %s database.";
|
||||
|
||||
@@ -216,4 +216,6 @@ $lang->user->noticeResetFile = "<h5>Contactez l'administrateur pour réinitialis
|
||||
<li>Gardez ce fichier vide.</li>
|
||||
<li>Si le fichier existe déjà, supprimez le et créez le à nouveau.</li><li>Bonne chance.</li>
|
||||
</ol>";
|
||||
$lang->user->notice4Safe = "It is detected that you may be using the one click installation package environment, and other sites in the environment are still using a simple password. For security, please change the password in time. Login address of other sites: <br />%s";
|
||||
$lang->user->notice4Safe = "Warning: one click package security hazard detected";
|
||||
$lang->user->process4DIR = "It is detected that you may be using the one click installation package environment. Other sites in the environment are still using simple passwords. For security reasons, if you do not use other sites, please handle them in time. Delete or rename the %s directory.";
|
||||
$lang->user->process4DB = "It is detected that you may be using the one click installation package environment. Other sites in the environment are still using simple passwords. For security reasons, if you do not use other sites, please handle them in time. Please visit login database and modify password field of zt_user table of %s database.";
|
||||
|
||||
@@ -216,4 +216,6 @@ $lang->user->noticeResetFile = "<h5>Liên hệ quản trị viên để thiết
|
||||
<li>Giữ tập tin này rỗng.</li>
|
||||
<li>Nếu tập tin đã tồn tại, xóa và tạo lại.</li>
|
||||
</ol>";
|
||||
$lang->user->notice4Safe = "It is detected that you may be using the one click installation package environment, and other sites in the environment are still using a simple password. For security, please change the password in time. Login address of other sites: <br />%s";
|
||||
$lang->user->notice4Safe = "Warning: one click package security hazard detected";
|
||||
$lang->user->process4DIR = "It is detected that you may be using the one click installation package environment. Other sites in the environment are still using simple passwords. For security reasons, if you do not use other sites, please handle them in time. Delete or rename the %s directory.";
|
||||
$lang->user->process4DB = "It is detected that you may be using the one click installation package environment. Other sites in the environment are still using simple passwords. For security reasons, if you do not use other sites, please handle them in time. Please visit login database and modify password field of zt_user table of %s database.";
|
||||
|
||||
@@ -216,4 +216,6 @@ $lang->user->noticeResetFile = "<h5>普通用户请联系管理员重置密码</
|
||||
<li>文件内容为空。</li>
|
||||
<li>如果之前文件存在,删除之后重新创建。</li>
|
||||
</ol>";
|
||||
$lang->user->notice4Safe = "检测到您可能在使用一键安装包环境,该环境中其他站点还在用简单密码,安全起见,请及时修改密码。其他站点的登录地址:<br />%s";
|
||||
$lang->user->notice4Safe = "警告:检测到一键安装包安全隐患";
|
||||
$lang->user->process4DIR = "检测到您可能在使用一键安装包环境,该环境中其他站点还在用简单密码,安全起见,如果不使用其他站点,请及时处理。将 %s 目录删除或改名。";
|
||||
$lang->user->process4DB = "检测到您可能在使用一键安装包环境,该环境中其他站点还在用简单密码,安全起见,如果不使用其他站点,请及时处理。请访问登录数据库,修改 %s 数据库的zt_user表的password字段。";
|
||||
|
||||
@@ -216,4 +216,6 @@ $lang->user->noticeResetFile = "<h5>普通用戶請聯繫管理員重置密碼</
|
||||
<li>檔案內容為空。</li>
|
||||
<li>如果之前檔案存在,刪除之後重新創建。</li>
|
||||
</ol>";
|
||||
$lang->user->notice4Safe = "檢測到您可能在使用一鍵安裝包環境,該環境中其他站點還在用簡單密碼,安全起見,請及時修改密碼。其他站點的登錄地址:<br />%s";
|
||||
$lang->user->notice4Safe = "警告:檢測到一鍵安裝包安全隱患";
|
||||
$lang->user->process4DIR = "檢測到您可能在使用一鍵安裝包環境,該環境中其他站點還在用簡單密碼,安全起見,如果不使用其他站點,請及時處理。將 %s 目錄刪除或改名。";
|
||||
$lang->user->process4DB = "檢測到您可能在使用一鍵安裝包環境,該環境中其他站點還在用簡單密碼,安全起見,如果不使用其他站點,請及時處理。請訪問登錄資料庫,修改 %s 資料庫的zt_user表的password欄位。";
|
||||
|
||||
@@ -81,6 +81,9 @@ if(empty($config->notMd5Pwd))js::import($jsRoot . 'md5.js');
|
||||
<div id="info" class="table-row">
|
||||
<div class="table-col text-middle text-center">
|
||||
<div id="poweredby">
|
||||
<?php if($weakSites):?>
|
||||
<div><a class='showNotice' href='javascript:showNotice()',><?php echo $lang->user->notice4Safe;?></a></div>
|
||||
<?php endif;?>
|
||||
<?php if($config->checkVersion):?>
|
||||
<iframe id='updater' class='hidden' frameborder='0' width='100%' height='45' scrolling='no' allowtransparency='true' src="<?php echo $this->createLink('misc', 'checkUpdate', "sn=$s");?>"></iframe>
|
||||
<?php endif;?>
|
||||
@@ -90,50 +93,23 @@ if(empty($config->notMd5Pwd))js::import($jsRoot . 'md5.js');
|
||||
</div>
|
||||
</main>
|
||||
<?php
|
||||
if(strpos('|/zentao/|/pro/|/biz/|', "|{$this->config->webRoot}|") !== false)
|
||||
if($weakSites)
|
||||
{
|
||||
$databases = array('zentao' => 'zentao', 'zentaopro' => 'zentaopro', 'zentaobiz' => 'zentaobiz', 'zentaoep' => 'zentaoep');
|
||||
if($this->config->webRoot == '/zentao/') unset($databases['zentao']);
|
||||
if($this->config->webRoot == '/pro/') unset($databases['zentaopro']);
|
||||
if($this->config->webRoot == '/biz/')
|
||||
$paths = array();
|
||||
$databases = array();
|
||||
$isXampp = false;
|
||||
foreach($weakSites as $webRoot => $site)
|
||||
{
|
||||
unset($databases['zentaobiz']);
|
||||
unset($databases['zentaoep']);
|
||||
$path = $site['path'];
|
||||
if(strpos($path, 'xampp') !== false) $isXampp = true;
|
||||
|
||||
$paths[] = $site['path'];
|
||||
$databases[] = $site['database'];
|
||||
}
|
||||
|
||||
$users = array();
|
||||
foreach($databases as $database)
|
||||
{
|
||||
try
|
||||
{
|
||||
$webRoot = "/{$database}/";
|
||||
if($database == 'zentao') $webRoot = '/zentao/';
|
||||
if($database == 'zentaopro') $webRoot = '/pro/';
|
||||
if($database == 'zentaobiz') $webRoot = '/biz/';
|
||||
if($database == 'zentaoep') $webRoot = '/biz/';
|
||||
|
||||
$user = $this->dbh->query("select * from {$database}.`zt_user` where account = 'admin' and password='" . md5('123456') . "'")->fetch();
|
||||
if($user) $users[$webRoot] = true;
|
||||
}
|
||||
catch(Exception $e){}
|
||||
}
|
||||
|
||||
if($users)
|
||||
{
|
||||
$sysURL = common::getSysURL();
|
||||
$links = array();
|
||||
foreach($users as $webRoot => $user) $links[] = $sysURL . $webRoot;
|
||||
|
||||
$notice = sprintf($lang->user->notice4Safe, join('<br />', $links));
|
||||
echo <<<EOD
|
||||
<script>
|
||||
\$(function()
|
||||
{
|
||||
bootbox.alert('$notice');
|
||||
})
|
||||
</script>
|
||||
EOD;
|
||||
}
|
||||
$process4Safe = $isXampp ? $lang->user->process4DB : $lang->user->process4DIR;
|
||||
$process4Safe = sprintf($process4Safe, join(' ', $isXampp ? $databases : $paths));
|
||||
js::set('process4Safe', $process4Safe);
|
||||
}
|
||||
?>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user