75 $this->dav_name =
null;
76 $this->target_collection_id =
null;
77 $this->target_resource_id =
null;
79 $this->expired =
true;
80 $this->dav_owner_id =
null;
81 $this->ticket_id = $ticket_id;
82 $this->privileges = 0;
83 $this->grantor_collection_privileges = 0;
86 'SELECT access_ticket.*, collection.dav_name, (access_ticket.expires < current_timestamp) AS expired,
87 path_privs(access_ticket.dav_owner_id,collection.dav_name,:scan_depth) AS grantor_collection_privileges
88 FROM access_ticket JOIN collection ON (target_collection_id = collection_id)
89 WHERE ticket_id = :ticket_id::text',
90 array(
':ticket_id' => $ticket_id,
':scan_depth' => $c->permission_scan_depth)
92 if ( $qry->Exec(
'DAVTicket',__LINE__,__FILE__) && $qry->rows() == 1 && $t = $qry->Fetch() ) {
93 if ( ! $t->expired ) {
94 foreach( $t AS $k => $v ) {
97 $this->expired =
false;
98 $this->privileges = bindec($this->privileges);
99 $this->grantor_collection_privileges = bindec($this->grantor_collection_privileges);
100 dbg_error_log(
'DAVTicket',
'Found a current ticket for "%s"', implode(
', ',bits_to_privilege($this->privileges())) );
103 dbg_error_log(
'DAVTicket',
'Found an expired ticket: %s - %s', $ticket_id, $t->expires );
106 if ( isset($this->target_resource_id) ) {
107 $qry =
new AwlQuery(
'SELECT dav_name FROM caldav_data WHERE dav_id = :dav_id', array(
':dav_id' => $this->target_resource_id ) );
108 if ( $qry->Exec(
'DAVTicket',__LINE__,__FILE__) && $qry->rows() == 1 && $r = $qry->Fetch() ) {
109 $this->dav_name = $r->dav_name;