* fix for upgrade.

This commit is contained in:
wangyidong
2017-12-22 09:05:34 +08:00
parent cc8bf62fe5
commit 60ebe9fa2e
20 changed files with 87 additions and 40 deletions
+1 -26
View File
@@ -626,31 +626,6 @@ class user extends control
}
}
/**
* Check Tmp dir.
*
* @access public
* @return void
*/
public function checkTmp()
{
if(!is_dir($this->app->tmpRoot)) mkdir($this->app->tmpRoot, 0755, true);
if(!is_dir($this->app->cacheRoot)) mkdir($this->app->cacheRoot, 0755, true);
if(!is_dir($this->app->logRoot)) mkdir($this->app->logRoot, 0755, true);
if(!is_dir($this->app->logRoot)) return false;
$file = $this->app->logRoot . DS . 'demo.txt';
if($fp = @fopen($file, 'a+'))
{
@fclose($fp);
@unlink($file);
}
else
{
return false;
}
return true;
}
/**
* User login, identify him and authorize him.
@@ -663,7 +638,7 @@ class user extends control
*/
public function login($referer = '', $from = '')
{
if($this->checkTmp() === false)
if($this->user->checkTmp() === false)
{
echo "<html><head><meta charset='utf-8'></head>";
echo "<body><table align='center' style='width:700px; margin-top:100px; border:1px solid gray; font-size:14px;'><tr><td style='padding:8px'>";
+26
View File
@@ -1188,4 +1188,30 @@ class userModel extends model
return $strength;
}
/**
* Check Tmp dir.
*
* @access public
* @return void
*/
public function checkTmp()
{
if(!is_dir($this->app->tmpRoot)) mkdir($this->app->tmpRoot, 0755, true);
if(!is_dir($this->app->cacheRoot)) mkdir($this->app->cacheRoot, 0755, true);
if(!is_dir($this->app->logRoot)) mkdir($this->app->logRoot, 0755, true);
if(!is_dir($this->app->logRoot)) return false;
$file = $this->app->logRoot . DS . 'demo.txt';
if($fp = @fopen($file, 'a+'))
{
@fclose($fp);
@unlink($file);
}
else
{
return false;
}
return true;
}
}