firstTime.php ➔ rand_sha1()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 1
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
if (!file_exists('config/settings.php')) {
3 View Code Duplication
    function rand_sha1($length)
0 ignored issues
show
Duplication introduced by
This function seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
4
    {
5
        $max = ceil($length / 40);
6
        $random = '';
7
        for ($i = 0; $i < $max; ++$i) {
8
            $random .= sha1(microtime(true).mt_rand(10000, 90000));
9
        }
10
11
        return substr($random, 0, $length);
12
    }
13
14
    function encrypt($text, $salt)
15
    {
16
        return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $salt, $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
17
    }
18
19
    function decrypt($text, $salt)
20
    {
21
        return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));
22
    }
23
24
    if (isset($_POST['user_name'])) {
25
        $last = str_replace(strrchr($_SERVER['REQUEST_URI'], '/'), '', $_SERVER['REQUEST_URI']).'/';
26
        $settings['url'] = 'http://'.$_SERVER['HTTP_HOST'].$last;
27
        $base = substr($last, 1);
28
        $settings['base'] = substr_count($settings['url'], '/') - 2;
29
30
        $hta = 'RewriteEngine On
31
RewriteBase /'.$base.'
32
RewriteCond %{REQUEST_FILENAME} !-f
33
RewriteRule . /'.$base.'index.php [L]';
34
        file_put_contents('.htaccess', $hta);
35
36
        $settings['id'] = 1001;
37
        $settings['community'] = $_POST['community_name'];
38
39
        $user_name = $_POST['user_name'];
40
        $user_email = $_POST['user_email'];
41
        $user_password = $_POST['user_password'];
42
        $user_pic = $_POST['user_pic'];
43
44
        $server_name = $_POST['server_name'];
45
        $server_type = $_POST['server_type'];
46
47
        $sql_type = $_POST['SQL_type'];
48
        $settings['key'] = rand_sha1(16);
49
50
        $server_use_SQ = $_POST['server_use_SQ'];
51
        if ($server_use_SQ == '1') {
52
            $server_IP = encrypt($_POST['server_IP'], $settings['key']);
53
            $server_PORT = encrypt($_POST['server_port'], $settings['key']);
54
            $server_RCON = encrypt($_POST['server_RCON_pass'], $settings['key']);
55
        }
56
57
        $server_SQL_host = $_POST['server_SQL_host'];
58
        if (strpos($server_SQL_host, ':')) {
59
            $SQL_ip = explode(':', $server_SQL_host);
60
            $settings['db']['host'] = encrypt($SQL_ip['0'], $settings['key']);
61
            $settings['db']['port'] = encrypt($SQL_ip['1'], $settings['key']);
62
        } else {
63
            $settings['db']['host'] = encrypt($server_SQL_host, $settings['key']);
64
        }
65
66
        $server_SQL_user = $_POST['server_SQL_user'];
67
        $server_SQL_pass = $_POST['server_SQL_pass'];
68
        $server_SQL_name = $_POST['server_SQL_name'];
69
70
        $encrypted_SQL_host = encrypt($server_SQL_host, $settings['key']);
71
        $encrypted_SQL_user = encrypt($server_SQL_user, $settings['key']);
72
        $encrypted_SQL_pass = encrypt($server_SQL_pass, $settings['key']);
73
        $encrypted_SQL_name = encrypt($server_SQL_name, $settings['key']);
74
75
        $settings['db']['user'] = $encrypted_SQL_user;
76
        $settings['db']['pass'] = $encrypted_SQL_pass;
77
        $settings['db']['name'] = $encrypted_SQL_name;
78
79
        $settings['maxLevels']['cop'] = 7;
80
        $settings['maxLevels']['medic'] = 5;
81
        $settings['maxLevels']['admin'] = 5;
82
        $settings['maxLevels']['donator'] = 5;
83
84
        $settings['items'] = 15;
85
        $settings['notifications'] = true;
86
        $settings['news'] = true;
87
        $settings['sql_phone'] = false;
88
        $settings['language'] = 'en';
89
        $settings['allowLang'] = true;
90
        $settings['lifeVersion'] = (int) $_POST['lifeVersion'];
91
        $settings['lifeVersionDisplay'] = $_POST['lifeVersion'];
92
        $settings['donorFormat'] = 'donorlevel';
93
        $settings['wanted'] = false;
94
        $settings['version'] = '0.5';
95
        $settings['staffRanks'] = 5;
96
        $settings['logging'] = true;
97
        $settings['2factor'] = false;
98
        $settings['gravatar'] = false;
99
        $settings['force2factor'] = 'none';
100 View Code Duplication
        if ($settings['lifeVersion'] == 5) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
101
            $settings['playerColumn'] = 'pid';
102
        } else {
103
            $settings['playerColumn'] = 'playerid';
104
        }
