Skip to content

Commit

Permalink
fixed cron with linkedin tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Apr 8, 2014
1 parent 227a96b commit 1e38c98
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 20 deletions.
5 changes: 3 additions & 2 deletions src/cron/poller/cronManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,14 +534,15 @@ function getDiscussionObjects(){
}

for($h=0; $h < count($accts); $h++){
print_r($accts); ?><br/><?php
$user = linkedInFetch('GET', '/v1/people/~/group-memberships', $accts[$h]['accessToken']);
#print_r($token);
print_r($user);
$user = objectToArray($user);

$groupArr = array();
$counter = 0;
for($z = 0; $z < count($user['values']); $z++){
$groupPost = linkedInFetch('GET', '/v1/groups/'.$user['values'][$z]['group']['id'].'/posts:(creator:(first-name,last-name,picture-url,id,headline),title,summary,creation-timestamp,id,likes,comments,attachment:(image-url,content-domain,content-url,title,summary))', $obj['accessToken']);
$groupPost = linkedInFetch('GET', '/v1/groups/'.$user['values'][$z]['group']['id'].'/posts:(creator:(first-name,last-name,picture-url,id,headline),title,summary,creation-timestamp,id,likes,comments,attachment:(image-url,content-domain,content-url,title,summary))', $accts[$h]['accessToken']);
$thing = objectToArray($groupPost);

for($t = 0; $t < count($thing['values']); $t++){
Expand Down
7 changes: 3 additions & 4 deletions src/oAuth/facebookAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,13 @@
$temp['name'] = $user->name;
$temp['authenticated'] = "true";
if(!isset($temp['loginDisallow'])){
$temp['loginDisallow'] = "false";
$temp['loginDisallow'] = $tempApp['accounts'][$open]['loginDisallow'];
}
if(!isset($temp['color'])){
//$temp['color'] = "#0066FF";
$temp['color'] = $tempApp['color'];
$temp['color'] = $tempApp['accounts'][$open]['color'];
}
if(!isset($temp['uuid'])){
$temp['uuid'] = uniqid();
$temp['uuid'] = $tempApp['accounts'][$open]['uuid'];
}

if($found == "false"){
Expand Down
7 changes: 3 additions & 4 deletions src/oAuth/instaAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,13 @@
$temp['name'] = $obj['user']['username'];
$temp['authenticated'] = "true";
if(!isset($temp['loginDisallow'])){
$temp['loginDisallow'] = "false";
$temp['loginDisallow'] = $tempApp['accounts'][$open]['loginDisallow'];
}
if(!isset($temp['color'])){
//$temp['color'] = "#F66733";
$temp['color'] = $tempApp['color'];
$temp['color'] = $tempApp['accounts'][$open]['color'];
}
if(!isset($temp['uuid'])){
$temp['uuid'] = uniqid();
$temp['uuid'] = $tempApp['accounts'][$open]['uuid'];
}

if($found == "false"){
Expand Down
7 changes: 3 additions & 4 deletions src/oAuth/linkedinAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,13 @@ function getAccessToken() {
$temp['name'] = $user->firstName . " " . $user->lastName;
$temp['authenticated'] = "true";
if(!isset($temp['loginDisallow'])){
$temp['loginDisallow'] = "false";
$temp['loginDisallow'] = $tempApp['accounts'][$open]['loginDisallow'];
}
if(!isset($temp['color'])){
$temp['color'] = $tempApp['color'];
$temp['color'] = "#B33DA5";
$temp['color'] = $tempApp['accounts'][$open]['color'];
}
if(!isset($temp['uuid'])){
$temp['uuid'] = uniqid();
$temp['uuid'] = $tempApp['accounts'][$open]['uuid'];
}

if($found == "false"){
Expand Down
7 changes: 3 additions & 4 deletions src/oAuth/twitterAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,13 @@
$temp['name'] = $account->screen_name;
$temp['authenticated'] = "true";
if(!isset($temp['loginDisallow'])){
$temp['loginDisallow'] = "false";
$temp['loginDisallow'] = $tempApp['accounts'][$open]['loginDisallow'];
}
if(!isset($temp['color'])){
//$temp['color'] = "#E32252";
$temp['color'] = $tempApp['color'];
$temp['color'] = $tempApp['accounts'][$open]['color'];
}
if(!isset($temp['uuid'])){
$temp['uuid'] = uniqid();
$temp['uuid'] = $tempApp['accounts'][$open]['uuid'];
}

if($found == "false"){
Expand Down
8 changes: 6 additions & 2 deletions src/rest/v1.0/lib/Credentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ public function getAuthCreds(){
"name" => $obj['name'],
"image" => $obj['image'],
"color" => $obj['color'],
'expiresAt' => $obj['expiresAt']
'expiresAt' => $obj['expiresAt'],
"loginDisallow" => $obj['loginDisallow'],
"authenticated" => $obj['authenticated']
);
}else{
$account = array(
Expand All @@ -294,7 +296,9 @@ public function getAuthCreds(){
"name" => $obj['name'],
"image" => $obj['image'],
"color" => $obj['color'],
'expiresAt' => $obj['expiresAt']
'expiresAt' => $obj['expiresAt'],
"loginDisallow" => $obj['loginDisallow'],
"authenticated" => $obj['authenticated']
);
}
array_push($returnArr['linkedin'], $account);
Expand Down
3 changes: 3 additions & 0 deletions src/rest/v1.0/lib/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,12 @@ public function setDisableLogin(){
for($x = 0; $x < count($credObj[$loginObj['param']][0]['accounts']); $x++){
if(isset($credObj[$loginObj['param']][0]['accounts'][$x]['user'])){
if($credObj[$loginObj['param']][0]['accounts'][$x]['user'] == $loginObj['user']){
print "here";
if($credObj[$loginObj['param']][0]['accounts'][$x]['loginDisallow'] == "true"){
print "false";
$credObj[$loginObj['param']][0]['accounts'][$x]['loginDisallow'] = "false";
}else{
print "login";
$credObj[$loginObj['param']][0]['accounts'][$x]['loginDisallow'] = "true";
}
break;
Expand Down

0 comments on commit 1e38c98

Please sign in to comment.