xref: /plugin/davcal/vendor/sabre/dav/lib/DAVACL/Exception/NotRecognizedPrincipal.php (revision a1a3b6794e0e143a4a8b51d3185ce2d339be61ab)
1*a1a3b679SAndreas Boehler<?php
2*a1a3b679SAndreas Boehler
3*a1a3b679SAndreas Boehlernamespace Sabre\DAVACL\Exception;
4*a1a3b679SAndreas Boehler
5*a1a3b679SAndreas Boehleruse Sabre\DAV;
6*a1a3b679SAndreas Boehler
7*a1a3b679SAndreas Boehler/**
8*a1a3b679SAndreas Boehler * If a client tried to set a privilege assigned to a non-existant principal,
9*a1a3b679SAndreas Boehler * this exception will be thrown.
10*a1a3b679SAndreas Boehler *
11*a1a3b679SAndreas Boehler * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
12*a1a3b679SAndreas Boehler * @author Evert Pot (http://evertpot.com/)
13*a1a3b679SAndreas Boehler * @license http://sabre.io/license/ Modified BSD License
14*a1a3b679SAndreas Boehler */
15*a1a3b679SAndreas Boehlerclass NotRecognizedPrincipal extends DAV\Exception\PreconditionFailed {
16*a1a3b679SAndreas Boehler
17*a1a3b679SAndreas Boehler    /**
18*a1a3b679SAndreas Boehler     * Adds in extra information in the xml response.
19*a1a3b679SAndreas Boehler     *
20*a1a3b679SAndreas Boehler     * This method adds the {DAV:}recognized-principal element as defined in rfc3744
21*a1a3b679SAndreas Boehler     *
22*a1a3b679SAndreas Boehler     * @param DAV\Server $server
23*a1a3b679SAndreas Boehler     * @param \DOMElement $errorNode
24*a1a3b679SAndreas Boehler     * @return void
25*a1a3b679SAndreas Boehler     */
26*a1a3b679SAndreas Boehler    function serialize(DAV\Server $server, \DOMElement $errorNode) {
27*a1a3b679SAndreas Boehler
28*a1a3b679SAndreas Boehler        $doc = $errorNode->ownerDocument;
29*a1a3b679SAndreas Boehler
30*a1a3b679SAndreas Boehler        $np = $doc->createElementNS('DAV:', 'd:recognized-principal');
31*a1a3b679SAndreas Boehler        $errorNode->appendChild($np);
32*a1a3b679SAndreas Boehler
33*a1a3b679SAndreas Boehler    }
34*a1a3b679SAndreas Boehler
35*a1a3b679SAndreas Boehler}
36