diff options
author | Frédéric Guillot <contact@fredericguillot.com> | 2014-02-23 20:25:49 -0500 |
---|---|---|
committer | Frédéric Guillot <contact@fredericguillot.com> | 2014-02-23 20:25:49 -0500 |
commit | 229859445515b9f8e379a2037f177cbd277094d7 (patch) | |
tree | e369193020c252ba30f0ff92129f10440713eec1 /lib/helper.php | |
parent | b664175b043e0db1930325b771859ab730ffee53 (diff) |
Add helpers for the user session and fix bug edit_user admin checkbox
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/helper.php b/lib/helper.php index 922faba0..22121015 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -2,6 +2,16 @@ namespace Helper; +function is_current_user($user_id) +{ + return $_SESSION['user']['id'] == $user_id; +} + +function is_admin() +{ + return $_SESSION['user']['is_admin'] == 1; +} + function markdown($text) { require_once __DIR__.'/../vendor/Michelf/MarkdownExtra.inc.php'; |