示例#1
0
// 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/boinc_db.inc";
require_once "../inc/xml.inc";
xml_header();
$retval = db_init_xml();
if ($retval) {
    xml_error($retval);
}
check_get_args(array("account_key"));
$auth = get_str("account_key");
$user = BoincUser::lookup_auth($auth);
if (!$user) {
    xml_error(ERR_DB_NOT_FOUND);
}
$name = urlencode($user->name);
$country = urlencode($user->country);
$postal_code = urlencode($user->postal_code);
$url = urlencode($user->url);
$weak_auth = weak_auth($user);
$cpid = md5($user->cross_project_id . $user->email_addr);
$ret = "<id>{$user->id}</id>\n<name>{$name}</name>\n<country>{$country}</country>\n<weak_auth>{$weak_auth}</weak_auth>\n<postal_code>{$postal_code}</postal_code>\n<cpid>{$cpid}</cpid>\n<has_profile>{$user->has_profile}</has_profile>\n<create_time>{$user->create_time}</create_time>\n<global_prefs>\n{$user->global_prefs}\n</global_prefs>\n<project_prefs>\n{$user->project_prefs}\n</project_prefs>\n<url>{$url}</url>\n<send_email>{$user->send_email}</send_email>\n<show_hosts>{$user->show_hosts}</show_hosts>\n<teamid>{$user->teamid}</teamid>\n<venue>{$user->venue}</venue>";
if ($user->teamid) {
    $team = BoincTeam::lookup_id_nocache($user->teamid);
    if ($team->userid == $user->id) {
        $ret = $ret . "<teamfounder/>\n";
    }
}
echo "<am_get_info_reply>\n    <success/>\n    {$ret}\n</am_get_info_reply>\n";