* finish task #4976.

This commit is contained in:
wangyidong
2018-10-11 15:38:26 +08:00
parent 148f54ce2e
commit 75e0e6555b
20 changed files with 4053 additions and 8 deletions
+14 -2
View File
@@ -24,6 +24,7 @@ class commonModel extends model
{
define('FIRST_RUN', true);
$this->sendHeader();
$this->setFingerprint();
$this->setCompany();
$this->setUser();
$this->loadConfigFromDB();
@@ -51,6 +52,17 @@ class commonModel extends model
header("Cache-control: private");
}
/**
* Set fingerprint.
*
* @access public
* @return void
*/
public function setFingerprint()
{
if($this->cookie->fingerprint and !$this->session->fingerprint) $this->session->set('fingerprint', $this->cookie->fingerprint);
}
/**
* Set the commpany.
*
@@ -1314,8 +1326,8 @@ EOD;
$method = $this->app->getMethodName();
if(isset($this->app->user->modifyPassword) and $this->app->user->modifyPassword and ($module != 'my' or $method != 'changepassword')) die(js::locate(helper::createLink('my', 'changepassword')));
if($this->isOpenMethod($module, $method)) return true;
if(!$this->loadModel('user')->isLogon() and $this->server->php_auth_user) $this->user->identifyByPhpAuth();
if(!$this->loadModel('user')->isLogon() and $this->cookie->za) $this->user->identifyByCookie();
if(!$this->loadModel('user')->isLogon() and $this->cookie->fingerprint and $this->server->php_auth_user) $this->user->identifyByPhpAuth();
if(!$this->loadModel('user')->isLogon() and $this->cookie->fingerprint and $this->cookie->za) $this->user->identifyByCookie();
if(isset($this->app->user))
{