Add helpers for the user session and fix bug edit_user admin checkbox

This commit is contained in:
Frédéric Guillot
2014-02-23 20:25:49 -05:00
parent b664175b04
commit 2298594455
5 changed files with 18 additions and 8 deletions

View File

@@ -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';