Xataface
2.0alpha2
Xataface Application Framework
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
actions
whoami.php
Go to the documentation of this file.
1
<?php
2
class
dataface_actions_whoami
{
3
function
handle
($params){
4
$app
=
Dataface_Application::getInstance
();
5
$user =
Dataface_AuthenticationTool::getInstance
()
6
->getLoggedInUser();
7
$username =
Dataface_AuthenticationTool::getInstance
()
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
}
Generated on Fri Mar 22 2013 09:40:33 for Xataface by
1.8.1.2