I`m creating a simple social network site, I need to implement a sophisticated friend request system, one which works like facebook, this will work as follows: If James wants John to be his friend, he will click John's name. John will be notified that James has asked to be his friend( notification will appear on John's profile page) John will then need to agree for James to be his friend. Once agreed, they will both be friends.
And I would also like to restrict access to the user's profile to people who that users friends, in orther words, if the logged in user is trying to view a profile of someone who is not their friend, they should not be able to.
Anyone who have idea on how i can solve this i will really appreciate.