Completed
Push — master ( 9992d6...33de33 )
by mains
20:37 queued 05:04
created
admin.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 						?>
217 217
 							<div class="row">								
218 218
 								<div class="col-12 col-sm-12">
219
-								<h2>Voting (<?php echo $votesRemaining;?> votes remaining)</h2>
219
+								<h2>Voting (<?php echo $votesRemaining; ?> votes remaining)</h2>
220 220
 									<form>
221 221
 										<div class="form-group">
222 222
 											<label for="quantityDelay">Quantity</label>
@@ -224,15 +224,15 @@  discard block
 block discarded – undo
224 224
 										</div>
225 225
 										<div class="form-group">
226 226
 											<label for="minDelay">Minimum delay</label>
227
-											<input placeholder="min interval" class="form-control" id="minDelay" value="<?php echo $config['minInterval'];?>" type="number" name="min">
227
+											<input placeholder="min interval" class="form-control" id="minDelay" value="<?php echo $config['minInterval']; ?>" type="number" name="min">
228 228
 										</div>
229 229
 										<div class="form-group">
230 230
 											<label for="maxDelay">Maximum delay</label>
231
-											<input placeholder="max interval" class="form-control" id="maxDelay" value="<?php echo $config['maxInterval'];?>" type="number" name="max">
231
+											<input placeholder="max interval" class="form-control" id="maxDelay" value="<?php echo $config['maxInterval']; ?>" type="number" name="max">
232 232
 										</div>
233 233
 										<div class="form-group">
234 234
 											<label for="postIdDelay">Post Id</label>
235
-											<input placeholder="postId" class="form-control" id="postIdDelay" value="<?php if(isset($_GET['postId'])) echo $_GET['postId'];?>" type="text" name="postId">
235
+											<input placeholder="postId" class="form-control" id="postIdDelay" value="<?php if(isset($_GET['postId'])) echo $_GET['postId']; ?>" type="text" name="postId">
236 236
 										</div>
237 237
 										<div class="row">
238 238
 											<div class="col-6 col-sm-6"><button type="button" name="vote" value="up" class="half" onclick="voteWithAjax('up');">Upvote</button></div>
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 			  crossorigin="anonymous"></script>
259 259
 	    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
260 260
 	    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
261
-	    <script src="<?php echo $baseUrl;?>js/jQueryEmoji.js"></script>
261
+	    <script src="<?php echo $baseUrl; ?>js/jQueryEmoji.js"></script>
262 262
 	    <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>
263 263
 
264 264
 		<script>
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 			{
303 303
 				$.ajax({
304 304
 				  type: "POST",
305
-				  url: "<?php echo $baseUrl;?>vote-ajax.php",
305
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php",
306 306
 				  data: {"vote" : data["vote"],
307 307
 						 "postId" : data["id"]},
308 308
 				  success: function(result){
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 				console.log(solution);
357 357
 				$.ajax({
358 358
 				  type: "POST",
359
-				  url: "<?php echo $baseUrl;?>vote-ajax.php?solution=" + solution + "&key="+key,
359
+				  url: "<?php echo $baseUrl; ?>vote-ajax.php?solution=" + solution + "&key="+key,
360 360
 				  data: {"deviceUid" : deviceUid},
361 361
 				  success: function(result){
362 362
 					  var response = JSON.parse(result);
Please login to merge, or discard this patch.