Create New Item
type
File
Folder
name
Search file in folder and subfolders...
Are you sure want to rename?
/
src
/
controllers
:
api-token.inc.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php header('Access-Control-Allow-Origin: *'); header('Content-Type: text/json; charset="UTF-8"'); # POST if ($_SERVER['REQUEST_METHOD'] == 'POST') { $data = _json(file_get_contents('php://input')); $user->update_app(array( "app_token" => _a($data, 'app_token', $user['app_token']), "app_notifications" => _a($data, 'app_notifications', $user['app_notifications']), "app_details" => $data, )); if (!_a($user['data'], 'first-app')) { $res = classes\Fidelity::SetPunti($user['card'], '04'); if (!_a($res, 'Errore') || $res['Errore'] == 3 || $res['Errore'] == 6) { $user['data']['first-app'] = date('Y-m-d H:i:s'); $user->update_data($user['data']); } } $user = models\User::get_by_id($user['id']); $result = array("user" => $user); # JSON output echo json_encode($result); } # DEFAULT else { header('HTTP/1.0 400 Bad Request', true, 400); header("Content-Type: application/json; charset=utf-8"); echo json_encode(array("error" => "unsupported method")); } ?>