/*
nn_remote_demo.php
This file is a stub for a script which will receive visitors from the netnexus
server. The script should load user information from the netnexus server, log
the user into the local server. An account should be created automatically if
possible.
This script will receive 1 input via the GET method. It will be an "authCode"
which can be used to retrieve the user's information from the netnexus server.
The file "nn_remote_lib.php" is required for this script to run correctly.
Fill in the TODO sections.
** Copyright 2004 - Tom Brown **
** Modification of the code contained within this fill is allowed.
** Distribution of this file is not allowed.
*/
include( "nn_remote_lib.php" );
$authCode = $_GET['authCode'];
/* Load this user's information from the netnexus server. */
$userInfo = NN_loadUserFromAuthCode( $authCode );
/* This tests whether or not the user exists on the netnexus server. */
if(! $userInfo['success'] ) {
echo "The netnexus server returned the following error: $userInfo[status]
\n";
exit;
}
/* TODO: Remove this debug information. */
echo "The following information was sent by the NN server:";
echo "
"; print_r($userInfo); echo ""; /* TODO: Check if the user exists in the local system. */ /* TODO: If the user does not exist in the local system, add it to * the system using information provided by the netnexus server. * * To keep netnexus usernames from conflicting with people who may * have signed into your system directly, it is recommended that * netnexus users are automatically named: user@netnexus * * If my netnexus username were 'tbrown', my username on the local * system would be 'tbrown@netnexus'. **/ /* TODO: Forward the now-logged-in user to your main page, or * directly to the game **/ ?>