Allow public access to the principals/system/public

This commit is contained in:
Thomas Müller 2016-07-19 08:31:41 +02:00 committed by Lukas Reschke
parent aadb56dfcc
commit e783d01da7
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 4 additions and 3 deletions

View File

@ -34,7 +34,8 @@ class PublicAuth implements BackendInterface {
*/ */
public function __construct() { public function __construct() {
$this->publicURLs = [ $this->publicURLs = [
'public-calendars' 'public-calendars',
'principals/system/public'
]; ];
} }
@ -82,7 +83,7 @@ class PublicAuth implements BackendInterface {
/** /**
* @param RequestInterface $request * @param RequestInterface $request
* @return array * @return bool
*/ */
private function isRequestPublic(RequestInterface $request) { private function isRequestPublic(RequestInterface $request) {
$params = $request->getQueryParameters(); $params = $request->getQueryParameters();
@ -93,6 +94,6 @@ class PublicAuth implements BackendInterface {
$matchingUrls = array_filter($this->publicURLs, function ($publicUrl) use ($url) { $matchingUrls = array_filter($this->publicURLs, function ($publicUrl) use ($url) {
return strpos($url, $publicUrl, 0) === 0; return strpos($url, $publicUrl, 0) === 0;
}); });
return $matchingUrls; return !empty($matchingUrls);
} }
} }