diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-07-25 07:27:21 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-07-25 07:27:21 +0200 |
commit | fa9a7bbb3c61116e5db76c9f25ef2340fef971d7 (patch) | |
tree | cd733e8548290158d578da185bd541e7fe4b1a31 /inc/3rdparty/Session.class.php | |
parent | ebd6bf6007e0fad4c3e11dac0e79f687e1d195a2 (diff) | |
parent | 830612f555d8bc72669fe9bc0686680001af0e52 (diff) | |
download | wallabag-fa9a7bbb3c61116e5db76c9f25ef2340fef971d7.tar.gz wallabag-fa9a7bbb3c61116e5db76c9f25ef2340fef971d7.tar.zst wallabag-fa9a7bbb3c61116e5db76c9f25ef2340fef971d7.zip |
Merge branch 'fix/securityAllowedActions' 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 | } |