/** * Overwrites DAV_Resource::propname() * * @return array */ public function propname() { $retval = parent::propname(); foreach (array_keys(DAV::$ACL_PROPERTIES) as $prop) { if (!isset($retval[$prop])) { $retval[$prop] = false; } } if ($this instanceof DAVACL_Principal) { foreach (array_keys(DAV::$PRINCIPAL_PROPERTIES) as $prop) { if (!isset($retval[$prop])) { $retval[$prop] = false; } } } return $retval; }
/** * Recursively gathers properties in a WebDAV tree. * Called by {@link method_PROPFIND()} * @param DAV_Request_PROPFIND $propfind * @param DAV_Resource $resource * @return DAV_Props */ private function handle2($resource) { $props = $this->props; // A client may submit a 'propfind' XML element in the body of the // request method describing what information is being requested. It is // possible to: switch ($this->requestType) { // o Request property values for those properties defined in this // specification (at a minimum) plus dead properties, by using the // 'allprop' element (the 'include' element can be used with // 'allprop' to instruct the server to also include additional live // properties that may not have been returned otherwise), case 'allprop': foreach ($resource->propname() as $key => $value) { if ($value) { $props[] = $key; } } $props = array_unique($props); // o Request particular property values, by naming the properties // desired within the 'prop' element (the ordering of properties in // here MAY be ignored by the server), // o Request particular property values, by naming the properties // desired within the 'prop' element (the ordering of properties in // here MAY be ignored by the server), case 'prop': $this->handle3($resource, $props); break; // o Request a list of names of all the properties defined on the // resource, by using the 'propname' element. // o Request a list of names of all the properties defined on the // resource, by using the 'propname' element. case 'propname': $response = new DAV_Element_response($resource->path); $propname = $resource->propname(); foreach (array_keys($propname) as $key) { $response->setStatus($key, DAV_Status::$OK); } DAV_Multistatus::inst()->addResponse($response); break; } }