Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
whoami.php
Go to the documentation of this file.
1 <?php
3  function handle($params){
6  ->getLoggedInUser();
8  ->getLoggedInUserName();
9 
10  if ( !isset($user) ){
11  header('HTTP/1.0 401 Please Login');
12  header('Content-type: text/json; charset="'.$app->_conf['oe'].'"');
13  echo json_encode(array(
14  'code' => 401,
15  'message' => 'You are not logged in'
16  ));
17  exit;
18  } else {
19  header('Content-type: text/json; charset="'.$app->_conf['oe'].'"');
20  echo json_encode(array(
21  'code' => 200,
22  'message' => 'You are not logged in as '.$username,
23  'username' => $username
24  ));
25  exit;
26  }
27  }
28 }