Enable profiles but keep them private? Only Admin can send messages!

Permalink 1 user found helpful
Is there a way to keep profiles private? It's pretty obvious if you seewww.www.yourdomain.com/profile/6/... in the address bar that you can change the number and find a different profile. I would like to make each profile private to all except that particular person and the admin.

The reason is that the profiles will be clients and I don't want the clients to cross-talk, but I *do* want the admin to be able to message each client/profile easily.

 
Flight643 replied on at Permalink Reply
Hey Zoinks!

Not sure if you're still looking for help on this, but I was looking to do the same thing and just decided to hard code a PHP if statement in to the profile's view.php file. There may be a better way to do it, but:

1) If you haven't already, copy: /concrete/single_pages/profile/view.php to /single_pages/profile/view.php

2) At the top of the page, start the if condition:

<?php 
   $u = new User();
   $g = Group::getByName("Administrators"); 
   if($u->getUserID() == $profile->getUserID() || $u->inGroup($g) ) {
// All of the profile page as normal
?>


and then at the bottom of the page close out the if statement and scold them for snooping around :)

<?php } else { echo 'You do not have permission to access this page.'; } ?>


Hope that helps.
merge replied on at Permalink Reply
I have been looking for this for a hours! Thank you! You are a life saver. :)