Example #1
0
 } else {
     $Authenticated = false;
     $NormalizeFunc = 'api_args_' . strtolower($_REQUEST['query']);
     $Parameter = function_exists($NormalizeFunc) ? call_user_func($NormalizeFunc, $_REQUEST) : null;
     // Validate against public or private token
     // If no token is given, try to validate the currently logged in user.
     if (isset($_REQUEST['token'])) {
         $Authenticated = Api::testPrivateToken($_REQUEST['token']) || Api::testPublicToken($Parameter, $_REQUEST['token']);
     }
     // Only execute requests if validated
     if (!$Authenticated) {
         $Out->pushError('Validation failed.');
     } else {
         switch (strtolower($_REQUEST['query'])) {
             case 'location':
                 $Out->pushValue('result', api_query_location($Parameter));
                 break;
             case 'user':
                 $Out->pushValue('result', api_query_user($Parameter));
                 break;
             case 'raid':
                 $Out->pushValue('result', api_query_raid($Parameter));
                 break;
             case 'statistic':
                 $Out->pushValue('result', api_query_statistic($Parameter));
                 break;
             default:
                 $Out->pushError('Unknown query type ' . $_REQUEST['query']);
                 break;
         }
     }
Example #2
0
 public static function queryLocation($aParameter)
 {
     return api_query_location($aParameter);
 }