Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
functions.inc.php
Go to the documentation of this file.
1 <?php
14 function getUser(){
15  static $user =-1;
16  if (is_int($user) and $user == -1 ){
17  $user = Dataface_AuthenticationTool::getInstance()->getLoggedInUser();
18  }
19  return $user;
20 
21 }
22 
27 function getRole(){
28  static $role = -1;
29  if ( is_int($role) and $role == -1 ){
30  $user = getUser();
31  if ( !$user ) return null;
32  $role = $user->val('role');
33  }
34  return $role;
35 }
36 
41 function isAdmin(){
42  return (getRole() == 'ADMIN');
43 }
44 
45 
46