minfix + avoid session_guard.child for SATS api call
This commit is contained in:
parent
51f1f6f80c
commit
00f1efb38d
|
@ -154,10 +154,13 @@
|
||||||
|
|
||||||
/* (4) api/module/method -> Api */
|
/* (4) api/module/method -> Api */
|
||||||
$R->post('api(?:(/.*))/?', function($url){
|
$R->post('api(?:(/.*))/?', function($url){
|
||||||
|
if( isset($_SERVER['HTTP_X_TREE_TOKEN']) )
|
||||||
$GLOBALS['page_log']->log('api.call('.$_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');
|
||||||
|
|
||||||
|
// {1} Allow authed SATS not to be checked by session_guard.child //
|
||||||
|
if( $GLOBALS['auth'] < 3 || !isset($_SERVER['PHP_AUTH_DIGEST']) )
|
||||||
if( !$GLOBALS['session_guard']->init_child() )
|
if( !$GLOBALS['session_guard']->init_child() )
|
||||||
die(json_encode([ 'error' => 100, 'ErrorDescription' => 'session_guard.child error' ]));
|
die(json_encode([ 'error' => 100, 'ErrorDescription' => 'session_guard.child error' ]));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue