diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@smile.fr> | 2014-10-10 13:33:54 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@smile.fr> | 2014-10-10 13:33:54 +0200 |
commit | 44d35257e805856b4913c63fcbed3c0acb64bae8 (patch) | |
tree | 11e9d276c34b1b287706cb61182bdc71729661e2 /inc/3rdparty/Session.class.php | |
parent | af8292c1de1886cd975d79f0f42df40e0bd1c5bd (diff) | |
parent | cf8a5e1eedbed484dbcb1ddc9f7a13fc19b7a27b (diff) | |
download | wallabag-44d35257e805856b4913c63fcbed3c0acb64bae8.tar.gz wallabag-44d35257e805856b4913c63fcbed3c0acb64bae8.tar.zst wallabag-44d35257e805856b4913c63fcbed3c0acb64bae8.zip |
Merge branch 'dev'1.8.0
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 | } |