2002-08-07 18:56:55 +00:00
|
|
|
<?php
|
2004-07-15 18:54:17 +00:00
|
|
|
require_once("../inc/cache.inc");
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/util.inc");
|
2005-06-15 04:53:08 +00:00
|
|
|
require_once("../inc/xml.inc");
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2005-06-15 04:53:08 +00:00
|
|
|
$id = get_int("userid", true);
|
2005-02-13 06:13:33 +00:00
|
|
|
$format = get_str("format", true);
|
2005-06-15 04:53:08 +00:00
|
|
|
$auth = get_str("auth", true);
|
2004-07-15 18:54:17 +00:00
|
|
|
|
|
|
|
require_once("../inc/db.inc");
|
|
|
|
require_once("../inc/user.inc");
|
2004-09-20 21:58:47 +00:00
|
|
|
require_once("../inc/forum.inc");
|
2004-07-15 18:54:17 +00:00
|
|
|
db_init();
|
2002-12-06 21:37:30 +00:00
|
|
|
|
2005-06-15 04:53:08 +00:00
|
|
|
$show_hosts = false;
|
|
|
|
if ($id) {
|
|
|
|
$user = lookup_user_id($id);
|
|
|
|
} else if (strlen($auth)) {
|
|
|
|
$user = lookup_user_auth($auth);
|
|
|
|
$show_hosts = true;
|
|
|
|
}
|
2005-02-15 22:29:32 +00:00
|
|
|
if (!$user) {
|
2005-06-15 04:53:08 +00:00
|
|
|
if ($format == "xml") {
|
|
|
|
xml_error("no such user ID");
|
|
|
|
} else {
|
|
|
|
error_page("no such user");
|
|
|
|
}
|
2005-02-15 22:29:32 +00:00
|
|
|
}
|
|
|
|
|
2005-06-15 04:53:08 +00:00
|
|
|
if ($id) {
|
|
|
|
$cache_args = "userid=$id";
|
|
|
|
if ($format=="xml") {
|
|
|
|
$cache_args .= "&format=xml";
|
|
|
|
}
|
|
|
|
start_cache(USER_PAGE_TTL, $cache_args);
|
2005-02-15 22:29:32 +00:00
|
|
|
}
|
2002-12-06 21:37:30 +00:00
|
|
|
|
2004-09-20 21:58:47 +00:00
|
|
|
$user = getForumPreferences($user);
|
|
|
|
|
2004-07-15 18:54:17 +00:00
|
|
|
if ($format == "xml") {
|
2005-06-15 04:53:08 +00:00
|
|
|
show_user_xml($user, $show_hosts);
|
2002-08-07 18:56:55 +00:00
|
|
|
} else {
|
2005-06-15 04:53:08 +00:00
|
|
|
page_head("Account data for $user->name");
|
|
|
|
start_table();
|
|
|
|
show_user_summary_public($user);
|
|
|
|
show_profile_link($user);
|
|
|
|
end_table();
|
|
|
|
project_user_summary($user);
|
|
|
|
page_tail(true);
|
|
|
|
}
|
|
|
|
if ($id) {
|
|
|
|
end_cache(USER_PAGE_TTL,$cache_args);
|
2002-08-07 18:56:55 +00:00
|
|
|
}
|
|
|
|
?>
|