Completed
Pull Request — master (#82)
by
unknown
02:45
created
classes/openid.php 3 patches
Doc Comments   +17 added lines, -1 removed lines patch added patch discarded remove patch
@@ -154,6 +154,9 @@  discard block
 block discarded – undo
154 154
         return !!gethostbynamel($server);
155 155
     }
156 156
 
157
+    /**
158
+     * @param boolean $update_claimed_id
159
+     */
157 160
     protected function request_curl($url, $method = 'GET', $params = array(), $update_claimed_id)
158 161
     {
159 162
         $params = http_build_query($params, '', '&');
@@ -262,6 +265,9 @@  discard block
 block discarded – undo
262 265
         return $headers;
263 266
     }
264 267
 
268
+    /**
269
+     * @param boolean $update_claimed_id
270
+     */
265 271
     protected function request_streams($url, $method = 'GET', $params = array(), $update_claimed_id)
266 272
     {
267 273
         if (!$this->hostExists($url)) {
@@ -384,6 +390,11 @@  discard block
 block discarded – undo
384 390
     /**
385 391
      * Helper function used to scan for <meta>/<link> tags and extract information
386 392
      * from them
393
+     * @param string $tag
394
+     * @param string $attrName
395
+     * @param string $attrValue
396
+     * @param string $valueName
397
+     * @return string
387 398
      */
388 399
     protected function htmlTag($content, $tag, $attrName, $attrValue, $valueName)
389 400
     {
@@ -628,6 +639,9 @@  discard block
 block discarded – undo
628 639
         return $params;
629 640
     }
630 641
 
642
+    /**
643
+     * @param boolean $immediate
644
+     */
631 645
     protected function authUrl_v1($immediate)
632 646
     {
633 647
         $returnUrl = $this->returnUrl;
@@ -649,6 +663,9 @@  discard block
 block discarded – undo
649 663
                                 , array('query' => http_build_query($params, '', '&')));
650 664
     }
651 665
 
666
+    /**
667
+     * @param boolean $immediate
668
+     */
652 669
     protected function authUrl_v2($immediate)
653 670
     {
654 671
         $params = array(
@@ -684,7 +701,6 @@  discard block
 block discarded – undo
684 701
     /**
685 702
      * Returns authentication url. Usually, you want to redirect your user to it.
686 703
      * @return String The authentication url.
687
-     * @param String $select_identifier Whether to request OP to select identity for an user in OpenID 2. Does not affect OpenID 1.
688 704
      * @throws ErrorException
689 705
      */
690 706
     function authUrl($immediate = false)
Please login to merge, or discard this patch.
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -1,52 +1,52 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
-     * This class provides a simple interface for OpenID (1.1 and 2.0) authentication.
4
-     * Supports Yadis discovery.
5
-     * The authentication process is stateless/dumb.
6
-     *
7
-     * Usage:
8
-     * Sign-on with OpenID is a two step process:
9
-     * Step one is authentication with the provider:
10
-     * <code>
11
-     * $openid = new LightOpenID('my-host.example.org');
12
-     * $openid->identity = 'ID supplied by user';
13
-     * header('Location: ' . $openid->authUrl());
14
-     * </code>
15
-     * The provider then sends various parameters via GET, one of them is openid_mode.
16
-     * Step two is verification:
17
-     * <code>
18
-     * $openid = new LightOpenID('my-host.example.org');
19
-     * if ($openid->mode) {
20
-     *     echo $openid->validate() ? 'Logged in.' : 'Failed';
21
-     * }
22
-     * </code>
23
-     *
24
-     * Change the 'my-host.example.org' to your domain name. Do NOT use $_SERVER['HTTP_HOST']
25
-     * for that, unless you know what you are doing.
26
-     *
27
-     * Optionally, you can set $returnUrl and $realm (or $trustRoot, which is an alias).
28
-     * The default values for those are:
29
-     * $openid->realm     = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
30
-     * $openid->returnUrl = $openid->realm . $_SERVER['REQUEST_URI'];
31
-     * If you don't know their meaning, refer to any openid tutorial, or specification. Or just guess.
32
-     *
33
-     * AX and SREG extensions are supported.
34
-     * To use them, specify $openid->required and/or $openid->optional before calling $openid->authUrl().
35
-     * These are arrays, with values being AX schema paths (the 'path' part of the URL).
36
-     * For example:
37
-     *   $openid->required = array('namePerson/friendly', 'contact/email');
38
-     *   $openid->optional = array('namePerson/first');
39
-     * If the server supports only SREG or OpenID 1.1, these are automaticaly
40
-     * mapped to SREG names, so that user doesn't have to know anything about the server.
41
-     *
42
-     * To get the values, use $openid->getAttributes().
43
-     *
44
-     *
45
-     * The library requires PHP >= 5.1.2 with curl or http/https stream wrappers enabled.
46
-     * @author Mewp
47
-     * @copyright Copyright (c) 2010, Mewp
48
-     * @license http://www.opensource.org/licenses/mit-license.php MIT
49
-     */
3
+ * This class provides a simple interface for OpenID (1.1 and 2.0) authentication.
4
+ * Supports Yadis discovery.
5
+ * The authentication process is stateless/dumb.
6
+ *
7
+ * Usage:
8
+ * Sign-on with OpenID is a two step process:
9
+ * Step one is authentication with the provider:
10
+ * <code>
11
+ * $openid = new LightOpenID('my-host.example.org');
12
+ * $openid->identity = 'ID supplied by user';
13
+ * header('Location: ' . $openid->authUrl());
14
+ * </code>
15
+ * The provider then sends various parameters via GET, one of them is openid_mode.
16
+ * Step two is verification:
17
+ * <code>
18
+ * $openid = new LightOpenID('my-host.example.org');
19
+ * if ($openid->mode) {
20
+ *     echo $openid->validate() ? 'Logged in.' : 'Failed';
21
+ * }
22
+ * </code>
23
+ *
24
+ * Change the 'my-host.example.org' to your domain name. Do NOT use $_SERVER['HTTP_HOST']
25
+ * for that, unless you know what you are doing.
26
+ *
27
+ * Optionally, you can set $returnUrl and $realm (or $trustRoot, which is an alias).
28
+ * The default values for those are:
29
+ * $openid->realm     = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
30
+ * $openid->returnUrl = $openid->realm . $_SERVER['REQUEST_URI'];
31
+ * If you don't know their meaning, refer to any openid tutorial, or specification. Or just guess.
32
+ *
33
+ * AX and SREG extensions are supported.
34
+ * To use them, specify $openid->required and/or $openid->optional before calling $openid->authUrl().
35
+ * These are arrays, with values being AX schema paths (the 'path' part of the URL).
36
+ * For example:
37
+ *   $openid->required = array('namePerson/friendly', 'contact/email');
38
+ *   $openid->optional = array('namePerson/first');
39
+ * If the server supports only SREG or OpenID 1.1, these are automaticaly
40
+ * mapped to SREG names, so that user doesn't have to know anything about the server.
41
+ *
42
+ * To get the values, use $openid->getAttributes().
43
+ *
44
+ *
45
+ * The library requires PHP >= 5.1.2 with curl or http/https stream wrappers enabled.
46
+ * @author Mewp
47
+ * @copyright Copyright (c) 2010, Mewp
48
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
49
+ */
50 50
 class LightOpenID
51 51
 {
52 52
     public $returnUrl
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -73,12 +73,12 @@  discard block
 block discarded – undo
73 73
 
74 74
     function __construct($host)
75 75
     {
76
-        $this->trustRoot = (strpos($host, '://') ? $host : 'http://' . $host);
76
+        $this->trustRoot = (strpos($host, '://') ? $host : 'http://'.$host);
77 77
         if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
78 78
             || (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
79 79
             && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
80 80
         ) {
81
-            $this->trustRoot = (strpos($host, '://') ? $host : 'https://' . $host);
81
+            $this->trustRoot = (strpos($host, '://') ? $host : 'https://'.$host);
82 82
         }
83 83
 
84 84
         if (($host_end = strpos($this->trustRoot, '/', 8)) !== false) {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         }
87 87
 
88 88
         $uri = rtrim(preg_replace('#((?<=\?)|&)openid\.[^&]+#', '', $_SERVER['REQUEST_URI']), '?');
89
-        $this->returnUrl = $this->trustRoot . $uri;
89
+        $this->returnUrl = $this->trustRoot.$uri;
90 90
 
91 91
         $this->data = ($_SERVER['REQUEST_METHOD'] === 'POST') ? $_POST : $_GET;
92 92
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     protected function request_curl($url, $method = 'GET', $params = array(), $update_claimed_id)
158 158
     {
159 159
         $params = http_build_query($params, '', '&');
160
-        $curl = curl_init($url . ($method == 'GET' && $params ? '?' . $params : ''));
160
+        $curl = curl_init($url.($method == 'GET' && $params ? '?'.$params : ''));
161 161
         curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
162 162
         curl_setopt($curl, CURLOPT_HEADER, false);
163 163
         curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
                     } elseif ($headers[$name][0] == '/') {
253 253
                         $parsed_url = parse_url($this->claimed_id);
254 254
                         $this->identity =
255
-                        $this->claimed_id = $parsed_url['scheme'] . '://'
255
+                        $this->claimed_id = $parsed_url['scheme'].'://'
256 256
                                             . $parsed_url['host']
257 257
                                             . $headers[$name];
258 258
                     }
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
                         'CN_match' => parse_url($url, PHP_URL_HOST),
281 281
                     ),
282 282
                 );
283
-                $url = $url . ($params ? '?' . $params : '');
283
+                $url = $url.($params ? '?'.$params : '');
284 284
                 break;
285 285
             case 'POST':
286 286
                 $opts = array(
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                     )
312 312
                 );
313 313
 
314
-                $url = $url . ($params ? '?' . $params : '');
314
+                $url = $url.($params ? '?'.$params : '');
315 315
                 $headers = get_headers($url);
316 316
                 if (!$headers) {
317 317
                     return array();
@@ -365,11 +365,11 @@  discard block
 block discarded – undo
365 365
     protected function build_url($url, $parts)
366 366
     {
367 367
         if (isset($url['query'], $parts['query'])) {
368
-            $parts['query'] = $url['query'] . '&' . $parts['query'];
368
+            $parts['query'] = $url['query'].'&'.$parts['query'];
369 369
         }
370 370
 
371 371
         $url = $parts + $url;
372
-        $url = $url['scheme'] . '://'
372
+        $url = $url['scheme'].'://'
373 373
                 . (empty($url['username']) ? ''
374 374
                  :(empty($url['password']) ? "{$url['username']}@"
375 375
                  :"{$url['username']}:{$url['password']}@"))
@@ -442,11 +442,11 @@  discard block
 block discarded – undo
442 442
 
443 443
                     preg_match_all('#<Service.*?>(.*?)</Service>#s', $content, $m);
444 444
                     foreach ($m[1] as $content) {
445
-                        $content = ' ' . $content; # The space is added, so that strpos doesn't return 0.
445
+                        $content = ' '.$content; # The space is added, so that strpos doesn't return 0.
446 446
 
447 447
                         # OpenID 2
448 448
                         $ns = preg_quote('http://specs.openid.net/auth/2.0/', '#');
449
-                        if (preg_match('#<Type>\s*' . $ns . '(server|signon)\s*</Type>#s', $content, $type)) {
449
+                        if (preg_match('#<Type>\s*'.$ns.'(server|signon)\s*</Type>#s', $content, $type)) {
450 450
                             if ($type[1] == 'server') {
451 451
                                 $this->identifier_select = true;
452 452
                             }
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 
474 474
                         # OpenID 1.1
475 475
                         $ns = preg_quote('http://openid.net/signon/1.1', '#');
476
-                        if (preg_match('#<Type>\s*' . $ns . '\s*</Type>#s', $content)) {
476
+                        if (preg_match('#<Type>\s*'.$ns.'\s*</Type>#s', $content)) {
477 477
 
478 478
                             preg_match('#<URI.*?>(.*)</URI>#', $content, $server);
479 479
                             preg_match('#<.*?Delegate>(.*)</.*?Delegate>#', $content, $delegate);
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
                     if (is_int($alias)) {
599 599
                         $alias = strtr($field, '/', '_');
600 600
                     }
601
-                    $this->aliases[$alias] = 'http://axschema.org/' . $field;
601
+                    $this->aliases[$alias] = 'http://axschema.org/'.$field;
602 602
                     if (empty($counts[$alias])) {
603 603
                         $counts[$alias] = 0;
604 604
                     }
@@ -607,13 +607,13 @@  discard block
 block discarded – undo
607 607
                 }
608 608
             }
609 609
             foreach ($this->aliases as $alias => $ns) {
610
-                $params['openid.ax.type.' . $alias] = $ns;
610
+                $params['openid.ax.type.'.$alias] = $ns;
611 611
             }
612 612
             foreach ($counts as $alias => $count) {
613 613
                 if ($count == 1) {
614 614
                     continue;
615 615
                 }
616
-                $params['openid.ax.count.' . $alias] = $count;
616
+                $params['openid.ax.count.'.$alias] = $count;
617 617
             }
618 618
 
619 619
             # Don't send empty ax.requied and ax.if_available.
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
         # we need to somehow preserve the claimed id between requests.
636 636
         # The simplest way is to just send it along with the return_to url.
637 637
         if ($this->identity != $this->claimed_id) {
638
-            $returnUrl .= (strpos($returnUrl, '?') ? '&' : '?') . 'openid.claimed_id=' . $this->claimed_id;
638
+            $returnUrl .= (strpos($returnUrl, '?') ? '&' : '?').'openid.claimed_id='.$this->claimed_id;
639 639
         }
640 640
 
641 641
         $params = array(
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
             # If it's an OpenID 1 provider, and we've got claimed_id,
740 740
             # we have to append it to the returnUrl, like authUrl_v1 does.
741 741
             $this->returnUrl .= (strpos($this->returnUrl, '?') ? '&' : '?')
742
-                                .  'openid.claimed_id=' . $this->claimed_id;
742
+                                .  'openid.claimed_id='.$this->claimed_id;
743 743
         }
744 744
 
745 745
         if ($this->data['openid_return_to'] != $this->returnUrl) {
@@ -757,8 +757,8 @@  discard block
 block discarded – undo
757 757
             # In such case, validation would fail, since we'd send different data than OP
758 758
             # wants to verify. stripslashes() should solve that problem, but we can't
759 759
             # use it when magic_quotes is off.
760
-            $value = $this->data['openid_' . str_replace('.', '_', $item)];
761
-            $params['openid.' . $item] = function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ? stripslashes($value) : $value;
760
+            $value = $this->data['openid_'.str_replace('.', '_', $item)];
761
+            $params['openid.'.$item] = function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ? stripslashes($value) : $value;
762 762
 
763 763
         }
764 764
 
@@ -796,19 +796,19 @@  discard block
 block discarded – undo
796 796
 
797 797
         $attributes = array();
798 798
         foreach (explode(',', $this->data['openid_signed']) as $key) {
799
-            $keyMatch = $alias . '.value.';
799
+            $keyMatch = $alias.'.value.';
800 800
             if (substr($key, 0, strlen($keyMatch)) != $keyMatch) {
801 801
                 continue;
802 802
             }
803 803
             $key = substr($key, strlen($keyMatch));
804
-            if (!isset($this->data['openid_' . $alias . '_type_' . $key])) {
804
+            if (!isset($this->data['openid_'.$alias.'_type_'.$key])) {
805 805
                 # OP is breaking the spec by returning a field without
806 806
                 # associated ns. This shouldn't happen, but it's better
807 807
                 # to check, than cause an E_NOTICE.
808 808
                 continue;
809 809
             }
810
-            $value = $this->data['openid_' . $alias . '_value_' . $key];
811
-            $key = substr($this->data['openid_' . $alias . '_type_' . $key],
810
+            $value = $this->data['openid_'.$alias.'_value_'.$key];
811
+            $key = substr($this->data['openid_'.$alias.'_type_'.$key],
812 812
                             strlen('http://axschema.org/'));
813 813
 
814 814
             $attributes[$key] = $value;
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
                 # The field name isn't part of the SREG spec, so we ignore it.
831 831
                 continue;
832 832
             }
833
-            $attributes[$sreg_to_ax[$key]] = $this->data['openid_sreg_' . $key];
833
+            $attributes[$sreg_to_ax[$key]] = $this->data['openid_sreg_'.$key];
834 834
         }
835 835
         return $attributes;
836 836
     }
Please login to merge, or discard this patch.
classes/steamlogin.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -3,6 +3,9 @@
 block discarded – undo
3 3
 
4 4
 class user
5 5
 {
6
+    /**
7
+     * @param string $steamid
8
+     */
6 9
     public function GetPlayerSummaries($steamid)
7 10
     {
8 11
         $settings = require('config/settings.php');
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
     public function GetPlayerSummaries($steamid)
7 7
     {
8 8
         $settings = require('config/settings.php');
9
-        $response = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=' . $settings['steamAPI'] . '&steamids=' . $steamid);
9
+        $response = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.$settings['steamAPI'].'&steamids='.$steamid);
10 10
         $json = json_decode($response);
11 11
         return $json->response->players[0];
12 12
     }
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
             $openid = new LightOpenID($settings['url']);
20 20
             if (!$openid->mode) {
21 21
                 $openid->identity = 'http://steamcommunity.com/openid';
22
-                header('Location: ' . $openid->authUrl());
22
+                header('Location: '.$openid->authUrl());
23 23
             } elseif ($openid->mode == 'cancel') {
24 24
                 print ('User has canceled authentication!');
25 25
             } else {
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
                     $db_connection = masterConnect();
31 31
 
32 32
                     $sql = "SELECT user_name, user_email, user_level, user_profile, permissions, user_password_hash, user_id
33
-                            FROM users WHERE playerid = '" . $_SESSION['playerid'] . "';";
33
+                            FROM users WHERE playerid = '" . $_SESSION['playerid']."';";
34 34
                     $result_of_login_check = $db_connection->query($sql);
35 35
 
36 36
                     if ($result_of_login_check->num_rows == 1) {
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
                             $_SESSION['steamsignon'] = false; //used to determine if its a single sign on with no account
55 55
                             multiDB();
56 56
 
57
-                            logAction($_SESSION['user_name'], 'Successful Steam Login (' . $_SERVER['REMOTE_ADDR'] . ')', 2);
57
+                            logAction($_SESSION['user_name'], 'Successful Steam Login ('.$_SERVER['REMOTE_ADDR'].')', 2);
58 58
                         } else {
59 59
                             $this->errors[] = "User is banned.";
60
-                            logAction($_POST['user_name'], 'Steam Login Failed - Banned User (' . $_SERVER['REMOTE_ADDR'] . ')', 3);
60
+                            logAction($_POST['user_name'], 'Steam Login Failed - Banned User ('.$_SERVER['REMOTE_ADDR'].')', 3);
61 61
                         }
62 62
                     } else {
63 63
                         if ($settings['annonlogin']) {
@@ -73,12 +73,12 @@  discard block
 block discarded – undo
73 73
                             $_SESSION['steamsignon'] = true; //used to determine if its a single sign on with no account
74 74
                             multiDB();
75 75
 
76
-                            logAction($_SESSION['user_name'], 'Successful Steam Login (' . $_SERVER['REMOTE_ADDR'] . ')', 2);
76
+                            logAction($_SESSION['user_name'], 'Successful Steam Login ('.$_SERVER['REMOTE_ADDR'].')', 2);
77 77
                         } else {
78 78
                             errorMessage(7);
79 79
                         }
80 80
                     }
81
-                    header('Location: ' . $settings['url']);
81
+                    header('Location: '.$settings['url']);
82 82
                     exit;
83 83
                 } else {
84 84
                     print ('Error');
Please login to merge, or discard this patch.
views/steam/dashboard.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 								</div>
42 42
 							</div>
43 43
 						</li>
44
-			<?php }elseif ($row['type'] == 'waste') { ?>
44
+			<?php } elseif ($row['type'] == 'waste') { ?>
45 45
 						<li class="list-danger">
46 46
 							<i class=" fa fa-ellipsis-v"></i>
47 47
 							<div class="task-title">
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
     </div>
7 7
 </div>
8 8
 <?php if (isset($message)) {
9
-    echo '<div class="alert alert-info" role="alert">' . $message . '</div>';
9
+    echo '<div class="alert alert-info" role="alert">'.$message.'</div>';
10 10
 }
11 11
 ?>
12 12
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
     if ($result_of_query->num_rows >= 1) {
28 28
         while ($row = mysqli_fetch_assoc($result_of_query)) {
29
-            if ($row['type'] == 'life'){ ?>
29
+            if ($row['type'] == 'life') { ?>
30 30
 						<li class="list-primary">
31 31
 							<i class=" fa fa-ellipsis-v"></i>
32 32
 							<div class="task-title">
Please login to merge, or discard this patch.
views/steam/life/dashboard.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -272,7 +272,8 @@  discard block
 block discarded – undo
272 272
                                     </tbody>
273 273
                                 </table>
274 274
                                 <?php echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="' . $settings['url'] . 'houses/' . $player->playerid . '"> More</a>';
275
-                            } else echo $lang['noHouse'] ?>
275
+                            } else {
276
+                                echo $lang['noHouse'] ?>
276 277
                         </div>
277 278
                     </div>
278 279
                 <?php } if ($player->playerid == $_SESSION['playerid']) { ?>
@@ -281,6 +282,7 @@  discard block
 block discarded – undo
281 282
                         <?php
282 283
                             $sql = "SELECT `classname`,`type`,`id`,`plate` FROM `vehicles` WHERE `pid` = '" . $player->playerid . "' ORDER BY `id` DESC LIMIT 8";
283 284
                             }
285
+                            }
284 286
                             $result_of_query = $db_link->query($sql);
285 287
                             if ($result_of_query->num_rows > 0) {
286 288
                                 $veh = $result_of_query->fetch_object();
Please login to merge, or discard this patch.
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@  discard block
 block discarded – undo
5 5
     require_once("config/images.php");
6 6
     require_once("config/license.php");
7 7
 } else {
8
-    require_once(realpath($settings['url']) . "config/carNames.php");
9
-    require_once(realpath($settings['url']) . "config/images.php");
10
-    require_once(realpath($settings['url']) . "config/license.php");
8
+    require_once(realpath($settings['url'])."config/carNames.php");
9
+    require_once(realpath($settings['url'])."config/images.php");
10
+    require_once(realpath($settings['url'])."config/license.php");
11 11
 }
12 12
 
13 13
 $db_link = serverConnect();
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     }
29 29
 }
30 30
 
31
-$sql = "SELECT *, $playerIdColumn as playerid FROM `players` WHERE $playerIdColumn = '" . $_SESSION['playerid'] . "'";
31
+$sql = "SELECT *, $playerIdColumn as playerid FROM `players` WHERE $playerIdColumn = '".$_SESSION['playerid']."'";
32 32
 $result = $db_link->query($sql);
33 33
 if ($result->num_rows > 0) {
34 34
     $player = $result->fetch_object();
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $temp .= chr($pGID & 0xFF);
40 40
         $pGID >>= 8;
41 41
     }
42
-    $pGID = md5('BE' . $temp);
42
+    $pGID = md5('BE'.$temp);
43 43
 ?>
44 44
 <div class="col-md-3" style="float:left;  padding-top:20px;">
45 45
     <div class="panel panel-default">
@@ -53,26 +53,26 @@  discard block
 block discarded – undo
53 53
                 $alias = str_replace('"[`', "", $player->aliases);
54 54
                 $alias = str_replace('`]"', "", $alias);
55 55
 
56
-                echo '<center><img alt="' . $alias . '" src="' . $settings['url'] . 'assets/img/uniform/' . getPlayerSkin($player->civ_gear, $playerSkins) . '.jpg">';
57
-                echo "<h4>" . $lang['aliases'] . ": " . $alias . "</h4>";
58
-                echo "<h4>" . $lang['playerID'] . ": " . $player->playerid . "</h4>";
59
-                echo "<h4 style='word-wrap: break-word;'>" . $lang['GUID'] . ": " . $pGID . "</h4>";
56
+                echo '<center><img alt="'.$alias.'" src="'.$settings['url'].'assets/img/uniform/'.getPlayerSkin($player->civ_gear, $playerSkins).'.jpg">';
57
+                echo "<h4>".$lang['aliases'].": ".$alias."</h4>";
58
+                echo "<h4>".$lang['playerID'].": ".$player->playerid."</h4>";
59
+                echo "<h4 style='word-wrap: break-word;'>".$lang['GUID'].": ".$pGID."</h4>";
60 60
             ?>
61 61
             <i class="fa fa-2x fa-money"></i>
62
-            <h4> <?php echo $lang['cash'] . ": " . $player->cash; ?> </h4>
62
+            <h4> <?php echo $lang['cash'].": ".$player->cash; ?> </h4>
63 63
             <i style="padding-left:15px;" class="fa fa-2x fa-bank"></i>
64
-            <h4> <?php echo $lang['bank'] . ": " . $player->bankacc; ?> </h4>
64
+            <h4> <?php echo $lang['bank'].": ".$player->bankacc; ?> </h4>
65 65
             <?php
66 66
                 if ($player->arrested == 0) {
67
-                    echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-success'>" . $lang["not"] . " " . $lang["arrested"] . "</button></h4>";
67
+                    echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-success'>".$lang["not"]." ".$lang["arrested"]."</button></h4>";
68 68
                 } else {
69
-                    echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-theme01'>" . $lang["arrested"] . "</button></h4>";
69
+                    echo "<h4><button type='button' id='arrested' class='arrest btn btn-xs btn-theme01'>".$lang["arrested"]."</button></h4>";
70 70
                 }
71 71
 
72 72
                 if ($player->blacklist == 0) {
73
-                    echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-success'>" . $lang["not"] . " " . $lang["blacklisted"] . "</button></h4>";
73
+                    echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-success'>".$lang["not"]." ".$lang["blacklisted"]."</button></h4>";
74 74
                 } else {
75
-                    echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-theme01'>" . $lang["blacklisted"] . "</button></h4>";
75
+                    echo "<h4><button type='button' id='blacklist' class='arrest btn btn-xs btn-theme01'>".$lang["blacklisted"]."</button></h4>";
76 76
                 }
77 77
 
78 78
                 echo "</center>";
@@ -89,34 +89,34 @@  discard block
 block discarded – undo
89 89
             <div class="box1">
90 90
                 <span class="fa fa-3x fa-taxi"></span>
91 91
 
92
-                <h3> <?php echo $lang['police'] . ": " . $player->coplevel; ?> </h3>
92
+                <h3> <?php echo $lang['police'].": ".$player->coplevel; ?> </h3>
93 93
             </div>
94 94
         </div>
95 95
         <div class="col-md-2 col-sm-2 box0">
96 96
             <div class="box1">
97 97
                 <span class="fa fa-3x fa-ambulance"></span>
98 98
 
99
-                <h3> <?php echo $lang['medic'] . ": " . $player->mediclevel; ?> </h3>
99
+                <h3> <?php echo $lang['medic'].": ".$player->mediclevel; ?> </h3>
100 100
             </div>
101 101
         </div>
102 102
         <div class="col-md-2 col-sm-2 box0">
103 103
             <div class="box1">
104 104
                 <span class="fa fa-3x fa-usd"></span>
105 105
 
106
-                <h3> <?php echo $lang['donator'] . ": " . $player->$settings['donorFormat']; ?> </h3>
106
+                <h3> <?php echo $lang['donator'].": ".$player->$settings['donorFormat']; ?> </h3>
107 107
             </div>
108 108
         </div>
109 109
         <div class="col-md-2 col-sm-2 box0">
110 110
             <div class="box1">
111 111
                 <span class="fa fa-3x fa-group"></span>
112 112
 
113
-                <h3> <?php echo $lang['admin'] . ": " . $player->adminlevel; ?> </h3>
113
+                <h3> <?php echo $lang['admin'].": ".$player->adminlevel; ?> </h3>
114 114
             </div>
115 115
         </div>
116 116
         <?php
117 117
         if ($player->playerid == $_SESSION['playerid']) {
118 118
             echo '<div class="col-md-2 col-sm-2 box0">';
119
-            echo '<a href="http://steamcommunity.com/profiles/' . $player->playerid . '"';
119
+            echo '<a href="http://steamcommunity.com/profiles/'.$player->playerid.'"';
120 120
             echo 'target="_blank">';
121 121
             echo '<div class="box1">';
122 122
             echo '<span class="fa fa-3x fa-steam"></span>';
@@ -151,25 +151,25 @@  discard block
 block discarded – undo
151 151
             <div id="myTabContent" class="tab-content">
152 152
                 <?php if ($player->playerid == $_SESSION['playerid']) { ?>
153 153
                     <div class="tab-pane fade in active well" id="civ_lic">
154
-                        <h4 style="centred"><?php echo $lang['civ'] . " " . $lang['licenses']; ?> </h4>
154
+                        <h4 style="centred"><?php echo $lang['civ']." ".$lang['licenses']; ?> </h4>
155 155
                         <?php
156 156
                             if ($player->civ_licenses !== '"[]"') {
157 157
                                 $return = stripArray($player->civ_licenses, 0);
158 158
                                 foreach ($return as $value) {
159 159
                                     if (strpos($value, "1") == TRUE) {
160 160
                                         $name = before(',', $value);
161
-                                        echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
161
+                                        echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license)."</button> ";
162 162
                                     } else {
163 163
                                         $name = before(',', $value);
164
-                                        echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
164
+                                        echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license)."</button> ";
165 165
                                     }
166 166
                                 }
167 167
                             } else {
168
-                                echo $lang['no'] . " " . $lang['licenses'];
168
+                                echo $lang['no']." ".$lang['licenses'];
169 169
                             }?>
170 170
                     </div>
171 171
                     <div class="tab-pane well fade" id="medic_lic">
172
-                        <h4 style="centred"><?php echo $lang['medic'] . " " . $lang['licenses']; ?> </h4>
172
+                        <h4 style="centred"><?php echo $lang['medic']." ".$lang['licenses']; ?> </h4>
173 173
                         <?php
174 174
                             if ($player->med_licenses !== '"[]"') {
175 175
                                 $return = stripArray($player->med_licenses, 0);
@@ -177,18 +177,18 @@  discard block
 block discarded – undo
177 177
                                 foreach ($return as $value) {
178 178
                                     if (strpos($value, "1") == TRUE) {
179 179
                                         $name = before(',', $value);
180
-                                        echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
180
+                                        echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license)."</button> ";
181 181
                                     } else {
182 182
                                         $name = before(',', $value);
183
-                                        echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
183
+                                        echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license)."</button> ";
184 184
                                     }
185 185
                                 }
186 186
                             } else {
187
-                                echo $lang['no'] . " " . $lang['licenses'];
187
+                                echo $lang['no']." ".$lang['licenses'];
188 188
                             } ?>
189 189
                     </div>
190 190
                     <div class="tab-pane well fade" id="police_lic">
191
-                        <h4 style="centred"><?php echo $lang['cop'] . " " . $lang['licenses']; ?> </h4>
191
+                        <h4 style="centred"><?php echo $lang['cop']." ".$lang['licenses']; ?> </h4>
192 192
                         <?php
193 193
                             if ($player->cop_licenses !== '"[]"') {
194 194
                                 $return = stripArray($player->cop_licenses, 0);
@@ -196,22 +196,22 @@  discard block
 block discarded – undo
196 196
                                 foreach ($return as $value) {
197 197
                                     if (strpos($value, "1") == TRUE) {
198 198
                                         $name = before(',', $value);
199
-                                        echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
199
+                                        echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>".licName($name, $license)."</button> ";
200 200
                                     } else {
201 201
                                         $name = before(',', $value);
202
-                                        echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
202
+                                        echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>".licName($name, $license)."</button> ";
203 203
                                     }
204 204
                                 }
205 205
                             } else {
206
-                                echo $lang['no'] . " " . $lang['licenses'];
206
+                                echo $lang['no']." ".$lang['licenses'];
207 207
                             }
208 208
                         ?>
209 209
                     </div>
210 210
                 <?php } if ($player->playerid == $_SESSION['playerid']) { ?>
211 211
                     <div class="tab-pane fade well" id="civ_inv">
212
-                        <h4 style="centred"><?php echo $lang['civ'] . " " . $lang['gear']; ?> </h4>
212
+                        <h4 style="centred"><?php echo $lang['civ']." ".$lang['gear']; ?> </h4>
213 213
                         <?php
214
-                        echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='civ_gear'>" . $player->civ_gear . "</textarea>";
214
+                        echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='civ_gear'>".$player->civ_gear."</textarea>";
215 215
                         echo '<br>';
216 216
 
217 217
                         if ($_SESSION['permissions']['edit']['inventory']) {
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
                         <br>
223 223
                     </div>
224 224
                     <div class="tab-pane fade well" id="police_inv">
225
-                        <h4 style="centred"><?php echo $lang['police'] . " " . $lang['gear']; ?> </h4>
225
+                        <h4 style="centred"><?php echo $lang['police']." ".$lang['gear']; ?> </h4>
226 226
                         <?php
227
-                        echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='cop_gear'>" . $player->cop_gear . "</textarea>";
227
+                        echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='cop_gear'>".$player->cop_gear."</textarea>";
228 228
                         echo '<br>';
229 229
                         if ($_SESSION['permissions']['edit']['inventory']) {
230 230
                             echo '<a data-toggle="modal" href="#edit_cop_inv" class="btn btn-primary btn-xs" style="float: right;">';
@@ -234,9 +234,9 @@  discard block
 block discarded – undo
234 234
                         <br>
235 235
                     </div>
236 236
                     <div class="tab-pane fade well" id="medic_inv">
237
-                        <h4 style="centred"><?php echo $lang['medic'] . " " . $lang['gear']; ?> </h4>
237
+                        <h4 style="centred"><?php echo $lang['medic']." ".$lang['gear']; ?> </h4>
238 238
                         <?php
239
-                        echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='med_gear'>" . $player->med_gear . "</textarea>";
239
+                        echo "<textarea class='form-control' readonly rows='5' style='width: 100%' id='civ_gear' name='med_gear'>".$player->med_gear."</textarea>";
240 240
                         echo '<br>';
241 241
                         if ($_SESSION['permissions']['edit']['inventory']) {
242 242
                             echo '<a data-toggle="modal" href="#edit_med_inv" class="btn btn-primary btn-xs" style="float: right;">';
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
                     <div class="tab-pane fade" id="house">
249 249
                         <div class="table-responsive">
250 250
                             <?php
251
-                            $sql = "SELECT `pos`,`id` FROM `houses` WHERE `pid` = '" . $player->playerid . "' ORDER BY `id` DESC LIMIT 8";
251
+                            $sql = "SELECT `pos`,`id` FROM `houses` WHERE `pid` = '".$player->playerid."' ORDER BY `id` DESC LIMIT 8";
252 252
                             $result_of_query = $db_link->query($sql);
253 253
                             if ($result_of_query->num_rows > 0) {
254 254
                                 ?>
@@ -263,15 +263,15 @@  discard block
 block discarded – undo
263 263
                                     <?php
264 264
                                     while ($row = mysqli_fetch_assoc($result_of_query)) {
265 265
                                         echo "<tr>";
266
-                                        echo "<td>" . $row["pos"] . "</td>";
267
-                                        echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editHouse/" . $row["id"] . "'>";
266
+                                        echo "<td>".$row["pos"]."</td>";
267
+                                        echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url']."editHouse/".$row["id"]."'>";
268 268
                                         echo "<i class='fa fa-pencil'></i></a></td>";
269 269
                                         echo "</tr>";
270 270
                                     };
271 271
                                     ?>
272 272
                                     </tbody>
273 273
                                 </table>
274
-                                <?php echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="' . $settings['url'] . 'houses/' . $player->playerid . '"> More</a>';
274
+                                <?php echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="'.$settings['url'].'houses/'.$player->playerid.'"> More</a>';
275 275
                             } else echo $lang['noHouse'] ?>
276 276
                         </div>
277 277
                     </div>
@@ -279,33 +279,33 @@  discard block
 block discarded – undo
279 279
                     <div class="tab-pane fade" id="veh">
280 280
                         <div class="table-responsive">
281 281
                         <?php
282
-                            $sql = "SELECT `classname`,`type`,`id`,`plate` FROM `vehicles` WHERE `pid` = '" . $player->playerid . "' ORDER BY `id` DESC LIMIT 8";
282
+                            $sql = "SELECT `classname`,`type`,`id`,`plate` FROM `vehicles` WHERE `pid` = '".$player->playerid."' ORDER BY `id` DESC LIMIT 8";
283 283
                             }
284 284
                             $result_of_query = $db_link->query($sql);
285 285
                             if ($result_of_query->num_rows > 0) {
286 286
                                 $veh = $result_of_query->fetch_object();
287 287
                                 echo '<table class="table table-bordered table-hover table-striped">';
288 288
                                 echo '<thead><tr>';
289
-                                echo '<th>' . $lang['class'] . '</th>';
290
-                                echo '<th>' . $lang['type'] . '</th>';
291
-                                echo '<th>' . $lang['plate'] . '</th>';
289
+                                echo '<th>'.$lang['class'].'</th>';
290
+                                echo '<th>'.$lang['type'].'</th>';
291
+                                echo '<th>'.$lang['plate'].'</th>';
292 292
                                 if ($_SESSION['permissions']['edit']['vehicles']) {
293
-                                    echo "<th>" . $lang['edit'] . "</th>";
293
+                                    echo "<th>".$lang['edit']."</th>";
294 294
                                 }
295 295
                                 echo '</tr></thead><tbody';
296 296
                                 echo '<tr>';
297
-                                echo '<td>' . carName($veh->classname) . '</td>';
298
-                                echo '<td>' . carType($veh->type, $lang) . '</td>';
299
-                                echo '<td>' . $veh->plate . '</td>';
297
+                                echo '<td>'.carName($veh->classname).'</td>';
298
+                                echo '<td>'.carType($veh->type, $lang).'</td>';
299
+                                echo '<td>'.$veh->plate.'</td>';
300 300
 
301 301
                                 if ($_SESSION['permissions']['edit']['vehicles']) {
302
-                                    echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editVeh.php?ID=" . $veh->id . "'>";
302
+                                    echo "<td><a class='btn btn-primary btn-xs' href='".$settings['url']."editVeh.php?ID=".$veh->id."'>";
303 303
                                     echo "<i class='fa fa-pencil'></i></a></td>";
304 304
                                 }
305 305
 
306 306
                                 echo '</tr>';
307 307
                                 echo '</tbody></table>';
308
-                                echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="' . $settings['url'] . 'vehicles/' . $player->playerid . '"> More</a>';
308
+                                echo '<a class="fa fa-caret-right fa-2x" style="float: right; padding-right:15px;" href="'.$settings['url'].'vehicles/'.$player->playerid.'"> More</a>';
309 309
 
310 310
                             } else {
311 311
                                 echo $lang['noVeh'];
@@ -323,6 +323,6 @@  discard block
 block discarded – undo
323 323
     if ($settings['url'] == "/") {
324 324
         include("views/steam/errors/noData.php");
325 325
     } else {
326
-        include(realpath($settings['url']) . "views/steam/errors/noData.php");
326
+        include(realpath($settings['url'])."views/steam/errors/noData.php");
327 327
     }
328 328
 } ?>
329 329
\ No newline at end of file
Please login to merge, or discard this patch.
views/core/servers.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 
19 19
     if ($result_of_query->num_rows >= 1) {
20 20
         while ($row = mysqli_fetch_assoc($result_of_query)) {
21
-            if ($row['type'] == 'life'){
21
+            if ($row['type'] == 'life') {
22 22
 ?>
23 23
 						<li class="list-primary">
24 24
 							<i class=" fa fa-ellipsis-v"></i>
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 								</div>
31 31
 							</div>
32 32
 						</li>
33
-					<?php }elseif ($row['type'] == 'waste') { ?>
33
+					<?php } elseif ($row['type'] == 'waste') { ?>
34 34
 						<li class="list-danger">
35 35
 							<i class=" fa fa-ellipsis-v"></i>
36 36
 							<div class="task-title">
Please login to merge, or discard this patch.
views/core/dashboard.php 3 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -18,23 +18,23 @@  discard block
 block discarded – undo
18 18
 			  <div class="task-content">
19 19
 				  <ul id="sortable" class="task-list ui-sortable">
20 20
 			<?php
21
-			    $sql = "SELECT `sid`,`dbid`,`type`,`name` FROM `servers`;";
22
-			    $result_of_query = $db_connection->query($sql);
21
+                $sql = "SELECT `sid`,`dbid`,`type`,`name` FROM `servers`;";
22
+                $result_of_query = $db_connection->query($sql);
23 23
 			
24
-			    if ($result_of_query->num_rows >= 1) {
25
-			        while ($row = mysqli_fetch_assoc($result_of_query)) {
26
-			?>
24
+                if ($result_of_query->num_rows >= 1) {
25
+                    while ($row = mysqli_fetch_assoc($result_of_query)) {
26
+            ?>
27 27
 					<li class="list-primary">
28 28
 						<i class=" fa fa-ellipsis-v"></i>
29 29
 						<div class="task-title">
30 30
 							<span class="task-title-sp"><?php echo $row['name']; ?></span>
31 31
 							<?php
32
-							if ($row['type'] == 'life'){
33
-								echo '<span class="badge bg-theme">Life</span>';
34
-							} elseif ($row['type'] == 'waste') {
35
-								echo '<span class="badge bg-important">Wasteland</span>';
36
-							}
37
-							?>
32
+                            if ($row['type'] == 'life'){
33
+                                echo '<span class="badge bg-theme">Life</span>';
34
+                            } elseif ($row['type'] == 'waste') {
35
+                                echo '<span class="badge bg-important">Wasteland</span>';
36
+                            }
37
+                            ?>
38 38
 							<div style="float:right; padding-right: 15px;">
39 39
 								<form method="post" action="<?php echo $settings['url'] ?>dashboard">
40 40
 									<input type="hidden" name="type" value="<?php echo $row['type']; ?>">
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 						</div>
46 46
 					</li>
47 47
 					<?php
48
-			        }
49
-			        echo '</select>';
50
-			    }
51
-			?>
48
+                    }
49
+                    echo '</select>';
50
+                }
51
+            ?>
52 52
 				  </ul>
53 53
 			  </div>
54 54
 		  </div>
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,10 @@
 block discarded – undo
5 5
         </h1>
6 6
     </div>
7 7
 </div>
8
-<?php if (isset($_SESSION['update'])) echo '<div class="alert alert-info" role="alert">' . $land['updateMessage'] . ' (' . $_SESSION['message']->version . ')</div>'; ?>
8
+<?php if (isset($_SESSION['update'])) {
9
+    echo '<div class="alert alert-info" role="alert">' . $land['updateMessage'] . ' (' . $_SESSION['message']->version . ')</div>';
10
+}
11
+?>
9 12
 
10 13
 <div class="row mt mb">
11 14
   <div class="col-md-12">
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
         </h1>
6 6
     </div>
7 7
 </div>
8
-<?php if (isset($_SESSION['update'])) echo '<div class="alert alert-info" role="alert">' . $land['updateMessage'] . ' (' . $_SESSION['message']->version . ')</div>'; ?>
8
+<?php if (isset($_SESSION['update'])) echo '<div class="alert alert-info" role="alert">'.$land['updateMessage'].' ('.$_SESSION['message']->version.')</div>'; ?>
9 9
 
10 10
 <div class="row mt mb">
11 11
   <div class="col-md-12">
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 						<div class="task-title">
30 30
 							<span class="task-title-sp"><?php echo $row['name']; ?></span>
31 31
 							<?php
32
-							if ($row['type'] == 'life'){
32
+							if ($row['type'] == 'life') {
33 33
 								echo '<span class="badge bg-theme">Life</span>';
34 34
 							} elseif ($row['type'] == 'waste') {
35 35
 								echo '<span class="badge bg-important">Wasteland</span>';
Please login to merge, or discard this patch.
views/core/2factor.php 2 patches
Braces   +28 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,7 +32,9 @@  discard block
 block discarded – undo
32 32
     setcookie('token', '', time() - 3600, '/');
33 33
     message($lang['2factorDeviceRevoke']);
34 34
 } elseif (isset($_GET['revokeToken']) && $_SESSION['2factor'] == 2) {
35
-    if (isset($_COOKIE['token'])) unset($_COOKIE['token']);
35
+    if (isset($_COOKIE['token'])) {
36
+        unset($_COOKIE['token']);
37
+    }
36 38
     $sql = "UPDATE `users` SET `token`='NULL' WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
37 39
     $db_connection->query($sql);
38 40
     message($lang['2factorTokenRevoke']);
@@ -42,8 +44,10 @@  discard block
 block discarded – undo
42 44
     $db_connection->query($sql);
43 45
     $_SESSION['2factor'] = 2;
44 46
     message($lang['2factor1']);
45
-    } else message($lang['2factor2']);
46
-} ?>
47
+    } else {
48
+        message($lang['2factor2']);
49
+    }
50
+    } ?>
47 51
 <div class="row">
48 52
     <div class="col-lg-8">
49 53
         <h1 class="page-header">
@@ -53,7 +57,9 @@  discard block
 block discarded – undo
53 57
 </div>
54 58
 <?php
55 59
 if ($_SESSION['2factor'] == 1 || $_SESSION['2factor'] == 5 || $_SESSION['2factor'] == 3) {
56
-    if ($_SESSION['2factor'] == 3) message($lang['2factorError2']);
60
+    if ($_SESSION['2factor'] == 3) {
61
+        message($lang['2factorError2']);
62
+    }
57 63
     echo '<form method="post" action="' . $currentPage . '" class="form-inline">
58 64
   <label for="code">'.$lang['2factorSetup3'] . '<div class="form-group"></label><input class="form-control" id="code" type="text" name="code"></div>
59 65
   <button type="submit" class="btn btn-default">Verify</button></form>';
@@ -61,12 +67,21 @@  discard block
 block discarded – undo
61 67
     echo $lang['2factor1'] . '<br><br><a href="?backup" class="btn btn-default">';
62 68
     $sql = "SELECT `backup`,`token` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
63 69
     $twoFactor = $db_connection->query($sql)->fetch_object();
64
-    if (isset($twoFactor->backup)) echo $lang['new'] . ' ' . $lang['2factor3']; else echo $lang['2factor3'];
70
+    if (isset($twoFactor->backup)) {
71
+        echo $lang['new'] . ' ' . $lang['2factor3'];
72
+    } else {
73
+        echo $lang['2factor3'];
74
+    }
65 75
     echo '</a>';
66 76
     echo '<a href="?revoke" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factor4'] . '</a>';
67
-    if (isset($twoFactor->token)) echo '<a href="?revokeToken" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factorTokenRevoke'] . '</a>';
68
-    if (isset($_COOKIE['token'])) echo '<a href="?revokeDevice" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factorRevokeRememberDevice'];
69
-    else echo '<a href="?remember" style="margin-left: 5px;" class="btn btn-primary">' . $lang['2factorRememberDevice'];
77
+    if (isset($twoFactor->token)) {
78
+        echo '<a href="?revokeToken" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factorTokenRevoke'] . '</a>';
79
+    }
80
+    if (isset($_COOKIE['token'])) {
81
+        echo '<a href="?revokeDevice" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factorRevokeRememberDevice'];
82
+    } else {
83
+        echo '<a href="?remember" style="margin-left: 5px;" class="btn btn-primary">' . $lang['2factorRememberDevice'];
84
+    }
70 85
     echo '</a>';
71 86
 
72 87
 } elseif ($_SESSION['2factor'] == 0 || $_SESSION['2factor'] == 5) {
@@ -76,8 +91,11 @@  discard block
 block discarded – undo
76 91
         echo "<i class='fa fa-info-circle'></i> " . $lang['2factorForce'] . "</div></div>";
77 92
     }
78 93
     $secret = $gauth->createSecret();
79
-    if (isset($settings['communityName'])) $name = urlencode(str_replace(' ', '', $settings['communityName']) . "CyberWorks");
80
-    else $name = 'CyberWorks';
94
+    if (isset($settings['communityName'])) {
95
+        $name = urlencode(str_replace(' ', '', $settings['communityName']) . "CyberWorks");
96
+    } else {
97
+        $name = 'CyberWorks';
98
+    }
81 99
     echo '<div class="col-md-6">' . $lang['2factorSetup1'] . '<br>' . $lang['2factorSetup2'] . ' <b>' . $secret . '</b><br><form method="post" action="2factor" class="form-inline">
82 100
   <label for="testCode">'.$lang['2factorSetup3'] . '<div class="form-group"></label><input style="margin-left: 5px;" class="form-control" id="testCode" type="text" name="testCode"></div>
83 101
   <input type="hidden" id="secret" name="secret" value="'.$secret . '"><button type="submit" class="btn btn-default">Verify</button>
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if (isset($_GET['backup']) && $_SESSION['2factor'] == 2) {
3 3
     $backup = $gauth->createSecret(8);
4
-    $sql = "UPDATE `users` SET `backup`='" . $backup . "' WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
4
+    $sql = "UPDATE `users` SET `backup`='".$backup."' WHERE `user_id` = '".$_SESSION['user_id']."';";
5 5
     $db_connection->query($sql);
6
-    message($lang['2factorBackup1'] . ' <b>' . $backup . '</b> ' . $lang['2factorBackup2']);
6
+    message($lang['2factorBackup1'].' <b>'.$backup.'</b> '.$lang['2factorBackup2']);
7 7
 } elseif (isset($_GET['revokeBackup']) && $_SESSION['2factor'] == 2) {
8
-    $sql = "UPDATE `users` SET `backup`=NULL WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
8
+    $sql = "UPDATE `users` SET `backup`=NULL WHERE `user_id` = '".$_SESSION['user_id']."';";
9 9
     $db_connection->query($sql);
10 10
     message($lang['2factorBackupRevoke']);
11 11
 } elseif (isset($_GET['revoke']) && $_SESSION['2factor'] == 2) {
12
-    $sql = "UPDATE `users` SET `backup`=NULL,`twoFactor`=NULL,`token`=NULL WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
12
+    $sql = "UPDATE `users` SET `backup`=NULL,`twoFactor`=NULL,`token`=NULL WHERE `user_id` = '".$_SESSION['user_id']."';";
13 13
     $db_connection->query($sql);
14 14
     unset($_COOKIE['token']);
15 15
     setcookie('token', '', time() - 3600, '/');
16 16
     $_SESSION['2factor'] = 0;
17 17
     message($lang['2factorRevoke']);
18 18
 } elseif (isset($_GET['remember']) && $_SESSION['2factor'] == 2 && !isset($_COOKIE['token'])) {
19
-    $sql = "SELECT `token` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
19
+    $sql = "SELECT `token` FROM `users` WHERE `user_id` = '".$_SESSION['user_id']."';";
20 20
     $token = $db_connection->query($sql)->fetch_object()->token;
21 21
     if (empty($token)) {
22 22
         $key = $gauth->createSecret(32);
23
-        $sql = "UPDATE `users` SET `token`='" . encrypt($key) . "' WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
23
+        $sql = "UPDATE `users` SET `token`='".encrypt($key)."' WHERE `user_id` = '".$_SESSION['user_id']."';";
24 24
         $db_connection->query($sql);
25 25
         setcookie('token', $key, time() + 5184000, "/");
26 26
     } else {
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
     message($lang['2factorDeviceRevoke']);
34 34
 } elseif (isset($_GET['revokeToken']) && $_SESSION['2factor'] == 2) {
35 35
     if (isset($_COOKIE['token'])) unset($_COOKIE['token']);
36
-    $sql = "UPDATE `users` SET `token`='NULL' WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
36
+    $sql = "UPDATE `users` SET `token`='NULL' WHERE `user_id` = '".$_SESSION['user_id']."';";
37 37
     $db_connection->query($sql);
38 38
     message($lang['2factorTokenRevoke']);
39 39
 } elseif (isset($_POST['testCode']) && isset($_POST['secret']) && $_SESSION['2factor'] == 0) {
40 40
     if ($gauth->verifyCode($_POST['secret'], $_POST['testCode'])) {
41
-    $sql = "UPDATE `users` SET `twoFactor`='" . $_POST['secret'] . "' WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
41
+    $sql = "UPDATE `users` SET `twoFactor`='".$_POST['secret']."' WHERE `user_id` = '".$_SESSION['user_id']."';";
42 42
     $db_connection->query($sql);
43 43
     $_SESSION['2factor'] = 2;
44 44
     message($lang['2factor1']);
@@ -54,32 +54,32 @@  discard block
 block discarded – undo
54 54
 <?php
55 55
 if ($_SESSION['2factor'] == 1 || $_SESSION['2factor'] == 5 || $_SESSION['2factor'] == 3) {
56 56
     if ($_SESSION['2factor'] == 3) message($lang['2factorError2']);
57
-    echo '<form method="post" action="' . $currentPage . '" class="form-inline">
58
-  <label for="code">'.$lang['2factorSetup3'] . '<div class="form-group"></label><input class="form-control" id="code" type="text" name="code"></div>
57
+    echo '<form method="post" action="'.$currentPage.'" class="form-inline">
58
+  <label for="code">'.$lang['2factorSetup3'].'<div class="form-group"></label><input class="form-control" id="code" type="text" name="code"></div>
59 59
   <button type="submit" class="btn btn-default">Verify</button></form>';
60 60
 } elseif ($_SESSION['2factor'] == 2) {
61
-    echo $lang['2factor1'] . '<br><br><a href="?backup" class="btn btn-default">';
62
-    $sql = "SELECT `backup`,`token` FROM `users` WHERE `user_id` = '" . $_SESSION['user_id'] . "';";
61
+    echo $lang['2factor1'].'<br><br><a href="?backup" class="btn btn-default">';
62
+    $sql = "SELECT `backup`,`token` FROM `users` WHERE `user_id` = '".$_SESSION['user_id']."';";
63 63
     $twoFactor = $db_connection->query($sql)->fetch_object();
64
-    if (isset($twoFactor->backup)) echo $lang['new'] . ' ' . $lang['2factor3']; else echo $lang['2factor3'];
64
+    if (isset($twoFactor->backup)) echo $lang['new'].' '.$lang['2factor3']; else echo $lang['2factor3'];
65 65
     echo '</a>';
66
-    echo '<a href="?revoke" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factor4'] . '</a>';
67
-    if (isset($twoFactor->token)) echo '<a href="?revokeToken" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factorTokenRevoke'] . '</a>';
68
-    if (isset($_COOKIE['token'])) echo '<a href="?revokeDevice" style="margin-left: 5px;" class="btn btn-danger">' . $lang['2factorRevokeRememberDevice'];
69
-    else echo '<a href="?remember" style="margin-left: 5px;" class="btn btn-primary">' . $lang['2factorRememberDevice'];
66
+    echo '<a href="?revoke" style="margin-left: 5px;" class="btn btn-danger">'.$lang['2factor4'].'</a>';
67
+    if (isset($twoFactor->token)) echo '<a href="?revokeToken" style="margin-left: 5px;" class="btn btn-danger">'.$lang['2factorTokenRevoke'].'</a>';
68
+    if (isset($_COOKIE['token'])) echo '<a href="?revokeDevice" style="margin-left: 5px;" class="btn btn-danger">'.$lang['2factorRevokeRememberDevice'];
69
+    else echo '<a href="?remember" style="margin-left: 5px;" class="btn btn-primary">'.$lang['2factorRememberDevice'];
70 70
     echo '</a>';
71 71
 
72 72
 } elseif ($_SESSION['2factor'] == 0 || $_SESSION['2factor'] == 5) {
73 73
     if ($_SESSION['2factor'] == 5) {
74 74
         echo "<div class='alert alert-danger alert-dismissable'>";
75 75
         echo "<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>";
76
-        echo "<i class='fa fa-info-circle'></i> " . $lang['2factorForce'] . "</div></div>";
76
+        echo "<i class='fa fa-info-circle'></i> ".$lang['2factorForce']."</div></div>";
77 77
     }
78 78
     $secret = $gauth->createSecret();
79
-    if (isset($settings['communityName'])) $name = urlencode(str_replace(' ', '', $settings['communityName']) . "CyberWorks");
79
+    if (isset($settings['communityName'])) $name = urlencode(str_replace(' ', '', $settings['communityName'])."CyberWorks");
80 80
     else $name = 'CyberWorks';
81
-    echo '<div class="col-md-6">' . $lang['2factorSetup1'] . '<br>' . $lang['2factorSetup2'] . ' <b>' . $secret . '</b><br><form method="post" action="2factor" class="form-inline">
82
-  <label for="testCode">'.$lang['2factorSetup3'] . '<div class="form-group"></label><input style="margin-left: 5px;" class="form-control" id="testCode" type="text" name="testCode"></div>
83
-  <input type="hidden" id="secret" name="secret" value="'.$secret . '"><button type="submit" class="btn btn-default">Verify</button>
84
-  </form></div><div class="col-md-6"><img src="'.$gauth->getQRCodeGoogleUrl($name, $secret) . '"></div>';
81
+    echo '<div class="col-md-6">'.$lang['2factorSetup1'].'<br>'.$lang['2factorSetup2'].' <b>'.$secret.'</b><br><form method="post" action="2factor" class="form-inline">
82
+  <label for="testCode">'.$lang['2factorSetup3'].'<div class="form-group"></label><input style="margin-left: 5px;" class="form-control" id="testCode" type="text" name="testCode"></div>
83
+  <input type="hidden" id="secret" name="secret" value="'.$secret.'"><button type="submit" class="btn btn-default">Verify</button>
84
+  </form></div><div class="col-md-6"><img src="'.$gauth->getQRCodeGoogleUrl($name, $secret).'"></div>';
85 85
 }
86 86
\ No newline at end of file
Please login to merge, or discard this patch.
views/core/editServer.php 2 patches
Braces   +13 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@  discard block
 block discarded – undo
6 6
     $sql = "DELETE FROM `servers` WHERE `dbid`='" . $id . "';";
7 7
     $result_of_query = $db_connection->query($sql);
8 8
 
9
-}
10
-elseif (isset($_POST['edit'])) {
9
+} elseif (isset($_POST['edit'])) {
11 10
     if (isset($_POST['sql_host'])) {
12 11
         if ($_SESSION['permissions']['super_admin']) {
13 12
             if (formtoken::validateToken($_POST)) {
@@ -32,8 +31,12 @@  discard block
 block discarded – undo
32 31
                     $sql = "UPDATE `servers` SET `name`= '" . $name . "',`type`= '" . $type . "',`use_sq`= '" . $usegsq . "' WHERE `dbid`='" . $id . "';";
33 32
                 }
34 33
                 $result_of_query = $db_connection->query($sql);
35
-            } else message($lang['expired']);
36
-        } else logAction($_SESSION['user_name'], $lang['failedUpdate'] . ' ' . $lang['gsq'], 3);
34
+            } else {
35
+                message($lang['expired']);
36
+            }
37
+        } else {
38
+            logAction($_SESSION['user_name'], $lang['failedUpdate'] . ' ' . $lang['gsq'], 3);
39
+        }
37 40
     }
38 41
 }
39 42
     $sql = "SELECT * FROM `servers` WHERE `dbid`='" . $id . "';";
@@ -116,7 +119,12 @@  discard block
 block discarded – undo
116 119
 
117 120
 <script>
118 121
 $(document).ready(function() {
119
-if (<?php if ($server->usegsq == 1) echo 'false'; else echo 'true'; ?>) {
122
+if (<?php if ($server->usegsq == 1) {
123
+    echo 'false';
124
+} else {
125
+    echo 'true';
126
+}
127
+?>) {
120 128
     $("#sq_details").hide();
121 129
 };
122 130
 $("#usegsq").change(function () {
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $id = clean($id, "int");
3 3
 if (isset($_POST['del']) && $id != 1) {
4
-    $sql = "DELETE FROM `db` WHERE `dbid`='" . $id . "';";
4
+    $sql = "DELETE FROM `db` WHERE `dbid`='".$id."';";
5 5
     $result_of_query = $db_connection->query($sql);
6
-    $sql = "DELETE FROM `servers` WHERE `dbid`='" . $id . "';";
6
+    $sql = "DELETE FROM `servers` WHERE `dbid`='".$id."';";
7 7
     $result_of_query = $db_connection->query($sql);
8 8
 
9 9
 }
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
                 $pass = encrypt(clean($_POST['sql_pass'], "string"));
17 17
                 $name = encrypt(clean($_POST['sql_name'], "string"));
18 18
 
19
-                $sql = "UPDATE `db` SET `sql_host` = '" . $host . "',`sql_name` = '" . $name . "',`sql_pass` = '" . $pass . "',`sql_user` = '" . $user . "' WHERE `dbid`='" . $id . "';";
19
+                $sql = "UPDATE `db` SET `sql_host` = '".$host."',`sql_name` = '".$name."',`sql_pass` = '".$pass."',`sql_user` = '".$user."' WHERE `dbid`='".$id."';";
20 20
                 $result_of_query = $db_connection->query($sql);
21 21
 
22 22
                 $type = clean($_POST['type'], "string");
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
                     $sq_ip = encrypt(clean($_POST['sq_ip'], "string"));
28 28
                     $sq_port = encrypt(clean($_POST['sq_port'], "string"));
29 29
                     $rcon_pass = encrypt(clean($_POST['rcon_pass'], "string"));
30
-                    $sql = "UPDATE `servers` SET `name`= '" . $name . "',`type`= '" . $type . "',`use_sq`= '" . $usegsq . "',`sq_port`= '" . $sq_port . "',`sq_ip`= '" . $sq_ip . "',`rcon_pass`= '" . $rcon_pass . "' WHERE `dbid`='" . $id . "';";
30
+                    $sql = "UPDATE `servers` SET `name`= '".$name."',`type`= '".$type."',`use_sq`= '".$usegsq."',`sq_port`= '".$sq_port."',`sq_ip`= '".$sq_ip."',`rcon_pass`= '".$rcon_pass."' WHERE `dbid`='".$id."';";
31 31
                 } else {
32
-                    $sql = "UPDATE `servers` SET `name`= '" . $name . "',`type`= '" . $type . "',`use_sq`= '" . $usegsq . "' WHERE `dbid`='" . $id . "';";
32
+                    $sql = "UPDATE `servers` SET `name`= '".$name."',`type`= '".$type."',`use_sq`= '".$usegsq."' WHERE `dbid`='".$id."';";
33 33
                 }
34 34
                 $result_of_query = $db_connection->query($sql);
35 35
             } else message($lang['expired']);
36
-        } else logAction($_SESSION['user_name'], $lang['failedUpdate'] . ' ' . $lang['gsq'], 3);
36
+        } else logAction($_SESSION['user_name'], $lang['failedUpdate'].' '.$lang['gsq'], 3);
37 37
     }
38 38
 }
