* Fix token name of API.
This commit is contained in:
@@ -5,5 +5,23 @@ class ProgramsEntry extends Entry
|
||||
{
|
||||
$program = $this->loadController('program', 'browse');
|
||||
$program->browse();
|
||||
|
||||
$data = $this->getData();
|
||||
if(isset($data->status) and $data->status == 'success')
|
||||
{
|
||||
$programs = $data->data->programs;
|
||||
$result = array();
|
||||
foreach($programs as $program)
|
||||
{
|
||||
$result[] = $program;
|
||||
}
|
||||
return $this->send(200, $result);
|
||||
}
|
||||
if(isset($data->status) and $data->status == 'fail')
|
||||
{
|
||||
return $this->sendError(400, $data->message);
|
||||
}
|
||||
|
||||
return $this->sendError(400, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -852,7 +852,7 @@ class baseRouter
|
||||
if(!defined('SESSION_STARTED'))
|
||||
{
|
||||
/* If request header has token, use it as session for authentication. */
|
||||
$this->sessionID = isset($_SERVER['HTTP_TOKEN']) ? session_id($_SERVER['HTTP_TOKEN']) : session_id();
|
||||
$this->sessionID = isset($_SERVER['HTTP_AUTHORIZATION']) ? session_id($_SERVER['HTTP_AUTHORIZATION']) : session_id();
|
||||
|
||||
$sessionName = $this->config->sessionVar;
|
||||
session_name($sessionName);
|
||||
|
||||
Reference in New Issue
Block a user