1

Topic: Check if user is Admin

I want to make a simple function isAdmin() that just checks whether the current user is an admin or not as defined with the PUN_ADMIN, but it seems anything I try keeps saying they are admin...even if they are logged out.

If anyone would help me out, it would be appreciated.

Thanks in advance.

Re: Check if user is Admin

This should work:

function isAdmin()
{
  global $pun_user;

  if ($pun_user['g_id'] == PUN_ADMIN)
    return True;
  else
    return False;
}

3

Re: Check if user is Admin

Thanks, that was almost identical to what I had, but I see where the problem lies now.