@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | function user_log($msg) |
| 41 | 41 | { |
| 42 | - $log = $msg . PHP_EOL; |
|
| 42 | + $log = $msg . PHP_EOL; |
|
| 43 | 43 | file_put_contents(realpath(__DIR__ . '/..') . '/logs/user_log-' . date("j.n.Y") . '.txt', $log, FILE_APPEND); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches); |
| 49 | 49 | |
| 50 | - return (isset($matches[0])) ? true : false; |
|
| 50 | + return (isset($matches[0]))?true : false; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | function configPropertyExists($config, $property) |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | function isUserAdmin() { |
| 65 | 65 | global $config; |
| 66 | - if (isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword']) |
|
| 66 | + if(isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword']) |
|
| 67 | 67 | { |
| 68 | 68 | return TRUE; |
| 69 | 69 | } |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | function isDeviceUidInDatabase($deviceUid) |
| 77 | 77 | { |
| 78 | 78 | $db = new DatabaseConnect(); |
| 79 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
| 79 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
| 80 | 80 | |
| 81 | - if ($result->num_rows > 0) |
|
| 81 | + if($result->num_rows > 0) |
|
| 82 | 82 | { |
| 83 | 83 | return TRUE; |
| 84 | 84 | } |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | if(!isset($_COOKIE['JodelDeviceId']) || !isDeviceUidInDatabase($_COOKIE['JodelDeviceId'])) |
| 101 | 101 | { |
| 102 | 102 | $jodelAccountForView = new JodelAccount(); |
| 103 | - setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time()+60*60*24*365*10); |
|
| 104 | - user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']'); |
|
| 103 | + setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time() + 60 * 60 * 24 * 365 * 10); |
|
| 104 | + user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']'); |
|
| 105 | 105 | |
| 106 | 106 | } |
| 107 | 107 | else |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | if(isset($_GET['search'])) |
| 131 | 131 | { |
| 132 | 132 | |
| 133 | - user_log('User with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] searched for ' . $_GET['search']); |
|
| 133 | + user_log('User with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] searched for ' . $_GET['search']); |
|
| 134 | 134 | |
| 135 | 135 | if(substr($_GET['search'], 0, 1) === "#") |
| 136 | 136 | { |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | if(isset($_GET['view'])) |
| 187 | 187 | { |
| 188 | - switch ($_GET['view']) { |
|
| 188 | + switch($_GET['view']) { |
|
| 189 | 189 | case 'discussed': |
| 190 | 190 | $view = 'discussed'; |
| 191 | 191 | break; |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <div id="sortJodelBy" class="row"> |
| 2 | 2 | <div class="col-3"> |
| 3 | - <a <?php if($view->view == 'combo')echo 'class="active"';?> href="<?php echo $view->changeView('combo')->back()->toUrl();?>"><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 3 | + <a <?php if($view->view == 'combo')echo 'class="active"'; ?> href="<?php echo $view->changeView('combo')->back()->toUrl(); ?>"><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 4 | 4 | </div> |
| 5 | 5 | <div class="col-3"> |
| 6 | - <a <?php if($view->view == 'discussed') echo 'class="active"';?> href="<?php echo $view->changeView('discussed')->back()->toUrl();?>"><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 6 | + <a <?php if($view->view == 'discussed') echo 'class="active"'; ?> href="<?php echo $view->changeView('discussed')->back()->toUrl(); ?>"><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 7 | 7 | </div> |
| 8 | 8 | <div class="col-3"> |
| 9 | - <a <?php if($view->view == 'popular') echo 'class="active"';?> href="<?php echo $view->changeView('popular')->back()->toUrl();?>"><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 9 | + <a <?php if($view->view == 'popular') echo 'class="active"'; ?> href="<?php echo $view->changeView('popular')->back()->toUrl(); ?>"><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 10 | 10 | </div> |
| 11 | 11 | <div class="col-3"> |
| 12 | 12 | <nav> |
| 13 | - <a href="<?php echo $baseUrl;?>about-us.php">about</a> |
|
| 13 | + <a href="<?php echo $baseUrl; ?>about-us.php">about</a> |
|
| 14 | 14 | </nav> |
| 15 | 15 | </div> |
| 16 | 16 | </div> |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | </article> |
| 92 | 92 | |
| 93 | 93 | <aside class="topSidebar col-sm-4 sidebar-outer"> |
| 94 | - <div class="fixed<?php if(!$view->isDetailedView) echo(' hide-mobile');?>"> |
|
| 94 | + <div class="fixed<?php if(!$view->isDetailedView) echo(' hide-mobile'); ?>"> |
|
| 95 | 95 | <article> |
| 96 | 96 | <div> |
| 97 | 97 | <h2>Position / Hashtag</h2> |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | <?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?> |
| 116 | 116 | <h2>Comment on Jodel</h2> |
| 117 | 117 | <form method="POST"> |
| 118 | - <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" /> |
|
| 118 | + <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']); ?>" /> |
|
| 119 | 119 | <textarea id="message" name="message" placeholder="Send a comment on a Jodel to all students within 10km" required></textarea> |
| 120 | 120 | <br /> |
| 121 | 121 | <input type="submit" value="SEND" /> |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | </div> |
| 158 | 158 | </aside> |
| 159 | 159 | </div> |
| 160 | - <?php include 'templates/nav-bottom.php';?> |
|
| 160 | + <?php include 'templates/nav-bottom.php'; ?> |
|
| 161 | 161 | </div> |
| 162 | 162 | <?php |
| 163 | 163 | $includeEmojiAndAjax = TRUE; |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | crossorigin="anonymous"></script> |
| 6 | 6 | <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script> |
| 7 | 7 | <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script> |
| 8 | - <script src="<?php echo $baseUrl;?>js/jQueryEmoji.js"></script> |
|
| 8 | + <script src="<?php echo $baseUrl; ?>js/jQueryEmoji.js"></script> |
|
| 9 | 9 | |
| 10 | 10 | <script> |
| 11 | 11 | //BackButton |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | window.history.back(); |
| 15 | 15 | } |
| 16 | - <?php if(isset($includeEmojiAndAjax)){ ?> |
|
| 16 | + <?php if(isset($includeEmojiAndAjax)) { ?> |
|
| 17 | 17 | $(document).ready(function() |
| 18 | 18 | { |
| 19 | 19 | //Transform UTF-8 Emoji to img |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | function getMorePosts(lastPostId, view, hashtag, old_lastPostId) |
| 46 | 46 | { |
| 47 | 47 | $.ajax({ |
| 48 | - url: '<?php echo $baseUrl;?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURIComponent(hashtag), |
|
| 48 | + url: '<?php echo $baseUrl; ?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURIComponent(hashtag), |
|
| 49 | 49 | dataType: 'html', |
| 50 | 50 | async: false, |
| 51 | 51 | success: function(html) { |
@@ -49,25 +49,25 @@ discard block |
||
| 49 | 49 | $timediff_inDays = (string)$timediff->format('%d'); |
| 50 | 50 | $timediff_inMonth = (string)$timediff->format('%m'); |
| 51 | 51 | |
| 52 | - if($timediff_inMonth!=0) |
|
| 52 | + if($timediff_inMonth != 0) |
|
| 53 | 53 | { |
| 54 | 54 | $timediff = $timediff_inMonth . "m"; |
| 55 | 55 | } |
| 56 | 56 | else |
| 57 | 57 | { |
| 58 | - if($timediff_inDays!=0) |
|
| 58 | + if($timediff_inDays != 0) |
|
| 59 | 59 | { |
| 60 | 60 | $timediff = $timediff_inDays . "d"; |
| 61 | 61 | } |
| 62 | 62 | else |
| 63 | 63 | { |
| 64 | - if($timediff_inHours!=0) |
|
| 64 | + if($timediff_inHours != 0) |
|
| 65 | 65 | { |
| 66 | 66 | $timediff = $timediff_inHours . "h"; |
| 67 | 67 | } |
| 68 | 68 | else |
| 69 | 69 | { |
| 70 | - if($timediff_inMinutes!=0) |
|
| 70 | + if($timediff_inMinutes != 0) |
|
| 71 | 71 | { |
| 72 | 72 | $timediff = $timediff_inMinutes . "m"; |
| 73 | 73 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | ?> |
| 84 | - <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color'];?>;"> |
|
| 84 | + <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color']; ?>;"> |
|
| 85 | 85 | <content> |
| 86 | 86 | <?php |
| 87 | 87 | if(isset($post['image_url'])) |
@@ -99,24 +99,24 @@ discard block |
||
| 99 | 99 | <?php |
| 100 | 100 | if($this->isDetailedView) |
| 101 | 101 | {?> |
| 102 | - <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow"> |
|
| 102 | + <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id']; ?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']); ?>" rel="nofollow"> |
|
| 103 | 103 | <?php } |
| 104 | 104 | else |
| 105 | 105 | {?> |
| 106 | - <a href="index.php?vote=up&postId=<?php echo $post['post_id'];?>" rel="nofollow"> |
|
| 106 | + <a href="index.php?vote=up&postId=<?php echo $post['post_id']; ?>" rel="nofollow"> |
|
| 107 | 107 | <?php } ?> |
| 108 | 108 | <i class="fa fa-angle-up fa-3x"></i> |
| 109 | 109 | </a> |
| 110 | 110 | <br /> |
| 111 | - <?php echo $post["vote_count"];?><br /> |
|
| 111 | + <?php echo $post["vote_count"]; ?><br /> |
|
| 112 | 112 | <?php |
| 113 | 113 | if($this->isDetailedView) |
| 114 | 114 | {?> |
| 115 | - <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow"> |
|
| 115 | + <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id']; ?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']); ?>" rel="nofollow"> |
|
| 116 | 116 | <?php } |
| 117 | 117 | else |
| 118 | 118 | {?> |
| 119 | - <a href="index.php?vote=down&postId=<?php echo $post['post_id'];?>" rel="nofollow"> |
|
| 119 | + <a href="index.php?vote=down&postId=<?php echo $post['post_id']; ?>" rel="nofollow"> |
|
| 120 | 120 | <?php } ?> |
| 121 | 121 | <i class="fa fa-angle-down fa-3x"></i> |
| 122 | 122 | </a> |
@@ -128,14 +128,14 @@ discard block |
||
| 128 | 128 | <span class="time"> |
| 129 | 129 | <span class="tip" data-tooltip="Time"> |
| 130 | 130 | <i class="fa fa-clock-o"></i> |
| 131 | - <?php echo $timediff;?> |
|
| 132 | - <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span> |
|
| 131 | + <?php echo $timediff; ?> |
|
| 132 | + <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s'); ?></span> |
|
| 133 | 133 | </span> |
| 134 | 134 | </span> |
| 135 | 135 | <?php if(!$this->isDetailedView) {?> |
| 136 | 136 | <span class="comments"> |
| 137 | 137 | <span data-tooltip="Comments"> |
| 138 | - <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>"> |
|
| 138 | + <a href="<?php echo $this->changePostId($post['post_id'])->toUrl(); ?>"> |
|
| 139 | 139 | <i class="fa fa-commenting-o"></i> |
| 140 | 140 | <?php if(array_key_exists("child_count", $post)) { |
| 141 | 141 | echo $post["child_count"]; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | </span> |
| 148 | 148 | <?php |
| 149 | 149 | } |
| 150 | - if (isUserAdmin()) |
|
| 150 | + if(isUserAdmin()) |
|
| 151 | 151 | { |
| 152 | 152 | ?> |
| 153 | 153 | <span class="voting"> |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | { |
| 178 | 178 | ?> |
| 179 | 179 | <span data-tooltip="Author"> |
| 180 | - <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"];?> | |
|
| 180 | + <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"]; ?> | |
|
| 181 | 181 | </span> |
| 182 | 182 | <?php |
| 183 | 183 | } |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | <span class="tip" data-tooltip="Distance"> |
| 189 | 189 | <i class="fa fa-map-marker"></i> |
| 190 | - <?php echo $post['distance'];?> km |
|
| 191 | - <span class="tiptext"><?php echo $post['location']['name'];?></span> |
|
| 190 | + <?php echo $post['distance']; ?> km |
|
| 191 | + <span class="tiptext"><?php echo $post['location']['name']; ?></span> |
|
| 192 | 192 | </span> |
| 193 | 193 | </span> |
| 194 | 194 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | if($post != '' && array_key_exists('message', $post) && $post['message'] != '' && $this->isDetailedView) |
| 229 | 229 | { |
| 230 | - $description = 'On JodelBlue in ' . htmlspecialchars($this->city) . ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130); |
|
| 230 | + $description = 'On JodelBlue in ' . htmlspecialchars($this->city) . ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | return $description; |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | { |
| 359 | 359 | return $data['recent']; |
| 360 | 360 | } |
| 361 | - else if(array_key_exists('posts', $data)&& array_key_exists(0, $data['posts'])) |
|
| 361 | + else if(array_key_exists('posts', $data) && array_key_exists(0, $data['posts'])) |
|
| 362 | 362 | { |
| 363 | 363 | return $data['posts']; |
| 364 | 364 | } |
@@ -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; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $header = $this->getSignHeaders(); |
| 30 | 30 | $url = $this->getFullUrl(); |
| 31 | 31 | |
| 32 | - if ($this->getAccessToken()) { |
|
| 32 | + if($this->getAccessToken()) { |
|
| 33 | 33 | $header['Authorization'] = "Bearer " . $this->getAccessToken(); |
| 34 | 34 | } |
| 35 | 35 | //Comment out to debug the Request: |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | 'proxy' => '186.103.169.165:8080', |
| 53 | 53 | );*/ |
| 54 | 54 | |
| 55 | - switch ($this->getMethod()) { |
|
| 55 | + switch($this->getMethod()) { |
|
| 56 | 56 | case 'POST': |
| 57 | 57 | $result = Requests::post($url, $header, $this->payLoad); |
| 58 | 58 | break; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $result = Requests::put($url, $header, $this->payLoad); |
| 71 | 71 | break; |
| 72 | 72 | } |
| 73 | - switch ($result->status_code) { |
|
| 73 | + switch($result->status_code) { |
|
| 74 | 74 | case 200: |
| 75 | 75 | $result = json_decode($result->body, true); |
| 76 | 76 | break; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | exit("Error 403: Access denied"); |
| 102 | 102 | break; |
| 103 | 103 | default: |
| 104 | - error_log('Error '.$result->status_code.' - Unauthorized'); |
|
| 104 | + error_log('Error ' . $result->status_code . ' - Unauthorized'); |
|
| 105 | 105 | $result = json_decode($result->body, true); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -17,10 +17,10 @@ |
||
| 17 | 17 | { |
| 18 | 18 | error_log('ER_TOO_MANY_USER_CONNECTIONS'); |
| 19 | 19 | sleep(1); |
| 20 | - header('location: '.$_SERVER['PHP_SELF']); |
|
| 20 | + header('location: ' . $_SERVER['PHP_SELF']); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | -if ($db->connect_errno) { |
|
| 23 | +if($db->connect_errno) { |
|
| 24 | 24 | echo 'Sorry, die Verbindung zu unserem |
| 25 | 25 | Server ist hops gegangen. Wegen '. $db -> connect_error; |
| 26 | 26 | } |