// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/profile.inc";
check_get_args(array("userid"));
$userid = get_int('userid');
$user = BoincUser::lookup_id($userid);
if (!$user) {
    error_page(tra("No such user"));
}
if (!$user->has_profile) {
    // check whether user.has_profile is out of synch w/ profile table
    //
    $profile = BoincProfile::lookup("userid={$user->id}");
    if ($profile) {
        $user->update("has_profile=1");
        $user->has_profile = 1;
    } else {
        error_page(tra("This user has no profile"));
    }
}
$logged_in_user = get_logged_in_user(false);
check_whether_to_show_profile($user, $logged_in_user);
$cache_args = "userid={$userid}";
$cacheddata = get_cached_data(USER_PROFILE_TTL, $cache_args);
if ($cacheddata) {
    // Already got a cached version of the information
    $community_links_object = unserialize($cacheddata);
} else {