diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-08-30 13:58:51 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-09-09 13:37:51 +0200 |
commit | 76d01653309f1535bfe8d364a5aae50e83a348e3 (patch) | |
tree | 1e5b15504a1251b3810a478fc8cbca9dd69477e3 /core/Controller/GuestAvatarController.php | |
parent | f98ae2b5b0567f28a875106724c0475d6395f3c5 (diff) | |
download | nextcloud-server-76d01653309f1535bfe8d364a5aae50e83a348e3.tar.gz nextcloud-server-76d01653309f1535bfe8d364a5aae50e83a348e3.zip |
Dark theme for guest avatar
And better caching policy
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'core/Controller/GuestAvatarController.php')
-rw-r--r-- | core/Controller/GuestAvatarController.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/core/Controller/GuestAvatarController.php b/core/Controller/GuestAvatarController.php index 9c0606f368f..09146ff3928 100644 --- a/core/Controller/GuestAvatarController.php +++ b/core/Controller/GuestAvatarController.php @@ -60,8 +60,9 @@ class GuestAvatarController extends Controller { * @param string $size The desired avatar size, e.g. 64 for 64x64px * @return FileDisplayResponse|Http\Response */ - public function getAvatar(string $guestName, string $size) { + public function getAvatar(string $guestName, string $size, ?bool $dark = false) { $size = (int) $size; + $dark = $dark === null ? false : $dark; if ($size <= 64) { if ($size !== 64) { @@ -94,7 +95,15 @@ class GuestAvatarController extends Controller { } // Cache for 30 minutes - $resp->cacheFor(1800); + $resp->cacheFor(1800, false, true); return $resp; } + + /** + * @PublicPage + * @NoCSRFRequired + */ + public function getAvatarDark(string $guestName, string $size) { + return $this->getAvatar($guestName, $size, true); + } } |