Improve Board::Index() and avoid useless HTTP redirects

This commit is contained in:
Frédéric Guillot
2014-09-16 13:25:44 +02:00
parent a7f3cd87fb
commit 12a688347c
4 changed files with 64 additions and 47 deletions

View File

@@ -27,6 +27,39 @@ class User extends Base
*/
const EVERYBODY_ID = -1;
/**
* Get the default project from the session
*
* @access public
* @return integer
*/
public function getFavoriteProjectId()
{
return isset($_SESSION['user']['default_project_id']) ? $_SESSION['user']['default_project_id'] : 0;
}
/**
* Get the last seen project from the session
*
* @access public
* @return integer
*/
public function getLastSeenProject()
{
return empty($_SESSION['user']['last_show_project_id']) ? 0 : $_SESSION['user']['last_show_project_id'];
}
/**
* Set the last seen project from the session
*
* @access public
* @@param integer $project_id Project id
*/
public function storeLastSeenProject($project_id)
{
$_SESSION['user']['last_show_project_id'] = (int) $project_id;
}
/**
* Get a specific user by id
*