@@ -36,54 +36,54 @@ |
||
36 | 36 | * @method void setName(string $name) |
37 | 37 | */ |
38 | 38 | class Tag extends Entity { |
39 | - protected $owner; |
|
40 | - protected $type; |
|
41 | - protected $name; |
|
39 | + protected $owner; |
|
40 | + protected $type; |
|
41 | + protected $name; |
|
42 | 42 | |
43 | - /** |
|
44 | - * Constructor. |
|
45 | - * |
|
46 | - * @param string $owner The tag's owner |
|
47 | - * @param string $type The type of item this tag is used for |
|
48 | - * @param string $name The tag's name |
|
49 | - */ |
|
50 | - public function __construct($owner = null, $type = null, $name = null) { |
|
51 | - $this->setOwner($owner); |
|
52 | - $this->setType($type); |
|
53 | - $this->setName($name); |
|
54 | - } |
|
43 | + /** |
|
44 | + * Constructor. |
|
45 | + * |
|
46 | + * @param string $owner The tag's owner |
|
47 | + * @param string $type The type of item this tag is used for |
|
48 | + * @param string $name The tag's name |
|
49 | + */ |
|
50 | + public function __construct($owner = null, $type = null, $name = null) { |
|
51 | + $this->setOwner($owner); |
|
52 | + $this->setType($type); |
|
53 | + $this->setName($name); |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * Transform a database columnname to a property |
|
58 | - * |
|
59 | - * @param string $columnName the name of the column |
|
60 | - * @return string the property name |
|
61 | - * @todo migrate existing database columns to the correct names |
|
62 | - * to be able to drop this direct mapping |
|
63 | - */ |
|
64 | - public function columnToProperty($columnName) { |
|
65 | - if ($columnName === 'category') { |
|
66 | - return 'name'; |
|
67 | - } elseif ($columnName === 'uid') { |
|
68 | - return 'owner'; |
|
69 | - } else { |
|
70 | - return parent::columnToProperty($columnName); |
|
71 | - } |
|
72 | - } |
|
56 | + /** |
|
57 | + * Transform a database columnname to a property |
|
58 | + * |
|
59 | + * @param string $columnName the name of the column |
|
60 | + * @return string the property name |
|
61 | + * @todo migrate existing database columns to the correct names |
|
62 | + * to be able to drop this direct mapping |
|
63 | + */ |
|
64 | + public function columnToProperty($columnName) { |
|
65 | + if ($columnName === 'category') { |
|
66 | + return 'name'; |
|
67 | + } elseif ($columnName === 'uid') { |
|
68 | + return 'owner'; |
|
69 | + } else { |
|
70 | + return parent::columnToProperty($columnName); |
|
71 | + } |
|
72 | + } |
|
73 | 73 | |
74 | - /** |
|
75 | - * Transform a property to a database column name |
|
76 | - * |
|
77 | - * @param string $property the name of the property |
|
78 | - * @return string the column name |
|
79 | - */ |
|
80 | - public function propertyToColumn($property) { |
|
81 | - if ($property === 'name') { |
|
82 | - return 'category'; |
|
83 | - } elseif ($property === 'owner') { |
|
84 | - return 'uid'; |
|
85 | - } else { |
|
86 | - return parent::propertyToColumn($property); |
|
87 | - } |
|
88 | - } |
|
74 | + /** |
|
75 | + * Transform a property to a database column name |
|
76 | + * |
|
77 | + * @param string $property the name of the property |
|
78 | + * @return string the column name |
|
79 | + */ |
|
80 | + public function propertyToColumn($property) { |
|
81 | + if ($property === 'name') { |
|
82 | + return 'category'; |
|
83 | + } elseif ($property === 'owner') { |
|
84 | + return 'uid'; |
|
85 | + } else { |
|
86 | + return parent::propertyToColumn($property); |
|
87 | + } |
|
88 | + } |
|
89 | 89 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | * @package OC\AppFramework\Middleware\Security\Exceptions |
33 | 33 | */ |
34 | 34 | class StrictCookieMissingException extends SecurityException { |
35 | - public function __construct() { |
|
36 | - parent::__construct('Strict Cookie has not been found in request.', Http::STATUS_PRECONDITION_FAILED); |
|
37 | - } |
|
35 | + public function __construct() { |
|
36 | + parent::__construct('Strict Cookie has not been found in request.', Http::STATUS_PRECONDITION_FAILED); |
|
37 | + } |
|
38 | 38 | } |
@@ -26,71 +26,71 @@ |
||
26 | 26 | use Sabre\DAV\File; |
27 | 27 | |
28 | 28 | class AvatarNode extends File { |
29 | - private $ext; |
|
30 | - private $size; |
|
31 | - private $avatar; |
|
29 | + private $ext; |
|
30 | + private $size; |
|
31 | + private $avatar; |
|
32 | 32 | |
33 | - /** |
|
34 | - * AvatarNode constructor. |
|
35 | - * |
|
36 | - * @param integer $size |
|
37 | - * @param string $ext |
|
38 | - * @param IAvatar $avatar |
|
39 | - */ |
|
40 | - public function __construct($size, $ext, $avatar) { |
|
41 | - $this->size = $size; |
|
42 | - $this->ext = $ext; |
|
43 | - $this->avatar = $avatar; |
|
44 | - } |
|
33 | + /** |
|
34 | + * AvatarNode constructor. |
|
35 | + * |
|
36 | + * @param integer $size |
|
37 | + * @param string $ext |
|
38 | + * @param IAvatar $avatar |
|
39 | + */ |
|
40 | + public function __construct($size, $ext, $avatar) { |
|
41 | + $this->size = $size; |
|
42 | + $this->ext = $ext; |
|
43 | + $this->avatar = $avatar; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Returns the name of the node. |
|
48 | - * |
|
49 | - * This is used to generate the url. |
|
50 | - * |
|
51 | - * @return string |
|
52 | - */ |
|
53 | - public function getName() { |
|
54 | - return "$this->size.$this->ext"; |
|
55 | - } |
|
46 | + /** |
|
47 | + * Returns the name of the node. |
|
48 | + * |
|
49 | + * This is used to generate the url. |
|
50 | + * |
|
51 | + * @return string |
|
52 | + */ |
|
53 | + public function getName() { |
|
54 | + return "$this->size.$this->ext"; |
|
55 | + } |
|
56 | 56 | |
57 | - public function get() { |
|
58 | - $image = $this->avatar->get($this->size); |
|
59 | - $res = $image->resource(); |
|
57 | + public function get() { |
|
58 | + $image = $this->avatar->get($this->size); |
|
59 | + $res = $image->resource(); |
|
60 | 60 | |
61 | - ob_start(); |
|
62 | - if ($this->ext === 'png') { |
|
63 | - imagepng($res); |
|
64 | - } else { |
|
65 | - imagejpeg($res); |
|
66 | - } |
|
61 | + ob_start(); |
|
62 | + if ($this->ext === 'png') { |
|
63 | + imagepng($res); |
|
64 | + } else { |
|
65 | + imagejpeg($res); |
|
66 | + } |
|
67 | 67 | |
68 | - return ob_get_clean(); |
|
69 | - } |
|
68 | + return ob_get_clean(); |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * Returns the mime-type for a file |
|
73 | - * |
|
74 | - * If null is returned, we'll assume application/octet-stream |
|
75 | - * |
|
76 | - * @return string|null |
|
77 | - */ |
|
78 | - public function getContentType() { |
|
79 | - if ($this->ext === 'png') { |
|
80 | - return 'image/png'; |
|
81 | - } |
|
82 | - return 'image/jpeg'; |
|
83 | - } |
|
71 | + /** |
|
72 | + * Returns the mime-type for a file |
|
73 | + * |
|
74 | + * If null is returned, we'll assume application/octet-stream |
|
75 | + * |
|
76 | + * @return string|null |
|
77 | + */ |
|
78 | + public function getContentType() { |
|
79 | + if ($this->ext === 'png') { |
|
80 | + return 'image/png'; |
|
81 | + } |
|
82 | + return 'image/jpeg'; |
|
83 | + } |
|
84 | 84 | |
85 | - public function getETag() { |
|
86 | - return $this->avatar->getFile($this->size)->getEtag(); |
|
87 | - } |
|
85 | + public function getETag() { |
|
86 | + return $this->avatar->getFile($this->size)->getEtag(); |
|
87 | + } |
|
88 | 88 | |
89 | - public function getLastModified() { |
|
90 | - $timestamp = $this->avatar->getFile($this->size)->getMTime(); |
|
91 | - if (!empty($timestamp)) { |
|
92 | - return (int)$timestamp; |
|
93 | - } |
|
94 | - return $timestamp; |
|
95 | - } |
|
89 | + public function getLastModified() { |
|
90 | + $timestamp = $this->avatar->getFile($this->size)->getMTime(); |
|
91 | + if (!empty($timestamp)) { |
|
92 | + return (int)$timestamp; |
|
93 | + } |
|
94 | + return $timestamp; |
|
95 | + } |
|
96 | 96 | } |
@@ -26,66 +26,66 @@ |
||
26 | 26 | |
27 | 27 | class PublicAuth implements BackendInterface { |
28 | 28 | |
29 | - /** @var string[] */ |
|
30 | - private $publicURLs; |
|
29 | + /** @var string[] */ |
|
30 | + private $publicURLs; |
|
31 | 31 | |
32 | - public function __construct() { |
|
33 | - $this->publicURLs = [ |
|
34 | - 'public-calendars', |
|
35 | - 'principals/system/public' |
|
36 | - ]; |
|
37 | - } |
|
32 | + public function __construct() { |
|
33 | + $this->publicURLs = [ |
|
34 | + 'public-calendars', |
|
35 | + 'principals/system/public' |
|
36 | + ]; |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * When this method is called, the backend must check if authentication was |
|
41 | - * successful. |
|
42 | - * |
|
43 | - * The returned value must be one of the following |
|
44 | - * |
|
45 | - * [true, "principals/username"] |
|
46 | - * [false, "reason for failure"] |
|
47 | - * |
|
48 | - * If authentication was successful, it's expected that the authentication |
|
49 | - * backend returns a so-called principal url. |
|
50 | - * |
|
51 | - * Examples of a principal url: |
|
52 | - * |
|
53 | - * principals/admin |
|
54 | - * principals/user1 |
|
55 | - * principals/users/joe |
|
56 | - * principals/uid/123457 |
|
57 | - * |
|
58 | - * If you don't use WebDAV ACL (RFC3744) we recommend that you simply |
|
59 | - * return a string such as: |
|
60 | - * |
|
61 | - * principals/users/[username] |
|
62 | - * |
|
63 | - * @param RequestInterface $request |
|
64 | - * @param ResponseInterface $response |
|
65 | - * @return array |
|
66 | - */ |
|
67 | - public function check(RequestInterface $request, ResponseInterface $response) { |
|
68 | - if ($this->isRequestPublic($request)) { |
|
69 | - return [true, "principals/system/public"]; |
|
70 | - } |
|
71 | - return [false, "No public access to this resource."]; |
|
72 | - } |
|
39 | + /** |
|
40 | + * When this method is called, the backend must check if authentication was |
|
41 | + * successful. |
|
42 | + * |
|
43 | + * The returned value must be one of the following |
|
44 | + * |
|
45 | + * [true, "principals/username"] |
|
46 | + * [false, "reason for failure"] |
|
47 | + * |
|
48 | + * If authentication was successful, it's expected that the authentication |
|
49 | + * backend returns a so-called principal url. |
|
50 | + * |
|
51 | + * Examples of a principal url: |
|
52 | + * |
|
53 | + * principals/admin |
|
54 | + * principals/user1 |
|
55 | + * principals/users/joe |
|
56 | + * principals/uid/123457 |
|
57 | + * |
|
58 | + * If you don't use WebDAV ACL (RFC3744) we recommend that you simply |
|
59 | + * return a string such as: |
|
60 | + * |
|
61 | + * principals/users/[username] |
|
62 | + * |
|
63 | + * @param RequestInterface $request |
|
64 | + * @param ResponseInterface $response |
|
65 | + * @return array |
|
66 | + */ |
|
67 | + public function check(RequestInterface $request, ResponseInterface $response) { |
|
68 | + if ($this->isRequestPublic($request)) { |
|
69 | + return [true, "principals/system/public"]; |
|
70 | + } |
|
71 | + return [false, "No public access to this resource."]; |
|
72 | + } |
|
73 | 73 | |
74 | - /** |
|
75 | - * @inheritdoc |
|
76 | - */ |
|
77 | - public function challenge(RequestInterface $request, ResponseInterface $response) { |
|
78 | - } |
|
74 | + /** |
|
75 | + * @inheritdoc |
|
76 | + */ |
|
77 | + public function challenge(RequestInterface $request, ResponseInterface $response) { |
|
78 | + } |
|
79 | 79 | |
80 | - /** |
|
81 | - * @param RequestInterface $request |
|
82 | - * @return bool |
|
83 | - */ |
|
84 | - private function isRequestPublic(RequestInterface $request) { |
|
85 | - $url = $request->getPath(); |
|
86 | - $matchingUrls = array_filter($this->publicURLs, function ($publicUrl) use ($url) { |
|
87 | - return strpos($url, $publicUrl, 0) === 0; |
|
88 | - }); |
|
89 | - return !empty($matchingUrls); |
|
90 | - } |
|
80 | + /** |
|
81 | + * @param RequestInterface $request |
|
82 | + * @return bool |
|
83 | + */ |
|
84 | + private function isRequestPublic(RequestInterface $request) { |
|
85 | + $url = $request->getPath(); |
|
86 | + $matchingUrls = array_filter($this->publicURLs, function ($publicUrl) use ($url) { |
|
87 | + return strpos($url, $publicUrl, 0) === 0; |
|
88 | + }); |
|
89 | + return !empty($matchingUrls); |
|
90 | + } |
|
91 | 91 | } |
@@ -26,54 +26,54 @@ |
||
26 | 26 | use Sabre\Xml\XmlDeserializable; |
27 | 27 | |
28 | 28 | class ShareRequest implements XmlDeserializable { |
29 | - public $set = []; |
|
29 | + public $set = []; |
|
30 | 30 | |
31 | - public $remove = []; |
|
31 | + public $remove = []; |
|
32 | 32 | |
33 | - /** |
|
34 | - * Constructor |
|
35 | - * |
|
36 | - * @param array $set |
|
37 | - * @param array $remove |
|
38 | - */ |
|
39 | - public function __construct(array $set, array $remove) { |
|
40 | - $this->set = $set; |
|
41 | - $this->remove = $remove; |
|
42 | - } |
|
33 | + /** |
|
34 | + * Constructor |
|
35 | + * |
|
36 | + * @param array $set |
|
37 | + * @param array $remove |
|
38 | + */ |
|
39 | + public function __construct(array $set, array $remove) { |
|
40 | + $this->set = $set; |
|
41 | + $this->remove = $remove; |
|
42 | + } |
|
43 | 43 | |
44 | - public static function xmlDeserialize(Reader $reader) { |
|
45 | - $elements = $reader->parseInnerTree([ |
|
46 | - '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', |
|
47 | - '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', |
|
48 | - ]); |
|
44 | + public static function xmlDeserialize(Reader $reader) { |
|
45 | + $elements = $reader->parseInnerTree([ |
|
46 | + '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', |
|
47 | + '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', |
|
48 | + ]); |
|
49 | 49 | |
50 | - $set = []; |
|
51 | - $remove = []; |
|
50 | + $set = []; |
|
51 | + $remove = []; |
|
52 | 52 | |
53 | - foreach ($elements as $elem) { |
|
54 | - switch ($elem['name']) { |
|
53 | + foreach ($elements as $elem) { |
|
54 | + switch ($elem['name']) { |
|
55 | 55 | |
56 | - case '{' . Plugin::NS_OWNCLOUD . '}set': |
|
57 | - $sharee = $elem['value']; |
|
56 | + case '{' . Plugin::NS_OWNCLOUD . '}set': |
|
57 | + $sharee = $elem['value']; |
|
58 | 58 | |
59 | - $sumElem = '{' . Plugin::NS_OWNCLOUD . '}summary'; |
|
60 | - $commonName = '{' . Plugin::NS_OWNCLOUD . '}common-name'; |
|
59 | + $sumElem = '{' . Plugin::NS_OWNCLOUD . '}summary'; |
|
60 | + $commonName = '{' . Plugin::NS_OWNCLOUD . '}common-name'; |
|
61 | 61 | |
62 | - $set[] = [ |
|
63 | - 'href' => $sharee['{DAV:}href'], |
|
64 | - 'commonName' => isset($sharee[$commonName]) ? $sharee[$commonName] : null, |
|
65 | - 'summary' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null, |
|
66 | - 'readOnly' => !array_key_exists('{' . Plugin::NS_OWNCLOUD . '}read-write', $sharee), |
|
67 | - ]; |
|
68 | - break; |
|
62 | + $set[] = [ |
|
63 | + 'href' => $sharee['{DAV:}href'], |
|
64 | + 'commonName' => isset($sharee[$commonName]) ? $sharee[$commonName] : null, |
|
65 | + 'summary' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null, |
|
66 | + 'readOnly' => !array_key_exists('{' . Plugin::NS_OWNCLOUD . '}read-write', $sharee), |
|
67 | + ]; |
|
68 | + break; |
|
69 | 69 | |
70 | - case '{' . Plugin::NS_OWNCLOUD . '}remove': |
|
71 | - $remove[] = $elem['value']['{DAV:}href']; |
|
72 | - break; |
|
70 | + case '{' . Plugin::NS_OWNCLOUD . '}remove': |
|
71 | + $remove[] = $elem['value']['{DAV:}href']; |
|
72 | + break; |
|
73 | 73 | |
74 | - } |
|
75 | - } |
|
74 | + } |
|
75 | + } |
|
76 | 76 | |
77 | - return new self($set, $remove); |
|
78 | - } |
|
77 | + return new self($set, $remove); |
|
78 | + } |
|
79 | 79 | } |
@@ -29,19 +29,19 @@ |
||
29 | 29 | use Exception; |
30 | 30 | |
31 | 31 | class FileLocked extends \Sabre\DAV\Exception { |
32 | - public function __construct($message = "", $code = 0, Exception $previous = null) { |
|
33 | - if ($previous instanceof \OCP\Files\LockNotAcquiredException) { |
|
34 | - $message = sprintf('Target file %s is locked by another process.', $previous->path); |
|
35 | - } |
|
36 | - parent::__construct($message, $code, $previous); |
|
37 | - } |
|
32 | + public function __construct($message = "", $code = 0, Exception $previous = null) { |
|
33 | + if ($previous instanceof \OCP\Files\LockNotAcquiredException) { |
|
34 | + $message = sprintf('Target file %s is locked by another process.', $previous->path); |
|
35 | + } |
|
36 | + parent::__construct($message, $code, $previous); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * Returns the HTTP status code for this exception |
|
41 | - * |
|
42 | - * @return int |
|
43 | - */ |
|
44 | - public function getHTTPCode() { |
|
45 | - return 423; |
|
46 | - } |
|
39 | + /** |
|
40 | + * Returns the HTTP status code for this exception |
|
41 | + * |
|
42 | + * @return int |
|
43 | + */ |
|
44 | + public function getHTTPCode() { |
|
45 | + return 423; |
|
46 | + } |
|
47 | 47 | } |
@@ -31,12 +31,12 @@ |
||
31 | 31 | */ |
32 | 32 | class UnsupportedMediaType extends \Sabre\DAV\Exception { |
33 | 33 | |
34 | - /** |
|
35 | - * Returns the HTTP status code for this exception |
|
36 | - * |
|
37 | - * @return int |
|
38 | - */ |
|
39 | - public function getHTTPCode() { |
|
40 | - return 415; |
|
41 | - } |
|
34 | + /** |
|
35 | + * Returns the HTTP status code for this exception |
|
36 | + * |
|
37 | + * @return int |
|
38 | + */ |
|
39 | + public function getHTTPCode() { |
|
40 | + return 415; |
|
41 | + } |
|
42 | 42 | } |
@@ -31,12 +31,12 @@ |
||
31 | 31 | */ |
32 | 32 | class EntityTooLarge extends \Sabre\DAV\Exception { |
33 | 33 | |
34 | - /** |
|
35 | - * Returns the HTTP status code for this exception |
|
36 | - * |
|
37 | - * @return int |
|
38 | - */ |
|
39 | - public function getHTTPCode() { |
|
40 | - return 413; |
|
41 | - } |
|
34 | + /** |
|
35 | + * Returns the HTTP status code for this exception |
|
36 | + * |
|
37 | + * @return int |
|
38 | + */ |
|
39 | + public function getHTTPCode() { |
|
40 | + return 413; |
|
41 | + } |
|
42 | 42 | } |
@@ -23,11 +23,11 @@ |
||
23 | 23 | |
24 | 24 | class PublicCalendarObject extends CalendarObject { |
25 | 25 | |
26 | - /** |
|
27 | - * public calendars are always shared |
|
28 | - * @return bool |
|
29 | - */ |
|
30 | - protected function isShared() { |
|
31 | - return true; |
|
32 | - } |
|
26 | + /** |
|
27 | + * public calendars are always shared |
|
28 | + * @return bool |
|
29 | + */ |
|
30 | + protected function isShared() { |
|
31 | + return true; |
|
32 | + } |
|
33 | 33 | } |