+ add the security checking when execute upgrade program.
This commit is contained in:
@@ -52,6 +52,22 @@ class common extends control
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check upgrade's status file is ok or not.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkUpgradeStatus()
|
||||
{
|
||||
$statusFile = $this->app->getAppRoot() . 'www' . $this->pathFix . 'ok';
|
||||
if(!file_exists($statusFile) or time() - filemtime($statusFile) > 3600)
|
||||
{
|
||||
$this->app->loadLang('upgrade');
|
||||
die(printf($this->lang->upgrade->setStatusFile, $statusFile, $statusFile, $statusFile));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the user has permisson of one method of one module.
|
||||
*
|
||||
|
||||
@@ -24,6 +24,10 @@ EOT;
|
||||
|
||||
|
||||
|
||||
$lang->upgrade->setStatusFile = "For security reason, we will check file <strong>%s</strong><br />
|
||||
But this file doesn't exist or out of date. You can use the flowing command to create(update)it <br />
|
||||
For linux:<strong>touch %s;</strong> <br />
|
||||
For windows:<strong>echo ok > %s</strong>";
|
||||
$lang->upgrade->selectVersion = 'Select version';
|
||||
$lang->upgrade->noteVersion = "Must select the correct version";
|
||||
$lang->upgrade->fromVersion = 'From version';
|
||||
|
||||
@@ -24,6 +24,10 @@ $lang->upgrade->warnningContent = <<<EOT
|
||||
要将上面红色的部分分别替换成对应的用户名和禅道系统的数据库名。<br />
|
||||
比如: mysqldump -u root -p zentao >zentao.bak
|
||||
EOT;
|
||||
$lang->upgrade->setStatusFile = '基于安全考虑,升级之间需要检查这个文件:<strong>%s</strong><br />
|
||||
该文件不存在或者已经过期,请用下面的命令来创建或者更新它。<br />
|
||||
linux下面的命令:<strong>touch %s;</strong> <br />
|
||||
windows下面的命令:<strong>echo ok > %s</strong>';
|
||||
$lang->upgrade->selectVersion = '选择版本';
|
||||
$lang->upgrade->noteVersion = "务必选择正确的版本,否则会造成数据丢失。";
|
||||
$lang->upgrade->fromVersion = '原来的版本';
|
||||
|
||||
@@ -24,6 +24,10 @@ $lang->upgrade->warnningContent = <<<EOT
|
||||
要將上面紅色的部分分別替換成對應的用戶名和禪道系統的資料庫名。<br />
|
||||
比如: mysqldump -u root -p zentao >zentao.bak
|
||||
EOT;
|
||||
$lang->upgrade->setStatusFile = '基于安全考慮,升級之間需要檢查這個檔案:<strong>%s</strong><br />
|
||||
該檔案不存在或者已經過期,請用下面的命令來創建或者更新它。<br />
|
||||
linux下面的命令:<strong>touch %s;</strong> <br />
|
||||
windows下面的命令:<strong>echo ok > %s</strong>';
|
||||
$lang->upgrade->selectVersion = '選擇版本';
|
||||
$lang->upgrade->noteVersion = "務必選擇正確的版本,否則會造成數據丟失。";
|
||||
$lang->upgrade->fromVersion = '原來的版本';
|
||||
|
||||
@@ -33,4 +33,5 @@ if(version_compare($config->version, $config->installedVersion) <= 0) die(header
|
||||
|
||||
/* Run it. */
|
||||
$app->parseRequest();
|
||||
$common->checkUpgradeStatus();
|
||||
$app->loadModule();
|
||||
|
||||
Reference in New Issue
Block a user