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