minfix + avoid session_guard.child for SATS api call
This commit is contained in:
parent
51f1f6f80c
commit
00f1efb38d
|
@ -154,12 +154,15 @@
|
||||||
|
|
||||||
/* (4) api/module/method -> Api */
|
/* (4) api/module/method -> Api */
|
||||||
$R->post('api(?:(/.*))/?', function($url){
|
$R->post('api(?:(/.*))/?', function($url){
|
||||||
$GLOBALS['page_log']->log('api.call('.$_SERVER['HTTP_X_TREE_TOKEN'].')');
|
if( isset($_SERVER['HTTP_X_TREE_TOKEN']) )
|
||||||
|
$GLOBALS['page_log']->log('api.call('.$_SERVER['HTTP_X_TREE_TOKEN'].')');
|
||||||
|
|
||||||
header('Content-Type: application/json; charset=UTF-8');
|
header('Content-Type: application/json; charset=UTF-8');
|
||||||
|
|
||||||
if( !$GLOBALS['session_guard']->init_child() )
|
// {1} Allow authed SATS not to be checked by session_guard.child //
|
||||||
die(json_encode([ 'error' => 100, 'ErrorDescription' => 'session_guard.child error' ]));
|
if( $GLOBALS['auth'] < 3 || !isset($_SERVER['PHP_AUTH_DIGEST']) )
|
||||||
|
if( !$GLOBALS['session_guard']->init_child() )
|
||||||
|
die(json_encode([ 'error' => 100, 'ErrorDescription' => 'session_guard.child error' ]));
|
||||||
|
|
||||||
$request = Request::remote($url[0]);
|
$request = Request::remote($url[0]);
|
||||||
$answer = $request->dispatch();
|
$answer = $request->dispatch();
|
||||||
|
|
Loading…
Reference in New Issue