105
106
        $settings['steamAPI'] = '';
107
        $settings['vacTest'] = false;
108
        $settings['steamdomain'] = '';
109
        $settings['steamlogin'] = false;
110
        $settings['plugins'] = array();
111
        $settings['performance'] = false;
112
        $settings['annonlogin'] = false;
113
        $settings['performance'] = false;
114
        $settings['register'] = false;
115
        $settings['passreset'] = false;
116
        $settings['performance'] = false;
117
        $settings['refresh'] = 30;
118
        $settings['communityBansTest'] = false;
119
        $settings['communityBansAPI'] = '';
120
121
        $settings['item'] = array(5, 10, 15, 25, 50);
122
123
        $settings['installedLanguage'] = array();
124
        $langEn = array('English', 'en');
125
        $langDe = array('German', 'de');
126
        $langFr = array('Fran�ais', 'fr');
127
        array_push($settings['installedLanguage'], $langEn);
128
        array_push($settings['installedLanguage'], $langDe);
129
        array_push($settings['installedLanguage'], $langFr);
130
131
        $settings['names'] = array('', 'Dave', 'Sam', 'Joe', 'Kerry', 'Connie', 'Jess');
132
        $settings['ranks'] = array('Banned', 'Player', 'Member', 'Moderator', 'Server Admin', 'Super Admin');
133
134
        $permissions = include 'config/permissions.php';
135
        $userPerms = json_encode($permissions['5']);
136
137
        $link = mysqli_connect($server_SQL_host, $server_SQL_user, $server_SQL_pass, $server_SQL_name);
138
        if (mysqli_connect_errno()) {
139
            printf("Connect failed: %s\n", mysqli_connect_error());
140
            exit();
141
        }
142
143
        $user_password_hash = password_hash($user_password, PASSWORD_DEFAULT);
144
145
        mysqli_query($link, 'USE `'.$server_SQL_name.'`;') or die('LINK: '.mysqli_error($link));
146
147
        $query = mysqli_query($link, "SHOW TABLES LIKE 'users'") or die('TEST 1: '.mysqli_error($link));
148 View Code Duplication
        if (mysqli_num_rows($query) == 1) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
149
            mysqli_query($link, 'DROP TABLE `users`') or die('DROP 1: '.mysqli_error($link));
150
        }
151
152
        $query = mysqli_query($link, "SHOW TABLES LIKE 'notes'") or die('TEST 2: '.mysqli_error($link));
153 View Code Duplication
        if (mysqli_num_rows($query) == 1) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
154
            mysqli_query($link, 'DROP TABLE `notes`') or die('DROP 2: '.mysqli_error($link));
155
        }
156
157
        $query = mysqli_query($link, "SHOW TABLES LIKE 'db'") or die('TEST 3: '.mysqli_error($link));
158 View Code Duplication
        if (mysqli_num_rows($query) == 1) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
159
            mysqli_query($link, 'DROP TABLE `db`') or die('DROP 3: '.mysqli_error($link));
160
        }
161
162
        $query = mysqli_query($link, "SHOW TABLES LIKE 'servers'") or die('TEST 4: '.mysqli_error($link));
163 View Code Duplication
        if (mysqli_num_rows($query) == 1) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
164
            mysqli_query($link, 'DROP TABLE `servers`') or die('DROP 4: '.mysqli_error($link));
165
        }
166
167
        $query = mysqli_query($link, "SHOW TABLES LIKE 'logs'") or die('TEST 5: '.mysqli_error($link));
168 View Code Duplication
        if (mysqli_num_rows($query) == 1) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
169
            mysqli_query($link, 'DROP TABLE `logs`') or die('DROP 5: '.mysqli_error($link));
170
        }
