* Finish story #52015.

This commit is contained in:
hufangzhou
2024-01-05 13:09:15 +08:00
parent af9486f3b9
commit 4e5a5bc279
3 changed files with 18 additions and 4 deletions
+1
View File
@@ -34,6 +34,7 @@ $filter->default->cookie['goback'] = 'reg::any';
$filter->default->cookie['maxImport'] = 'reg::any';
$filter->default->cookie['za'] = 'reg::any';
$filter->default->cookie['zp'] = 'reg::any';
$filter->default->cookie['vision'] = 'reg::word';
$filter->index = new stdclass();
$filter->my = new stdclass();
+15 -4
View File
@@ -862,12 +862,20 @@ class baseRouter
if(empty($account)) $account = $this->cookie->za;
$vision = '';
$sql = new sql();
if($this->config->installed and validater::checkAccount($account))
{
$sql = new sql();
$account = $sql->quote($account);
$vision = $this->dbQuery("SELECT * FROM " . TABLE_CONFIG . " WHERE owner = $account AND `key` = 'vision' LIMIT 1")->fetch();
if($vision) $vision = $vision->value;
if(!empty($_COOKIE['vision']))
{
$vision = $_COOKIE['vision'];
}
else
{
$vision = $this->dbQuery("SELECT * FROM " . TABLE_CONFIG . " WHERE owner = $account AND `key` = 'vision' LIMIT 1")->fetch();
if($vision) $vision = $vision->value;
}
$user = $this->dbQuery("SELECT * FROM " . TABLE_USER . " WHERE account = $account AND deleted = '0' LIMIT 1")->fetch();
if(!empty($user->visions))
@@ -882,7 +890,10 @@ class baseRouter
if($defaultVision != 'lite' && $defaultVision != 'or') $defaultVision = 'rnd';
if($vision and !str_contains((string) $this->config->visions, ",{$vision},")) $vision = $defaultVision;
$this->config->vision = $vision ?: $defaultVision;
$vision = $vision ?: $defaultVision;
if(empty($_COOKIE['vision'])) setcookie('vision', $vision, $this->config->cookieLife, $this->config->webRoot, '', false, false);
$this->config->vision = $vision;
}
/**
+2
View File
@@ -1438,6 +1438,8 @@ class my extends control
$_SESSION['user']->rights = $this->user->authorize($this->app->user->account);
setcookie('vision', $vision, $this->config->cookieLife, $this->config->webRoot, '', false, false);
return $this->send(array('result' => 'success', 'load' => helper::createLink('index', 'index')));
}
}