diff --git a/module/common/control.php b/module/common/control.php index 8ac281c97c..658d610d4c 100644 --- a/module/common/control.php +++ b/module/common/control.php @@ -38,10 +38,9 @@ class common extends control */ public function checkUpgradeStatus() { - $statusFile = $this->app->getAppRoot() . 'www' . $this->pathFix . 'ok.txt'; - if(!file_exists($statusFile) or time() - filemtime($statusFile) > 3600) + $statusFile = $this->loadModel('upgrade')->checkSafeFile(); + if($statusFile) { - $this->app->loadLang('upgrade'); echo "
"; echo "";
printf($this->lang->upgrade->setStatusFile, $statusFile, $statusFile, $statusFile);
diff --git a/module/editor/control.php b/module/editor/control.php
index 157b99f361..764be8515e 100644
--- a/module/editor/control.php
+++ b/module/editor/control.php
@@ -134,6 +134,11 @@ class editor extends control
*/
public function save($filePath = '', $action = '')
{
+ $statusFile = $this->loadModel('upgrade')->checkSafeFile();
+ if($statusFile)
+ {
+ die(js::alert(sprintf($this->lang->editor->noticeOkFile, $statusFile, $statusFile, $statusFile)));
+ }
if($filePath and $_POST)
{
$filePath = helper::safe64Decode($filePath);
diff --git a/module/editor/lang/en.php b/module/editor/lang/en.php
index 6b4cd29000..93ac1ec684 100644
--- a/module/editor/lang/en.php
+++ b/module/editor/lang/en.php
@@ -30,6 +30,7 @@ $lang->editor->deleteConfirm = 'Are you sure?';
$lang->editor->extendConfirm = 'Would you reuse the code.';
$lang->editor->repeatFile = 'File name repeat';
$lang->editor->repeatPage = 'This page has extisted. Is override?';
+$lang->editor->noticeOkFile = 'The ok file does not exist or has expired\nFor safe, please re create the ok file\nYou can perform the following commands on the server: \nFor windows:echo ok > %s\nFor linux:touch %s;';
$lang->editor->notWritable = "Can not writable, maybe no power. please try chmod 777 -R ";
$lang->editor->notDelete = "Can not delete, please check power!";
diff --git a/module/editor/lang/zh-cn.php b/module/editor/lang/zh-cn.php
index 805b7e1683..2f05eaae31 100644
--- a/module/editor/lang/zh-cn.php
+++ b/module/editor/lang/zh-cn.php
@@ -30,6 +30,7 @@ $lang->editor->deleteConfirm = '是否要删除?';
$lang->editor->extendConfirm = '是否要重用原来代码?';
$lang->editor->repeatFile = '文件名重复';
$lang->editor->repeatPage = '已经有此页面。是否覆盖?';
+$lang->editor->noticeOkFile = 'ok文件不存在或文件已过期\n为了系统的安全,请重新创建ok文件\n您可在服务器执行下面相应的命令:\nwindows: 打开命令行,执行 echo ok > %s\nlinux: touch %s;\n或者删掉 %s 这个文件 ,重新创建一个ok.txt文件,不需要内容。';
$lang->editor->notWritable = "无法写入,可能没有权限。请尝试执行 chmod 777 -R ";
$lang->editor->notDelete = '无法删除,请检查权限!';
diff --git a/module/extension/control.php b/module/extension/control.php
index 37360e6b09..859927940d 100644
--- a/module/extension/control.php
+++ b/module/extension/control.php
@@ -120,6 +120,13 @@ class extension extends control
$this->view->upgrade = $upgrade;
$this->view->title = $installTitle . $extension;
+
+ $statusFile = $this->loadModel('upgrade')->checkSafeFile();
+ if($statusFile)
+ {
+ $this->view->error = sprintf($this->lang->extension->noticeOkFile, $statusFile, $statusFile, $statusFile);
+ die($this->display());
+ }
/* Get the package file name. */
$packageFile = $this->extension->getPackageFile($extension);
diff --git a/module/extension/lang/en.php b/module/extension/lang/en.php
index dd5d184172..24ea514998 100644
--- a/module/extension/lang/en.php
+++ b/module/extension/lang/en.php
@@ -81,6 +81,14 @@ $lang->extension->viewInstalled = 'View installed extensions.';
$lang->extension->viewAvailable = 'View available extensions';
$lang->extension->viewDeactivated = 'View deactivated extensions';
$lang->extension->backDBFile = 'Plug-related data has been backed up to %s file!';
+$lang->extension->noticeOkFile = 'The ok file does not exist or has expired+For safe, please re create the ok file+You can perform the following commands on the server: +
ok文件不存在或文件已过期+为了系统的安全,请重新创建ok文件+您可在服务器执行下面相应的命令: +
|