diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-07-23 13:44:48 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-07-23 13:44:48 +0200 |
commit | 887b015def3098f1e898e7bf3338fa2d093b6d95 (patch) | |
tree | 41206132200aa9390e11d600ad2b84ffa23242e4 /inc/3rdparty/Session.class.php | |
parent | ebd6bf6007e0fad4c3e11dac0e79f687e1d195a2 (diff) | |
parent | 505a74ad1de7cf2cd3605e793233365501f03d87 (diff) | |
download | wallabag-887b015def3098f1e898e7bf3338fa2d093b6d95.tar.gz wallabag-887b015def3098f1e898e7bf3338fa2d093b6d95.tar.zst wallabag-887b015def3098f1e898e7bf3338fa2d093b6d95.zip |
Merge branch 'refactor' into dev
Diffstat (limited to 'inc/3rdparty/Session.class.php')
-rw-r--r-- | inc/3rdparty/Session.class.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/inc/3rdparty/Session.class.php b/inc/3rdparty/Session.class.php index 59dfbe67..b56e4c54 100644 --- a/inc/3rdparty/Session.class.php +++ b/inc/3rdparty/Session.class.php | |||
@@ -309,4 +309,38 @@ class Session | |||
309 | 309 | ||
310 | return true; // User is not banned. | 310 | return true; // User is not banned. |
311 | } | 311 | } |
312 | |||
313 | |||
314 | /** | ||
315 | * Tells if a param exists in session | ||
316 | * | ||
317 | * @param $name name of the param to test | ||
318 | * @return bool | ||
319 | */ | ||
320 | public static function isInSession($name) | ||
321 | { | ||
322 | return (isset($_SESSION[$name]) ? : FALSE); | ||
323 | } | ||
324 | |||
325 | /** | ||
326 | * Returns param in session | ||
327 | * | ||
328 | * @param $name name of the param to return | ||
329 | * @return mixed param or null | ||
330 | */ | ||
331 | public static function getParam($name) | ||
332 | { | ||
333 | return (self::isInSession($name) ? $_SESSION[$name] : NULL); | ||
334 | } | ||
335 | |||
336 | /** | ||
337 | * Store value in session | ||
338 | * | ||
339 | * @param $name name of the variable to store | ||
340 | * @param $value value to store | ||
341 | */ | ||
342 | public static function setParam($name, $value) | ||
343 | { | ||
344 | $_SESSION[$name] = $value; | ||
345 | } | ||
312 | } | 346 | } |