From dc659c6c1664b7574f623ea4533e54efbb3e4e2a Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Mon, 26 Apr 2021 13:03:27 +0800 Subject: [PATCH] * Fix bug #12194. --- module/user/control.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/module/user/control.php b/module/user/control.php index b01fafe60d..04aba479ba 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -765,12 +765,25 @@ class user extends control */ public function login($referer = '', $from = '') { + /* Check if you can operating on the folder. */ + $canModifyDIR = true; if($this->user->checkTmp() === false) + { + $canModifyDIR = false; + $floderPath = $this->app->tmpRoot; + } + elseif(!is_dir($this->app->dataRoot) or substr(base_convert(@fileperms($this->app->dataRoot),10,8),-4) != '0777') + { + $canModifyDIR = false; + $floderPath = $this->app->dataRoot; + } + + if(!$canModifyDIR) { echo "
"; echo "| ";
- echo " 不能创建临时目录,请确认目录{$this->app->tmpRoot}是否存在并有操作权限。 ";
- echo "Can't create tmp directory, make sure the directory {$this->app->tmpRoot} exists and has permission to operate. ";
+ echo "不能创建临时目录,请确认目录{$floderPath}是否存在并有操作权限。 ";
+ echo "Can't create tmp directory, make sure the directory {$floderPath} exists and has permission to operate. ";
die(" |