Beispiel #1
0
 /**
  * @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);
     }
 }
Beispiel #2
0
 /**
  * @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);
     }
 }
Beispiel #3
0
 public function removeUser($stamp)
 {
     if ($this->validateAdmin()) {
         if (User::Remove($id)) {
             echo 1;
         } else {
             echo 0;
         }
     } else {
         echo 0;
     }
 }