@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $this->refreshToken(); |
37 | 37 | } |
38 | - $this->accessToken = $this->getAccessToken(); |
|
38 | + $this->accessToken = $this->getAccessToken(); |
|
39 | 39 | |
40 | 40 | /* if($this->isAccountVerified() != 1) |
41 | 41 | { |
@@ -110,11 +110,11 @@ discard block |
||
110 | 110 | function locationEquals($city) |
111 | 111 | { |
112 | 112 | $db = new DatabaseConnect(); |
113 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
113 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
114 | 114 | |
115 | 115 | $location = new Location(); |
116 | 116 | |
117 | - if ($result->num_rows > 0) |
|
117 | + if($result->num_rows > 0) |
|
118 | 118 | { |
119 | 119 | // output data of each row |
120 | 120 | while($row = $result->fetch_assoc()) |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | else |
188 | 188 | { |
189 | - user_log('User with JodelDeviceId:' . $this->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name); |
|
189 | + user_log('User with JodelDeviceId:' . $this->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name); |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
@@ -198,11 +198,11 @@ discard block |
||
198 | 198 | function getLocation() |
199 | 199 | { |
200 | 200 | $db = new DatabaseConnect(); |
201 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
201 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
202 | 202 | |
203 | 203 | $location = new Location(); |
204 | 204 | |
205 | - if ($result->num_rows > 0) |
|
205 | + if($result->num_rows > 0) |
|
206 | 206 | { |
207 | 207 | // output data of each row |
208 | 208 | while($row = $result->fetch_assoc()) |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | if(isset($_POST['color'])) |
334 | 334 | { |
335 | 335 | $color = $_POST['color']; |
336 | - switch ($color) { |
|
336 | + switch($color) { |
|
337 | 337 | case '8ABDB0': |
338 | 338 | $color = '8ABDB0'; |
339 | 339 | break; |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | $db = new DatabaseConnect(); |
408 | 408 | $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
409 | 409 | |
410 | - if ($result->num_rows > 0) |
|
410 | + if($result->num_rows > 0) |
|
411 | 411 | { |
412 | 412 | // output data of each row |
413 | 413 | while($row = $result->fetch_assoc()) |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | expiration_date='" . $expiration_date . "' |
447 | 447 | WHERE device_uid='" . $device_uid . "'"); |
448 | 448 | |
449 | - if($result === false){ |
|
449 | + if($result === false) { |
|
450 | 450 | error_log("Adding account failed: (" . $db->errno . ") " . $db->error); |
451 | 451 | } |
452 | 452 | } |
@@ -456,11 +456,11 @@ discard block |
||
456 | 456 | function getAccessToken() |
457 | 457 | { |
458 | 458 | $db = new DatabaseConnect(); |
459 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
459 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
460 | 460 | |
461 | 461 | $accessToken; |
462 | 462 | |
463 | - if ($result->num_rows > 0) |
|
463 | + if($result->num_rows > 0) |
|
464 | 464 | { |
465 | 465 | // output data of each row |
466 | 466 | while($row = $result->fetch_assoc()) |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
527 | 527 | VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')"); |
528 | 528 | |
529 | - if($result === false){ |
|
529 | + if($result === false) { |
|
530 | 530 | $error = db_error(); |
531 | 531 | echo $error; |
532 | 532 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
@@ -554,11 +554,11 @@ discard block |
||
554 | 554 | $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type, |
555 | 555 | expires_in, expiration_date, distinct_id, device_uid, name, lat, lng) |
556 | 556 | VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type . |
557 | - "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id . |
|
557 | + "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id . |
|
558 | 558 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
559 | 559 | |
560 | 560 | $success = TRUE; |
561 | - if($result === false){ |
|
561 | + if($result === false) { |
|
562 | 562 | $error = $db->error(); |
563 | 563 | echo $error; |
564 | 564 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |
@@ -29,8 +29,8 @@ |
||
29 | 29 | |
30 | 30 | if(!$userIsVoter && !$userIsAdmin) |
31 | 31 | { |
32 | - error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php'); |
|
33 | - $response = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php',"success" => false); |
|
32 | + error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php'); |
|
33 | + $response = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php', "success" => false); |
|
34 | 34 | echo json_encode($response); |
35 | 35 | die(); |
36 | 36 | } |