Loading...
Searching...
No Matches
caldav-DELTICKET.php
<?php
dbg_error_log('DELTICKET', 'method handler');
require_once('DAVResource.php');
if ( ! $request->HavePrivilegeTo('DAV::unbind') && $request->ticket->owner() != $session->principal_id ) {
$request->NeedPrivilege('DAV::unbind');
}
if ( ! isset($request->ticket) ) {
if ( isset($_GET['ticket']) || isset($_SERVER['HTTP_TICKET']) ) {
$r = new DAVResource($request->path);
if ( ! $r->Exists() ) {
$request->PreconditionFailed(404,'not-found');
}
else {
$request->PreconditionFailed(412,'ticket-does-not-exist','The specified ticket does not exist');
}
}
else
$request->MalformedRequest('No ticket specified');
}
$qry = new AwlQuery('DELETE FROM access_ticket WHERE ticket_id=:ticket_id', array( ':ticket_id' => $request->ticket->id() ) );
if ( $qry->Exec('DELTICKET', __LINE__, __FILE__) ) {
$request->DoResponse( 204 );
}
$request->DoResponse( 500 );
DAVResource
Definition DAVResource.php:25