static function logout($redirectUri = null)
 {
     $request = \ManiaLib\Application\Request::getInstance();
     $maniaplanet = new \Maniaplanet\WebServices\ManiaConnect\Player();
     $maniaplanet->logout();
     $logoutURL = $maniaplanet->getLogoutURL($redirectUri ?: $request->createLink('/'));
     $request->redirectAbsolute($logoutURL);
 }
/**
 * Maniaplanet Web Services SDK for PHP
 *
 * @copyright   Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
 * @license     http://www.gnu.org/licenses/lgpl.html LGPL License 3
 * @author      $Author: maximeraoust $:
 * @version     $Revision: 10 $:
 * @date        $Date: 2011-09-27 15:21:52 +0200 (mar., 27 sept. 2011) $:
 */
require_once __DIR__ . '/../../../libraries/autoload.php';
define('API_USERNAME', 'api_username');
define('API_PASSWORD', 'api_password');
define('SCOPE', '');
try {
    $trackmania = new \Maniaplanet\WebServices\ManiaConnect\Player(API_USERNAME, API_PASSWORD);
    // URLs to log in and out
    $loginURL = $trackmania->getLoginURL(SCOPE);
    $logoutURL = $trackmania->getLogoutURL();
    if (isset($_POST['logout'])) {
        $trackmania->logout();
        header('Location: ' . $logoutURL);
        exit;
    }
    // Retrive player information. If the user is not logged in, it will return false
    $player = $trackmania->getPlayer();
} catch (\Maniaplanet\WebServices\Exception $e) {
    $player = null;
    // Uncomment to debug...
    //var_dump($e);
}
<?php

require_once __DIR__ . '/../../../libraries/autoload.php';
try {
    $maniaconnect = new \Maniaplanet\WebServices\ManiaConnect\Player('your_api_username', 'your_api_password');
    $loginURL = $maniaconnect->getLoginURL('basic');
    $player = $maniaconnect->getPlayer();
} catch (\Maniaplanet\WebServices\Exception $e) {
    // We ignore errors
}
if ($player) {
    // Player is logged in, do whatever you want
    echo $player->login;
} else {
    // Player is not logged in, link or redirect to $loginURL
    printf('<a href="%s">Login</a>', htmlentities($loginURL));
}
<?php

$apiUsername = '';
$apiPassword = '';
?>

<html>
	<head></head>
	<body>
		<?php 
require_once __DIR__ . '/../../../libraries/autoload.php';
try {
    $maniaconnect = new \Maniaplanet\WebServices\ManiaConnect\Player($apiUsername, $apiPassword);
    $loginURL = $maniaconnect->getLoginURL('dedicated');
    $maniaconnect->getPlayer();
    $servers = $maniaconnect->getDedicated();
    if ($servers) {
        echo '<form method="post" action="">' . '<label for="login">Choose on your server login</label>' . '<select name="serverLogin">';
        foreach ($servers as $server) {
            $isSelected = isset($_POST['serverLogin']) && $server->login == $_POST['serverLogin'];
            echo '<option value="' . $server->login . '" ' . ($isSelected ? 'selected="selected"' : '') . '>' . $server->serverName . '</option>';
        }
        echo '</select>' . '<input type="submit" value="send"/>' . '</form>';
        if (isset($_POST['serverLogin'])) {
            echo '<h2>Reports for: ' . $_POST['serverLogin'] . '</h2>';
            $reports = $maniaconnect->getReportAbuses($_POST['serverLogin']);
            print_r($reports);
        }
    }
} catch (\Maniaplanet\WebServices\Exception $e) {
    print_r($e);