2002-08-07 18:56:55 +00:00
|
|
|
<?php
|
2006-09-06 20:56:55 +00:00
|
|
|
|
|
|
|
// This page shows basic account details about a given user
|
|
|
|
// The page can be output as either XML or HTML.
|
|
|
|
// If output as xml the user may optionally
|
|
|
|
// also get a list of hosts in case the user provides his/her authenticator.
|
|
|
|
// Object-caching and full-file caching is used to speed up queries
|
|
|
|
// for data from this page.
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2006-08-27 21:03:29 +00:00
|
|
|
$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit
|
2004-07-15 18:54:17 +00:00
|
|
|
|
2006-08-27 21:03:29 +00:00
|
|
|
require_once("../inc/cache.inc");
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/xml.inc");
|
|
|
|
require_once("../inc/db.inc");
|
|
|
|
require_once("../inc/user.inc");
|
|
|
|
require_once("../inc/forum.inc");
|
2006-09-06 20:56:55 +00:00
|
|
|
require_once("../project/project.inc");
|
2006-08-27 21:03:29 +00:00
|
|
|
|
|
|
|
$id = get_int("userid", true);
|
|
|
|
$format = get_str("format", true);
|
|
|
|
$auth = get_str("auth", true);
|
2002-12-06 21:37:30 +00:00
|
|
|
|
2006-08-27 21:03:29 +00:00
|
|
|
if ($format=="xml"){
|
2006-09-06 20:56:55 +00:00
|
|
|
// XML doesn't need translating, so use the full-file cache for this
|
|
|
|
//
|
2006-08-27 21:03:29 +00:00
|
|
|
$cache_args="userid=".$id."&auth=".$auth;
|
|
|
|
start_cache(USER_PAGE_TTL, $cache_args);
|
2006-09-06 20:56:55 +00:00
|
|
|
xml_header();
|
|
|
|
$retval = db_init_xml();
|
|
|
|
if ($retval) xml_error($retval);
|
2006-08-27 21:03:29 +00:00
|
|
|
if ($auth){
|
2006-09-05 19:00:59 +00:00
|
|
|
$user = lookup_user_auth($auth);
|
|
|
|
$show_hosts = true;
|
2006-08-27 21:03:29 +00:00
|
|
|
} else {
|
2005-06-15 04:53:08 +00:00
|
|
|
$user = lookup_user_id($id);
|
2006-09-05 19:00:59 +00:00
|
|
|
$show_hosts = false;
|
2005-02-15 22:29:32 +00:00
|
|
|
}
|
2006-09-06 20:56:55 +00:00
|
|
|
if (!$user) xml_error(-136);
|
2005-02-15 22:29:32 +00:00
|
|
|
|
2006-08-27 21:03:29 +00:00
|
|
|
show_user_xml($user, $show_hosts);
|
2006-09-06 20:56:55 +00:00
|
|
|
end_cache(USER_PAGE_TTL, $cache_args);
|
2006-08-27 21:03:29 +00:00
|
|
|
} else {
|
2006-09-06 20:56:55 +00:00
|
|
|
db_init(); // need to do this in any case,
|
|
|
|
// since show_user_summary_public() etc. accesses DB
|
|
|
|
|
|
|
|
// The webfrontend may be presented in many different languages,
|
|
|
|
// so here we cache the data instead
|
|
|
|
//
|
2006-08-27 21:03:29 +00:00
|
|
|
$cache_args="userid=".$id;
|
|
|
|
$cached_data = get_cached_data(TOP_PAGES_TTL,$cache_args);
|
|
|
|
if ($cached_data){
|
2006-09-05 19:00:59 +00:00
|
|
|
// We found some old but non-stale data, let's use it
|
|
|
|
$user = unserialize($cached_data);
|
2006-08-27 21:03:29 +00:00
|
|
|
} else {
|
2006-09-05 19:00:59 +00:00
|
|
|
// No data was found, generate new data for the cache and store it
|
2006-08-27 21:03:29 +00:00
|
|
|
$user = lookup_user_id($id);
|
2006-09-05 19:00:59 +00:00
|
|
|
$user = getForumPreferences($user);
|
|
|
|
set_cache_data(serialize($user),$cache_args);
|
2005-02-15 22:29:32 +00:00
|
|
|
}
|
2006-09-06 20:56:55 +00:00
|
|
|
if (!$user->id) {
|
|
|
|
error_page("No such user found - please check the ID and try again.");
|
|
|
|
}
|
2002-12-06 21:37:30 +00:00
|
|
|
|
2006-08-27 21:03:29 +00:00
|
|
|
// Output:
|
|
|
|
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);
|
|
|
|
}
|
2004-09-20 21:58:47 +00:00
|
|
|
|
2002-08-07 18:56:55 +00:00
|
|
|
?>
|