summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-09-16 13:25:44 +0200
committerFrédéric Guillot <fred@kanboard.net>2014-09-16 13:25:44 +0200
commit12a688347ce9374e060f4adb98af3892542285d4 (patch)
tree53e349326f114da6ac01d4ec9c79da1605b0e8ee /app/Model
parenta7f3cd87fba3e02d31f1c939a75e884d645c35e9 (diff)
Improve Board::Index() and avoid useless HTTP redirects
Diffstat (limited to 'app/Model')
-rw-r--r--app/Model/User.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/app/Model/User.php b/app/Model/User.php
index b99be2cb..9eccb207 100644
--- a/app/Model/User.php
+++ b/app/Model/User.php
@@ -28,6 +28,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
*
* @access public