39
-    $sql = "SELECT * FROM `servers` WHERE `dbid`='" . $id . "';";
39
+    $sql = "SELECT * FROM `servers` WHERE `dbid`='".$id."';";
40 40
     $result_of_query = $db_connection->query($sql);
41 41
 
42 42
     if ($result_of_query->num_rows == 1) {
43 43
         $server = $result_of_query->fetch_object();
44
-        $sql = "SELECT `sql_host`,`dbid`,`sql_name`,`sql_pass`,`sql_user` FROM `db` WHERE `dbid`='" . $id . "';";
44
+        $sql = "SELECT `sql_host`,`dbid`,`sql_name`,`sql_pass`,`sql_user` FROM `db` WHERE `dbid`='".$id."';";
45 45
         $result = $db_connection->query($sql);
46 46
         if ($result->num_rows == 1) {
47 47
             $db = $result->fetch_object();
@@ -59,45 +59,45 @@  discard block
 block discarded – undo
59 59
     <form method='post' action='<?php echo $settings['url'] ?>editServer/<?php echo $id ?>' id='updateServer' name='updateServer'>
60 60
         <div class="col-md-6">
61 61
             <?php
62
-            echo "<h3>" . $lang['database'] . "</h3>";
63
-            echo "<div class='form-group'><label for='sql_host'>" . $lang['database'] . " " . $lang['host'] . ": </label><input class='form-control' id='sql_host' type='text' name='sql_host' value='" . decrypt($db->sql_host) . "'></div>";
64
-            echo "<div class='form-group'><label for='sql_user'>" . $lang['database'] . " " . $lang['user'] . ": </label><input class='form-control' id='sql_user' type='text' name='sql_user' value='" . decrypt($db->sql_user) . "'></div>";
65
-            echo "<div class='form-group'><div class='input-group'><label for='sql_pass'>" . $lang['database'] . " " . $lang['password'] . ": </label><input class='form-control pwd' id='sql_pass' type='password' name='sql_pass' value='" . decrypt($db->sql_pass) . "'>";
62
+            echo "<h3>".$lang['database']."</h3>";
63
+            echo "<div class='form-group'><label for='sql_host'>".$lang['database']." ".$lang['host'].": </label><input class='form-control' id='sql_host' type='text' name='sql_host' value='".decrypt($db->sql_host)."'></div>";
64
+            echo "<div class='form-group'><label for='sql_user'>".$lang['database']." ".$lang['user'].": </label><input class='form-control' id='sql_user' type='text' name='sql_user' value='".decrypt($db->sql_user)."'></div>";
65
+            echo "<div class='form-group'><div class='input-group'><label for='sql_pass'>".$lang['database']." ".$lang['password'].": </label><input class='form-control pwd' id='sql_pass' type='password' name='sql_pass' value='".decrypt($db->sql_pass)."'>";
66 66
             echo "<span class='input-group-btn'><button style='margin-top: 23px; background-color: #eee;' ";
67 67
             echo "class='btn btn-default reveal' type='button'><i class='fa fa-eye-slash'></i></button></span></div></div>";
68
-            echo "<div class='form-group'><label for='sql_name'>" . $lang['database'] . " " . $lang['name'] . ": </label><input class='form-control' id='sql_name' type='text' name='sql_name' value='" . decrypt($db->sql_name) . "'></div>";
69
-            echo "<div class='form-group'><label for='name'>" . $lang['name'] . ": </label><input class='form-control' id='name' type='text' name='name' value='" . $server->name . "'></div>";
68
+            echo "<div class='form-group'><label for='sql_name'>".$lang['database']." ".$lang['name'].": </label><input class='form-control' id='sql_name' type='text' name='sql_name' value='".decrypt($db->sql_name)."'></div>";
69
+            echo "<div class='form-group'><label for='name'>".$lang['name'].": </label><input class='form-control' id='name' type='text' name='name' value='".$server->name."'></div>";
70 70
             ?>
71
-            <div class='form-group'><label for="type"><?php echo $lang['database'] . " " . $lang['type'] ?>: </label>
71
+            <div class='form-group'><label for="type"><?php echo $lang['database']." ".$lang['type'] ?>: </label>
72 72
                 <select name="type" id="type" class="form-control">
73 73
                     <option value="life"
74
-                    <?php echo select('life', $server->type) . '>' . $lang['life'] ?></option>
74
+                    <?php echo select('life', $server->type).'>'.$lang['life'] ?></option>
75 75
                     <option value="waste"
76
-                    <?php echo select('waste', $server->type) . '>' . $lang['waste'] ?></option>
76
+                    <?php echo select('waste', $server->type).'>'.$lang['waste'] ?></option>
77 77
                 </select>
78 78
             </div>
79 79
         </div>
80 80
         <div class="col-md-6" style="float:right;">
81 81
                 <h3><?php echo $lang['gsq'] ?></h3>
82
-                <div class='form-group'><label for="usegsq"><?php echo $lang['use'] . " " . $lang['gsq'] ?>: </label>
82
+                <div class='form-group'><label for="usegsq"><?php echo $lang['use']." ".$lang['gsq'] ?>: </label>
83 83
                 <select name="usegsq" id="usegsq" class="form-control">
84 84
                     <option value="1"
85
-                    <?php echo select('1', $server->use_sq) . '>' . $lang['yes'] ?></option>
85
+                    <?php echo select('1', $server->use_sq).'>'.$lang['yes'] ?></option>
86 86
                     <option value="0"
87
-                    <?php echo select('0', $server->use_sq) . '>' . $lang['no'] ?></option>
87
+                    <?php echo select('0', $server->use_sq).'>'.$lang['no'] ?></option>
88 88
                 </select>
89 89
             </div> <?php
90
-                echo "<div id='sq_details'><div class='form-group'><label for='sq_ip'>" . $lang['gsq'] . " " . $lang['gsqa'] . ": </label><input class='form-control' id='sq_ip' type='text' name='sq_ip' value='";
90
+                echo "<div id='sq_details'><div class='form-group'><label for='sq_ip'>".$lang['gsq']." ".$lang['gsqa'].": </label><input class='form-control' id='sq_ip' type='text' name='sq_ip' value='";
91 91
                 if (isset($server->sq_ip)) {
92 92
                     echo decrypt($server->sq_ip);
93 93
                 }
94 94
                 echo "'></div>";
95
-                echo "<div class='form-group'><label for='sq_port'>" . $lang['gsq'] . " " . $lang['gsqp'] . ": </label><input class='form-control' id='sq_port' type='text' name='sq_port' value='";
95
+                echo "<div class='form-group'><label for='sq_port'>".$lang['gsq']." ".$lang['gsqp'].": </label><input class='form-control' id='sq_port' type='text' name='sq_port' value='";
96 96
                 if (isset($server->sq_port)) {
97 97
                     echo decrypt($server->sq_port);
98 98
                 }
99 99
                 echo "'></div>";
100
-                echo "<div class='form-group'><div class='input-group'><label for='rcon_pass'>" . $lang['gsq'] . " " . $lang['gsrc'] . ": </label><input class='form-control pwd' id='rcon_pass' type='password' name='rcon_pass' value='";
100
+                echo "<div class='form-group'><div class='input-group'><label for='rcon_pass'>".$lang['gsq']." ".$lang['gsrc'].": </label><input class='form-control pwd' id='rcon_pass' type='password' name='rcon_pass' value='";
101 101
                 if (isset($server->rcon_pass)) {
102 102
                     echo decrypt($server->rcon_pass);
103 103
                 }
Please login to merge, or discard this patch.
views/core/pluginstore.php 2 patches
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -117,24 +117,32 @@
 block discarded – undo
117 117
         }
118 118
 
119 119
         $dropIn = array_diff($files, array_column($plugins, 'dirname'));
120
-        if ($dropIn > 0) echo "<h2 style='margin-top: 0;'>" . $lang['dropIn'] . "</h2>";
120
+        if ($dropIn > 0) {
121
+            echo "<h2 style='margin-top: 0;'>" . $lang['dropIn'] . "</h2>";
122
+        }
121 123
         
122 124
         foreach ($dropIn as &$plugin) {
123 125
             $key = array_search($plugin, array_column($installed, 'dirname'));
124 126
             echo '<div class="col-sm-6 col-md-4"><div class="thumbnail"><div class="caption">';
125 127
             echo '<h3>' . $installed[$key]['name'] . ' - ' . $installed[$key]['version'];
126 128
 
127
-            if (in_array($plugin, $settings['plugins']))
128
-            echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span></small>';
129
-            else echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>';
129
+            if (in_array($plugin, $settings['plugins'])) {
130
+                        echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span></small>';
131
+            } else {
132
+                echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>';
133
+            }
130 134
 
131 135
             echo '</h3><p><strong>' . $installed[$key]['author'] . '</strong> - ' . $installed[$key]['description'] . '</p>';
132 136
 
133
-            if (in_array($plugin, $settings['plugins']))
134
-            echo '<p><a href="?deactivate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>';
135
-            else echo '<p><a href="?activate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>';
137
+            if (in_array($plugin, $settings['plugins'])) {
138
+                        echo '<p><a href="?deactivate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>';
139
+            } else {
140
+                echo '<p><a href="?activate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>';
141
+            }
136 142
 
137
-            if (isset($installed[$key]['authurl'])) echo '<a style="margin-left: 5px;" href="' . $installed[$key]['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>';
143
+            if (isset($installed[$key]['authurl'])) {
144
+                echo '<a style="margin-left: 5px;" href="' . $installed[$key]['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>';
145
+            }
138 146
             echo '<a style="float: right;" href="?delete=' . $plugin . '" class="btn btn-danger" role="button">' . $lang['delete'] . '</a>';
139 147
             echo '</p></div></div></div>';
140 148
         }
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if (file_exists("plugins")) {
3
-    $plugins = json_decode(file_get_contents('http://cyberbyte.org.uk/hooks/cyberworks/plugins.php?id=' . $settings['id']), true);
3
+    $plugins = json_decode(file_get_contents('http://cyberbyte.org.uk/hooks/cyberworks/plugins.php?id='.$settings['id']), true);
4 4
 
5 5
     function downloadFile($url) {
6
-        $newfname = realpath('downloading') . '/plugin.zip';
6
+        $newfname = realpath('downloading').'/plugin.zip';
7 7
         $folder = realpath('plugins');
8 8
         $file = fopen($url, "rb");
9 9
         if ($file) {
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
             $objects = scandir($dir);
38 38
             foreach ($objects as $object) {
39 39
                 if ($object != "." && $object != "..") {
40
-                    if (filetype($dir . "/" . $object) == "dir") {
41
-                        rrmdir($dir . "/" . $object);
40
+                    if (filetype($dir."/".$object) == "dir") {
41
+                        rrmdir($dir."/".$object);
42 42
                     } else {
43
-                        unlink($dir . "/" . $object);
43
+                        unlink($dir."/".$object);
44 44
                     }
45 45
                 }
46 46
             }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     if (isset($_GET['activate'])) {
59 59
         if (!in_array($_GET['activate'], $settings['plugins'])) {
60 60
             array_push($settings['plugins'], $_GET['activate']);
61
-            $json = json_decode(file_get_contents('plugins/' . $_GET['activate'] . '/plugin.json'), true);
61
+            $json = json_decode(file_get_contents('plugins/'.$_GET['activate'].'/plugin.json'), true);
62 62
             if (isset($json['language']) && isset($json['short'])) {
63 63
                 $lang = array($json['language'], $json['short']);
64 64
                 array_push($settings['installedLanguage'], $lang);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
                 }
71 71
             }
72
-            file_put_contents('config/settings.php', '<?php return ' . var_export($settings, true) . ';');
72
+            file_put_contents('config/settings.php', '<?php return '.var_export($settings, true).';');
73 73
             message($lang['pluginActivated']);
74 74
         } message($lang['activeAlready']);
75 75
     }
@@ -82,17 +82,17 @@  discard block
 block discarded – undo
82 82
                 $settings['plugins'] = array_diff($settings['plugins'], array($_GET['deactivate']));
83 83
             }
84 84
             
85
-            $json = json_decode(file_get_contents('plugins/' . $_GET['deactivate'] . '/plugin.json'), true);
85
+            $json = json_decode(file_get_contents('plugins/'.$_GET['deactivate'].'/plugin.json'), true);
86 86
             if (isset($json['language']) && isset($json['short'])) {
87 87
                 $key = array_search($_GET['deactivate'], array_column($settings['installedLanguage'], 0));
88 88
                 unset($settings['installedLanguage'][$key]);
89 89
             }
90
-            file_put_contents('config/settings.php', '<?php return ' . var_export($settings, true) . ';');
90
+            file_put_contents('config/settings.php', '<?php return '.var_export($settings, true).';');
91 91
         } message($lang['notActive']);
92 92
     }
93 93
 
94 94
     if (isset($_GET['delete'])) {
95
-        rrmdir(realpath('plugins') . '/' . $_GET['delete']);
95
+        rrmdir(realpath('plugins').'/'.$_GET['delete']);
96 96
     }
97 97
     ?>
98 98
 
@@ -112,91 +112,91 @@  discard block
 block discarded – undo
112 112
         unset($files[1]);
113 113
 
114 114
         foreach ($files as &$file) {
115
-            $path = 'plugins/' . $file . '/plugin.json';
115
+            $path = 'plugins/'.$file.'/plugin.json';
116 116
             $installed[] = json_decode(file_get_contents($path), true);
117 117
         }
118 118
 
119 119
         $dropIn = array_diff($files, array_column($plugins, 'dirname'));
120
-        if ($dropIn > 0) echo "<h2 style='margin-top: 0;'>" . $lang['dropIn'] . "</h2>";
120
+        if ($dropIn > 0) echo "<h2 style='margin-top: 0;'>".$lang['dropIn']."</h2>";
121 121
         
122 122
         foreach ($dropIn as &$plugin) {
123 123
             $key = array_search($plugin, array_column($installed, 'dirname'));
124 124
             echo '<div class="col-sm-6 col-md-4"><div class="thumbnail"><div class="caption">';
125
-            echo '<h3>' . $installed[$key]['name'] . ' - ' . $installed[$key]['version'];
125
+            echo '<h3>'.$installed[$key]['name'].' - '.$installed[$key]['version'];
126 126
 
127 127
             if (in_array($plugin, $settings['plugins']))
128
-            echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span></small>';
129
-            else echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>';
128
+            echo '<small style="padding-left: 6px;"><span class="label label-success">'.$lang['active'].'</span></small>';
129
+            else echo '<small style="padding-left: 6px;"><span class="label label-default">'.$lang['installed'].'</span></small>';
130 130
 
131
-            echo '</h3><p><strong>' . $installed[$key]['author'] . '</strong> - ' . $installed[$key]['description'] . '</p>';
131
+            echo '</h3><p><strong>'.$installed[$key]['author'].'</strong> - '.$installed[$key]['description'].'</p>';
132 132
 
133 133
             if (in_array($plugin, $settings['plugins']))
134
-            echo '<p><a href="?deactivate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>';
135
-            else echo '<p><a href="?activate=' . $plugin . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>';
134
+            echo '<p><a href="?deactivate='.$plugin.'" class="btn btn-primary" role="button">'.$lang['deactivate'].'</a>';
135
+            else echo '<p><a href="?activate='.$plugin.'" class="btn btn-primary" role="button">'.$lang['activate'].'</a>';
136 136
 
137
-            if (isset($installed[$key]['authurl'])) echo '<a style="margin-left: 5px;" href="' . $installed[$key]['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>';
138
-            echo '<a style="float: right;" href="?delete=' . $plugin . '" class="btn btn-danger" role="button">' . $lang['delete'] . '</a>';
137
+            if (isset($installed[$key]['authurl'])) echo '<a style="margin-left: 5px;" href="'.$installed[$key]['authurl'].'" class="btn btn-default" role="button">'.$lang['visitSite'].'</a>';
138
+            echo '<a style="float: right;" href="?delete='.$plugin.'" class="btn btn-danger" role="button">'.$lang['delete'].'</a>';
139 139
             echo '</p></div></div></div>';
140 140
         }
141
-        echo "<div class='row'></div><h2>" . $lang['pluginstore'] . "</h2>";
141
+        echo "<div class='row'></div><h2>".$lang['pluginstore']."</h2>";
142 142
 
143 143
         foreach ($plugins as &$plugin) {
144 144
             echo '<div class="col-sm-6 col-md-4"><div class="thumbnail">';
145
-            echo '<img  src="' . $plugin['image'] . '" alt="' . $plugin['name'] . '">';
145
+            echo '<img  src="'.$plugin['image'].'" alt="'.$plugin['name'].'">';
146 146
             echo '<div class="caption">';
147
-            echo '<h3>' . $plugin['name'] . ' - ' . $plugin['version'];
147
+            echo '<h3>'.$plugin['name'].' - '.$plugin['version'];
148 148
 
149 149
             $key = array_search($plugin['dirname'], array_column($installed, 'dirname'));
150 150
 
151 151
             if ($key !== false) {
152 152
                 if (in_array($plugin['dirname'], $settings['plugins'])) {
153 153
                     if ($plugin['version'] > $installed[$key]['version']) {
154
-                        echo '<small style="padding-left: 6px;"><span class="label label-info">' . $lang['updateAvalible'] . '</span></small>';
154
+                        echo '<small style="padding-left: 6px;"><span class="label label-info">'.$lang['updateAvalible'].'</span></small>';
155 155
                     }
156 156
                     // Update avalible
157 157
                     else {
158
-                        echo '<small style="padding-left: 6px;"><span class="label label-success">' . $lang['active'] . '</span>';
158
+                        echo '<small style="padding-left: 6px;"><span class="label label-success">'.$lang['active'].'</span>';
159 159
                     }
160 160
                     // Active plugin
161 161
                 } elseif (in_array($plugin['dirname'], $files)) {
162
-                    echo '<small style="padding-left: 6px;"><span class="label label-default">' . $lang['installed'] . '</span></small>';
162
+                    echo '<small style="padding-left: 6px;"><span class="label label-default">'.$lang['installed'].'</span></small>';
163 163
                 }
164 164
                 // Installed not active
165 165
             }
166
-            echo '</h3><p><strong>' . $plugin['author'] . '</strong> - ' . $plugin['description'] . '</p>';
166
+            echo '</h3><p><strong>'.$plugin['author'].'</strong> - '.$plugin['description'].'</p>';
167 167
 
168 168
             if ($key !== false) {
169 169
                 if (in_array($plugin['dirname'], $settings['plugins'])) {
170 170
                     if ($plugin['version'] > $installed[$key]['version']) {
171
-                        echo '<div><a href="?install=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['update'] . '</a>';
171
+                        echo '<div><a href="?install='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['update'].'</a>';
172 172
                     }
173 173
                     // Update avalible
174 174
                     else {
175
-                        echo '<p><a href="?deactivate=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['deactivate'] . '</a>';
175
+                        echo '<p><a href="?deactivate='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['deactivate'].'</a>';
176 176
                     }
177 177
                     // Active plugin
178 178
                 } elseif (in_array($plugin['dirname'], $files)) {
179
-                    echo '<p><a href="?activate=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['activate'] . '</a>';
179
+                    echo '<p><a href="?activate='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['activate'].'</a>';
180 180
                 }
181 181
                 // Installed not active
182 182
             } else {
183
-                echo '<p><a href="?install=' . $plugin['dirname'] . '" class="btn btn-primary" role="button">' . $lang['install'] . '</a>';
183
+                echo '<p><a href="?install='.$plugin['dirname'].'" class="btn btn-primary" role="button">'.$lang['install'].'</a>';
184 184
             }
185 185
             // Not installed
186 186
 
187 187
             if (isset($plugin['authurl'])) {
188
-                echo '<a style="margin-left: 5px;" href="' . $plugin['authurl'] . '" class="btn btn-default" role="button">' . $lang['visitSite'] . '</a>';
188
+                echo '<a style="margin-left: 5px;" href="'.$plugin['authurl'].'" class="btn btn-default" role="button">'.$lang['visitSite'].'</a>';
189 189
             }
190 190
             if (in_array($plugin['dirname'], $files)) {
191
-                echo '<a style="float: right;" href="?delete=' . $plugin['dirname'] . '" class="btn btn-danger" role="button">' . $lang['delete'] . '</a></div>';
191
+                echo '<a style="float: right;" href="?delete='.$plugin['dirname'].'" class="btn btn-danger" role="button">'.$lang['delete'].'</a></div>';
192 192
             }
193 193
             echo '</div></div></div>';
194 194
         }
195 195
 
196 196
         echo '</div></div></form>';
197 197
     } else {
198
-        echo '<h2>' . $lang['notverified'] . '</h2>';
198
+        echo '<h2>'.$lang['notverified'].'</h2>';
199 199
     }
200 200
     } else {
201
-    echo '<h2>' . $lang['noPlugin'] . '</h2>';
201
+    echo '<h2>'.$lang['noPlugin'].'</h2>';
202 202
 }
Please login to merge, or discard this patch.