* Fix session app.

This commit is contained in:
Yagami
2021-03-18 16:37:01 +08:00
parent cceffa2106
commit 7fa5a2dab0
3 changed files with 7 additions and 9 deletions
+4 -6
View File
@@ -2492,7 +2492,7 @@ class super
* @access public
* @return void
*/
public function set($key, $value)
public function set($key, $value, $openApp = '')
{
if($this->scope == 'post')
{
@@ -2512,9 +2512,8 @@ class super
}
elseif($this->scope == 'session')
{
$openApp = $this->openApp;
empty($openApp) ? $_SESSION[$key] = $value : $_SESSION['app-' . $openApp][$key] = $value;
$_SESSION[$key] = $value;
$openApp = $openApp ? $openApp : $this->openApp;
$openApp ? $_SESSION["app-$openApp"][$key] = $value : $_SESSION[$key] = $value;
}
elseif($this->scope == 'env')
{
@@ -2562,9 +2561,8 @@ class super
elseif($this->scope == 'session')
{
$openApp = $this->openApp;
if(!empty($openApp) and isset($_SESSION['app-' . $openApp][$key])) return $_SESSION['app-' . $openApp][$key];
if($openApp and isset($_SESSION["app-$openApp"][$key])) return $_SESSION["app-$openApp"][$key];
if(isset($_SESSION[$key])) return $_SESSION[$key];
return false;
}
elseif($this->scope == 'env')
+1 -2
View File
@@ -273,8 +273,7 @@ class my extends control
/* Save session. */
if($this->app->viewType != 'json')
{
$this->session->set('taskList', $this->app->getURI(true));
$this->session->set('storyList', $this->app->getURI(true));
$this->session->set('taskList', $this->app->getURI(true), 'execution');
}
/* Load pager. */
+2 -1
View File
@@ -96,8 +96,9 @@ class programModel extends model
->where('type')->in('program,project')
->andWhere('deleted')->eq(0)
->beginIF(!$this->app->user->admin)
->andWhere('id')->in($this->app->user->view->programs)
->andWhere('(id')->in($this->app->user->view->programs)
->orWhere('id')->in($this->app->user->view->projects)
->markRight(1)
->fi()
->beginIF($status != 'all')->andWhere('status')->eq($status)->fi()
->beginIF(!$this->cookie->showClosed)->andWhere('status')->ne('closed')->fi()