php-mpos/public/include/pages/api/getcurrentworkers.inc.php
Sebastian Grewe 4ffca7d5ac API overhaul for easier handling of API calls
* [FEATURE] Allow in-class checking for user permissions
* [FEATURE] Allow in-class creation of the JSON data for coherence
* [FEATURE} Added API version in JSON data for client side checks
* [IMPROVEMENT] Adjusted all API calls to use the new JSON layout

**NOTE**: This is breaking backwads compatibility with the old API!
Please adjust your client application to support this new version.
The data array should not change much more other than added features.
2013-09-17 11:55:54 +02:00

18 lines
395 B
PHP

<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
// Check if the API is activated
$api->isActive();
// Check user token
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
// Output JSON format
echo $api->get_json($worker->getCountAllActiveWorkers());
// Supress master template
$supress_master = 1;
?>