@@ -28,146 +28,146 @@ |
||
28 | 28 | |
29 | 29 | class Action implements IAction { |
30 | 30 | |
31 | - /** @var string */ |
|
32 | - protected $label; |
|
33 | - |
|
34 | - /** @var string */ |
|
35 | - protected $labelParsed; |
|
36 | - |
|
37 | - /** @var string */ |
|
38 | - protected $link; |
|
39 | - |
|
40 | - /** @var string */ |
|
41 | - protected $requestType; |
|
42 | - |
|
43 | - /** @var string */ |
|
44 | - protected $icon; |
|
45 | - |
|
46 | - /** @var bool */ |
|
47 | - protected $primary; |
|
48 | - |
|
49 | - public function __construct() { |
|
50 | - $this->label = ''; |
|
51 | - $this->labelParsed = ''; |
|
52 | - $this->link = ''; |
|
53 | - $this->requestType = ''; |
|
54 | - $this->primary = false; |
|
55 | - } |
|
56 | - |
|
57 | - /** |
|
58 | - * @param string $label |
|
59 | - * @return $this |
|
60 | - * @throws \InvalidArgumentException if the label is invalid |
|
61 | - * @since 8.2.0 |
|
62 | - */ |
|
63 | - public function setLabel(string $label): IAction { |
|
64 | - if ($label === '' || isset($label[32])) { |
|
65 | - throw new \InvalidArgumentException('The given label is invalid'); |
|
66 | - } |
|
67 | - $this->label = $label; |
|
68 | - return $this; |
|
69 | - } |
|
70 | - |
|
71 | - /** |
|
72 | - * @return string |
|
73 | - * @since 8.2.0 |
|
74 | - */ |
|
75 | - public function getLabel(): string { |
|
76 | - return $this->label; |
|
77 | - } |
|
78 | - |
|
79 | - /** |
|
80 | - * @param string $label |
|
81 | - * @return $this |
|
82 | - * @throws \InvalidArgumentException if the label is invalid |
|
83 | - * @since 8.2.0 |
|
84 | - */ |
|
85 | - public function setParsedLabel(string $label): IAction { |
|
86 | - if ($label === '') { |
|
87 | - throw new \InvalidArgumentException('The given parsed label is invalid'); |
|
88 | - } |
|
89 | - $this->labelParsed = $label; |
|
90 | - return $this; |
|
91 | - } |
|
92 | - |
|
93 | - /** |
|
94 | - * @return string |
|
95 | - * @since 8.2.0 |
|
96 | - */ |
|
97 | - public function getParsedLabel(): string { |
|
98 | - return $this->labelParsed; |
|
99 | - } |
|
100 | - |
|
101 | - /** |
|
102 | - * @param $primary bool |
|
103 | - * @return $this |
|
104 | - * @since 9.0.0 |
|
105 | - */ |
|
106 | - public function setPrimary(bool $primary): IAction { |
|
107 | - $this->primary = $primary; |
|
108 | - return $this; |
|
109 | - } |
|
110 | - |
|
111 | - /** |
|
112 | - * @return bool |
|
113 | - * @since 9.0.0 |
|
114 | - */ |
|
115 | - public function isPrimary(): bool { |
|
116 | - return $this->primary; |
|
117 | - } |
|
118 | - |
|
119 | - /** |
|
120 | - * @param string $link |
|
121 | - * @param string $requestType |
|
122 | - * @return $this |
|
123 | - * @throws \InvalidArgumentException if the link is invalid |
|
124 | - * @since 8.2.0 |
|
125 | - */ |
|
126 | - public function setLink(string $link, string $requestType): IAction { |
|
127 | - if ($link === '' || isset($link[256])) { |
|
128 | - throw new \InvalidArgumentException('The given link is invalid'); |
|
129 | - } |
|
130 | - if (!in_array($requestType, [ |
|
131 | - self::TYPE_GET, |
|
132 | - self::TYPE_POST, |
|
133 | - self::TYPE_PUT, |
|
134 | - self::TYPE_DELETE, |
|
135 | - self::TYPE_WEB, |
|
136 | - ], true)) { |
|
137 | - throw new \InvalidArgumentException('The given request type is invalid'); |
|
138 | - } |
|
139 | - $this->link = $link; |
|
140 | - $this->requestType = $requestType; |
|
141 | - return $this; |
|
142 | - } |
|
143 | - |
|
144 | - /** |
|
145 | - * @return string |
|
146 | - * @since 8.2.0 |
|
147 | - */ |
|
148 | - public function getLink(): string { |
|
149 | - return $this->link; |
|
150 | - } |
|
151 | - |
|
152 | - /** |
|
153 | - * @return string |
|
154 | - * @since 8.2.0 |
|
155 | - */ |
|
156 | - public function getRequestType(): string { |
|
157 | - return $this->requestType; |
|
158 | - } |
|
159 | - |
|
160 | - /** |
|
161 | - * @return bool |
|
162 | - */ |
|
163 | - public function isValid(): bool { |
|
164 | - return $this->label !== '' && $this->link !== ''; |
|
165 | - } |
|
166 | - |
|
167 | - /** |
|
168 | - * @return bool |
|
169 | - */ |
|
170 | - public function isValidParsed(): bool { |
|
171 | - return $this->labelParsed !== '' && $this->link !== ''; |
|
172 | - } |
|
31 | + /** @var string */ |
|
32 | + protected $label; |
|
33 | + |
|
34 | + /** @var string */ |
|
35 | + protected $labelParsed; |
|
36 | + |
|
37 | + /** @var string */ |
|
38 | + protected $link; |
|
39 | + |
|
40 | + /** @var string */ |
|
41 | + protected $requestType; |
|
42 | + |
|
43 | + /** @var string */ |
|
44 | + protected $icon; |
|
45 | + |
|
46 | + /** @var bool */ |
|
47 | + protected $primary; |
|
48 | + |
|
49 | + public function __construct() { |
|
50 | + $this->label = ''; |
|
51 | + $this->labelParsed = ''; |
|
52 | + $this->link = ''; |
|
53 | + $this->requestType = ''; |
|
54 | + $this->primary = false; |
|
55 | + } |
|
56 | + |
|
57 | + /** |
|
58 | + * @param string $label |
|
59 | + * @return $this |
|
60 | + * @throws \InvalidArgumentException if the label is invalid |
|
61 | + * @since 8.2.0 |
|
62 | + */ |
|
63 | + public function setLabel(string $label): IAction { |
|
64 | + if ($label === '' || isset($label[32])) { |
|
65 | + throw new \InvalidArgumentException('The given label is invalid'); |
|
66 | + } |
|
67 | + $this->label = $label; |
|
68 | + return $this; |
|
69 | + } |
|
70 | + |
|
71 | + /** |
|
72 | + * @return string |
|
73 | + * @since 8.2.0 |
|
74 | + */ |
|
75 | + public function getLabel(): string { |
|
76 | + return $this->label; |
|
77 | + } |
|
78 | + |
|
79 | + /** |
|
80 | + * @param string $label |
|
81 | + * @return $this |
|
82 | + * @throws \InvalidArgumentException if the label is invalid |
|
83 | + * @since 8.2.0 |
|
84 | + */ |
|
85 | + public function setParsedLabel(string $label): IAction { |
|
86 | + if ($label === '') { |
|
87 | + throw new \InvalidArgumentException('The given parsed label is invalid'); |
|
88 | + } |
|
89 | + $this->labelParsed = $label; |
|
90 | + return $this; |
|
91 | + } |
|
92 | + |
|
93 | + /** |
|
94 | + * @return string |
|
95 | + * @since 8.2.0 |
|
96 | + */ |
|
97 | + public function getParsedLabel(): string { |
|
98 | + return $this->labelParsed; |
|
99 | + } |
|
100 | + |
|
101 | + /** |
|
102 | + * @param $primary bool |
|
103 | + * @return $this |
|
104 | + * @since 9.0.0 |
|
105 | + */ |
|
106 | + public function setPrimary(bool $primary): IAction { |
|
107 | + $this->primary = $primary; |
|
108 | + return $this; |
|
109 | + } |
|
110 | + |
|
111 | + /** |
|
112 | + * @return bool |
|
113 | + * @since 9.0.0 |
|
114 | + */ |
|
115 | + public function isPrimary(): bool { |
|
116 | + return $this->primary; |
|
117 | + } |
|
118 | + |
|
119 | + /** |
|
120 | + * @param string $link |
|
121 | + * @param string $requestType |
|
122 | + * @return $this |
|
123 | + * @throws \InvalidArgumentException if the link is invalid |
|
124 | + * @since 8.2.0 |
|
125 | + */ |
|
126 | + public function setLink(string $link, string $requestType): IAction { |
|
127 | + if ($link === '' || isset($link[256])) { |
|
128 | + throw new \InvalidArgumentException('The given link is invalid'); |
|
129 | + } |
|
130 | + if (!in_array($requestType, [ |
|
131 | + self::TYPE_GET, |
|
132 | + self::TYPE_POST, |
|
133 | + self::TYPE_PUT, |
|
134 | + self::TYPE_DELETE, |
|
135 | + self::TYPE_WEB, |
|
136 | + ], true)) { |
|
137 | + throw new \InvalidArgumentException('The given request type is invalid'); |
|
138 | + } |
|
139 | + $this->link = $link; |
|
140 | + $this->requestType = $requestType; |
|
141 | + return $this; |
|
142 | + } |
|
143 | + |
|
144 | + /** |
|
145 | + * @return string |
|
146 | + * @since 8.2.0 |
|
147 | + */ |
|
148 | + public function getLink(): string { |
|
149 | + return $this->link; |
|
150 | + } |
|
151 | + |
|
152 | + /** |
|
153 | + * @return string |
|
154 | + * @since 8.2.0 |
|
155 | + */ |
|
156 | + public function getRequestType(): string { |
|
157 | + return $this->requestType; |
|
158 | + } |
|
159 | + |
|
160 | + /** |
|
161 | + * @return bool |
|
162 | + */ |
|
163 | + public function isValid(): bool { |
|
164 | + return $this->label !== '' && $this->link !== ''; |
|
165 | + } |
|
166 | + |
|
167 | + /** |
|
168 | + * @return bool |
|
169 | + */ |
|
170 | + public function isValidParsed(): bool { |
|
171 | + return $this->labelParsed !== '' && $this->link !== ''; |
|
172 | + } |
|
173 | 173 | } |
@@ -30,23 +30,23 @@ |
||
30 | 30 | * @since 9.0.0 |
31 | 31 | */ |
32 | 32 | interface IApp { |
33 | - /** |
|
34 | - * @param INotification $notification |
|
35 | - * @throws \InvalidArgumentException When the notification is not valid |
|
36 | - * @since 9.0.0 |
|
37 | - */ |
|
38 | - public function notify(INotification $notification): void; |
|
33 | + /** |
|
34 | + * @param INotification $notification |
|
35 | + * @throws \InvalidArgumentException When the notification is not valid |
|
36 | + * @since 9.0.0 |
|
37 | + */ |
|
38 | + public function notify(INotification $notification): void; |
|
39 | 39 | |
40 | - /** |
|
41 | - * @param INotification $notification |
|
42 | - * @since 9.0.0 |
|
43 | - */ |
|
44 | - public function markProcessed(INotification $notification): void; |
|
40 | + /** |
|
41 | + * @param INotification $notification |
|
42 | + * @since 9.0.0 |
|
43 | + */ |
|
44 | + public function markProcessed(INotification $notification): void; |
|
45 | 45 | |
46 | - /** |
|
47 | - * @param INotification $notification |
|
48 | - * @return int |
|
49 | - * @since 9.0.0 |
|
50 | - */ |
|
51 | - public function getCount(INotification $notification): int; |
|
46 | + /** |
|
47 | + * @param INotification $notification |
|
48 | + * @return int |
|
49 | + * @since 9.0.0 |
|
50 | + */ |
|
51 | + public function getCount(INotification $notification): int; |
|
52 | 52 | } |
@@ -28,11 +28,11 @@ |
||
28 | 28 | */ |
29 | 29 | class AlreadyProcessedException extends \RuntimeException { |
30 | 30 | |
31 | - /** |
|
32 | - * @since 17.0.0 |
|
33 | - */ |
|
34 | - public function __construct() { |
|
35 | - parent::__construct('Notification is processed already'); |
|
36 | - } |
|
31 | + /** |
|
32 | + * @since 17.0.0 |
|
33 | + */ |
|
34 | + public function __construct() { |
|
35 | + parent::__construct('Notification is processed already'); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | } |
@@ -31,29 +31,29 @@ |
||
31 | 31 | */ |
32 | 32 | interface INotifier { |
33 | 33 | |
34 | - /** |
|
35 | - * Identifier of the notifier, only use [a-z0-9_] |
|
36 | - * |
|
37 | - * @return string |
|
38 | - * @since 17.0.0 |
|
39 | - */ |
|
40 | - public function getID(): string; |
|
34 | + /** |
|
35 | + * Identifier of the notifier, only use [a-z0-9_] |
|
36 | + * |
|
37 | + * @return string |
|
38 | + * @since 17.0.0 |
|
39 | + */ |
|
40 | + public function getID(): string; |
|
41 | 41 | |
42 | - /** |
|
43 | - * Human readable name describing the notifier |
|
44 | - * |
|
45 | - * @return string |
|
46 | - * @since 17.0.0 |
|
47 | - */ |
|
48 | - public function getName(): string; |
|
42 | + /** |
|
43 | + * Human readable name describing the notifier |
|
44 | + * |
|
45 | + * @return string |
|
46 | + * @since 17.0.0 |
|
47 | + */ |
|
48 | + public function getName(): string; |
|
49 | 49 | |
50 | - /** |
|
51 | - * @param INotification $notification |
|
52 | - * @param string $languageCode The code of the language that should be used to prepare the notification |
|
53 | - * @return INotification |
|
54 | - * @throws \InvalidArgumentException When the notification was not prepared by a notifier |
|
55 | - * @throws AlreadyProcessedException When the notification is not needed anymore and should be deleted |
|
56 | - * @since 9.0.0 |
|
57 | - */ |
|
58 | - public function prepare(INotification $notification, string $languageCode): INotification; |
|
50 | + /** |
|
51 | + * @param INotification $notification |
|
52 | + * @param string $languageCode The code of the language that should be used to prepare the notification |
|
53 | + * @return INotification |
|
54 | + * @throws \InvalidArgumentException When the notification was not prepared by a notifier |
|
55 | + * @throws AlreadyProcessedException When the notification is not needed anymore and should be deleted |
|
56 | + * @since 9.0.0 |
|
57 | + */ |
|
58 | + public function prepare(INotification $notification, string $languageCode): INotification; |
|
59 | 59 | } |
@@ -31,99 +31,99 @@ |
||
31 | 31 | */ |
32 | 32 | interface IAction { |
33 | 33 | |
34 | - /** |
|
35 | - * @since 17.0.0 |
|
36 | - */ |
|
37 | - public const TYPE_GET = 'GET'; |
|
38 | - /** |
|
39 | - * @since 17.0.0 |
|
40 | - */ |
|
41 | - public const TYPE_POST = 'POST'; |
|
42 | - /** |
|
43 | - * @since 17.0.0 |
|
44 | - */ |
|
45 | - public const TYPE_PUT = 'PUT'; |
|
46 | - /** |
|
47 | - * @since 17.0.0 |
|
48 | - */ |
|
49 | - public const TYPE_DELETE = 'DELETE'; |
|
50 | - /** |
|
51 | - * @since 17.0.0 |
|
52 | - */ |
|
53 | - public const TYPE_WEB = 'WEB'; |
|
34 | + /** |
|
35 | + * @since 17.0.0 |
|
36 | + */ |
|
37 | + public const TYPE_GET = 'GET'; |
|
38 | + /** |
|
39 | + * @since 17.0.0 |
|
40 | + */ |
|
41 | + public const TYPE_POST = 'POST'; |
|
42 | + /** |
|
43 | + * @since 17.0.0 |
|
44 | + */ |
|
45 | + public const TYPE_PUT = 'PUT'; |
|
46 | + /** |
|
47 | + * @since 17.0.0 |
|
48 | + */ |
|
49 | + public const TYPE_DELETE = 'DELETE'; |
|
50 | + /** |
|
51 | + * @since 17.0.0 |
|
52 | + */ |
|
53 | + public const TYPE_WEB = 'WEB'; |
|
54 | 54 | |
55 | - /** |
|
56 | - * @param string $label |
|
57 | - * @return $this |
|
58 | - * @throws \InvalidArgumentException if the label is invalid |
|
59 | - * @since 9.0.0 |
|
60 | - */ |
|
61 | - public function setLabel(string $label): IAction; |
|
55 | + /** |
|
56 | + * @param string $label |
|
57 | + * @return $this |
|
58 | + * @throws \InvalidArgumentException if the label is invalid |
|
59 | + * @since 9.0.0 |
|
60 | + */ |
|
61 | + public function setLabel(string $label): IAction; |
|
62 | 62 | |
63 | - /** |
|
64 | - * @return string |
|
65 | - * @since 9.0.0 |
|
66 | - */ |
|
67 | - public function getLabel(): string; |
|
63 | + /** |
|
64 | + * @return string |
|
65 | + * @since 9.0.0 |
|
66 | + */ |
|
67 | + public function getLabel(): string; |
|
68 | 68 | |
69 | - /** |
|
70 | - * @param string $label |
|
71 | - * @return $this |
|
72 | - * @throws \InvalidArgumentException if the label is invalid |
|
73 | - * @since 9.0.0 |
|
74 | - */ |
|
75 | - public function setParsedLabel(string $label): IAction; |
|
69 | + /** |
|
70 | + * @param string $label |
|
71 | + * @return $this |
|
72 | + * @throws \InvalidArgumentException if the label is invalid |
|
73 | + * @since 9.0.0 |
|
74 | + */ |
|
75 | + public function setParsedLabel(string $label): IAction; |
|
76 | 76 | |
77 | - /** |
|
78 | - * @return string |
|
79 | - * @since 9.0.0 |
|
80 | - */ |
|
81 | - public function getParsedLabel(): string; |
|
77 | + /** |
|
78 | + * @return string |
|
79 | + * @since 9.0.0 |
|
80 | + */ |
|
81 | + public function getParsedLabel(): string; |
|
82 | 82 | |
83 | - /** |
|
84 | - * @param bool $primary |
|
85 | - * @return $this |
|
86 | - * @throws \InvalidArgumentException if $primary is invalid |
|
87 | - * @since 9.0.0 |
|
88 | - */ |
|
89 | - public function setPrimary(bool $primary): IAction; |
|
83 | + /** |
|
84 | + * @param bool $primary |
|
85 | + * @return $this |
|
86 | + * @throws \InvalidArgumentException if $primary is invalid |
|
87 | + * @since 9.0.0 |
|
88 | + */ |
|
89 | + public function setPrimary(bool $primary): IAction; |
|
90 | 90 | |
91 | - /** |
|
92 | - * @return bool |
|
93 | - * @since 9.0.0 |
|
94 | - */ |
|
95 | - public function isPrimary(): bool; |
|
91 | + /** |
|
92 | + * @return bool |
|
93 | + * @since 9.0.0 |
|
94 | + */ |
|
95 | + public function isPrimary(): bool; |
|
96 | 96 | |
97 | - /** |
|
98 | - * @param string $link |
|
99 | - * @param string $requestType |
|
100 | - * @return $this |
|
101 | - * @throws \InvalidArgumentException if the link is invalid |
|
102 | - * @since 9.0.0 |
|
103 | - */ |
|
104 | - public function setLink(string $link, string $requestType): IAction; |
|
97 | + /** |
|
98 | + * @param string $link |
|
99 | + * @param string $requestType |
|
100 | + * @return $this |
|
101 | + * @throws \InvalidArgumentException if the link is invalid |
|
102 | + * @since 9.0.0 |
|
103 | + */ |
|
104 | + public function setLink(string $link, string $requestType): IAction; |
|
105 | 105 | |
106 | - /** |
|
107 | - * @return string |
|
108 | - * @since 9.0.0 |
|
109 | - */ |
|
110 | - public function getLink(): string; |
|
106 | + /** |
|
107 | + * @return string |
|
108 | + * @since 9.0.0 |
|
109 | + */ |
|
110 | + public function getLink(): string; |
|
111 | 111 | |
112 | - /** |
|
113 | - * @return string |
|
114 | - * @since 9.0.0 |
|
115 | - */ |
|
116 | - public function getRequestType(): string; |
|
112 | + /** |
|
113 | + * @return string |
|
114 | + * @since 9.0.0 |
|
115 | + */ |
|
116 | + public function getRequestType(): string; |
|
117 | 117 | |
118 | - /** |
|
119 | - * @return bool |
|
120 | - * @since 9.0.0 |
|
121 | - */ |
|
122 | - public function isValid(): bool; |
|
118 | + /** |
|
119 | + * @return bool |
|
120 | + * @since 9.0.0 |
|
121 | + */ |
|
122 | + public function isValid(): bool; |
|
123 | 123 | |
124 | - /** |
|
125 | - * @return bool |
|
126 | - * @since 9.0.0 |
|
127 | - */ |
|
128 | - public function isValidParsed(): bool; |
|
124 | + /** |
|
125 | + * @return bool |
|
126 | + * @since 9.0.0 |
|
127 | + */ |
|
128 | + public function isValidParsed(): bool; |
|
129 | 129 | } |
@@ -34,51 +34,51 @@ |
||
34 | 34 | * @package OCA\LookupServerConnector |
35 | 35 | */ |
36 | 36 | class UpdateLookupServer { |
37 | - /** @var IConfig */ |
|
38 | - private $config; |
|
39 | - /** @var IJobList */ |
|
40 | - private $jobList; |
|
37 | + /** @var IConfig */ |
|
38 | + private $config; |
|
39 | + /** @var IJobList */ |
|
40 | + private $jobList; |
|
41 | 41 | |
42 | - /** |
|
43 | - * @param IJobList $jobList |
|
44 | - * @param IConfig $config |
|
45 | - */ |
|
46 | - public function __construct(IJobList $jobList, |
|
47 | - IConfig $config) { |
|
48 | - $this->config = $config; |
|
49 | - $this->jobList = $jobList; |
|
50 | - } |
|
42 | + /** |
|
43 | + * @param IJobList $jobList |
|
44 | + * @param IConfig $config |
|
45 | + */ |
|
46 | + public function __construct(IJobList $jobList, |
|
47 | + IConfig $config) { |
|
48 | + $this->config = $config; |
|
49 | + $this->jobList = $jobList; |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * @param IUser $user |
|
54 | - */ |
|
55 | - public function userUpdated(IUser $user): void { |
|
56 | - if (!$this->shouldUpdateLookupServer()) { |
|
57 | - return; |
|
58 | - } |
|
52 | + /** |
|
53 | + * @param IUser $user |
|
54 | + */ |
|
55 | + public function userUpdated(IUser $user): void { |
|
56 | + if (!$this->shouldUpdateLookupServer()) { |
|
57 | + return; |
|
58 | + } |
|
59 | 59 | |
60 | - // Reset retry counter |
|
61 | - $this->config->deleteUserValue( |
|
62 | - $user->getUID(), |
|
63 | - 'lookup_server_connector', |
|
64 | - 'update_retries' |
|
65 | - ); |
|
66 | - $this->jobList->add(RetryJob::class, ['userId' => $user->getUID()]); |
|
67 | - } |
|
60 | + // Reset retry counter |
|
61 | + $this->config->deleteUserValue( |
|
62 | + $user->getUID(), |
|
63 | + 'lookup_server_connector', |
|
64 | + 'update_retries' |
|
65 | + ); |
|
66 | + $this->jobList->add(RetryJob::class, ['userId' => $user->getUID()]); |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * check if we should update the lookup server, we only do it if |
|
71 | - * |
|
72 | - * + we have an internet connection |
|
73 | - * + the lookup server update was not disabled by the admin |
|
74 | - * + we have a valid lookup server URL |
|
75 | - * |
|
76 | - * @return bool |
|
77 | - */ |
|
78 | - private function shouldUpdateLookupServer(): bool { |
|
79 | - return $this->config->getSystemValueBool('has_internet_connection', true) === true && |
|
80 | - $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') === 'yes' && |
|
81 | - $this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') !== ''; |
|
82 | - } |
|
69 | + /** |
|
70 | + * check if we should update the lookup server, we only do it if |
|
71 | + * |
|
72 | + * + we have an internet connection |
|
73 | + * + the lookup server update was not disabled by the admin |
|
74 | + * + we have a valid lookup server URL |
|
75 | + * |
|
76 | + * @return bool |
|
77 | + */ |
|
78 | + private function shouldUpdateLookupServer(): bool { |
|
79 | + return $this->config->getSystemValueBool('has_internet_connection', true) === true && |
|
80 | + $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') === 'yes' && |
|
81 | + $this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') !== ''; |
|
82 | + } |
|
83 | 83 | |
84 | 84 | } |
@@ -32,10 +32,10 @@ |
||
32 | 32 | */ |
33 | 33 | class UnsupportedLimitOnInitialSyncException extends InsufficientStorage { |
34 | 34 | |
35 | - /** |
|
36 | - * @inheritDoc |
|
37 | - */ |
|
38 | - public function serialize(Server $server, \DOMElement $errorNode) { |
|
39 | - $errorNode->appendChild($errorNode->ownerDocument->createElementNS('DAV:', 'd:number-of-matches-within-limits')); |
|
40 | - } |
|
35 | + /** |
|
36 | + * @inheritDoc |
|
37 | + */ |
|
38 | + public function serialize(Server $server, \DOMElement $errorNode) { |
|
39 | + $errorNode->appendChild($errorNode->ownerDocument->createElementNS('DAV:', 'd:number-of-matches-within-limits')); |
|
40 | + } |
|
41 | 41 | } |
@@ -42,45 +42,45 @@ |
||
42 | 42 | * @deprecated 17.0.0 |
43 | 43 | */ |
44 | 44 | class StrictContentSecurityPolicy extends EmptyContentSecurityPolicy { |
45 | - /** @var bool Whether inline JS snippets are allowed */ |
|
46 | - protected $inlineScriptAllowed = false; |
|
47 | - /** @var bool Whether eval in JS scripts is allowed */ |
|
48 | - protected $evalScriptAllowed = false; |
|
49 | - /** @var array Domains from which scripts can get loaded */ |
|
50 | - protected $allowedScriptDomains = [ |
|
51 | - '\'self\'', |
|
52 | - ]; |
|
53 | - /** @var bool Whether inline CSS is allowed */ |
|
54 | - protected $inlineStyleAllowed = false; |
|
55 | - /** @var array Domains from which CSS can get loaded */ |
|
56 | - protected $allowedStyleDomains = [ |
|
57 | - '\'self\'', |
|
58 | - ]; |
|
59 | - /** @var array Domains from which images can get loaded */ |
|
60 | - protected $allowedImageDomains = [ |
|
61 | - '\'self\'', |
|
62 | - 'data:', |
|
63 | - 'blob:', |
|
64 | - ]; |
|
65 | - /** @var array Domains to which connections can be done */ |
|
66 | - protected $allowedConnectDomains = [ |
|
67 | - '\'self\'', |
|
68 | - ]; |
|
69 | - /** @var array Domains from which media elements can be loaded */ |
|
70 | - protected $allowedMediaDomains = [ |
|
71 | - '\'self\'', |
|
72 | - ]; |
|
73 | - /** @var array Domains from which object elements can be loaded */ |
|
74 | - protected $allowedObjectDomains = []; |
|
75 | - /** @var array Domains from which iframes can be loaded */ |
|
76 | - protected $allowedFrameDomains = []; |
|
77 | - /** @var array Domains from which fonts can be loaded */ |
|
78 | - protected $allowedFontDomains = [ |
|
79 | - '\'self\'', |
|
80 | - ]; |
|
81 | - /** @var array Domains from which web-workers and nested browsing content can load elements */ |
|
82 | - protected $allowedChildSrcDomains = []; |
|
45 | + /** @var bool Whether inline JS snippets are allowed */ |
|
46 | + protected $inlineScriptAllowed = false; |
|
47 | + /** @var bool Whether eval in JS scripts is allowed */ |
|
48 | + protected $evalScriptAllowed = false; |
|
49 | + /** @var array Domains from which scripts can get loaded */ |
|
50 | + protected $allowedScriptDomains = [ |
|
51 | + '\'self\'', |
|
52 | + ]; |
|
53 | + /** @var bool Whether inline CSS is allowed */ |
|
54 | + protected $inlineStyleAllowed = false; |
|
55 | + /** @var array Domains from which CSS can get loaded */ |
|
56 | + protected $allowedStyleDomains = [ |
|
57 | + '\'self\'', |
|
58 | + ]; |
|
59 | + /** @var array Domains from which images can get loaded */ |
|
60 | + protected $allowedImageDomains = [ |
|
61 | + '\'self\'', |
|
62 | + 'data:', |
|
63 | + 'blob:', |
|
64 | + ]; |
|
65 | + /** @var array Domains to which connections can be done */ |
|
66 | + protected $allowedConnectDomains = [ |
|
67 | + '\'self\'', |
|
68 | + ]; |
|
69 | + /** @var array Domains from which media elements can be loaded */ |
|
70 | + protected $allowedMediaDomains = [ |
|
71 | + '\'self\'', |
|
72 | + ]; |
|
73 | + /** @var array Domains from which object elements can be loaded */ |
|
74 | + protected $allowedObjectDomains = []; |
|
75 | + /** @var array Domains from which iframes can be loaded */ |
|
76 | + protected $allowedFrameDomains = []; |
|
77 | + /** @var array Domains from which fonts can be loaded */ |
|
78 | + protected $allowedFontDomains = [ |
|
79 | + '\'self\'', |
|
80 | + ]; |
|
81 | + /** @var array Domains from which web-workers and nested browsing content can load elements */ |
|
82 | + protected $allowedChildSrcDomains = []; |
|
83 | 83 | |
84 | - /** @var array Domains which can embed this Nextcloud instance */ |
|
85 | - protected $allowedFrameAncestors = []; |
|
84 | + /** @var array Domains which can embed this Nextcloud instance */ |
|
85 | + protected $allowedFrameAncestors = []; |
|
86 | 86 | } |
@@ -31,50 +31,50 @@ |
||
31 | 31 | */ |
32 | 32 | interface IRoom { |
33 | 33 | |
34 | - /** |
|
35 | - * Get a unique ID for the room |
|
36 | - * |
|
37 | - * This id has to be unique within the backend |
|
38 | - * |
|
39 | - * @return string |
|
40 | - * @since 14.0.0 |
|
41 | - */ |
|
42 | - public function getId():string; |
|
34 | + /** |
|
35 | + * Get a unique ID for the room |
|
36 | + * |
|
37 | + * This id has to be unique within the backend |
|
38 | + * |
|
39 | + * @return string |
|
40 | + * @since 14.0.0 |
|
41 | + */ |
|
42 | + public function getId():string; |
|
43 | 43 | |
44 | - /** |
|
45 | - * Get the display name for the room |
|
46 | - * |
|
47 | - * @return string |
|
48 | - * @since 14.0.0 |
|
49 | - */ |
|
50 | - public function getDisplayName():string; |
|
44 | + /** |
|
45 | + * Get the display name for the room |
|
46 | + * |
|
47 | + * @return string |
|
48 | + * @since 14.0.0 |
|
49 | + */ |
|
50 | + public function getDisplayName():string; |
|
51 | 51 | |
52 | - /** |
|
53 | - * Get a list of groupIds that are allowed to access this room |
|
54 | - * |
|
55 | - * If an empty array is returned, no group restrictions are |
|
56 | - * applied. |
|
57 | - * |
|
58 | - * @return string[] |
|
59 | - * @since 14.0.0 |
|
60 | - */ |
|
61 | - public function getGroupRestrictions():array; |
|
52 | + /** |
|
53 | + * Get a list of groupIds that are allowed to access this room |
|
54 | + * |
|
55 | + * If an empty array is returned, no group restrictions are |
|
56 | + * applied. |
|
57 | + * |
|
58 | + * @return string[] |
|
59 | + * @since 14.0.0 |
|
60 | + */ |
|
61 | + public function getGroupRestrictions():array; |
|
62 | 62 | |
63 | - /** |
|
64 | - * Get the email-address for the room |
|
65 | - * |
|
66 | - * The email-address has to be globally unique |
|
67 | - * |
|
68 | - * @return string |
|
69 | - * @since 14.0.0 |
|
70 | - */ |
|
71 | - public function getEMail():string; |
|
63 | + /** |
|
64 | + * Get the email-address for the room |
|
65 | + * |
|
66 | + * The email-address has to be globally unique |
|
67 | + * |
|
68 | + * @return string |
|
69 | + * @since 14.0.0 |
|
70 | + */ |
|
71 | + public function getEMail():string; |
|
72 | 72 | |
73 | - /** |
|
74 | - * Get corresponding backend object |
|
75 | - * |
|
76 | - * @return IBackend |
|
77 | - * @since 14.0.0 |
|
78 | - */ |
|
79 | - public function getBackend():IBackend; |
|
73 | + /** |
|
74 | + * Get corresponding backend object |
|
75 | + * |
|
76 | + * @return IBackend |
|
77 | + * @since 14.0.0 |
|
78 | + */ |
|
79 | + public function getBackend():IBackend; |
|
80 | 80 | } |