Skip to content
This repository was archived by the owner on Feb 11, 2018. It is now read-only.

Commit 6344101

Browse files
committed
Add 5.0
1 parent 3e8c654 commit 6344101

5 files changed

Lines changed: 819 additions & 697 deletions

File tree

views/core/settings.php

Lines changed: 61 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,24 @@
1515
} else {
1616
$settings['donorFormat'] = 'donatorlvl';
1717
}
18+
19+
if ($_POST['lifeVersion'] == 5) {
20+
$settings['playerColumn'] = 'pid';
21+
} else {
22+
$settings['playerColumn'] = 'playerid';
23+
}
1824
$settings['lifeVersion'] = intval($_POST['lifeVersion']);
1925
$settings['lifeVersionDisplay'] = $_POST['lifeVersion'];
20-
26+
2127
$settings['allowLang'] = filter_var($_POST['allowLang'], FILTER_VALIDATE_BOOLEAN);
2228
$settings['wanted'] = filter_var($_POST['wanted'], FILTER_VALIDATE_BOOLEAN);
2329
$settings['news'] = filter_var($_POST['news'], FILTER_VALIDATE_BOOLEAN);
24-
$settings['register'] = filter_var($_POST['register'], FILTER_VALIDATE_BOOLEAN);
25-
$settings['steamlogin'] = filter_var($_POST['steamlogin'], FILTER_VALIDATE_BOOLEAN);
30+
$settings['register'] = filter_var($_POST['register'], FILTER_VALIDATE_BOOLEAN);
31+
$settings['steamlogin'] = filter_var($_POST['steamlogin'], FILTER_VALIDATE_BOOLEAN);
2632
$settings['vacTest'] = filter_var($_POST['vacTest'], FILTER_VALIDATE_BOOLEAN);
27-
$settings['performance'] = filter_var($_POST['performance'], FILTER_VALIDATE_BOOLEAN);
28-
$settings['notifications'] = filter_var($_POST['notifications'], FILTER_VALIDATE_BOOLEAN);
29-
33+
$settings['performance'] = filter_var($_POST['performance'], FILTER_VALIDATE_BOOLEAN);
34+
$settings['notifications'] = filter_var($_POST['notifications'], FILTER_VALIDATE_BOOLEAN);
35+
3036
$settings['2factor'] = false;
3137
$settings['gravatar'] = false;
3238
$settings['force2factor'] = 'none';
@@ -36,10 +42,9 @@
3642
$settings['maxLevels']['admin'] = $_POST['max_admin'];
3743
$settings['maxLevels']['donator'] = $_POST['max_donator'];
3844

