Skip to content

Commit

Permalink
corrected logout token revoke issue
Browse files Browse the repository at this point in the history
  • Loading branch information
scnakandala committed Apr 21, 2014
1 parent 5c943d3 commit 90a210e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion index_nav.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<?php
if(oauth_session_exists()){
echo '<li><a href="./events.php">' . 'Portal' . '</a></li>';
echo '<li><a href=' . "./login.php?lType=revoke" . ">Logout</a></li>";
echo '<li><a href=' . "./logout.php" . ">Logout</a></li>";
}else{
echo '<li><a href=' . "./login.php?lType=initiate" . ">Connect with LinkedIn</a></li>";
}
Expand Down
7 changes: 7 additions & 0 deletions logout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
require_once './global.inc.php';
session_start();
if (oauth_session_exists()) {
session_destroy();
}
header('Location: ./');
2 changes: 1 addition & 1 deletion nav.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<li class="<?php if($pageName== 'admin') {echo 'active';}?>"><a href="./admin.users.php">Admin</a></li>
<?php
$user = User::currentUser();
echo '<li title="'.$user->name.' as '.$user->getOrganization()->name.'"><a href=' . "./login.php?lType=revoke" . ">Logout</a></li>";
echo '<li title="'.$user->name.' as '.$user->getOrganization()->name.'"><a href=' . "./logout.php" . ">Logout</a></li>";
}else{

echo '<li><a href=' . "./login.php?lType=initiate" . ">Connect with LinkedIn</a></li>";
Expand Down
29 changes: 20 additions & 9 deletions tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@

<?php

$batchTools = new BatchTools();
$batches = $batchTools->getAllBatches();

foreach($batches as $batch) {
echo '<input type="checkbox" name="batch[]" value="' . $batch->name . '">' . $batch->display_name . '<br>';
echo " -- " . "<br>";
}


// $batchTools = new BatchTools();
// $batches = $batchTools->getAllBatches();
//
// foreach($batches as $batch) {
// echo '<input type="checkbox" name="batch[]" value="' . $batch->name . '">' . $batch->display_name . '<br>';
// echo " -- " . "<br>";
// }
require_once('linkedin_3.2.0.class.php');
// display constants
$API_CONFIG = array(
'appKey' => '75d6pivzxrsxbo',
'appSecret' => 'EglOAOQCTzy7pVLI',
'callbackUrl' => NULL
);
$OBJ_linkedin = new LinkedIn($API_CONFIG);
$OBJ_linkedin->setToken(array("oauth_token"=>"d5bc154e-f98b-4372-892b-54ad5efce7e4","oauth_token_secret"=>"e164bdef-1b46-45d2-97e1-488986d3c4e6"));
$OBJ_linkedin->setResponseFormat(LINKEDIN::_RESPONSE_XML);
$response = $OBJ_linkedin->profile('~:(id,first-name,last-name,picture-url,skills,summary,languages,public-profile-url)');

var_dump($response);
?>

0 comments on commit 90a210e

Please sign in to comment.