2003-07-11 22:33:59 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// 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/>.
|
2009-12-25 04:23:48 +00:00
|
|
|
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/profile.inc");
|
2003-07-11 22:33:59 +00:00
|
|
|
|
2011-02-09 19:10:10 +00:00
|
|
|
check_get_args(array("userid"));
|
|
|
|
|
2005-02-19 08:06:53 +00:00
|
|
|
$userid = get_int('userid');
|
2008-01-01 22:29:10 +00:00
|
|
|
$user = BoincUser::lookup_id($userid);
|
|
|
|
if (!$user) {
|
2008-12-29 18:44:11 +00:00
|
|
|
error_page(tra("No such user"));
|
2008-01-01 22:29:10 +00:00
|
|
|
}
|
2008-10-28 21:59:25 +00:00
|
|
|
if (!$user->has_profile) {
|
2008-12-29 18:44:11 +00:00
|
|
|
error_page(tra("This user has no profile"));
|
2008-10-28 21:59:25 +00:00
|
|
|
}
|
2008-01-01 22:29:10 +00:00
|
|
|
|
|
|
|
$logged_in_user = get_logged_in_user(false);
|
2008-12-19 18:14:02 +00:00
|
|
|
check_whether_to_show_profile($user, $logged_in_user);
|
|
|
|
|
2008-12-29 18:44:11 +00:00
|
|
|
$cache_args = "userid=$userid";
|
2009-12-25 04:23:48 +00:00
|
|
|
$cacheddata = get_cached_data(USER_PROFILE_TTL, $cache_args);
|
2008-12-29 18:44:11 +00:00
|
|
|
if ($cacheddata){
|
|
|
|
// Already got a cached version of the information
|
|
|
|
$community_links_object = unserialize($cacheddata);
|
|
|
|
} else {
|
|
|
|
// Need to generate a new bunch of data
|
|
|
|
$community_links_object = get_community_links_object($user);
|
2011-03-12 15:36:58 +00:00
|
|
|
set_cached_data(USER_PROFILE_TTL, serialize($community_links_object), $cache_args);
|
2008-01-01 22:29:10 +00:00
|
|
|
}
|
2009-12-25 04:23:48 +00:00
|
|
|
|
2010-02-16 01:06:03 +00:00
|
|
|
page_head(tra("Profile: %1", $user->name));
|
2008-12-29 18:44:11 +00:00
|
|
|
|
2008-01-01 22:29:10 +00:00
|
|
|
start_table();
|
2008-12-29 18:44:11 +00:00
|
|
|
echo "<tr><td valign=\"top\">";
|
2009-12-25 04:23:48 +00:00
|
|
|
start_table();
|
|
|
|
show_profile($user, $logged_in_user);
|
|
|
|
end_table();
|
2008-12-29 18:44:11 +00:00
|
|
|
echo "</td><td valign=\"top\">";
|
2009-12-25 04:23:48 +00:00
|
|
|
start_table();
|
|
|
|
row2(tra("Account data"),
|
|
|
|
"<a href=\"show_user.php?userid=".$userid."\">".tra("View")."</a>"
|
|
|
|
);
|
2008-12-29 18:44:11 +00:00
|
|
|
|
2009-12-25 04:23:48 +00:00
|
|
|
community_links($community_links_object, $logged_in_user);
|
|
|
|
end_table();
|
2008-12-29 18:44:11 +00:00
|
|
|
echo "</td></tr>";
|
2008-01-01 22:29:10 +00:00
|
|
|
end_table();
|
2003-07-11 22:33:59 +00:00
|
|
|
|
2008-01-01 22:29:10 +00:00
|
|
|
page_tail();
|
2003-07-15 22:29:39 +00:00
|
|
|
?>
|