39-
40-
file_put_contents('config/settings.php', '<?php return ' . var_export($settings, true) . ';');
45+
file_put_contents('config/settings.php', '<?php return '.var_export($settings, true).';');
4146
} else {
42-
logAction($_SESSION['user_name'], $lang['failedUpdate'] . ' ' . $lang['server'] . ' ' . $lang['settings'], 3);
47+
logAction($_SESSION['user_name'], $lang['failedUpdate'].' '.$lang['server'].' '.$lang['settings'], 3);
4348
}
4449
} else {
4550
message($lang['expired']);
@@ -59,44 +64,49 @@
5964
<form method='post' action='settings' id='settings' name='settingsEdit'>
6065
<?php
6166
echo formtoken::getField();
62-
echo "<h3>" . $lang['database'] . "</h3>";
63-
echo "<div class='form-group'><label for='db_host'>" . $lang['database'] . " " . $lang['host'] . ": </label><input class='form-control' id='db_host' type='text' name='db_host' value='" . decrypt($settings['db']['host']) . "' readonly></div>";
64-
echo "<div class='form-group'><label for='db_user'>" . $lang['database'] . " " . $lang['user'] . ": </label><input class='form-control' id='db_user' type='text' name='db_user' value='" . decrypt($settings['db']['user']) . "' readonly></div>";
65-
echo "<div class='form-group'><div class='input-group'><label for='db_pass'>" . $lang['database'] . " " . $lang['password'] . ": </label><input class='form-control pwd' id='db_pass' type='password' name='db_pass' value='" . decrypt($settings['db']['pass']) . "' readonly>";
67+
echo '<h3>'.$lang['database'].'</h3>';
68+
echo "<div class='form-group'><label for='db_host'>".$lang['database'].' '.$lang['host'].": </label><input class='form-control' id='db_host' type='text' name='db_host' value='".decrypt($settings['db']['host'])."' readonly></div>";
69+
echo "<div class='form-group'><label for='db_user'>".$lang['database'].' '.$lang['user'].": </label><input class='form-control' id='db_user' type='text' name='db_user' value='".decrypt($settings['db']['user'])."' readonly></div>";
70+
echo "<div class='form-group'><div class='input-group'><label for='db_pass'>".$lang['database'].' '.$lang['password'].": </label><input class='form-control pwd' id='db_pass' type='password' name='db_pass' value='".decrypt($settings['db']['pass'])."' readonly>";
6671
echo "<span class='input-group-btn'><button style='margin-top: 21px; background-color: #eee;' ";
6772
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='db_name'>" . $lang['database'] . " " . $lang['name'] . ": </label><input class='form-control' id='db_name' type='text' name='db_name' value='" . decrypt($settings['db']['name']) . "' readonly></div>";
73+
echo "<div class='form-group'><label for='db_name'>".$lang['database'].' '.$lang['name'].": </label><input class='form-control' id='db_name' type='text' name='db_name' value='".decrypt($settings['db']['name'])."' readonly></div>";
6974
?>
7075

7176
<h3><?php echo $lang['panel']?></h3>
7277
<div class='form-group'><label for='max_cop'> <?php echo $lang['community'] ?>: </label>
7378
<input class='form-control' id='community' type='text' name='community' value='<?php echo $settings['community']; ?>'></div>
7479

75-
<?php if (count($settings['installedLanguage']) > 1) { ?>
80+
<?php if (count($settings['installedLanguage']) > 1) {
81+
?>
7682
<div class='form-group'><label for="language"><?php echo $lang['language'] ?>: </label>
7783
<select name="language" id="language" class="form-control">
7884
<?php
7985
foreach ($settings['installedLanguage'] as $language) {
80-
echo '<option value = "' . $language[1] . '" ';
81-
if ($settings['language'] == $language[1]) echo 'selected';
82-
echo '> ' . $language[0] . '</option>';
86+
echo '<option value = "'.$language[1].'" ';
87+
if ($settings['language'] == $language[1]) {
88+
echo 'selected';
89+
}
90+
echo '> '.$language[0].'</option>';
8391
} ?>
8492
</select></div>
8593

8694
<div class='form-group'><label for="allowLang"><?php echo $lang['allowLang'] ?>: </label>
8795
<select name="allowLang" id="allowLang" class="form-control">
88-
<option value="true"<?php echo select(true, $settings['allowLang']) . '>' . $lang['yes'] ?></option>
89-
<option value="false"<?php echo select(false, $settings['allowLang']) . '>' . $lang['no'] ?></option>
96+
<option value="true"<?php echo select(true, $settings['allowLang']).'>'.$lang['yes'] ?></option>
97+
<option value="false"<?php echo select(false, $settings['allowLang']).'>'.$lang['no'] ?></option>
9098
</select></div>
91-
92-
<?php } ?>
93-
99+
100+
<?php
101+
102+
} ?>
103+
94104
<div class='form-group'><label for="performance"><?php echo $lang['performance'] ?>: </label>
95105
<select name="performance" id="performance" class="form-control">
96106
<option value="true"
97-
<?php echo select(true, $settings['performance']) . '>' . $lang['yes'] ?></option>
107+
<?php echo select(true, $settings['performance']).'>'.$lang['yes'] ?></option>
98108
<option value="false"
99-
<?php echo select(false, $settings['performance']) . '>' . $lang['no'] ?></option>
109+
<?php echo select(false, $settings['performance']).'>'.$lang['no'] ?></option>
100110
</select></div>
101111

102112
<div class='form-group'><label for="items"><?php echo $lang['itemsPP'] ?></label>
@@ -110,38 +120,38 @@
110120

111121
<div class='form-group'><label for="register"><?php echo $lang['registration'] ?>: </label>
112122
<select name="register" id="register" class="form-control">
113-
<option value="true"<?php echo select(true, $settings['register']) . '>' . $lang['yes'] ?></option>
114-
<option value="false"<?php echo select(false, $settings['register']) . '>' . $lang['no'] ?></option>
123+
<option value="true"<?php echo select(true, $settings['register']).'>'.$lang['yes'] ?></option>
124+
<option value="false"<?php echo select(false, $settings['register']).'>'.$lang['no'] ?></option>
115125
</select>
116126
</div>
117127

118128
<div class='form-group'><label for="news"><?php echo $lang['useNews'] ?>: </label>
119129
<select name="news" id="news" class="form-control">
120-
<option value="true"<?php echo select(true, $settings['news']) . '>' . $lang['yes'] ?></option>
121-
<option value="false"<?php echo select(false, $settings['news']) . '>' . $lang['no'] ?></option>
130+
<option value="true"<?php echo select(true, $settings['news']).'>'.$lang['yes'] ?></option>
131+
<option value="false"<?php echo select(false, $settings['news']).'>'.$lang['no'] ?></option>
122132
</select></div>
123133

124134
<div class='form-group'><label for="notifications">Notifications: </label>
125135
<select name="notifications" id="notifications" class="form-control">
126-
<option value="true"<?php echo select(true, $settings['notifications']) . '>' . $lang['yes'] ?></option>
127-
<option value="false"<?php echo select(false, $settings['notifications']) . '>' . $lang['no'] ?></option>
136+
<option value="true"<?php echo select(true, $settings['notifications']).'>'.$lang['yes'] ?></option>
137+
<option value="false"<?php echo select(false, $settings['notifications']).'>'.$lang['no'] ?></option>
128138
</select></div>
129-
<?php echo "<div class='form-group'><label for='refresh'>" . $lang['refresh'] . ": </label><input class='form-control' id='refresh' type='number' name='refresh' value='" . $settings['refresh'] . "'></div>"; ?>
139+
<?php echo "<div class='form-group'><label for='refresh'>".$lang['refresh'].": </label><input class='form-control' id='refresh' type='number' name='refresh' value='".$settings['refresh']."'></div>"; ?>
130140
</div>
131141
<div class="col-md-6">
132142
<h3>Altis Life</h3>
133143
<?php
134-
echo "<div class='form-group'><label for='max_cop'>" . $lang['max'] . " " . $lang['cop'] . " " . $lang['level'] . ": </label><input class='form-control' id='max_cop' type='number' name='max_cop' value='" . $settings['maxLevels']['cop'] . "'></div>";
135-
echo "<div class='form-group'><label for='max_medic'>" . $lang['max'] . " " . $lang['medic'] . " " . $lang['level'] . ": </label><input class='form-control' id='max_medic' type='number' name='max_medic' value='" . $settings['maxLevels']['medic'] . "'></div>";
136-
echo "<div class='form-group'><label for='max_admin'>" . $lang['max'] . " " . $lang['admin'] . " " . $lang['level'] . ": </label><input class='form-control' id='max_admin' type='number' name='max_admin' value='" . $settings['maxLevels']['admin'] . "'></div>";
137-
echo "<div class='form-group'><label for='max_donator'>" . $lang['max'] . " " . $lang['donator'] . " " . $lang['level'] . ": </label><input class='form-control' id='max_donator' type='number' name='max_donator' value='" . $settings['maxLevels']['donator'] . "'></div>";
144+
echo "<div class='form-group'><label for='max_cop'>".$lang['max'].' '.$lang['cop'].' '.$lang['level'].": </label><input class='form-control' id='max_cop' type='number' name='max_cop' value='".$settings['maxLevels']['cop']."'></div>";
145+
echo "<div class='form-group'><label for='max_medic'>".$lang['max'].' '.$lang['medic'].' '.$lang['level'].": </label><input class='form-control' id='max_medic' type='number' name='max_medic' value='".$settings['maxLevels']['medic']."'></div>";
146+
echo "<div class='form-group'><label for='max_admin'>".$lang['max'].' '.$lang['admin'].' '.$lang['level'].": </label><input class='form-control' id='max_admin' type='number' name='max_admin' value='".$settings['maxLevels']['admin']."'></div>";
147+
echo "<div class='form-group'><label for='max_donator'>".$lang['max'].' '.$lang['donator'].' '.$lang['level'].": </label><input class='form-control' id='max_donator' type='number' name='max_donator' value='".$settings['maxLevels']['donator']."'></div>";
138148
?>
139149
<div class='form-group'><label for="wanted"><?php echo $lang['wanted'] ?>: </label>
140150
<select name="wanted" id="wanted" class="form-control">
141151
<option value="true"
142-
<?php echo select(true, $settings['wanted']) . '>' . $lang['yes'] ?></option>
152+
<?php echo select(true, $settings['wanted']).'>'.$lang['yes'] ?></option>
143153
<option value="false"
144-
<?php echo select(false, $settings['wanted']) . '>' . $lang['no'] ?></option>
154+
<?php echo select(false, $settings['wanted']).'>'.$lang['no'] ?></option>
145155
</select></div>
146156

147157
<div class='form-group'>
@@ -150,6 +160,7 @@
150160
<option value="3" <?php echo select('3', $settings['lifeVersionDisplay']) ?> >3.X.X.X</option>
151161
<option value="4" <?php echo select('4', $settings['lifeVersionDisplay']) ?> >4.0->4.4</option>
152162
<option value="4.2" <?php echo select('4.2', $settings['lifeVersionDisplay']) ?> >4.4r2->4.4r4</option>
163+
<option value="5.0" <?php echo select('5', $settings['lifeVersionDisplay']) ?> >5.0</option>
153164
</select></div>
154165
<h3>API's</h3>
155166
<div class='form-group'>
@@ -161,7 +172,7 @@
161172
</span>
162173
</div>
163174
</div>
164-
175+
165176
<div class='form-group'>
166177
<label for='steamDomain'>Steam Domain: </label>
167178
<input class='form-control' id='steamDomain' type='text' name='steamDomain' value='<?php echo $settings['steamdomain']?>'>
@@ -170,35 +181,37 @@
170181
<div class='form-group'><label for="steamlogin"><?php echo $lang['steamlogin'] ?>: </label>
171182
<select name="steamlogin" id="steamlogin" class="form-control">
172183
<option value="true"
173-
<?php echo select(true, $settings['steamlogin']) . '>' . $lang['yes'] ?></option>
184+
<?php echo select(true, $settings['steamlogin']).'>'.$lang['yes'] ?></option>
174185
<option value="false"
175-
<?php echo select(false, $settings['steamlogin']) . '>' . $lang['no'] ?></option>
186+
<?php echo select(false, $settings['steamlogin']).'>'.$lang['no'] ?></option>
176187
</select></div>
177188

178189
<div class='form-group'><label for="vacTest"><?php echo $lang['useVAC'] ?>: </label>
179190
<select name="vacTest" id="vacTest" class="form-control">
180191
<option value="true"
181-
<?php echo select(true, $settings['vacTest']) . '>' . $lang['yes'] ?></option>
192+
<?php echo select(true, $settings['vacTest']).'>'.$lang['yes'] ?></option>
182193
<option value="false"
183-
<?php echo select(false, $settings['vacTest']) . '>' . $lang['no'] ?></option>
194+
<?php echo select(false, $settings['vacTest']).'>'.$lang['no'] ?></option>
184195
</select></div>
185196

186197
<div class='form-group'><label for="communityBansTest"><?php echo $lang['useCommunityBans'] ?>: </label>
187198
<select name="communityBansTest" id="communityBansTest" class="form-control">
188199
<option value="true"
189-
<?php echo select(true, $settings['communityBansTest']) . '>' . $lang['yes'] ?></option>
200+
<?php echo select(true, $settings['communityBansTest']).'>'.$lang['yes'] ?></option>
190201
<option value="false"
191-
<?php echo select(false, $settings['communityBansTest']) . '>' . $lang['no'] ?></option>
202+
<?php echo select(false, $settings['communityBansTest']).'>'.$lang['no'] ?></option>
192203
</select></div>
193204

194205
<div class='form-group'><div class='input-group'><label for='communityBansAPI'>Community Bans API <?php echo $lang['key'] ?>: </label><input class='form-control pwd' id='communityBansAPI' type='password' name='communityBansAPI' value='<?php echo $settings['communityBansAPI']?>'>
195206
<span class='input-group-btn'><button style='margin-top: 21px;' class='btn btn-default reveal' type='button'><i class='fa fa-eye-slash'></i></button></span></div>
196207

197208
<?php
198-
if (!isset($pluginSettings)) echo '<h3>' . $lang['plugin'] . ' ' . $lang['settings'] . '</h3>';
209+
if (!isset($pluginSettings)) {
210+
echo '<h3>'.$lang['plugin'].' '.$lang['settings'].'</h3>';
211+
}
199212
foreach ($settings['plugins'] as &$plugin) {
200-
if (file_exists("plugins/" . $plugin . "/settings.php")) {
201-
include("plugins/" . $plugin . "/settings.php");
213+
if (file_exists('plugins/'.$plugin.'/settings.php')) {
214+
include 'plugins/'.$plugin.'/settings.php';
202215
}
203216
}
204217
?>

0 commit comments

Comments
 (0)