| @@ 33-38 (lines=6) @@ | ||
| 30 | var_dump($accessToken); |
|
| 31 | isTokenFreshByAccessToken($location, $accessToken); |
|
| 32 | ||
| 33 | if($_POST['vote'] == "up") { |
|
| 34 | $accountCreator = new Upvote(); |
|
| 35 | } |
|
| 36 | else if($_POST['vote'] == "down") { |
|
| 37 | $accountCreator = new Downvote(); |
|
| 38 | } |
|
| 39 | ||
| 40 | $accountCreator->setAccessToken($accessToken); |
|
| 41 | $accountCreator->postId = $_POST['postId']; |
|
| @@ 110-115 (lines=6) @@ | ||
| 107 | ||
| 108 | //Vote |
|
| 109 | if(isset($_GET['vote']) && isset($_GET['postID'])) { |
|
| 110 | if($_GET['vote'] == "up") { |
|
| 111 | $accountCreator = new Upvote(); |
|
| 112 | } |
|
| 113 | else if($_GET['vote'] == "down") { |
|
| 114 | $accountCreator = new Downvote(); |
|
| 115 | } |
|
| 116 | $accountCreator->setAccessToken($accessToken); |
|
| 117 | $accountCreator->postId = $_GET['postID']; |
|
| 118 | $data = $accountCreator->execute(); |
|