From 229859445515b9f8e379a2037f177cbd277094d7 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 23 Feb 2014 20:25:49 -0500 Subject: Add helpers for the user session and fix bug edit_user admin checkbox --- lib/helper.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/helper.php') 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'; -- cgit v1.2.3