@@ -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 | |
| 41 | 41 | function isAccountVerified() |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $db = new DatabaseConnect(); |
| 67 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
| 67 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
| 68 | 68 | |
| 69 | 69 | $location = new Location(); |
| 70 | 70 | |
| 71 | - if ($result->num_rows > 0) |
|
| 71 | + if($result->num_rows > 0) |
|
| 72 | 72 | { |
| 73 | 73 | // output data of each row |
| 74 | 74 | while($row = $result->fetch_assoc()) |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | else |
| 142 | 142 | { |
| 143 | - user_log('User with JodelDeviceId:' . $this->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name); |
|
| 143 | + user_log('User with JodelDeviceId:' . $this->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name); |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
@@ -152,11 +152,11 @@ discard block |
||
| 152 | 152 | function getLocation() |
| 153 | 153 | { |
| 154 | 154 | $db = new DatabaseConnect(); |
| 155 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
| 155 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
| 156 | 156 | |
| 157 | 157 | $location = new Location(); |
| 158 | 158 | |
| 159 | - if ($result->num_rows > 0) |
|
| 159 | + if($result->num_rows > 0) |
|
| 160 | 160 | { |
| 161 | 161 | // output data of each row |
| 162 | 162 | while($row = $result->fetch_assoc()) |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | if(isset($_POST['color'])) |
| 273 | 273 | { |
| 274 | 274 | $color = $_POST['color']; |
| 275 | - switch ($color) { |
|
| 275 | + switch($color) { |
|
| 276 | 276 | case '8ABDB0': |
| 277 | 277 | $color = '8ABDB0'; |
| 278 | 278 | break; |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | $db = new DatabaseConnect(); |
| 331 | 331 | $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
| 332 | 332 | |
| 333 | - if ($result->num_rows > 0) |
|
| 333 | + if($result->num_rows > 0) |
|
| 334 | 334 | { |
| 335 | 335 | // output data of each row |
| 336 | 336 | while($row = $result->fetch_assoc()) |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | expiration_date='" . $expiration_date . "' |
| 370 | 370 | WHERE device_uid='" . $device_uid . "'"); |
| 371 | 371 | |
| 372 | - if($result === false){ |
|
| 372 | + if($result === false) { |
|
| 373 | 373 | error_log("Adding account failed: (" . $db->errno . ") " . $db->error); |
| 374 | 374 | } |
| 375 | 375 | } |
@@ -379,11 +379,11 @@ discard block |
||
| 379 | 379 | function getAccessToken() |
| 380 | 380 | { |
| 381 | 381 | $db = new DatabaseConnect(); |
| 382 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
| 382 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
| 383 | 383 | |
| 384 | 384 | $accessToken; |
| 385 | 385 | |
| 386 | - if ($result->num_rows > 0) |
|
| 386 | + if($result->num_rows > 0) |
|
| 387 | 387 | { |
| 388 | 388 | // output data of each row |
| 389 | 389 | while($row = $result->fetch_assoc()) |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
| 450 | 450 | VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')"); |
| 451 | 451 | |
| 452 | - if($result === false){ |
|
| 452 | + if($result === false) { |
|
| 453 | 453 | $error = db_error(); |
| 454 | 454 | echo $error; |
| 455 | 455 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
@@ -477,11 +477,11 @@ discard block |
||
| 477 | 477 | $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type, |
| 478 | 478 | expires_in, expiration_date, distinct_id, device_uid, name, lat, lng) |
| 479 | 479 | VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type . |
| 480 | - "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id . |
|
| 480 | + "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id . |
|
| 481 | 481 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
| 482 | 482 | |
| 483 | 483 | $success = TRUE; |
| 484 | - if($result === false){ |
|
| 484 | + if($result === false) { |
|
| 485 | 485 | $error = $db->error(); |
| 486 | 486 | echo $error; |
| 487 | 487 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |