3

userhasrole

user_has_role
SYNOPSIS

user_has_role($role)

DESCRIPTION
CODE
  1. require_once 'userisidentified.php';
  2.  
  3. function user_has_role($role) {
  4.     return user_is_identified() and !empty($_SESSION['user']['role']) and in_array($role, $_SESSION['user']['role']);
  5. }
SEE ALSO

userisidentified, userprofile

Comments

To add a comment, click here.