* Save session with tab for project.
This commit is contained in:
@@ -117,12 +117,13 @@ class projectModel extends model
|
||||
*/
|
||||
public function saveState($projectID = 0, $projects = array())
|
||||
{
|
||||
if($projectID > 0) $this->session->set('project', (int)$projectID);
|
||||
if($projectID == 0 and $this->cookie->lastProject) $this->session->set('project', (int)$this->cookie->lastProject);
|
||||
if($projectID == 0 and $this->session->project == '') $this->session->set('project', key($projects));
|
||||
if($projectID == 0 and $this->cookie->lastProject) $projectID = $this->cookie->lastProject;
|
||||
if($projectID == 0 and $this->session->project == '') $projectID = key($projects);
|
||||
$this->session->set('project', (int)$projectID, $this->app->tab);
|
||||
|
||||
if(!isset($projects[$this->session->project]))
|
||||
{
|
||||
$this->session->set('project', key($projects));
|
||||
$this->session->set('project', key($projects), $this->app->tab);
|
||||
if($projectID && strpos(",{$this->app->user->view->projects},", ",{$this->session->project},") === false) $this->accessDenied();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user