<?php include_once dirname(__FILE__) . "/../common/common.php"; include_once dirname(__FILE__) . '/../business/AuthB.php'; include_once dirname(__FILE__) . '/../database/TripUser.php'; $auth = new AuthB(); if (!$auth->canSynchTripUser()) { $response = errorResponse(RESPONSE_UNAUTHORIZED); } else { if (isGetMethod()) { if (isset($_GET['hash'])) { $hash = $_GET['hash']; if ($hash === '') { $response = errorResponse(RESPONSE_BAD_REQUEST); } else { $object = TripUser::findByHash($hash); if ($object === null) { $response = errorResponse(RESPONSE_NOT_FOUND); } else { $response = successResponse(); $response['tripId'] = $object->getTripId(); $response['userId'] = $object->getUserId(); $response['created'] = $object->getCreated(); $response['updated'] = $object->getUpdated(); $response['role'] = $object->getRole(); $response['message'] = $object->getMessage(); $response['deleted'] = $object->getDeleted(); $response['hash'] = $object->getHash(); } } } else {