<?php
if (!$C->LOGIN_WITH_LINKEDIN) {
	$this->redirect($C->SITE_URL);	
} else {	
	require_once("linkedin/linkedin.php");
	require_once("linkedin/OAuth.php");
	
	$callback = $C->SITE_URL.'oauthlinkedinData';
	$linkedIn = new LinkedIn($C->IN_APIKEY, $C->IN_SECRETKEY, $callback);
	$linkedIn->getRequestToken();
	$_SESSION['requestToken'] = serialize($linkedIn->request_token);

	$linkedInUrl = $linkedIn->generateAuthorizeUrl();

	$this->redirect($linkedInUrl);
}
?>