mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-12-25 13:08:58 +00:00
Moved the can_posts_text value
This commit is contained in:
parent
debbdbc7ca
commit
814d840e38
@ -155,7 +155,6 @@ class friendsController{
|
||||
"sent_request" => false,
|
||||
"received_request" => false,
|
||||
"following" => false,
|
||||
"can_post_texts" => false,
|
||||
);
|
||||
|
||||
//Check if the two personns are friend
|
||||
@ -180,10 +179,6 @@ class friendsController{
|
||||
if(CS::get()->components->friends->is_following(userID, $friendID))
|
||||
$response['following'] = true;
|
||||
|
||||
//Check if the user can post text on his friend page
|
||||
if(CS::get()->components->friends->can_post_text(userID, $friendID))
|
||||
$response['can_post_texts'] = true;
|
||||
|
||||
}
|
||||
|
||||
//Return the response
|
||||
|
@ -139,9 +139,19 @@ class userController
|
||||
//User friends won't be displayed
|
||||
$userInfos["number_friends"] = 0;
|
||||
|
||||
//User can not post text on this page by default
|
||||
$userInfos["can_post_texts"] = FALSE;
|
||||
|
||||
//Get some informations only is user is signed in
|
||||
if(user_signed_in()){
|
||||
$userInfos["user_like_page"] = CS::get()->components->likes->is_liking(userID, $userID, Likes::LIKE_USER);
|
||||
|
||||
//Check if the user can post texts on this page
|
||||
$userInfos["can_post_texts"] =
|
||||
//If it is his page, yes by default
|
||||
userID == $userID ? TRUE :
|
||||
//Else check friendship status
|
||||
CS::get()->components->friends->can_post_text(userID, $userID);
|
||||
}
|
||||
|
||||
//Return user informations
|
||||
|
Loading…
Reference in New Issue
Block a user