171
172
        mysqli_query($link, "CREATE TABLE IF NOT EXISTS `users` (
173
  `user_id` int(11) NOT NULL primary key,
174
  `user_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
175
  `user_password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
176
  `user_email` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
177
  `playerid` varchar(17) COLLATE utf8_unicode_ci DEFAULT NULL,
178
  `user_level` int(1) NOT NULL DEFAULT '1',
179
  `permissions` text COLLATE utf8_unicode_ci NOT NULL,
180
  `user_profile` varchar(255) NOT NULL,
181
  `items` int(2) NULL,
182
  `twoFactor` VARCHAR(25) NULL,
183
  `backup` VARCHAR(255) NULL,
184
  `token` VARCHAR(64) NULL
185
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='user data';") or die('1: '.mysqli_error($link));
186
187
        if (isset($_POST['user_pid'])) {
188
            $user_pid = $_POST['user_pid'];
189
            mysqli_query($link, "INSERT INTO `users` (`user_id`, `user_name`, `user_password_hash`, `user_email`, `playerid`, `user_level`, `permissions`,
190
191
`user_profile`) VALUES
192
    (1, '" .$user_name."', '".$user_password_hash."', '".$user_email."', '".$user_pid."', 5, '".$userPerms."', '".$user_pic."');") or die('2: '.mysqli_error($link));
193
        } else {
194
            mysqli_query($link, "INSERT INTO `users` (`user_id`, `user_name`, `user_password_hash`, `user_email`, `user_level`, `permissions`, `user_profile`) VALUES
195
    (1, '" .$user_name."', '".$user_password_hash."', '".$user_email."', 5, '".$userPerms."', '".$user_pic."');") or die('2: '.mysqli_error($link));
196
        }
197
198
        mysqli_query($link, "ALTER TABLE `users`
199
    MODIFY `user_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'auto incrementing user_id of each user, unique index',AUTO_INCREMENT=2;") or die('3: '.mysqli_error($link));
200
201
        mysqli_query($link, "CREATE TABLE IF NOT EXISTS `notes` (
202
	  `note_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'auto incrementing note_id of each user, unique index',
203
	  `uid` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
204
	  `staff_name` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
205
	  `note_text` VARCHAR(255) NOT NULL,
206
	  `note_updated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
207
	  PRIMARY KEY (`note_id`),
208
	  UNIQUE KEY `note_id` (`note_id`)
209
    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;") or die('4: '.mysqli_error($link));
210
211
        mysqli_query($link, 'CREATE TABLE IF NOT EXISTS `db` (
212
    `dbid` INT(11) NOT NULL AUTO_INCREMENT,
213
    `type` VARCHAR(64) NOT NULL,
214
    `sql_host` VARCHAR(64) NOT NULL,
215
    `sql_user` VARCHAR(64) NOT NULL,
216
    `sql_pass` VARCHAR(255) NOT NULL,
217
    `sql_name` VARCHAR(64) NOT NULL,
218
	PRIMARY KEY (dbid),
219
	UNIQUE KEY `dbid` (`dbid`)
220
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;') or die('5: '.mysqli_error($link));
221
222
        mysqli_query($link, "INSERT INTO `db` (`type`, `sql_host`, `sql_user`, `sql_pass`, `sql_name`) VALUES
223
    ('" .$sql_type."', '".$encrypted_SQL_host."', '".$encrypted_SQL_user."', '".$encrypted_SQL_pass."', '".$encrypted_SQL_name."');") or die('6: '.mysqli_error($link));
224
225
        mysqli_query($link, 'CREATE TABLE IF NOT EXISTS `servers` (
226
    `sid` INT(2) NOT NULL AUTO_INCREMENT,
227
    `name` VARCHAR(64) NOT NULL,
228
    `dbid` INT(2) NOT NULL,
229
    `type` VARCHAR(64) NOT NULL,
230
    `use_sq` INT(2) NOT NULL,
231
    `sq_port` VARCHAR(255) NULL,
232
    `sq_ip` VARCHAR(255) NULL,
233
    `rcon_pass` VARCHAR(255) NULL,
234
	PRIMARY KEY (`sid`),
235
	UNIQUE KEY `sid` (`sid`)
236
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;') or die('7: '.mysqli_error($link));
237
238
        if ($server_use_SQ == '1') {
239
            mysqli_query($link, "INSERT INTO `servers` (`name`, `dbid`, `type`, `use_sq`, `sq_port`, `sq_ip`,`rcon_pass`) VALUES
240
    ('" .$server_name."', '1', '".$server_type."', '".$server_use_SQ."', '".$server_PORT."', '".$server_IP."', '".$server_RCON."');") or die('8: '.mysqli_error($link));
241
        } else {
242
            mysqli_query($link, "INSERT INTO `servers` (`name`, `dbid`, `type`, `use_sq`) VALUES
243
    ('" .$server_name."', '1', '".$server_type."', '".$server_use_SQ."');") or die('8: '.mysqli_error($link));
244
        }
245
246
        mysqli_query($link, 'CREATE TABLE IF NOT EXISTS `logs` (
247
    `logid` int(11) NOT NULL AUTO_INCREMENT,
248
    `date_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
249
    `user` varchar(64) DEFAULT NULL,
250
    `action` varchar(255) DEFAULT NULL,
251
    `level` int(11) NOT NULL,
252
    PRIMARY KEY (`logid`),
253
    UNIQUE KEY `logid` (`logid`),
254
    KEY `logid_2` (`logid`)
255
    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;') or die('9: '.mysqli_error($link));
256
257
        mysqli_close($link);
258
259
        file_put_contents('config/settings.php', '<?php return '.var_export($settings, true).';');
260
        $settings = include 'config/settings.php';
261
262
        header('Location: index.php?setup=1');
263
    } ?>
264
<!DOCTYPE html>
265
<html lang="en">
266
<head>
267
    <meta charset="utf-8">
268
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
269
    <meta name="description" content="CyberWorks Server Admin Panel needs to be installed">
270
    <meta name="keyword" content="CyberWorks, Server, Admin Panel">
271
272
    <title>Cyber Works Installer</title>
273
274
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Ruda:400,700,900">
275
    <link rel="stylesheet" type="text/css" href="assets/css/main.css">
276
    <!--Copyright CyberByte 2015 http://cyberbyte.org.uk/-->
277
</head>
278
279
<body>
280
<section id="container">
281
    <header class="header black-bg">
282
        <a href="http://cyberworks.org.uk" class="logo"><b>Cyber Works installer</b></a>
283
    </header>
284
        <section class="wrapper">
285
                <div class="row">
286
                    <div class="col-lg-12">
287
                        <h1 class="page-header">
288
                            <center>Cyber Works Installer</center>
289
                        </h1>
290
                    </div>
291
                </div>
292
293
                <div class="col-sm-4" style="float: none; margin: 0 auto;">
294
                    <form method="post" action="index.php" name="setupform">
295
                        <div class="form-group">
296
                            <p style="text-align: center;">Use this installer to
297
                            setup the Cyber Works server admin panel. If you need
298
                            any help feel free to contact support at
299
                            <a href="http://cyberbyte.org.uk">http://cyberbyte.org.uk</a>.</p>
300
                            <p style="text-align: center;"> If you just need to fix you can use our
301
                            <a href="gensettings.php">RECOVERY INSTALLER</a>.</p>
302
                            <br>
303
                            <label for="community_name">Community Name: </label>
304
                            <input placeholder="Community Name" id="community_name"
305
                                   class="form-control login_input" type="text" name="community_name" <?php if (isset($_POST['community_name'])) {
306
        echo 'value="'.$_POST['community_name'].'"';
307
    } ?>>
308
                            <br><h4>User Setup</h4>
309
                            <label for="user_name">Username: </label>
310
                            <input placeholder="Username" id="user_name"
311
                                   class="form-control login_input" type="text" name="user_name" <?php if (isset($_POST['user_name'])) {
312
        echo 'value="'.$_POST['user_name'].'"';
313
    } ?>>
314
315
                            <label for="user_email">Email: </label>
316
                            <input placeholder="Email" id="user_email" class="form-control login_input"
317
                                   type="email" name="user_email" required <?php if (isset($_POST['user_email'])) {
318
        echo 'value="'.$_POST['user_email'].'"';
319
    } ?>>
320
321
                            <label for="user_password">Password: </label>
322
                            <input placeholder="Password" id="user_password"
323
                                   class="form-control login_input" type="password" name="user_password"
324
                                   autocomplete="off" required <?php if (isset($_POST['user_password'])) {
325
        echo 'value="'.$_POST['user_password'].'"';
326
    } ?>>
327
328
                            <label for="user_pid">Player ID: </label>
329
                            <input placeholder="Player ID" id="user_pid"
330
                                   class="form-control login_input" type="number" name="user_pid" <?php if (isset($_POST['user_pid'])) {
331
        echo 'value="'.$_POST['user_pid'].'"';
332
    } ?>>
333
                            <label for="user_pic">Picture: </label>
334
335
                            <select id='user_pic' name='user_pic' class=" form-control login_input">
336
                            <?php
337
                            for ($icon = 1; $icon < 7; ++$icon) {
338
                                echo '<option value="'.$icon.'"';
339
                                if (isset($_POST['user_pic'])) {
340
                                    if ($icon == $_POST['user_pic']) {
341
                                        echo ' selected';
342
                                    }
343
                                }
344
                                echo '>'.$icon.'</option>';
345
                            } ?>
346
                            </select>
347
                            <br>
348
349
                            <h4>SQL Setup</h4>
350
                            <label for="SQL_type">Server type: </label>
351
                            <select id="SQL_type" class=" form-control login_input" name="SQL_type">
352
                                <option value="life">Altis Life</option>
353
                                <!--<option value="wasteland">Wasteland</option>-->
354
                            </select>
355
356
                            <label for="server_SQL_host">SQL Host: </label>
357
                            <input placeholder="SQL Host" id="server_SQL_host"
358
                                   class="form-control login_input" type="text" name="server_SQL_host"
359
                                <?php if (isset($_POST['server_SQL_host'])) {
360
                                echo 'value="'.$_POST['server_SQL_host'].'"';
361
                            } ?>>
362
363
                            <label for="server_SQL_user">SQL User: </label>
364
                            <input placeholder="SQL User" id="server_SQL_user"
365
                                   class="form-control login_input" type="text" name="server_SQL_user"
366
                                <?php if (isset($_POST['server_SQL_user'])) {
367
                                echo 'value="'.$_POST['server_SQL_user'].'"';
368
                            } ?>>
369
370
                            <label for="server_SQL_pass">SQL Password: </label>
371
                            <input placeholder="SQL Password" id="server_SQL_pass"
372
                                   class="form-control login_input" type="password" name="server_SQL_pass"
373
                                <?php if (isset($_POST['server_SQL_pass'])) {
374
                                echo 'value="'.$_POST['server_SQL_pass'].'"';
375
                            } ?>>
376
377
                            <label for="server_SQL_name">SQL Database: </label>
378
                            <input placeholder="SQL Database Name" id="server_SQL_name"
379
                                   class="form-control login_input" type="text" name="server_SQL_name"
380
                                <?php if (isset($_POST['server_SQL_name'])) {
381
                                echo 'value="'.$_POST['server_SQL_name'].'"';
382
                            } ?>>
383
                            <br><br>
384
385
                            <h4>Server Setup</h4>
386
                            <label for="server_name">Server name: </label>
387
                            <input placeholder="Server name" id="server_name"
388
                                   class="form-control login_input" type="text" name="server_name"
389
                                <?php if (isset($_POST['server_name'])) {
390
                                echo 'value="'.$_POST['server_name'].'"';
391
                            } ?>>
392
393
                            <label for="lifeVersion">Altis Life Version: </label>
394
                            <select name="lifeVersion" id="lifeVersion" class="form-control">
395
                                <option value="3">3.X.X.X</option>
396
                                <option value="4">4.0->4.4</option>
397
                                <option value="4.2">4.4r2->4.4r4</option>
398
                                <option value="5.0" >5.0</option>
399
                            </select>
400
401
                            <label for="server_type">Server type: </label>
402
                            <select id="server_name" class=" form-control login_input" name="server_type">
403
                                <option value="life">Altis Life</option>
404
                                <!--<option value="wasteland">Wasteland</option>-->
405
                            </select>
406
407
                            <br><label for="server_use_SQ">Use SourceQuery: </label>
408
                            <select class="form-control login_input" name="server_use_SQ" id="server_use_SQ">
409
                                <option value="1">Yes</option>
410
                                <option value="0">No</option>
411
                            </select><br>
412
413
                            <label for="server_port">Server Query Port: </label>
414
                            <input placeholder="Server Query Port (Default: 2302)" id="server_port"
415
                                   class="form-control login_input" type="text" name="server_port"
416
                                <?php if (isset($_POST['server_port'])) {
417
                                echo 'value="'.$_POST['server_port'].'"';
418
                            } ?>>
419
420
                            <label for="server_IP">Server Query IP: </label>
421
                            <input placeholder="Server Query IP" id="server_IP"
422
                                   class="form-control login_input" type="text" name="server_IP"
423
                                <?php if (isset($_POST['server_IP'])) {
424
                                echo 'value="'.$_POST['server_IP'].'"';
425
                            } ?>>
426
427
                            <label for="server_SQL_pass">RCON Password: </label>
428
                            <input placeholder="RCON Password" id="server_SQL_pass"
429
                                   class="form-control login_input" type="password" name="server_RCON_pass"
430
                                <?php if (isset($_POST['server_SQL_pass'])) {
431
                                echo 'value="'.$_POST['server_SQL_pass'].'"';
432
                            } ?>>
433
                            <br>
434
                            <input class="btn btn-lg btn-primary" style="float:right;" type="submit" name="setup"
435
                                   value="Setup">
436
                        </div>
437
                    </form>
438
                </div>
439
        </section>
440
</section>
441
442
</body>
443
</html>
444
<?php
445
446
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
447