@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | if(isset($_GET['postId']) && $_GET['vote']) |
6 | 6 | { |
7 | 7 | header('Content-Type: application/json'); |
8 | - echo json_encode($jodelAccountForKarma->votePostId($_GET['postId'], $_GET['vote'])); |
|
9 | - die(); |
|
8 | + echo json_encode($jodelAccountForKarma->votePostId($_GET['postId'], $_GET['vote'])); |
|
9 | + die(); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | if(isset($_GET['solution']) && isset($_POST['deviceUid'])) |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | WHERE user_token='" . $_COOKIE['JodelVoterPassword'] . "'"); |
129 | 129 | if($result === false) |
130 | 130 | { |
131 | - error_log("Update remaining votes failed: (" . $db->errno . ") " . $db->error); |
|
132 | - } |
|
133 | - $db->close(); |
|
131 | + error_log("Update remaining votes failed: (" . $db->errno . ") " . $db->error); |
|
132 | + } |
|
133 | + $db->close(); |
|
134 | 134 | $jodelAccount->votePostId($_POST['postId'], $_POST['vote']); |
135 | 135 | } |
136 | 136 | } |
@@ -5,14 +5,14 @@ discard block |
||
5 | 5 | |
6 | 6 | if(isset($_GET['pw'])) |
7 | 7 | { |
8 | - setcookie('JodelAdminPassword', $_GET['pw'], time()+60*60*24*365*10); |
|
8 | + setcookie('JodelAdminPassword', $_GET['pw'], time() + 60 * 60 * 24 * 365 * 10); |
|
9 | 9 | error_log('admin password saved for [' . $_SERVER ['HTTP_USER_AGENT'] . ']'); |
10 | 10 | header('Location: ' . $baseUrl . 'admin.php'); |
11 | 11 | exit; |
12 | 12 | } |
13 | 13 | else if(isset($_GET['voterPw'])) |
14 | 14 | { |
15 | - setcookie('JodelVoterPassword', $_GET['voterPw'], time()+60*60*24*365*10); |
|
15 | + setcookie('JodelVoterPassword', $_GET['voterPw'], time() + 60 * 60 * 24 * 365 * 10); |
|
16 | 16 | error_log('voter password saved for [' . $_SERVER ['HTTP_USER_AGENT'] . ']'); |
17 | 17 | header('Location: ' . $baseUrl); |
18 | 18 | exit; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | else |
44 | 44 | { |
45 | - error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong voterPw / pw on admin.php'); |
|
45 | + error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong voterPw / pw on admin.php'); |
|
46 | 46 | die(); |
47 | 47 | } |
48 | 48 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | . "','" . $db->escape_string($_POST['device_uid']) |
63 | 63 | . "','" . $db->escape_string($_POST['rights']) . "')"); |
64 | 64 | |
65 | - if($result === false){ |
|
65 | + if($result === false) { |
|
66 | 66 | $error = db_error(); |
67 | 67 | error_log($error); |
68 | 68 | error_log("Adding Voter failed: (" . $result->errno . ") " . $result->error); |
@@ -110,42 +110,42 @@ discard block |
||
110 | 110 | <meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client"> |
111 | 111 | |
112 | 112 | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi" crossorigin="anonymous"> |
113 | - <link rel="stylesheet" href="<?php echo $baseUrl;?>css/font-awesome.min.css"> |
|
114 | - <link rel="stylesheet" href="<?php echo $baseUrl;?>style.css" type="text/css"> |
|
113 | + <link rel="stylesheet" href="<?php echo $baseUrl; ?>css/font-awesome.min.css"> |
|
114 | + <link rel="stylesheet" href="<?php echo $baseUrl; ?>style.css" type="text/css"> |
|
115 | 115 | |
116 | - <link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico"> |
|
117 | - <link rel="icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico"> |
|
118 | - <link rel="icon" type="image/gif" href="<?php echo $baseUrl;?>img/favicon/favicon.gif"> |
|
119 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon.png"> |
|
120 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon.png"> |
|
121 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57"> |
|
122 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60"> |
|
123 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72"> |
|
124 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76"> |
|
125 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114"> |
|
126 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120"> |
|
127 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128"> |
|
128 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144"> |
|
129 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152"> |
|
130 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180"> |
|
131 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-precomposed.png"> |
|
132 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-16x16.png" sizes="16x16"> |
|
133 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-32x32.png" sizes="32x32"> |
|
134 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-96x96.png" sizes="96x96"> |
|
135 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-160x160.png" sizes="160x160"> |
|
136 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-192x192.png" sizes="192x192"> |
|
137 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-196x196.png" sizes="196x196"> |
|
138 | - <meta name="msapplication-TileImage" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> |
|
116 | + <link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico"> |
|
117 | + <link rel="icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico"> |
|
118 | + <link rel="icon" type="image/gif" href="<?php echo $baseUrl; ?>img/favicon/favicon.gif"> |
|
119 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon.png"> |
|
120 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon.png"> |
|
121 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57"> |
|
122 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60"> |
|
123 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72"> |
|
124 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76"> |
|
125 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114"> |
|
126 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120"> |
|
127 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128"> |
|
128 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144"> |
|
129 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152"> |
|
130 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180"> |
|
131 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-precomposed.png"> |
|
132 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-16x16.png" sizes="16x16"> |
|
133 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-32x32.png" sizes="32x32"> |
|
134 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-96x96.png" sizes="96x96"> |
|
135 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-160x160.png" sizes="160x160"> |
|
136 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-192x192.png" sizes="192x192"> |
|
137 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-196x196.png" sizes="196x196"> |
|
138 | + <meta name="msapplication-TileImage" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> |
|
139 | 139 | <meta name="msapplication-TileColor" content="#5682a3"> |
140 | 140 | <meta name="msapplication-navbutton-color" content="#5682a3"> |
141 | 141 | <meta name="application-name" content="JodelBlue"/> |
142 | 142 | <meta name="msapplication-tooltip" content="JodelBlue"/> |
143 | 143 | <meta name="apple-mobile-web-app-title" content="JodelBlue"/> |
144 | - <meta name="msapplication-square70x70logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-70x70.png"> |
|
145 | - <meta name="msapplication-square144x144logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> |
|
146 | - <meta name="msapplication-square150x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-150x150.png"> |
|
147 | - <meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x150.png"> |
|
148 | - <meta name="msapplication-square310x310logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x310.png"> |
|
144 | + <meta name="msapplication-square70x70logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-70x70.png"> |
|
145 | + <meta name="msapplication-square144x144logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> |
|
146 | + <meta name="msapplication-square150x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-150x150.png"> |
|
147 | + <meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x150.png"> |
|
148 | + <meta name="msapplication-square310x310logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x310.png"> |
|
149 | 149 | </head> |
150 | 150 | |
151 | 151 | <body> |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | ?> |
218 | 218 | <div class="row"> |
219 | 219 | <div class="col-12 col-sm-12"> |
220 | - <h2>Voting (<?php echo $votesRemaining;?> votes remaining)</h2> |
|
220 | + <h2>Voting (<?php echo $votesRemaining; ?> votes remaining)</h2> |
|
221 | 221 | <form> |
222 | 222 | <div class="form-group"> |
223 | 223 | <label for="quantityDelay">Quantity</label> |
@@ -226,20 +226,20 @@ discard block |
||
226 | 226 | <div class="form-group"> |
227 | 227 | <label for="minDelay">Minimum delay</label> |
228 | 228 | <div class="input-group"> |
229 | - <input placeholder="min interval" class="form-control" id="minDelay" value="<?php echo $config['minInterval'];?>" type="number" name="min"> |
|
229 | + <input placeholder="min interval" class="form-control" id="minDelay" value="<?php echo $config['minInterval']; ?>" type="number" name="min"> |
|
230 | 230 | <span class="input-group-addon">seconds</span> |
231 | 231 | </div> |
232 | 232 | </div> |
233 | 233 | <div class="form-group"> |
234 | 234 | <label for="maxDelay">Maximum delay</label> |
235 | 235 | <div class="input-group"> |
236 | - <input placeholder="max interval" class="form-control" id="maxDelay" value="<?php echo $config['maxInterval'];?>" type="number" name="max"> |
|
236 | + <input placeholder="max interval" class="form-control" id="maxDelay" value="<?php echo $config['maxInterval']; ?>" type="number" name="max"> |
|
237 | 237 | <span class="input-group-addon">seconds</span> |
238 | 238 | </div> |
239 | 239 | </div> |
240 | 240 | <div class="form-group"> |
241 | 241 | <label for="postIdDelay">Post Id</label> |
242 | - <input placeholder="postId" class="form-control" id="postIdDelay" value="<?php if(isset($_GET['postId'])) echo $_GET['postId'];?>" type="text" name="postId"> |
|
242 | + <input placeholder="postId" class="form-control" id="postIdDelay" value="<?php if(isset($_GET['postId'])) echo $_GET['postId']; ?>" type="text" name="postId"> |
|
243 | 243 | </div> |
244 | 244 | <div class="row"> |
245 | 245 | <div class="col-6 col-sm-6"><button type="button" name="vote" value="up" class="half" onclick="voteWithAjax('up');">Upvote</button></div> |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | crossorigin="anonymous"></script> |
266 | 266 | <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script> |
267 | 267 | <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script> |
268 | - <script src="<?php echo $baseUrl;?>js/jQueryEmoji.js"></script> |
|
268 | + <script src="<?php echo $baseUrl; ?>js/jQueryEmoji.js"></script> |
|
269 | 269 | <script src="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.1.1/ekko-lightbox.min.js" integrity="sha256-1odJPEl+KoMUaA1T7QNMGSSU/r5LCKCRC6SL8P0r2gY=" crossorigin="anonymous"></script> |
270 | 270 | |
271 | 271 | <script> |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | { |
310 | 310 | $.ajax({ |
311 | 311 | type: "POST", |
312 | - url: "<?php echo $baseUrl;?>vote-ajax.php", |
|
312 | + url: "<?php echo $baseUrl; ?>vote-ajax.php", |
|
313 | 313 | data: {"vote" : data["vote"], |
314 | 314 | "postId" : data["id"]}, |
315 | 315 | success: function(result){ |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | console.log(solution); |
364 | 364 | $.ajax({ |
365 | 365 | type: "POST", |
366 | - url: "<?php echo $baseUrl;?>vote-ajax.php?solution=" + solution + "&key="+key, |
|
366 | + url: "<?php echo $baseUrl; ?>vote-ajax.php?solution=" + solution + "&key="+key, |
|
367 | 367 | data: {"deviceUid" : deviceUid}, |
368 | 368 | success: function(result){ |
369 | 369 | var response = JSON.parse(result); |
@@ -49,27 +49,27 @@ discard block |
||
49 | 49 | |
50 | 50 | function user_log($msg) |
51 | 51 | { |
52 | - $log = $msg . PHP_EOL; |
|
53 | - file_put_contents(realpath(__DIR__ . '/..') . '/logs/user_log-' . date("j.n.Y") . '.txt', $log, FILE_APPEND); |
|
52 | + $log = $msg . PHP_EOL; |
|
53 | + file_put_contents(realpath(__DIR__ . '/..') . '/logs/user_log-' . date("j.n.Y") . '.txt', $log, FILE_APPEND); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | function isUserBot() |
57 | 57 | { |
58 | - preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches); |
|
58 | + preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches); |
|
59 | 59 | |
60 | - return (isset($matches[0])) ? true : false; |
|
60 | + return (isset($matches[0])) ? true : false; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | function configPropertyExists($config, $property) |
64 | 64 | { |
65 | - if(!array_key_exists($property, $config) || !isset($config[$property]) || $config[$property] == '' || $config[$property] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') |
|
66 | - { |
|
67 | - return FALSE; |
|
68 | - } |
|
69 | - else |
|
70 | - { |
|
71 | - return TRUE; |
|
72 | - } |
|
65 | + if(!array_key_exists($property, $config) || !isset($config[$property]) || $config[$property] == '' || $config[$property] == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') |
|
66 | + { |
|
67 | + return FALSE; |
|
68 | + } |
|
69 | + else |
|
70 | + { |
|
71 | + return TRUE; |
|
72 | + } |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | function isUserVoter() |
@@ -110,19 +110,19 @@ discard block |
||
110 | 110 | |
111 | 111 | function isDeviceUidInDatabase($deviceUid) |
112 | 112 | { |
113 | - $db = new DatabaseConnect(); |
|
114 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
113 | + $db = new DatabaseConnect(); |
|
114 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
115 | 115 | |
116 | - if ($result->num_rows > 0) |
|
117 | - { |
|
118 | - $db->close(); |
|
119 | - return TRUE; |
|
120 | - } |
|
121 | - else |
|
122 | - { |
|
123 | - $db->close(); |
|
124 | - return FALSE; |
|
125 | - } |
|
116 | + if ($result->num_rows > 0) |
|
117 | + { |
|
118 | + $db->close(); |
|
119 | + return TRUE; |
|
120 | + } |
|
121 | + else |
|
122 | + { |
|
123 | + $db->close(); |
|
124 | + return FALSE; |
|
125 | + } |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | //Check if it's a Spider or Google Bot |
@@ -149,14 +149,14 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | if(configPropertyExists($config, 'karmaDeviceUid')) |
152 | - { |
|
153 | - $jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']); |
|
154 | - } |
|
155 | - else |
|
156 | - { |
|
157 | - error_log("No Karma deviceUid set in config file"); |
|
152 | + { |
|
153 | + $jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']); |
|
154 | + } |
|
155 | + else |
|
156 | + { |
|
157 | + error_log("No Karma deviceUid set in config file"); |
|
158 | 158 | $jodelAccountForKarma = new JodelAccount($deviceUid); |
159 | - } |
|
159 | + } |
|
160 | 160 | |
161 | 161 | /* |
162 | 162 | * Cunstruct View |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | function user_log($msg) |
51 | 51 | { |
52 | - $log = $msg . PHP_EOL; |
|
52 | + $log = $msg . PHP_EOL; |
|
53 | 53 | file_put_contents(realpath(__DIR__ . '/..') . '/logs/user_log-' . date("j.n.Y") . '.txt', $log, FILE_APPEND); |
54 | 54 | } |
55 | 55 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches); |
59 | 59 | |
60 | - return (isset($matches[0])) ? true : false; |
|
60 | + return (isset($matches[0]))?true : false; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | function configPropertyExists($config, $property) |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | function isUserAdmin() |
99 | 99 | { |
100 | 100 | global $config; |
101 | - if (isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword']) |
|
101 | + if(isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword']) |
|
102 | 102 | { |
103 | 103 | return TRUE; |
104 | 104 | } |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | function isDeviceUidInDatabase($deviceUid) |
112 | 112 | { |
113 | 113 | $db = new DatabaseConnect(); |
114 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
114 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
115 | 115 | |
116 | - if ($result->num_rows > 0) |
|
116 | + if($result->num_rows > 0) |
|
117 | 117 | { |
118 | 118 | $db->close(); |
119 | 119 | return TRUE; |
@@ -137,8 +137,8 @@ discard block |
||
137 | 137 | if(!isset($_COOKIE['JodelDeviceId']) || !isDeviceUidInDatabase($_COOKIE['JodelDeviceId'])) |
138 | 138 | { |
139 | 139 | $jodelAccountForView = new JodelAccount(); |
140 | - setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time()+60*60*24*365*10); |
|
141 | - user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']'); |
|
140 | + setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time() + 60 * 60 * 24 * 365 * 10); |
|
141 | + user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']'); |
|
142 | 142 | |
143 | 143 | } |
144 | 144 | else |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | if(isset($_GET['search'])) |
168 | 168 | { |
169 | 169 | |
170 | - user_log('User with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] searched for ' . $_GET['search']); |
|
170 | + user_log('User with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] searched for ' . $_GET['search']); |
|
171 | 171 | |
172 | 172 | if(substr($_GET['search'], 0, 1) === "#") |
173 | 173 | { |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | |
223 | 223 | if(isset($_GET['view'])) |
224 | 224 | { |
225 | - switch ($_GET['view']) { |
|
225 | + switch($_GET['view']) { |
|
226 | 226 | case 'discussed': |
227 | 227 | $view = 'discussed'; |
228 | 228 | break; |
@@ -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 | { |
25 | 25 | error_log('Sorry, die Verbindung zu unserem |
26 | 26 | Server ist hops gegangen. Wegen '. $db -> connect_error); |
@@ -13,9 +13,12 @@ |
||
13 | 13 | } |
14 | 14 | $db = new DatabaseConnect(); |
15 | 15 | |
16 | -if($db->connect_errno == 1203) // 1203 == ER_TOO_MANY_USER_CONNECTIONS (mysqld_error.h) |
|
16 | +if($db->connect_errno == 1203) |
|
17 | +{ |
|
18 | + // 1203 == ER_TOO_MANY_USER_CONNECTIONS (mysqld_error.h) |
|
17 | 19 | { |
18 | 20 | error_log('ER_TOO_MANY_USER_CONNECTIONS'); |
21 | +} |
|
19 | 22 | sleep(1); |
20 | 23 | header('location: '.$_SERVER['PHP_SELF']); |
21 | 24 | } |