From 558f7dc59f82f8e8d56c2937447b55e6d2c5ffb8 Mon Sep 17 00:00:00 2001 From: Pierre Date: Wed, 20 Dec 2017 18:29:42 +0100 Subject: [PATCH] Implemented new functionality for account image --- classes/components/accountImage.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/classes/components/accountImage.php b/classes/components/accountImage.php index f53f23d..1e7ec5d 100644 --- a/classes/components/accountImage.php +++ b/classes/components/accountImage.php @@ -52,8 +52,8 @@ class accountImage{ //Get account image visibility level $visibilityLevel = $this->visibilityLevel($userID); - //If account image is open - if($visibilityLevel == 3) + //If account image is open or if the user signed in is the user making the request + if($visibilityLevel == 3 || userID == $userID) //Account image is OPEN return $accountImageFile; @@ -67,8 +67,12 @@ class accountImage{ //Else users must be friends if($visibilityLevel == 1){ - //Level not implemented yet - return $this->accountImageURL.$this->errorAccountImage; + //Check the two persons are friend or not + if(CS::get()->components->friends->are_friend($userID, userID)) + //User is allowed to access the image + return $accountImageFile; + else + return $this->accountImageURL.$this->errorAccountImage; } } else