/** * @method DELETE */ function remove($userUniqId) { // get an authuser $authUser = new AuthUser(); if (isset($authUser->UserUniqId)) { // check if authorized User::Remove($userUniqId); return new Tonic\Response(Tonic\Response::OK); } else { return new Tonic\Response(Tonic\Response::UNAUTHORIZED); } }
/** * @method POST */ function post() { // get token $token = Utilities::ValidateJWTToken(apache_request_headers()); // check if token is not null if ($token != NULL) { parse_str($this->request->data, $request); // parse request $userId = $request['userId']; User::Remove($userId); return new Tonic\Response(Tonic\Response::OK); } else { return new Tonic\Response(Tonic\Response::UNAUTHORIZED); } }
public function removeUser($stamp) { if ($this->validateAdmin()) { if (User::Remove($id)) { echo 1; } else { echo 0; } } else { echo 0; } }