@@ -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 | } |
@@ -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 |