Commit c5d39939 authored by thomas craipeau's avatar thomas craipeau

api token update comobi

parent c460ae81
......@@ -267,6 +267,7 @@ class CommunecterController extends Controller
"sendemail" => array("href" => "/ph/co2/person/sendemail"),
"index" => array("href" => "/ph/co2/person/dashboard",'title' => "My Dashboard"),
"authenticate" => array("href" => "/ph/co2/person/authenticate",'title' => "Authentication"),
"authenticatetoken" => array("href" => "/ph/co2/person/authenticatetoken",'title' => "Authentication token"),
"dashboard" => array("href" => "/ph/co2/person/dashboard"),
"detail" => array("href" => "/ph/co2/person/detail", "public" => true),
"follows" => array("href" => "/ph/co2/person/follows"),
......@@ -750,14 +751,10 @@ class CommunecterController extends Controller
"document/resized");
$prepareData = true;
//if (true)//(isset($_SERVER["HTTP_ORIGIN"]) )//&& $_SERVER["REMOTE_ADDR"] == "52.30.32.155" ) //this is an outside call
//{
//$host = "meteor.communecter.org";
//if (strpos("http://".$host, $_SERVER["HTTP_ORIGIN"]) >= 0 || strpos("https://".$host, $_SERVER["HTTP_ORIGIN"]) >= 0 ){
if( isset( $_POST["X-Auth-Token"]) && Authorisation::isMeteorConnected( $_POST["X-Auth-Token"] ) ){
$headers = getallheaders();
if( isset($headers["X-Auth-Token"]) && isset($headers["X-User-Id"]) && isset($headers["X-Auth-Name"]) && Authorisation::isMeteorConnected( $headers["X-Auth-Token"], $headers["X-User-Id"], $headers["X-Auth-Name"] ) ){
$prepareData = false;
//once the token is check => remove the token from the post
unset($_POST["X-Auth-Token"]);
}
//Api access through REST
//no need to prepare interface data
......
......@@ -29,7 +29,8 @@ class PersonController extends CommunecterController {
'logged' => 'citizenToolKit.controllers.person.LoggedAction',
'sendemail' => 'citizenToolKit.controllers.person.SendEmailAction',
'logout' => 'citizenToolKit.controllers.person.LogoutAction',
'authenticate' => 'citizenToolKit.controllers.person.AuthenticateAction',
'authenticate' => 'citizenToolKit.controllers.person.AuthenticateAction',
'authenticatetoken' => 'citizenToolKit.controllers.person.AuthenticateTokenAction',
//'settings' => 'citizenToolKit.controllers.person.SettingsAction',
'detail' => 'citizenToolKit.controllers.person.DetailAction',
'follows' => 'citizenToolKit.controllers.person.FollowsAction',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment