Exemple #1
0
		$match = true;
	}catch(Exception $ex){
		$match = false;
	}
	
}

if (isset($_REQUEST['logout']))
{
	unset($_SESSION['token']);
	$client -> revokeToken();
}

if (isset($_REQUEST['error']) && $_REQUEST['error'] == 'access_denied')
{
	processDeniedAndExit('gmail');
	exit();
}

if ($match && $client -> getAccessToken())
{
	$req = new apiHttpRequest("https://www.google.com/m8/feeds/contacts/default/full?alt=json&max-results=1000");
	$val = $client -> getIo() -> authenticatedRequest($req);

	// The contacts api only returns XML responses.
	$data = json_decode($val -> getResponseBody(), true);
	$contacts = array();

	foreach ($data['feed']['entry'] as $entry)
	{
Exemple #2
0
include 'settings.php';

include 'windowslivelogin.php';

// Initialize the WindowsLiveLogin module.
$wll = WindowsLiveLogin::initFromXml($KEYFILE);

$wll -> setDebug($DEBUG);

// Extract the 'action' parameter, if any, from the request.
$action = @$_REQUEST['action'];

// user denied application request
if (isset($_REQUEST['ResponseCode']) && $_REQUEST['ResponseCode'] == 'RequestRejected')
{
	processDeniedAndExit();
}

if ($action == 'delauth')
{
	$consent = $wll -> processConsent($_REQUEST);

	// If a consent token is found, store it in the cookie that is
	// configured in the settings.php file and then redirect to
	// the main page.
	if ($consent)
	{
		setcookie($COOKIE, $consent -> getToken(), $COOKIETTL);
	}
	else
	{