summaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-09-09 17:35:13 +0200
committerGitHub <noreply@github.com>2020-09-09 17:35:13 +0200
commit22ff60e088379335734bc28f2d1af6e920e204e6 (patch)
tree1e3710747a216950d8ec41ba020f465a694d886a /core/Controller
parent49415eea2c75a769a558667abc2ca7461cf8c8b0 (diff)
parentc2bef528efe34c50425fe4415e826929b1f78530 (diff)
downloadnextcloud-server-22ff60e088379335734bc28f2d1af6e920e204e6.tar.gz
nextcloud-server-22ff60e088379335734bc28f2d1af6e920e204e6.zip
Merge pull request #22564 from nextcloud/bugfix/noid/show-avatars-again
The privacy setting is only about syncing to other servers
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/AvatarController.php22
1 files changed, 1 insertions, 21 deletions
diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php
index dc6febc467f..c94d98da13e 100644
--- a/core/Controller/AvatarController.php
+++ b/core/Controller/AvatarController.php
@@ -31,7 +31,6 @@
namespace OC\Core\Controller;
use OC\AppFramework\Utility\TimeFactory;
-use OCP\Accounts\IAccountManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataDisplayResponse;
@@ -80,8 +79,6 @@ class AvatarController extends Controller {
/** @var TimeFactory */
protected $timeFactory;
- /** @var IAccountManager */
- private $accountManager;
public function __construct($appName,
IRequest $request,
@@ -92,8 +89,7 @@ class AvatarController extends Controller {
IRootFolder $rootFolder,
ILogger $logger,
$userId,
- TimeFactory $timeFactory,
- IAccountManager $accountManager) {
+ TimeFactory $timeFactory) {
parent::__construct($appName, $request);
$this->avatarManager = $avatarManager;
@@ -104,7 +100,6 @@ class AvatarController extends Controller {
$this->logger = $logger;
$this->userId = $userId;
$this->timeFactory = $timeFactory;
- $this->accountManager = $accountManager;
}
@@ -126,21 +121,6 @@ class AvatarController extends Controller {
$size = 64;
}
- $user = $this->userManager->get($userId);
- if ($user === null) {
- return new JSONResponse([], Http::STATUS_NOT_FOUND);
- }
-
- $account = $this->accountManager->getAccount($user);
- $scope = $account->getProperty(IAccountManager::PROPERTY_AVATAR)->getScope();
-
- if ($scope !== IAccountManager::VISIBILITY_PUBLIC && $this->userId === null) {
- // Public avatar access is not allowed
- $response = new JSONResponse([], Http::STATUS_NOT_FOUND);
- $response->cacheFor(1800);
- return $response;
- }
-
try {
$avatar = $this->avatarManager->getAvatar($userId);
$avatarFile = $avatar->getFile($size);