Source for file AuthenticationToken.class.php
Documentation is available at AuthenticationToken.class.php
* @copyright 2009-2010 NADEO
* Manialink Authentication
* Helps using the Manialink Authentication System developped by NADEO.
* Note that it only works with United Forever accounts.
* @subpackage Authentication
const scriptUrl =
'http://scripts.trackmaniaforever.com/checkAuthenticationToken.php?login=%s&token=%s';
* Check if the login and the token are correct for the
* @param string $playerlogin
* @throws AuthenticationTokenNoLoginException
* @throws AuthenticationTokenInvalidTokenException
* @throws AuthenticationTokenInvalidLoginException
* @throws AuthenticationNationsTokenUnknownPlayerException
* @throws AuthenticationTokenBadTokenException
* @throws AuthenticationTokenFailedException
throw
new AuthenticationTokenNoLoginException();
throw
new AuthenticationTokenInvalidTokenException();
$scriptUrl =
sprintf(self::scriptUrl,$playerlogin,$token);
$error =
strstr('<errors>',$response);
case 7: throw
new AuthenticationTokenInvalidLoginException();
case 14: throw
new AuthenticationNationsTokenUnknownPlayerException();
case 166: throw
new AuthenticationTokenInvalidTokenException();
case 167: throw
new AuthenticationTokenBadTokenException();
default: throw
new AuthenticationTokenFailedException();
* @subpackage Authentication
class AuthenticationTokenFailedException extends Exception {}
* @subpackage Authentication
class AuthenticationTokenInvalidLoginException extends AuthenticationTokenFailedException {}
* @subpackage Authentication
class AuthenticationTokenNoLoginException extends AuthenticationTokenFailedException {}
* @subpackage Authentication
class AuthenticationTokenBadTokenException extends AuthenticationTokenFailedException {}
* @subpackage Authentication
class AuthenticationTokenInvalidTokenException extends AuthenticationTokenFailedException {}
* @subpackage Authentication
class AuthenticationNationsTokenUnknownPlayerException extends AuthenticationTokenFailedException {}