summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
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