3 $request->NeedPrivilege(array(
'DAV::read',
'DAV::read-current-user-privilege-set',
'DAV::read-acl'));
5 if ( $request->depth > 0 ) {
6 $request->DoResponse( 400,
'The principal-match REPORT is only defined for Depth "0".' );
12 $match = $xmltree->GetPath(
'/DAV::principal-match/DAV::self');
13 if ( count ( $match ) == 0 ) {
14 $match = $xmltree->GetPath(
'/DAV::principal-match/DAV::principal-property');
20 if ( count ( $match ) == 0 ) {
21 $request->DoResponse( 400,
'Badly formed principal-match REPORT request.' );
31 $where .=
'username = :username';
32 $params = array(
':username' => $session->username );
35 $where =
'dav_name = :dav_name';
36 $params = array(
':dav_name'=>
'/'.$request->principal->GetProperty(
'username').
'/');
38 $sql =
"SELECT * FROM dav_principal WHERE $where ORDER BY principal_id LIMIT 100";
40 if ( $target->IsPrincipal() ) {
43 $sql =
"SELECT * FROM collection WHERE user_no = :user_no";
44 $params = array(
':user_no' => $target->user_no() );
47 $qry =
new AwlQuery($sql, $params);
53 $get_props = $xmltree->GetPath(
'/DAV::principal-match/DAV::prop/*');
54 $properties = array();
55 foreach( $get_props AS $k1 => $v1 ) {
56 $properties[] = $v1->GetNSTag();
60 if ( $qry->Exec(
"REPORT",__LINE__,__FILE__) && $qry->rows() > 0 ) {
61 while( $row = $qry->Fetch() ) {
63 $responses[] = $principal->RenderAsXML( $properties, $reply );
67 $multistatus =
new XMLElement(
"multistatus", $responses, $reply->GetXmlNsArray() );
69 $request->XMLResponse( 207, $multistatus );