release 1.2.7
This commit is contained in:
@@ -1,196 +1,206 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
echo "logout";
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
if(!isset($_POST['number']) || $_POST['number'] == "yes") {
|
||||
$_SESSION[$rspathhex.'showexcepted'] = "yes";
|
||||
$filter = " AND except='0'";
|
||||
} else {
|
||||
$_SESSION[$rspathhex.'showexcepted'] = "no";
|
||||
$filter = "";
|
||||
}
|
||||
$assign_groups_active = 0;
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) {
|
||||
$assign_groups_limit = $_POST['assign_groups_limit'];
|
||||
$assign_groups_groupids = $_POST['assign_groups_groupids'];
|
||||
if (isset($_POST['assign_groups_active'])) $assign_groups_active = 1;
|
||||
if ($mysqlcon->exec("UPDATE $dbname.addons_config SET value = CASE param WHEN 'assign_groups_active' THEN '$assign_groups_active' WHEN 'assign_groups_limit' THEN '$assign_groups_limit' WHEN 'assign_groups_groupids' THEN '$assign_groups_groupids' END WHERE param IN ('assign_groups_active','assign_groups_groupids','assign_groups_limit')") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc'];
|
||||
$err_lvl = NULL;
|
||||
}
|
||||
$addons_config['assign_groups_groupids']['value'] = $_POST['assign_groups_groupids'];
|
||||
$addons_config['assign_groups_limit']['value'] = $_POST['assign_groups_limit'];
|
||||
$addons_config['assign_groups_active']['value'] = $assign_groups_active;
|
||||
}
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['stag0001']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" data-toggle="validator" name="update" method="POST">
|
||||
<div class="form-horizontal">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#stag0014"><?php echo $lang['stag0013']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($addons_config['assign_groups_active']['value'] == '1') {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="assign_groups_active" value="',$assign_groups_active,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="assign_groups_active" value="',$assign_groups_active,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row"> </div>
|
||||
<div class="form-group required-field-block">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#stag0003"><?php echo $lang['stag0002']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" data-pattern="^([0-9]+,)*[0-9]+$" data-error="Wrong definition, please look at description for more details. No comma at ending!" rows="5" name="assign_groups_groupids" maxlength="5000" required><?php echo $addons_config['assign_groups_groupids']['value']; ?></textarea>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#stag0005"><?php echo $lang['stag0004']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="assign_groups_limit" value="<?php echo $addons_config['assign_groups_limit']['value']; ?>">
|
||||
<script>
|
||||
$("input[name='assign_groups_limit']").TouchSpin({
|
||||
min: 1,
|
||||
max: 65534,
|
||||
verticalbuttons: true,
|
||||
prefix: 'No.'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="update"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="stag0003" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['stag0002']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['stag0003']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="stag0005" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['stag0004']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['stag0005']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="stag0014" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['stag0013']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['stag0014']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('form[data-toggle="validator"]').validator({
|
||||
custom: {
|
||||
pattern: function ($el) {
|
||||
var pattern = new RegExp($el.data('pattern'));
|
||||
return pattern.test($el.val());
|
||||
}
|
||||
},
|
||||
delay: 100,
|
||||
errors: {
|
||||
pattern: "There should be an error in your value, please check all could be right!"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
<?PHP
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
if(in_array('sha512', hash_algos())) {
|
||||
ini_set('session.hash_function', 'sha512');
|
||||
}
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/load_addons_config.php');
|
||||
|
||||
$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath);
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
echo "logout";
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['update']) && $_POST['csrf_token'] != $_SESSION[$rspathhex.'csrf_token']) {
|
||||
echo $lang['errcsrf'];
|
||||
rem_session_ts3($rspathhex);
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
$assign_groups_active = 0;
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip() && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
$assign_groups_limit = $_POST['assign_groups_limit'];
|
||||
$assign_groups_groupids = $_POST['assign_groups_groupids'];
|
||||
if (isset($_POST['assign_groups_active'])) $assign_groups_active = 1;
|
||||
if ($mysqlcon->exec("UPDATE `$dbname`.`addons_config` SET `value` = CASE `param` WHEN 'assign_groups_active' THEN '$assign_groups_active' WHEN 'assign_groups_limit' THEN '$assign_groups_limit' WHEN 'assign_groups_groupids' THEN '$assign_groups_groupids' END WHERE `param` IN ('assign_groups_active','assign_groups_groupids','assign_groups_limit')") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc'];
|
||||
$err_lvl = NULL;
|
||||
}
|
||||
$addons_config['assign_groups_groupids']['value'] = $_POST['assign_groups_groupids'];
|
||||
$addons_config['assign_groups_limit']['value'] = $_POST['assign_groups_limit'];
|
||||
$addons_config['assign_groups_active']['value'] = $assign_groups_active;
|
||||
}
|
||||
|
||||
$_SESSION[$rspathhex.'csrf_token'] = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['stag0001']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" data-toggle="validator" name="update" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="form-horizontal">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#stag0014"><?php echo $lang['stag0013']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($addons_config['assign_groups_active']['value'] == '1') {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="assign_groups_active" value="',$assign_groups_active,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="assign_groups_active" value="',$assign_groups_active,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row"> </div>
|
||||
<div class="form-group required-field-block">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#stag0003"><?php echo $lang['stag0002']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" data-pattern="^([0-9]+,)*[0-9]+$" data-error="Wrong definition, please look at description for more details. No comma at ending!" rows="5" name="assign_groups_groupids" maxlength="5000" required><?php echo $addons_config['assign_groups_groupids']['value']; ?></textarea>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#stag0005"><?php echo $lang['stag0004']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="assign_groups_limit" value="<?php echo $addons_config['assign_groups_limit']['value']; ?>">
|
||||
<script>
|
||||
$("input[name='assign_groups_limit']").TouchSpin({
|
||||
min: 1,
|
||||
max: 65534,
|
||||
verticalbuttons: true,
|
||||
prefix: 'No.'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="update"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="stag0003" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['stag0002']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['stag0003']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="stag0005" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['stag0004']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['stag0005']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="stag0014" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['stag0013']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['stag0014']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('form[data-toggle="validator"]').validator({
|
||||
custom: {
|
||||
pattern: function ($el) {
|
||||
var pattern = new RegExp($el.data('pattern'));
|
||||
return pattern.test($el.val());
|
||||
}
|
||||
},
|
||||
delay: 100,
|
||||
errors: {
|
||||
pattern: "There should be an error in your value, please check all could be right!"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,240 +1,257 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
echo "logout";
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
if(!isset($_POST['number']) || $_POST['number'] == "yes") {
|
||||
$_SESSION[$rspathhex.'showexcepted'] = "yes";
|
||||
$filter = " AND except='0'";
|
||||
} else {
|
||||
$_SESSION[$rspathhex.'showexcepted'] = "no";
|
||||
$filter = "";
|
||||
}
|
||||
|
||||
|
||||
if(($dbuserdata = $mysqlcon->query("SELECT uuid,cldbid,name FROM $dbname.user WHERE 1=1$filter ORDER BY name ASC")) === false) {
|
||||
$err_msg = "DB Error: ".print_r($mysqlcon->errorInfo(), true); $err_lvl = 3;
|
||||
}
|
||||
$user_arr = $dbuserdata->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) {
|
||||
$setontime = 0;
|
||||
if($_POST['setontime_day']) { $setontime = $setontime + $_POST['setontime_day'] * 86400; }
|
||||
if($_POST['setontime_hour']) { $setontime = $setontime + $_POST['setontime_hour'] * 3600; }
|
||||
if($_POST['setontime_min']) { $setontime = $setontime + $_POST['setontime_min'] * 60; }
|
||||
if($_POST['setontime_sec']) { $setontime = $setontime + $_POST['setontime_sec']; }
|
||||
if($setontime == 0) {
|
||||
$err_msg = $lang['errseltime']; $err_lvl = 3;
|
||||
} elseif($_POST['user'] == NULL) {
|
||||
$err_msg = $lang['errselusr']; $err_lvl = 3;
|
||||
} else {
|
||||
$allupdateuuid = '';
|
||||
foreach($_POST['user'] as $user) {
|
||||
$allupdateuuid .= "'".$user."',";
|
||||
}
|
||||
$allupdateuuid = substr($allupdateuuid, 0, -1);
|
||||
if($mysqlcon->exec("UPDATE $dbname.user set count = count + $setontime WHERE uuid IN ($allupdateuuid)") === false) {
|
||||
$err_msg = $lang['isntwidbmsg'].print_r($mysqlcon->errorInfo(), true); $err_lvl = 3;
|
||||
} else {
|
||||
if($mysqlcon->exec("UPDATE $dbname.user_snapshot set count = count + $setontime WHERE uuid IN ($allupdateuuid)") === false) { }
|
||||
$err_msg = sprintf($lang['sccupcount'],$setontime,$allupdateuuid); $err_lvl = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihladm1']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <form id="update" method="POST"></form> -->
|
||||
<form name="post" method="POST">
|
||||
<div class="form-horizontal">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wiadmhidedesc"><?php echo $lang['wiadmhide']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 pull-right">
|
||||
<select class="selectpicker show-tick form-control" id="number" name="number" onchange="this.form.submit();">
|
||||
<?PHP
|
||||
echo '<option value="yes"'; if(!isset($_SESSION[$rspathhex.'showexcepted']) || $_SESSION[$rspathhex.'showexcepted'] == "yes") echo " selected=selected"; echo '>hide</option>';
|
||||
echo '<option value="no"'; if(isset($_SESSION[$rspathhex.'showexcepted']) && $_SESSION[$rspathhex.'showexcepted'] == "no") echo " selected=selected"; echo '>show</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wiselclddesc"><?php echo $lang['wiselcld']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" data-live-search="true" multiple name="user[]">
|
||||
<?PHP
|
||||
foreach ($user_arr as $user) {
|
||||
echo '<option value="',$user['uuid'],'" data-subtext="UUID: ',$user['uuid'],'; DBID: ',$user['cldbid'],'">',$user['name'],'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#setontimedesc"><?php echo $lang['setontime']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="setontime_day">
|
||||
<script>
|
||||
$("input[name='setontime_day']").TouchSpin({
|
||||
min: 0,
|
||||
max: 24855,
|
||||
verticalbuttons: true,
|
||||
prefix: '<?PHP echo $lang['time_day']; ?>'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#setontimedesc"></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="setontime_hour">
|
||||
<script>
|
||||
$("input[name='setontime_hour']").TouchSpin({
|
||||
min: 0,
|
||||
max: 23,
|
||||
verticalbuttons: true,
|
||||
prefix: '<?PHP echo $lang['time_hour']; ?>'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#setontimedesc"></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="setontime_min">
|
||||
<script>
|
||||
$("input[name='setontime_min']").TouchSpin({
|
||||
min: 0,
|
||||
max: 59,
|
||||
verticalbuttons: true,
|
||||
prefix: '<?PHP echo $lang['time_min']; ?>'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#setontimedesc"></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="setontime_sec">
|
||||
<script>
|
||||
$("input[name='setontime_sec']").TouchSpin({
|
||||
min: 0,
|
||||
max: 59,
|
||||
verticalbuttons: true,
|
||||
prefix: '<?PHP echo $lang['time_sec']; ?>'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="update"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="wiselclddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wiselcld']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wiselclddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="setontimedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['setontime']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['setontimedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wiadmhidedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wiadmhide']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wiadmhidedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<?PHP
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
if(in_array('sha512', hash_algos())) {
|
||||
ini_set('session.hash_function', 'sha512');
|
||||
}
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
echo "logout";
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['update']) && $_POST['csrf_token'] != $_SESSION[$rspathhex.'csrf_token']) {
|
||||
echo $lang['errcsrf'];
|
||||
rem_session_ts3($rspathhex);
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
if(!isset($_POST['number']) || $_POST['number'] == "yes") {
|
||||
$_SESSION[$rspathhex.'showexcepted'] = "yes";
|
||||
$filter = " `except`='0'";
|
||||
} else {
|
||||
$_SESSION[$rspathhex.'showexcepted'] = "no";
|
||||
$filter = "";
|
||||
}
|
||||
|
||||
if(($dbuserdata = $mysqlcon->query("SELECT `uuid`,`cldbid`,`name` FROM `$dbname`.`user` WHERE $filter ORDER BY `name` ASC")) === false) {
|
||||
$err_msg = "DB Error: ".print_r($mysqlcon->errorInfo(), true); $err_lvl = 3;
|
||||
}
|
||||
$user_arr = $dbuserdata->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip() && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
$setontime = 0;
|
||||
if($_POST['setontime_day']) { $setontime = $setontime + $_POST['setontime_day'] * 86400; }
|
||||
if($_POST['setontime_hour']) { $setontime = $setontime + $_POST['setontime_hour'] * 3600; }
|
||||
if($_POST['setontime_min']) { $setontime = $setontime + $_POST['setontime_min'] * 60; }
|
||||
if($_POST['setontime_sec']) { $setontime = $setontime + $_POST['setontime_sec']; }
|
||||
if($setontime == 0) {
|
||||
$err_msg = $lang['errseltime']; $err_lvl = 3;
|
||||
} elseif($_POST['user'] == NULL) {
|
||||
$err_msg = $lang['errselusr']; $err_lvl = 3;
|
||||
} else {
|
||||
$allinsertdata = '';
|
||||
$succmsg = '';
|
||||
$nowtime = time();
|
||||
foreach($_POST['user'] as $uuid) {
|
||||
$allinsertdata .= "('".$uuid."', ".$nowtime.", ".$setontime."),";
|
||||
$succmsg .= sprintf($lang['sccupcount'],$setontime,$uuid)."<br>";
|
||||
}
|
||||
$allinsertdata = substr($allinsertdata, 0, -1);
|
||||
if($mysqlcon->exec("INSERT INTO `$dbname`.`admin_addtime` (`uuid`,`timestamp`,`timecount`) VALUES $allinsertdata;") === false) {
|
||||
$err_msg = $lang['isntwidbmsg'].print_r($mysqlcon->errorInfo(), true); $err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = substr($succmsg,0,-4); $err_lvl = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION[$rspathhex.'csrf_token'] = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihladm1']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form name="post" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="form-horizontal">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wiadmhidedesc"><?php echo $lang['wiadmhide']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 pull-right">
|
||||
<select class="selectpicker show-tick form-control" id="number" name="number" onchange="this.form.submit();">
|
||||
<?PHP
|
||||
echo '<option value="yes"'; if(!isset($_SESSION[$rspathhex.'showexcepted']) || $_SESSION[$rspathhex.'showexcepted'] == "yes") echo " selected=selected"; echo '>hide</option>';
|
||||
echo '<option value="no"'; if(isset($_SESSION[$rspathhex.'showexcepted']) && $_SESSION[$rspathhex.'showexcepted'] == "no") echo " selected=selected"; echo '>show</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wiselclddesc"><?php echo $lang['wiselcld']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" data-live-search="true" multiple name="user[]">
|
||||
<?PHP
|
||||
foreach ($user_arr as $user) {
|
||||
echo '<option value="',$user['uuid'],'" data-subtext="UUID: ',$user['uuid'],'; DBID: ',$user['cldbid'],'">',$user['name'],'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#setontimedesc"><?php echo $lang['setontime']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="setontime_day">
|
||||
<script>
|
||||
$("input[name='setontime_day']").TouchSpin({
|
||||
min: 0,
|
||||
max: 24855,
|
||||
verticalbuttons: true,
|
||||
prefix: '<?PHP echo $lang['time_day']; ?>'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#setontimedesc"></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="setontime_hour">
|
||||
<script>
|
||||
$("input[name='setontime_hour']").TouchSpin({
|
||||
min: 0,
|
||||
max: 23,
|
||||
verticalbuttons: true,
|
||||
prefix: '<?PHP echo $lang['time_hour']; ?>'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#setontimedesc"></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="setontime_min">
|
||||
<script>
|
||||
$("input[name='setontime_min']").TouchSpin({
|
||||
min: 0,
|
||||
max: 59,
|
||||
verticalbuttons: true,
|
||||
prefix: '<?PHP echo $lang['time_min']; ?>'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#setontimedesc"></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="setontime_sec">
|
||||
<script>
|
||||
$("input[name='setontime_sec']").TouchSpin({
|
||||
min: 0,
|
||||
max: 59,
|
||||
verticalbuttons: true,
|
||||
prefix: '<?PHP echo $lang['time_sec']; ?>'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="update"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="wiselclddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wiselcld']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wiselclddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="setontimedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['setontime']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['setontimedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wiadmhidedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wiadmhide']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wiadmhidedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,364 +1,385 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/phpcommand.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function getlog($logpath,$number_lines,$filters,$filter2,$inactivefilter = NULL) {
|
||||
$lines=array();
|
||||
if(file_exists($logpath."ranksystem.log")) {
|
||||
$fp = fopen($logpath."ranksystem.log", "r");
|
||||
$buffer=array();
|
||||
while($line = fgets($fp, 4096)) {
|
||||
array_push($buffer, $line);
|
||||
}
|
||||
fclose($fp);
|
||||
$buffer = array_reverse($buffer);
|
||||
foreach($buffer as $line) {
|
||||
if(substr($line, 0, 2) != "20" && in_array($lastfilter, $filters)) {
|
||||
array_push($lines, $line);
|
||||
if (count($lines)>$number_lines) {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
foreach($filters as $filter) {
|
||||
if(($filter != NULL && strstr($line, $filter) && $filter2 == NULL) || ($filter2 != NULL && strstr($line, $filter2) && $filter != NULL && strstr($line, $filter))) {
|
||||
if($filter == "CRITICAL" || $filter == "ERROR") {
|
||||
array_push($lines, '<span class="text-danger">'.$line.'</span>');
|
||||
} else {
|
||||
array_push($lines, $line);
|
||||
}
|
||||
$lastfilter = $filter;
|
||||
if (count($lines)>$number_lines) {
|
||||
break 2;
|
||||
}
|
||||
continue;
|
||||
} elseif($inactivefilter != NULL) {
|
||||
foreach($inactivefilter as $defilter) {
|
||||
if($defilter != NULL && strstr($line, $defilter)) {
|
||||
$lastfilter = $defilter;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$lines[] = "No log entry found...\n";
|
||||
$lines[] = "The logfile will be created with next startup.\n";
|
||||
}
|
||||
return $lines;
|
||||
}
|
||||
|
||||
$number_lines = 20;
|
||||
if (isset($_POST['number'])) {
|
||||
if($_POST['number'] == 20) {
|
||||
$number_lines = 20;
|
||||
} elseif($_POST['number'] == 50) {
|
||||
$number_lines = 50;
|
||||
} elseif($_POST['number'] == 100) {
|
||||
$number_lines = 100;
|
||||
} elseif($_POST['number'] == 200) {
|
||||
$number_lines = 200;
|
||||
} elseif($_POST['number'] == 500) {
|
||||
$number_lines = 500;
|
||||
} elseif($_POST['number'] == 9999) {
|
||||
$number_lines = 9999;
|
||||
} else {
|
||||
$number_lines = 20;
|
||||
}
|
||||
$_SESSION[$rspathhex.'number_lines'] = $number_lines;
|
||||
} elseif (isset($_SESSION[$rspathhex.'number_lines'])) {
|
||||
$number_lines = $_SESSION[$rspathhex.'number_lines'];
|
||||
}
|
||||
|
||||
if(isset($_SESSION[$rspathhex.'logfilter2'])) {
|
||||
$filter2 = $_SESSION[$rspathhex.'logfilter2'];
|
||||
} else {
|
||||
$filter2 = '';
|
||||
}
|
||||
$filters = '';
|
||||
$inactivefilter = '';
|
||||
if(isset($_POST['logfilter']) && in_array('critical', $_POST['logfilter'])) {
|
||||
$filters .= "CRITICAL,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "CRITICAL,";
|
||||
}
|
||||
if(isset($_POST['logfilter']) && in_array('error', $_POST['logfilter'])) {
|
||||
$filters .= "ERROR,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "ERROR,";
|
||||
}
|
||||
if(isset($_POST['logfilter']) && in_array('warning', $_POST['logfilter'])) {
|
||||
$filters .= "WARNING,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "WARNING,";
|
||||
}
|
||||
if(isset($_POST['logfilter']) && in_array('notice', $_POST['logfilter'])) {
|
||||
$filters .= "NOTICE,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "NOTICE,";
|
||||
}
|
||||
if(isset($_POST['logfilter']) && in_array('info', $_POST['logfilter'])) {
|
||||
$filters .= "INFO,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "INFO,";
|
||||
}
|
||||
if(isset($_POST['logfilter']) && in_array('debug', $_POST['logfilter'])) {
|
||||
$filters .= "DEBUG,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "DEBUG,";
|
||||
}
|
||||
if(isset($_POST['logfilter'][0])) {
|
||||
$filter2 = htmlspecialchars($_POST['logfilter'][0]);
|
||||
$_SESSION[$rspathhex.'logfilter2'] = $filter2;
|
||||
}
|
||||
|
||||
if($filters != '') {
|
||||
$_SESSION[$rspathhex.'logfilter'] = $filters;
|
||||
}
|
||||
|
||||
if($inactivefilter != '') {
|
||||
$_SESSION[$rspathhex.'inactivefilter'] = $inactivefilter;
|
||||
}
|
||||
if(isset($_SESSION[$rspathhex.'inactivefilter']) && $_SESSION[$rspathhex.'inactivefilter'] != NULL) {
|
||||
$inactivefilter = explode(',', $_SESSION[$rspathhex.'inactivefilter']);
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'logfilter'])) {
|
||||
$_SESSION[$rspathhex.'logfilter'] = "CRITICAL,ERROR,WARNING,NOTICE,INFO,DEBUG";
|
||||
}
|
||||
|
||||
$filters = explode(',', $_SESSION[$rspathhex.'logfilter']);
|
||||
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
echo "logout";
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
$logoutput = getlog($logpath,$number_lines,$filters,$filter2,$inactivefilter);
|
||||
|
||||
if (isset($_POST['start']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) {
|
||||
if(substr(sprintf('%o', fileperms($logpath)), -3, 1)!='7') {
|
||||
$err_msg = "!!!! Logs folder is not writable !!!!<br>Cancel start request!"; $err_lvl = 3;
|
||||
} else {
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."\worker.php start", 0, false);
|
||||
if (file_exists(substr(__DIR__,0,-12)."\logs\autostart_deactivated")) {
|
||||
unlink(substr(__DIR__,0,-12)."\logs\autostart_deactivated");
|
||||
}
|
||||
} else {
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php start");
|
||||
if (file_exists(substr(__DIR__,0,-12)."logs/autostart_deactivated")) {
|
||||
unlink(substr(__DIR__,0,-12)."logs/autostart_deactivated");
|
||||
}
|
||||
}
|
||||
$err_msg = $lang['wibot2'];
|
||||
$err_lvl = 1;
|
||||
usleep(80000);
|
||||
$logoutput = getlog($logpath,$number_lines,$filters,$filter2,$inactivefilter);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['stop']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) {
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."\worker.php stop", 0, false);
|
||||
file_put_contents(substr(__DIR__,0,-12)."\logs\autostart_deactivated");
|
||||
} else {
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php stop");
|
||||
file_put_contents(substr(__DIR__,0,-12)."logs/autostart_deactivated");
|
||||
}
|
||||
$err_msg = $lang['wibot1'];
|
||||
$err_lvl = 1;
|
||||
usleep(80000);
|
||||
$logoutput = getlog($logpath,$number_lines,$filters,$filter2,$inactivefilter);
|
||||
}
|
||||
|
||||
if (isset($_POST['restart']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) {
|
||||
if(substr(sprintf('%o', fileperms($logpath)), -3, 1)!='7') {
|
||||
$err_msg = "!!!! Logs folder is not writable !!!!<br>Cancel restart request!"; $err_lvl = 3;
|
||||
} else {
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."\worker.php restart", 0, false);
|
||||
if (file_exists(substr(__DIR__,0,-12)."\logs\autostart_deactivated")) {
|
||||
unlink(substr(__DIR__,0,-12)."\logs\autostart_deactivated");
|
||||
}
|
||||
} else {
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php restart");
|
||||
if (file_exists(substr(__DIR__,0,-12)."logs/autostart_deactivated")) {
|
||||
unlink(substr(__DIR__,0,-12)."logs/autostart_deactivated");
|
||||
}
|
||||
}
|
||||
$err_msg = $lang['wibot3'];
|
||||
$err_lvl = 1;
|
||||
usleep(80000);
|
||||
$logoutput = getlog($logpath,$number_lines,$filters,$filter2,$inactivefilter);
|
||||
}
|
||||
}
|
||||
|
||||
$disabled = '';
|
||||
if($ts['host'] == NULL || $ts['query'] == NULL || $ts['voice'] == NULL || $ts['user'] == NULL || $ts['pass'] == NULL || $queryname == NULL || $queryname2 == NULL || $grouptime == NULL || $logpath == NULL) {
|
||||
$disabled = 1;
|
||||
$err_msg = $lang['wibot9'];
|
||||
$err_lvl = 2;
|
||||
}
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?PHP echo $lang['wibot4']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" name="start" method="POST">
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="start"<?PHP if($disabled == 1) echo " disabled"; ?>>
|
||||
<i class="fa fa-fw fa-power-off"></i> <?PHP echo $lang['wibot5']; ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
<form class="form-horizontal" name="stop" method="POST">
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="stop">
|
||||
<i class="fa fa-fw fa-close"></i> <?PHP echo $lang['wibot6']; ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
<form class="form-horizontal" name="restart" method="POST">
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="restart"<?PHP if($disabled == 1) echo " disabled"; ?>>
|
||||
<i class="fa fa-fw fa-refresh"></i> <?PHP echo $lang['wibot7']; ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="col-lg-2">
|
||||
<h4>
|
||||
<?PHP echo $lang['wibot8']; ?>
|
||||
</h4>
|
||||
</div>
|
||||
<form class="form-horizontal" name="logfilter" method="POST">
|
||||
<div class="col-lg-2">
|
||||
<div class="col-sm-12">
|
||||
<?PHP if($filter2!=NULL) { ?>
|
||||
<input type="text" class="form-control" name="logfilter[]" value="<?PHP echo $filter2; ?>" data-switch-no-init onchange="this.form.submit();">
|
||||
<?PHP } else { ?>
|
||||
<input type="text" class="form-control" name="logfilter[]" placeholder="filter the log entries..." data-switch-no-init onchange="this.form.submit();">
|
||||
<?PHP } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="critical" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('CRITICAL', $filters)) { echo "checked"; } ?>
|
||||
>Critical</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="error" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('ERROR', $filters)) { echo "checked"; } ?>
|
||||
>Error</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="warning" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('WARNING', $filters)) { echo "checked"; } ?>
|
||||
>Warning</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="notice" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('NOTICE', $filters)) { echo "checked"; } ?>
|
||||
>Notice</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="info" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('INFO', $filters)) { echo "checked"; } ?>
|
||||
>Info</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="debug" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('DEBUG', $filters)) { echo "checked"; } ?>
|
||||
>Debug</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<div class="col-sm-8 pull-left">
|
||||
<select class="selectpicker show-tick form-control" id="number" name="number" onchange="this.form.submit();">
|
||||
<?PHP
|
||||
echo '<option value="20"'; if($number_lines=="20") echo " selected=selected"; echo '>20</option>';
|
||||
echo '<option value="50"'; if($number_lines=="50") echo " selected=selected"; echo '>50</option>';
|
||||
echo '<option value="100"'; if($number_lines=="100") echo " selected=selected"; echo '>100</option>';
|
||||
echo '<option value="200"'; if($number_lines=="200") echo " selected=selected"; echo '>200</option>';
|
||||
echo '<option value="500"'; if($number_lines=="500") echo " selected=selected"; echo '>500</option>';
|
||||
echo '<option value="9999"'; if($number_lines=="9999") echo " selected=selected"; echo '>9999</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<pre><?PHP foreach ($logoutput as $line) { echo $line; } ?></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<?PHP
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
if(in_array('sha512', hash_algos())) {
|
||||
ini_set('session.hash_function', 'sha512');
|
||||
}
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/phpcommand.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function getlog($logpath,$number_lines,$filters,$filter2,$inactivefilter = NULL) {
|
||||
$lines=array();
|
||||
if(file_exists($logpath."ranksystem.log")) {
|
||||
$fp = fopen($logpath."ranksystem.log", "r");
|
||||
$buffer=array();
|
||||
while($line = fgets($fp, 4096)) {
|
||||
array_push($buffer, $line);
|
||||
}
|
||||
fclose($fp);
|
||||
$buffer = array_reverse($buffer);
|
||||
foreach($buffer as $line) {
|
||||
if(substr($line, 0, 2) != "20" && in_array($lastfilter, $filters)) {
|
||||
array_push($lines, $line);
|
||||
if (count($lines)>$number_lines) {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
foreach($filters as $filter) {
|
||||
if(($filter != NULL && strstr($line, $filter) && $filter2 == NULL) || ($filter2 != NULL && strstr($line, $filter2) && $filter != NULL && strstr($line, $filter))) {
|
||||
if($filter == "CRITICAL" || $filter == "ERROR") {
|
||||
array_push($lines, '<span class="text-danger">'.$line.'</span>');
|
||||
} else {
|
||||
array_push($lines, $line);
|
||||
}
|
||||
$lastfilter = $filter;
|
||||
if (count($lines)>$number_lines) {
|
||||
break 2;
|
||||
}
|
||||
continue;
|
||||
} elseif($inactivefilter != NULL) {
|
||||
foreach($inactivefilter as $defilter) {
|
||||
if($defilter != NULL && strstr($line, $defilter)) {
|
||||
$lastfilter = $defilter;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$lines[] = "No log entry found...\n";
|
||||
$lines[] = "The logfile will be created with next startup.\n";
|
||||
}
|
||||
return $lines;
|
||||
}
|
||||
|
||||
$number_lines = 20;
|
||||
if (isset($_POST['number'])) {
|
||||
if($_POST['number'] == 20) {
|
||||
$number_lines = 20;
|
||||
} elseif($_POST['number'] == 50) {
|
||||
$number_lines = 50;
|
||||
} elseif($_POST['number'] == 100) {
|
||||
$number_lines = 100;
|
||||
} elseif($_POST['number'] == 200) {
|
||||
$number_lines = 200;
|
||||
} elseif($_POST['number'] == 500) {
|
||||
$number_lines = 500;
|
||||
} elseif($_POST['number'] == 9999) {
|
||||
$number_lines = 9999;
|
||||
} else {
|
||||
$number_lines = 20;
|
||||
}
|
||||
$_SESSION[$rspathhex.'number_lines'] = $number_lines;
|
||||
} elseif (isset($_SESSION[$rspathhex.'number_lines'])) {
|
||||
$number_lines = $_SESSION[$rspathhex.'number_lines'];
|
||||
}
|
||||
|
||||
if(isset($_SESSION[$rspathhex.'logfilter2'])) {
|
||||
$filter2 = $_SESSION[$rspathhex.'logfilter2'];
|
||||
} else {
|
||||
$filter2 = '';
|
||||
}
|
||||
$filters = '';
|
||||
$inactivefilter = '';
|
||||
if(isset($_POST['logfilter']) && in_array('critical', $_POST['logfilter'])) {
|
||||
$filters .= "CRITICAL,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "CRITICAL,";
|
||||
}
|
||||
if(isset($_POST['logfilter']) && in_array('error', $_POST['logfilter'])) {
|
||||
$filters .= "ERROR,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "ERROR,";
|
||||
}
|
||||
if(isset($_POST['logfilter']) && in_array('warning', $_POST['logfilter'])) {
|
||||
$filters .= "WARNING,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "WARNING,";
|
||||
}
|
||||
if(isset($_POST['logfilter']) && in_array('notice', $_POST['logfilter'])) {
|
||||
$filters .= "NOTICE,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "NOTICE,";
|
||||
}
|
||||
if(isset($_POST['logfilter']) && in_array('info', $_POST['logfilter'])) {
|
||||
$filters .= "INFO,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "INFO,";
|
||||
}
|
||||
if(isset($_POST['logfilter']) && in_array('debug', $_POST['logfilter'])) {
|
||||
$filters .= "DEBUG,";
|
||||
} elseif(isset($_POST['logfilter'])) {
|
||||
$inactivefilter .= "DEBUG,";
|
||||
}
|
||||
if(isset($_POST['logfilter'][0])) {
|
||||
$filter2 = htmlspecialchars($_POST['logfilter'][0]);
|
||||
$_SESSION[$rspathhex.'logfilter2'] = $filter2;
|
||||
}
|
||||
|
||||
if($filters != '') {
|
||||
$_SESSION[$rspathhex.'logfilter'] = $filters;
|
||||
}
|
||||
|
||||
if($inactivefilter != '') {
|
||||
$_SESSION[$rspathhex.'inactivefilter'] = $inactivefilter;
|
||||
}
|
||||
if(isset($_SESSION[$rspathhex.'inactivefilter']) && $_SESSION[$rspathhex.'inactivefilter'] != NULL) {
|
||||
$inactivefilter = explode(',', $_SESSION[$rspathhex.'inactivefilter']);
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'logfilter'])) {
|
||||
$_SESSION[$rspathhex.'logfilter'] = "CRITICAL,ERROR,WARNING,NOTICE,INFO,DEBUG";
|
||||
}
|
||||
|
||||
$filters = explode(',', $_SESSION[$rspathhex.'logfilter']);
|
||||
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
echo "logout";
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if ((isset($_POST['start']) || isset($_POST['stop']) || isset($_POST['restart']) || isset($_POST['logfilter'])) && $_POST['csrf_token'] != $_SESSION[$rspathhex.'csrf_token']) {
|
||||
echo $lang['errcsrf'];
|
||||
rem_session_ts3($rspathhex);
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
$logoutput = getlog($logpath,$number_lines,$filters,$filter2,$inactivefilter);
|
||||
|
||||
if (isset($_POST['start']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip() && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
if(substr(sprintf('%o', fileperms($logpath)), -3, 1)!='7') {
|
||||
$err_msg = "!!!! Logs folder is not writable !!!!<br>Cancel start request!"; $err_lvl = 3;
|
||||
} else {
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."\worker.php start", 0, false);
|
||||
if (file_exists(substr(__DIR__,0,-12)."\logs\autostart_deactivated")) {
|
||||
unlink(substr(__DIR__,0,-12)."\logs\autostart_deactivated");
|
||||
}
|
||||
} else {
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php start");
|
||||
if (file_exists(substr(__DIR__,0,-12)."logs/autostart_deactivated")) {
|
||||
unlink(substr(__DIR__,0,-12)."logs/autostart_deactivated");
|
||||
}
|
||||
}
|
||||
$err_msg = $lang['wibot2'];
|
||||
$err_lvl = 1;
|
||||
usleep(80000);
|
||||
$logoutput = getlog($logpath,$number_lines,$filters,$filter2,$inactivefilter);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['stop']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip() && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."\worker.php stop", 0, false);
|
||||
file_put_contents(substr(__DIR__,0,-12)."\logs\autostart_deactivated");
|
||||
} else {
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php stop");
|
||||
file_put_contents(substr(__DIR__,0,-12)."logs/autostart_deactivated");
|
||||
}
|
||||
$err_msg = $lang['wibot1'];
|
||||
$err_lvl = 1;
|
||||
usleep(80000);
|
||||
$logoutput = getlog($logpath,$number_lines,$filters,$filter2,$inactivefilter);
|
||||
}
|
||||
|
||||
if (isset($_POST['restart']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip() && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
if(substr(sprintf('%o', fileperms($logpath)), -3, 1)!='7') {
|
||||
$err_msg = "!!!! Logs folder is not writable !!!!<br>Cancel restart request!"; $err_lvl = 3;
|
||||
} else {
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."\worker.php restart", 0, false);
|
||||
if (file_exists(substr(__DIR__,0,-12)."\logs\autostart_deactivated")) {
|
||||
unlink(substr(__DIR__,0,-12)."\logs\autostart_deactivated");
|
||||
}
|
||||
} else {
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php restart");
|
||||
if (file_exists(substr(__DIR__,0,-12)."logs/autostart_deactivated")) {
|
||||
unlink(substr(__DIR__,0,-12)."logs/autostart_deactivated");
|
||||
}
|
||||
}
|
||||
$err_msg = $lang['wibot3'];
|
||||
$err_lvl = 1;
|
||||
usleep(80000);
|
||||
$logoutput = getlog($logpath,$number_lines,$filters,$filter2,$inactivefilter);
|
||||
}
|
||||
}
|
||||
|
||||
$disabled = '';
|
||||
if($ts['host'] == NULL || $ts['query'] == NULL || $ts['voice'] == NULL || $ts['user'] == NULL || $ts['pass'] == NULL || $queryname == NULL || $queryname2 == NULL || $grouptime == NULL || $logpath == NULL) {
|
||||
$disabled = 1;
|
||||
$err_msg = $lang['wibot9'];
|
||||
$err_lvl = 2;
|
||||
}
|
||||
|
||||
$_SESSION[$rspathhex.'csrf_token'] = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?PHP echo $lang['wibot4']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" name="start" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="start"<?PHP if($disabled == 1) echo " disabled"; ?>>
|
||||
<i class="fa fa-fw fa-power-off"></i> <?PHP echo $lang['wibot5']; ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
<form class="form-horizontal" name="stop" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="stop">
|
||||
<i class="fa fa-fw fa-close"></i> <?PHP echo $lang['wibot6']; ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
<form class="form-horizontal" name="restart" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="restart"<?PHP if($disabled == 1) echo " disabled"; ?>>
|
||||
<i class="fa fa-fw fa-refresh"></i> <?PHP echo $lang['wibot7']; ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="col-lg-2">
|
||||
<h4>
|
||||
<?PHP echo $lang['wibot8']; ?>
|
||||
</h4>
|
||||
</div>
|
||||
<form class="form-horizontal" name="logfilter" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="col-lg-2">
|
||||
<div class="col-sm-12">
|
||||
<?PHP if($filter2!=NULL) { ?>
|
||||
<input type="text" class="form-control" name="logfilter[]" value="<?PHP echo $filter2; ?>" data-switch-no-init onchange="this.form.submit();">
|
||||
<?PHP } else { ?>
|
||||
<input type="text" class="form-control" name="logfilter[]" placeholder="filter the log entries..." data-switch-no-init onchange="this.form.submit();">
|
||||
<?PHP } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="critical" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('CRITICAL', $filters)) { echo "checked"; } ?>
|
||||
>Critical</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="error" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('ERROR', $filters)) { echo "checked"; } ?>
|
||||
>Error</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="warning" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('WARNING', $filters)) { echo "checked"; } ?>
|
||||
>Warning</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="notice" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('NOTICE', $filters)) { echo "checked"; } ?>
|
||||
>Notice</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="info" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('INFO', $filters)) { echo "checked"; } ?>
|
||||
>Info</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<div class="checkbox">
|
||||
<label><input id="switch-create-destroy" type="checkbox" name="logfilter[]" value="debug" data-switch-no-init onchange="this.form.submit();"
|
||||
<?PHP if(in_array('DEBUG', $filters)) { echo "checked"; } ?>
|
||||
>Debug</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<div class="col-sm-8 pull-left">
|
||||
<select class="selectpicker show-tick form-control" id="number" name="number" onchange="this.form.submit();">
|
||||
<?PHP
|
||||
echo '<option value="20"'; if($number_lines=="20") echo " selected=selected"; echo '>20</option>';
|
||||
echo '<option value="50"'; if($number_lines=="50") echo " selected=selected"; echo '>50</option>';
|
||||
echo '<option value="100"'; if($number_lines=="100") echo " selected=selected"; echo '>100</option>';
|
||||
echo '<option value="200"'; if($number_lines=="200") echo " selected=selected"; echo '>200</option>';
|
||||
echo '<option value="500"'; if($number_lines=="500") echo " selected=selected"; echo '>500</option>';
|
||||
echo '<option value="9999"'; if($number_lines=="9999") echo " selected=selected"; echo '>9999</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<pre><?PHP foreach ($logoutput as $line) { echo $line; } ?></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,132 +1,149 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/phpcommand.php');
|
||||
|
||||
function enter_logfile($logpath,$timezone,$loglevel,$logtext) {
|
||||
$file = $logpath.'ranksystem.log';
|
||||
if ($loglevel == 1) {
|
||||
$loglevel = " CRITICAL ";
|
||||
} elseif ($loglevel == 2) {
|
||||
$loglevel = " ERROR ";
|
||||
} elseif ($loglevel == 3) {
|
||||
$loglevel = " WARNING ";
|
||||
} elseif ($loglevel == 4) {
|
||||
$loglevel = " NOTICE ";
|
||||
} elseif ($loglevel == 5) {
|
||||
$loglevel = " INFO ";
|
||||
}
|
||||
$input = DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ").$loglevel.$logtext."\n";
|
||||
$loghandle = fopen($file, 'a');
|
||||
fwrite($loghandle, $input);
|
||||
if (filesize($file) > 5242880) {
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Logfile filesie of 5 MiB reached.. Rotate logfile.\n");
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Restart Bot to continue with new log file...\n");
|
||||
fclose($loghandle);
|
||||
$file2 = "$file.old";
|
||||
if (file_exists($file2)) unlink($file2);
|
||||
rename($file, $file2);
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
exec("del /F ".substr(__DIR__,0,-12).'logs/pid');
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."worker.php start", 0, false);
|
||||
exit;
|
||||
} else {
|
||||
exec("rm -f ".substr(__DIR__,0,-12).'logs/pid');
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php start");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
if (isset($_POST['changepw']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) {
|
||||
$newpass = password_hash($_POST['newpwd1'], PASSWORD_DEFAULT);
|
||||
if (!password_verify($_POST['oldpwd'], $webpass)) {
|
||||
$err_msg = $lang['wichpw1']; $err_lvl = 3;
|
||||
} elseif ($_POST['newpwd1'] != $_POST['newpwd2'] || $_POST['newpwd1'] == NULL) {
|
||||
$err_msg = $lang['wichpw2']; $err_lvl = 3;
|
||||
} elseif ($mysqlcon->exec("UPDATE $dbname.config set webpass='$newpass'") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true); $err_lvl = 3;
|
||||
} else {
|
||||
enter_logfile($logpath,$timezone,3,sprintf($lang['wichpw3'],getclientip()));
|
||||
$err_msg = $lang['wisvsuc']; $err_lvl = NULL;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div id="login-overlay" class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel"><?PHP echo $lang['wichpw4'].' - '.$lang['wi']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form id="resetForm" method="POST">
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label"><?PHP echo $lang['pass3']; ?>:</label>
|
||||
<div class="input-group-justified">
|
||||
<input type="password" class="form-control" name="oldpwd" data-toggle="password" data-placement="before" placeholder="<?PHP echo $lang['pass3']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<p> </p>
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label"><?PHP echo $lang['pass4']; ?>:</label>
|
||||
<div class="input-group-justified">
|
||||
<input type="password" class="form-control" name="newpwd1" data-toggle="password" data-placement="before" placeholder="<?PHP echo $lang['pass4']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label"><?PHP echo $lang['pass4']; ?> (<?PHP echo $lang['repeat']; ?>):</label>
|
||||
<div class="input-group-justified">
|
||||
<input type="password" class="form-control" name="newpwd2" data-toggle="password" data-placement="before" placeholder="<?PHP echo $lang['pass4']; ?> (<?PHP echo $lang['repeat']; ?>)">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<p>
|
||||
<button type="submit" class="btn btn-success btn-block" name="changepw"><?PHP echo $lang['wichpw4']; ?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<?PHP
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
if(in_array('sha512', hash_algos())) {
|
||||
ini_set('session.hash_function', 'sha512');
|
||||
}
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/phpcommand.php');
|
||||
|
||||
function enter_logfile($logpath,$timezone,$loglevel,$logtext) {
|
||||
$file = $logpath.'ranksystem.log';
|
||||
if ($loglevel == 1) {
|
||||
$loglevel = " CRITICAL ";
|
||||
} elseif ($loglevel == 2) {
|
||||
$loglevel = " ERROR ";
|
||||
} elseif ($loglevel == 3) {
|
||||
$loglevel = " WARNING ";
|
||||
} elseif ($loglevel == 4) {
|
||||
$loglevel = " NOTICE ";
|
||||
} elseif ($loglevel == 5) {
|
||||
$loglevel = " INFO ";
|
||||
}
|
||||
$input = DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ").$loglevel.$logtext."\n";
|
||||
$loghandle = fopen($file, 'a');
|
||||
fwrite($loghandle, $input);
|
||||
if (filesize($file) > 5242880) {
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Logfile filesie of 5 MiB reached.. Rotate logfile.\n");
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Restart Bot to continue with new log file...\n");
|
||||
fclose($loghandle);
|
||||
$file2 = "$file.old";
|
||||
if (file_exists($file2)) unlink($file2);
|
||||
rename($file, $file2);
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
exec("del /F ".substr(__DIR__,0,-12).'logs/pid');
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."worker.php start", 0, false);
|
||||
exit;
|
||||
} else {
|
||||
exec("rm -f ".substr(__DIR__,0,-12).'logs/pid');
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php start");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['changepw']) && $_POST['csrf_token'] != $_SESSION[$rspathhex.'csrf_token']) {
|
||||
echo $lang['errcsrf'];
|
||||
rem_session_ts3($rspathhex);
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
if (isset($_POST['changepw']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip() && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
$newpass = password_hash($_POST['newpwd1'], PASSWORD_DEFAULT);
|
||||
if (!password_verify($_POST['oldpwd'], $webpass)) {
|
||||
$err_msg = $lang['wichpw1']; $err_lvl = 3;
|
||||
} elseif ($_POST['newpwd1'] != $_POST['newpwd2'] || $_POST['newpwd1'] == NULL) {
|
||||
$err_msg = $lang['wichpw2']; $err_lvl = 3;
|
||||
} elseif ($mysqlcon->exec("UPDATE `$dbname`.`config` SET `webpass`='$newpass'") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true); $err_lvl = 3;
|
||||
} else {
|
||||
enter_logfile($logpath,$timezone,3,sprintf($lang['wichpw3'],getclientip()));
|
||||
$err_msg = $lang['wisvsuc']; $err_lvl = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION[$rspathhex.'csrf_token'] = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div id="login-overlay" class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel"><?PHP echo $lang['wichpw4'].' - '.$lang['wi']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form id="resetForm" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label"><?PHP echo $lang['pass3']; ?>:</label>
|
||||
<div class="input-group-justified">
|
||||
<input type="password" class="form-control" name="oldpwd" data-toggle="password" data-placement="before" placeholder="<?PHP echo $lang['pass3']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<p> </p>
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label"><?PHP echo $lang['pass4']; ?>:</label>
|
||||
<div class="input-group-justified">
|
||||
<input type="password" class="form-control" name="newpwd1" data-toggle="password" data-placement="before" placeholder="<?PHP echo $lang['pass4']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label"><?PHP echo $lang['pass4']; ?> (<?PHP echo $lang['repeat']; ?>):</label>
|
||||
<div class="input-group-justified">
|
||||
<input type="password" class="form-control" name="newpwd2" data-toggle="password" data-placement="before" placeholder="<?PHP echo $lang['pass4']; ?> (<?PHP echo $lang['repeat']; ?>)">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<p>
|
||||
<button type="submit" class="btn btn-success btn-block" name="changepw"><?PHP echo $lang['wichpw4']; ?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,238 +1,273 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) {
|
||||
$newconfig='<?php
|
||||
$db[\'type\']="'.$_POST['dbtype'].'";
|
||||
$db[\'host\']="'.$_POST['dbhost'].'";
|
||||
$db[\'user\']="'.$_POST['dbuser'].'";
|
||||
$db[\'pass\']="'.$_POST['dbpass'].'";
|
||||
$db[\'dbname\']="'.$_POST['dbname'].'";
|
||||
?>';
|
||||
$dbserver = $_POST['dbtype'].':host='.$_POST['dbhost'].';dbname='.$_POST['dbname'];
|
||||
try {
|
||||
$mysqlcon = new PDO($dbserver, $_POST['dbuser'], $_POST['dbpass']);
|
||||
$handle=fopen('../other/dbconfig.php','w');
|
||||
if(!fwrite($handle,$newconfig))
|
||||
{
|
||||
$err_msg = sprintf($lang['widbcfgerr']);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], ' <form class="btn-group" name="restart" action="bot.php" method="POST"><button
|
||||
type="submit" class="btn btn-primary" name="restart"><i class="fa fa-fw fa-refresh"></i> '.$lang['wibot7'].'</button></form>');
|
||||
$err_lvl = 0;
|
||||
}
|
||||
fclose($handle);
|
||||
} catch (PDOException $e) {
|
||||
$err_msg = sprintf($lang['widbcfgerr']);
|
||||
$err_lvl = 3;
|
||||
}
|
||||
$db['type'] = $_POST['dbtype'];
|
||||
$db['host'] = $_POST['dbhost'];
|
||||
$dbname = $_POST['dbname'];
|
||||
$db['user'] = $_POST['dbuser'];
|
||||
$db['pass'] = $_POST['dbpass'];
|
||||
}
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihldb']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" name="update" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#isntwidbtypedesc"><?php echo $lang['isntwidbtype']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" id="basic" name="dbtype" required>
|
||||
<option disabled value=""> -- select database -- </option>
|
||||
<?PHP
|
||||
echo '<option data-subtext="Cubrid" value="cubrid"'; if($db['type']=="cubrid") echo " selected=selected"; echo '>cubrid</option>';
|
||||
echo '<option data-subtext="FreeTDS / Microsoft SQL Server / Sybase" value="dblib"'; if($db['type']=="dblib") echo " selected=selected"; echo '>dblib</option>';
|
||||
echo '<option data-subtext="Firebird/Interbase 6" value="firebird"'; if($db['type']=="firebird") echo " selected=selected"; echo '>firebird</option>';
|
||||
echo '<option data-subtext="IBM DB2" value="ibm"'; if($db['type']=="ibm") echo " selected=selected"; echo '>ibm</option>';
|
||||
echo '<option data-subtext="IBM Informix Dynamic Server" value="informix"'; if($db['type']=="informix") echo " selected=selected"; echo '>informix</option>';
|
||||
echo '<option data-subtext="MySQL 3.x/4.x/5.x [recommend]" value="mysql"'; if($db['type']=="mysql") echo " selected=selected"; echo '>mysql</option>';
|
||||
echo '<option data-subtext="Oracle Call Interface" value="oci"'; if($db['type']=="oci") echo " selected=selected"; echo '>oci</option>';
|
||||
echo '<option data-subtext="ODBC v3 (IBM DB2, unixODBC und win32 ODBC)" value="odbc"'; if($db['type']=="odbc") echo " selected=selected"; echo '>odbc</option>';
|
||||
echo '<option data-subtext="PostgreSQL" value="pgsql"'; if($db['type']=="pgsql") echo " selected=selected"; echo '>pgsql</option>';
|
||||
echo '<option data-subtext="SQLite 3 und SQLite 2" value="sqlite"'; if($db['type']=="sqlite") echo " selected=selected"; echo '>sqlite</option>';
|
||||
echo '<option data-subtext="Microsoft SQL Server / SQL Azure" value="sqlsrv"'; if($db['type']=="sqlsrv") echo " selected=selected"; echo '>sqlsrv</option>';
|
||||
echo '<option data-subtext="4D" value="4d"'; if($db['type']=="4d") echo " selected=selected"; echo '>4d</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#isntwidbhostdesc"><?php echo $lang['isntwidbhost']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" name="dbhost" value="<?php echo $db['host']; ?>" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#isntwidbnamedesc"><?php echo $lang['isntwidbname']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" name="dbname" value="<?php echo $dbname; ?>" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#isntwidbusrdesc"><?php echo $lang['isntwidbusr']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" name="dbuser" value="<?php echo $db['user']; ?>" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#isntwidbpassdesc"><?php echo $lang['isntwidbpass']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="password" class="form-control" name="dbpass" value="<?php echo $db['pass']; ?>" data-toggle="password" data-placement="before" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="update"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="isntwidbtypedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['isntwidbtype']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['isntwidbtypedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="isntwidbhostdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['isntwidbhost']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['isntwidbhostdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="isntwidbusrdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['isntwidbusr']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['isntwidbusrdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="isntwidbpassdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['isntwidbpass']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['isntwidbpassdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="isntwidbnamedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['isntwidbname']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['isntwidbnamedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<?PHP
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
if(in_array('sha512', hash_algos())) {
|
||||
ini_set('session.hash_function', 'sha512');
|
||||
}
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['update']) && $_POST['csrf_token'] != $_SESSION[$rspathhex.'csrf_token']) {
|
||||
echo $lang['errcsrf'];
|
||||
rem_session_ts3($rspathhex);
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
$newcsrf = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip() && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
$newconfig='<?php
|
||||
$db[\'type\']=\''.$_POST['dbtype'].'\';
|
||||
$db[\'host\']=\''.$_POST['dbhost'].'\';
|
||||
$db[\'user\']=\''.$_POST['dbuser'].'\';
|
||||
$db[\'pass\']=\''.$_POST['dbpass'].'\';
|
||||
$db[\'dbname\']=\''.$_POST['dbname'].'\';
|
||||
?>';
|
||||
$dbserver = $_POST['dbtype'].':host='.$_POST['dbhost'].';dbname='.$_POST['dbname'].';charset=utf8mb4';
|
||||
try {
|
||||
$mysqlcon = new PDO($dbserver, $_POST['dbuser'], $_POST['dbpass']);
|
||||
$handle=fopen('../other/dbconfig.php','w');
|
||||
if(!fwrite($handle,$newconfig))
|
||||
{
|
||||
$err_msg = sprintf($lang['widbcfgerr']);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], ' <form class="btn-group" name="restart" action="bot.php" method="POST"><input type="hidden" name="csrf_token" value="'.$newcsrf.'"><button
|
||||
type="submit" class="btn btn-primary" name="restart"><i class="fa fa-fw fa-refresh"></i> '.$lang['wibot7'].'</button></form>');
|
||||
$err_lvl = 0;
|
||||
$db['type'] = $_POST['dbtype'];
|
||||
$db['host'] = $_POST['dbhost'];
|
||||
$dbname = $_POST['dbname'];
|
||||
$db['user'] = $_POST['dbuser'];
|
||||
$db['pass'] = $_POST['dbpass'];
|
||||
}
|
||||
fclose($handle);
|
||||
} catch (PDOException $e) {
|
||||
$err_msg = sprintf($lang['widbcfgerr']);
|
||||
$err_lvl = 3;
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION[$rspathhex.'csrf_token'] = $newcsrf;
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihldb']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" data-toggle="validator" name="update" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#isntwidbtypedesc"><?php echo $lang['isntwidbtype']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" id="basic" name="dbtype" required>
|
||||
<option disabled value=""> -- select database -- </option>
|
||||
<?PHP
|
||||
echo '<option data-subtext="Cubrid" value="cubrid"'; if($db['type']=="cubrid") echo " selected=selected"; echo '>cubrid</option>';
|
||||
echo '<option data-subtext="FreeTDS / Microsoft SQL Server / Sybase" value="dblib"'; if($db['type']=="dblib") echo " selected=selected"; echo '>dblib</option>';
|
||||
echo '<option data-subtext="Firebird/Interbase 6" value="firebird"'; if($db['type']=="firebird") echo " selected=selected"; echo '>firebird</option>';
|
||||
echo '<option data-subtext="IBM DB2" value="ibm"'; if($db['type']=="ibm") echo " selected=selected"; echo '>ibm</option>';
|
||||
echo '<option data-subtext="IBM Informix Dynamic Server" value="informix"'; if($db['type']=="informix") echo " selected=selected"; echo '>informix</option>';
|
||||
echo '<option data-subtext="MySQL 3.x/4.x/5.x [recommend]" value="mysql"'; if($db['type']=="mysql") echo " selected=selected"; echo '>mysql</option>';
|
||||
echo '<option data-subtext="Oracle Call Interface" value="oci"'; if($db['type']=="oci") echo " selected=selected"; echo '>oci</option>';
|
||||
echo '<option data-subtext="ODBC v3 (IBM DB2, unixODBC und win32 ODBC)" value="odbc"'; if($db['type']=="odbc") echo " selected=selected"; echo '>odbc</option>';
|
||||
echo '<option data-subtext="PostgreSQL" value="pgsql"'; if($db['type']=="pgsql") echo " selected=selected"; echo '>pgsql</option>';
|
||||
echo '<option data-subtext="SQLite 3 und SQLite 2" value="sqlite"'; if($db['type']=="sqlite") echo " selected=selected"; echo '>sqlite</option>';
|
||||
echo '<option data-subtext="Microsoft SQL Server / SQL Azure" value="sqlsrv"'; if($db['type']=="sqlsrv") echo " selected=selected"; echo '>sqlsrv</option>';
|
||||
echo '<option data-subtext="4D" value="4d"'; if($db['type']=="4d") echo " selected=selected"; echo '>4d</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#isntwidbhostdesc"><?php echo $lang['isntwidbhost']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" name="dbhost" value="<?php echo $db['host']; ?>" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#isntwidbnamedesc"><?php echo $lang['isntwidbname']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" data-pattern="^([A-Za-z0-9$_]){1,64}$" data-error="Please do not use special characters or more then 64 characters inside the database name!" class="form-control" name="dbname" value="<?php echo $dbname; ?>" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#isntwidbusrdesc"><?php echo $lang['isntwidbusr']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" data-pattern="^[^"'\\-\s]+$" data-error="Please do not use one of the following special characters: ' \ " - also no whitespace and do not user more then 64 characters inside the database user!" class="form-control" name="dbuser" value="<?php echo $db['user']; ?>" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#isntwidbpassdesc"><?php echo $lang['isntwidbpass']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="password" data-pattern="^[^"'\\-\s]+$" data-error="Please do not use one of the following special characters: ' \ " - also no whitespace and do not user more then 64 characters inside the database password!" class="form-control" name="dbpass" value="<?php echo $db['pass']; ?>" data-toggle="password" data-placement="before" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="update"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="isntwidbtypedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['isntwidbtype']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['isntwidbtypedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="isntwidbhostdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['isntwidbhost']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['isntwidbhostdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="isntwidbusrdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['isntwidbusr']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['isntwidbusrdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="isntwidbpassdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['isntwidbpass']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['isntwidbpassdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="isntwidbnamedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['isntwidbname']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['isntwidbnamedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('form[data-toggle="validator"]').validator({
|
||||
custom: {
|
||||
pattern: function ($el) {
|
||||
var pattern = new RegExp($el.data('pattern'));
|
||||
return pattern.test($el.val());
|
||||
}
|
||||
},
|
||||
delay: 100,
|
||||
errors: {
|
||||
pattern: "There should be an error in your value, please check all could be right!"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,139 +1,149 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/phpcommand.php');
|
||||
|
||||
function enter_logfile($logpath,$timezone,$loglevel,$logtext) {
|
||||
$file = $logpath.'ranksystem.log';
|
||||
if ($loglevel == 1) {
|
||||
$loglevel = " CRITICAL ";
|
||||
} elseif ($loglevel == 2) {
|
||||
$loglevel = " ERROR ";
|
||||
} elseif ($loglevel == 3) {
|
||||
$loglevel = " WARNING ";
|
||||
} elseif ($loglevel == 4) {
|
||||
$loglevel = " NOTICE ";
|
||||
} elseif ($loglevel == 5) {
|
||||
$loglevel = " INFO ";
|
||||
}
|
||||
$input = DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ").$loglevel.$logtext."\n";
|
||||
$loghandle = fopen($file, 'a');
|
||||
fwrite($loghandle, $input);
|
||||
if (filesize($file) > 5242880) {
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Logfile filesie of 5 MiB reached.. Rotate logfile.\n");
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Restart Bot to continue with new log file...\n");
|
||||
fclose($loghandle);
|
||||
$file2 = "$file.old";
|
||||
if (file_exists($file2)) unlink($file2);
|
||||
rename($file, $file2);
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
exec("del /F ".substr(__DIR__,0,-12).'logs/pid');
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."worker.php start", 0, false);
|
||||
exit;
|
||||
} else {
|
||||
exec("rm -f ".substr(__DIR__,0,-12).'logs/pid');
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php start");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if(($last_access = $mysqlcon->query("SELECT last_access,count_access FROM $dbname.config")) === false) {
|
||||
$err_msg .= print_r($mysqlcon->errorInfo(), true);
|
||||
}
|
||||
$last_access = $last_access->fetchAll();
|
||||
|
||||
if(($last_access[0]['last_access'] + 1) >= time()) {
|
||||
$again = $last_access[0]['last_access'] + 2 - time();
|
||||
$err_msg = sprintf($lang['errlogin2'],$again);
|
||||
$err_lvl = 3;
|
||||
} elseif ($last_access[0]['count_access'] >= 10) {
|
||||
enter_logfile($logpath,$timezone,3,sprintf($lang['brute'], getclientip()));
|
||||
$err_msg = $lang['errlogin3'];
|
||||
$err_lvl = 3;
|
||||
$bantime = time() + 299;
|
||||
if($mysqlcon->exec("UPDATE $dbname.config SET last_access='$bantime', count_access='0'") === false) { }
|
||||
} elseif (isset($_POST['username']) && $_POST['username'] == $webuser && password_verify($_POST['password'], $webpass)) {
|
||||
$_SESSION[$rspathhex.'username'] = $webuser;
|
||||
$_SESSION[$rspathhex.'password'] = $webpass;
|
||||
$_SESSION[$rspathhex.'clientip'] = getclientip();
|
||||
$_SESSION[$rspathhex.'newversion'] = $newversion;
|
||||
if($mysqlcon->exec("UPDATE $dbname.config SET count_access='0'") === false) { }
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\')."/bot.php");
|
||||
exit;
|
||||
} elseif(isset($_POST['username'])) {
|
||||
$nowtime = time();
|
||||
if($mysqlcon->exec("UPDATE $dbname.config SET last_access='$nowtime', count_access = count_access + 1") === false) { }
|
||||
$err_msg = $lang['errlogin'];
|
||||
$err_lvl = 3;
|
||||
}
|
||||
|
||||
if(isset($_SESSION[$rspathhex.'username']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\')."/bot.php");
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div id="login-overlay" class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel"><?PHP echo $lang['isntwiusrh']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form id="loginForm" method="POST">
|
||||
<div class="form-group">
|
||||
<label for="username" class="control-label"><?PHP echo $lang['user']; ?>:</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
|
||||
<input type="text" class="form-control" name="username" placeholder="" maxlength="64" autofocus>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label"><?PHP echo $lang['pass']; ?>:</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
|
||||
<input type="password" class="form-control" name="password" placeholder="<?PHP echo $lang['pass']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<p>
|
||||
<button type="submit" class="btn btn-success btn-block"><?PHP echo $lang['login']; ?></button>
|
||||
</p>
|
||||
<p class="small text-right">
|
||||
<a href="resetpassword.php"><?PHP echo $lang['pass5']; ?></a>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<?PHP
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
if(in_array('sha512', hash_algos())) {
|
||||
ini_set('session.hash_function', 'sha512');
|
||||
}
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/phpcommand.php');
|
||||
|
||||
function enter_logfile($logpath,$timezone,$loglevel,$logtext) {
|
||||
$file = $logpath.'ranksystem.log';
|
||||
if ($loglevel == 1) {
|
||||
$loglevel = " CRITICAL ";
|
||||
} elseif ($loglevel == 2) {
|
||||
$loglevel = " ERROR ";
|
||||
} elseif ($loglevel == 3) {
|
||||
$loglevel = " WARNING ";
|
||||
} elseif ($loglevel == 4) {
|
||||
$loglevel = " NOTICE ";
|
||||
} elseif ($loglevel == 5) {
|
||||
$loglevel = " INFO ";
|
||||
}
|
||||
$input = DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ").$loglevel.$logtext."\n";
|
||||
$loghandle = fopen($file, 'a');
|
||||
fwrite($loghandle, $input);
|
||||
if (filesize($file) > 5242880) {
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Logfile filesie of 5 MiB reached.. Rotate logfile.\n");
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Restart Bot to continue with new log file...\n");
|
||||
fclose($loghandle);
|
||||
$file2 = "$file.old";
|
||||
if (file_exists($file2)) unlink($file2);
|
||||
rename($file, $file2);
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
exec("del /F ".substr(__DIR__,0,-12).'logs/pid');
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."worker.php start", 0, false);
|
||||
exit;
|
||||
} else {
|
||||
exec("rm -f ".substr(__DIR__,0,-12).'logs/pid');
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php start");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if(($last_access = $mysqlcon->query("SELECT `last_access`,`count_access` FROM `$dbname`.`config`")) === false) {
|
||||
$err_msg .= print_r($mysqlcon->errorInfo(), true);
|
||||
}
|
||||
$last_access = $last_access->fetchAll();
|
||||
|
||||
if(($last_access[0]['last_access'] + 1) >= time()) {
|
||||
$again = $last_access[0]['last_access'] + 2 - time();
|
||||
$err_msg = sprintf($lang['errlogin2'],$again);
|
||||
$err_lvl = 3;
|
||||
} elseif ($last_access[0]['count_access'] >= 10) {
|
||||
enter_logfile($logpath,$timezone,3,sprintf($lang['brute'], getclientip()));
|
||||
$err_msg = $lang['errlogin3'];
|
||||
$err_lvl = 3;
|
||||
$bantime = time() + 299;
|
||||
if($mysqlcon->exec("UPDATE `$dbname`.`config` SET `last_access`='$bantime',`count_access`='0'") === false) { }
|
||||
} elseif (isset($_POST['username']) && $_POST['username'] == $webuser && password_verify($_POST['password'], $webpass)) {
|
||||
$_SESSION[$rspathhex.'username'] = $webuser;
|
||||
$_SESSION[$rspathhex.'password'] = $webpass;
|
||||
$_SESSION[$rspathhex.'clientip'] = getclientip();
|
||||
$_SESSION[$rspathhex.'newversion'] = $newversion;
|
||||
$_SESSION[$rspathhex.'csrf_token'] = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
if($mysqlcon->exec("UPDATE `$dbname`.`config` SET `count_access`='0'") === false) { }
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\')."/bot.php");
|
||||
exit;
|
||||
} elseif(isset($_POST['username'])) {
|
||||
$nowtime = time();
|
||||
if($mysqlcon->exec("UPDATE `$dbname`.`config` SET `last_access`='$nowtime',`count_access`=`count_access` + 1") === false) { }
|
||||
$err_msg = $lang['errlogin'];
|
||||
$err_lvl = 3;
|
||||
}
|
||||
|
||||
if(isset($_SESSION[$rspathhex.'username']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\')."/bot.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div id="login-overlay" class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel"><?PHP echo $lang['isntwiusrh']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form id="loginForm" method="POST">
|
||||
<div class="form-group">
|
||||
<label for="username" class="control-label"><?PHP echo $lang['user']; ?>:</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
|
||||
<input type="text" class="form-control" name="username" placeholder="" maxlength="64" autofocus>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label"><?PHP echo $lang['pass']; ?>:</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
|
||||
<input type="password" class="form-control" name="password" placeholder="<?PHP echo $lang['pass']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<p>
|
||||
<button type="submit" class="btn btn-success btn-block"><?PHP echo $lang['login']; ?></button>
|
||||
</p>
|
||||
<p class="small text-right">
|
||||
<a href="resetpassword.php"><?PHP echo $lang['pass5']; ?></a>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,263 +1,281 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) {
|
||||
$rankupmsg = addslashes($_POST['rankupmsg']);
|
||||
$servernews = addslashes($_POST['servernews']);
|
||||
$nextupinfomsg1 = addslashes($_POST['nextupinfomsg1']);
|
||||
$nextupinfomsg2 = addslashes($_POST['nextupinfomsg2']);
|
||||
$nextupinfomsg3 = addslashes($_POST['nextupinfomsg3']);
|
||||
$nextupinfo = $_POST['nextupinfo'];
|
||||
if (isset($_POST['msgtouser'])) $msgtouser = 1; else $msgtouser = 0;
|
||||
if ($mysqlcon->exec("UPDATE $dbname.config set msgtouser='$msgtouser',rankupmsg='$rankupmsg',servernews='$servernews',nextupinfo='$nextupinfo',nextupinfomsg1='$nextupinfomsg1',nextupinfomsg2='$nextupinfomsg2',nextupinfomsg3='$nextupinfomsg3'") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], ' <form class="btn-group" name="restart" action="bot.php" method="POST"><button
|
||||
type="submit" class="btn btn-primary" name="restart"><i class="fa fa-fw fa-refresh"></i> '.$lang['wibot7'].'</button></form>');
|
||||
$err_lvl = NULL;
|
||||
}
|
||||
$rankupmsg = $_POST['rankupmsg'];
|
||||
$servernews = $_POST['servernews'];
|
||||
$nextupinfomsg1 = $_POST['nextupinfomsg1'];
|
||||
$nextupinfomsg2 = $_POST['nextupinfomsg2'];
|
||||
$nextupinfomsg3 = $_POST['nextupinfomsg3'];
|
||||
}
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihlmsg']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" name="update" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wimsgusrdesc"><?php echo $lang['wimsgusr']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($msgtouser == 1) {
|
||||
echo '<input id="switch-animate" type="checkbox" checked data-size="mini" name="msgtouser" value="',$msgtouser,'">';
|
||||
} else {
|
||||
echo '<input id="switch-animate" type="checkbox" data-size="mini" name="msgtouser" value="',$msgtouser,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wimsgmsgdesc"><?php echo $lang['wimsgmsg']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" rows="5" name="rankupmsg" maxlength="500"><?php echo $rankupmsg; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wimsgsndesc"><?php echo $lang['wimsgsn']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" rows="15" name="servernews" maxlength="5000"><?php echo $servernews; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#winxinfodesc"><?php echo $lang['winxinfo']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" id="basic" name="nextupinfo">
|
||||
<?PHP
|
||||
echo '<option value="0"'; if($nextupinfo=="0") echo " selected=selected"; echo '>',$lang['winxmode1'],'</option>';
|
||||
echo '<option value="1"'; if($nextupinfo=="1") echo " selected=selected"; echo '>',$lang['winxmode2'],'</option>';
|
||||
echo '<option value="2"'; if($nextupinfo=="2") echo " selected=selected"; echo '>',$lang['winxmode3'],'</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#winxmsgdesc1"><?php echo $lang['winxmsg1']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" rows="5" name="nextupinfomsg1" maxlength="500"><?php echo $nextupinfomsg1; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#winxmsgdesc2"><?php echo $lang['winxmsg2']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" rows="5" name="nextupinfomsg2" maxlength="500"><?php echo $nextupinfomsg2; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#winxmsgdesc3"><?php echo $lang['winxmsg3']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" rows="5" name="nextupinfomsg3" maxlength="500"><?php echo $nextupinfomsg3; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" name="update" class="btn btn-primary"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="wimsgusrdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wimsgusr']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wimsgusrdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wimsgmsgdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wimsgmsg']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wimsgmsgdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wimsgsndesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wimsgsn']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wimsgsndesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="winxinfodesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['winxinfo']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['winxinfodesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="winxmsgdesc1" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['winxmsg1']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['winxmsgdesc1']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="winxmsgdesc2" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['winxmsg2']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['winxmsgdesc2']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="winxmsgdesc3" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['winxmsg3']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['winxmsgdesc3']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<?PHP
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
if(in_array('sha512', hash_algos())) {
|
||||
ini_set('session.hash_function', 'sha512');
|
||||
}
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['update']) && $_POST['csrf_token'] != $_SESSION[$rspathhex.'csrf_token']) {
|
||||
echo $lang['errcsrf'];
|
||||
rem_session_ts3($rspathhex);
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
$newcsrf = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip() && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
$rankupmsg = addslashes($_POST['rankupmsg']);
|
||||
$servernews = addslashes($_POST['servernews']);
|
||||
$nextupinfomsg1 = addslashes($_POST['nextupinfomsg1']);
|
||||
$nextupinfomsg2 = addslashes($_POST['nextupinfomsg2']);
|
||||
$nextupinfomsg3 = addslashes($_POST['nextupinfomsg3']);
|
||||
$nextupinfo = $_POST['nextupinfo'];
|
||||
if (isset($_POST['msgtouser'])) $msgtouser = 1; else $msgtouser = 0;
|
||||
if ($mysqlcon->exec("UPDATE `$dbname`.`config` SET `msgtouser`='$msgtouser',`rankupmsg`='$rankupmsg',`servernews`='$servernews',`nextupinfo`='$nextupinfo',`nextupinfomsg1`='$nextupinfomsg1',`nextupinfomsg2`='$nextupinfomsg2',`nextupinfomsg3`='$nextupinfomsg3'") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], ' <form class="btn-group" name="restart" action="bot.php" method="POST"><input type="hidden" name="csrf_token" value="'.$newcsrf.'"><button
|
||||
type="submit" class="btn btn-primary" name="restart"><i class="fa fa-fw fa-refresh"></i> '.$lang['wibot7'].'</button></form>');
|
||||
$err_lvl = NULL;
|
||||
}
|
||||
$rankupmsg = $_POST['rankupmsg'];
|
||||
$servernews = $_POST['servernews'];
|
||||
$nextupinfomsg1 = $_POST['nextupinfomsg1'];
|
||||
$nextupinfomsg2 = $_POST['nextupinfomsg2'];
|
||||
$nextupinfomsg3 = $_POST['nextupinfomsg3'];
|
||||
}
|
||||
|
||||
$_SESSION[$rspathhex.'csrf_token'] = $newcsrf;
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihlmsg']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" name="update" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wimsgusrdesc"><?php echo $lang['wimsgusr']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($msgtouser == 1) {
|
||||
echo '<input id="switch-animate" type="checkbox" checked data-size="mini" name="msgtouser" value="',$msgtouser,'">';
|
||||
} else {
|
||||
echo '<input id="switch-animate" type="checkbox" data-size="mini" name="msgtouser" value="',$msgtouser,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wimsgmsgdesc"><?php echo $lang['wimsgmsg']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" rows="5" name="rankupmsg" maxlength="500"><?php echo $rankupmsg; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wimsgsndesc"><?php echo $lang['wimsgsn']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" rows="15" name="servernews" maxlength="5000"><?php echo $servernews; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#winxinfodesc"><?php echo $lang['winxinfo']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" id="basic" name="nextupinfo">
|
||||
<?PHP
|
||||
echo '<option value="0"'; if($nextupinfo=="0") echo " selected=selected"; echo '>',$lang['winxmode1'],'</option>';
|
||||
echo '<option value="1"'; if($nextupinfo=="1") echo " selected=selected"; echo '>',$lang['winxmode2'],'</option>';
|
||||
echo '<option value="2"'; if($nextupinfo=="2") echo " selected=selected"; echo '>',$lang['winxmode3'],'</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#winxmsgdesc1"><?php echo $lang['winxmsg1']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" rows="5" name="nextupinfomsg1" maxlength="500"><?php echo $nextupinfomsg1; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#winxmsgdesc2"><?php echo $lang['winxmsg2']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" rows="5" name="nextupinfomsg2" maxlength="500"><?php echo $nextupinfomsg2; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#winxmsgdesc3"><?php echo $lang['winxmsg3']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" rows="5" name="nextupinfomsg3" maxlength="500"><?php echo $nextupinfomsg3; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" name="update" class="btn btn-primary"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="wimsgusrdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wimsgusr']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wimsgusrdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wimsgmsgdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wimsgmsg']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wimsgmsgdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wimsgsndesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wimsgsn']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wimsgsndesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="winxinfodesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['winxinfo']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['winxinfodesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="winxmsgdesc1" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['winxmsg1']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['winxmsgdesc1']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="winxmsgdesc2" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['winxmsg2']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['winxmsgdesc2']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="winxmsgdesc3" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['winxmsg3']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['winxmsgdesc3']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,182 +1,182 @@
|
||||
<?PHP
|
||||
$job_check = $mysqlcon->query("SELECT * FROM $dbname.job_check")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
if((time() - $job_check['last_update']['timestamp']) < 259200 && !isset($_SESSION[$rspathhex.'upinfomsg'])) {
|
||||
if(!isset($err_msg)) {
|
||||
$err_msg = '<i class="fa fa-fw fa-info-circle"></i> '.sprintf($lang['upinf2'], date("Y-m-d H:i",$job_check['last_update']['timestamp']), '<a href="//ts-n.net/ranksystem.php?changelog" target="_blank"><i class="fa fa-fw fa-book"></i> ', '</a>'); $err_lvl = 1;
|
||||
$_SESSION[$rspathhex.'upinfomsg'] = 1;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?PHP echo $language; ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="version" content="<?PHP echo $currvers; ?>">
|
||||
<link rel="icon" href="../tsicons/rs.png">
|
||||
<title>TS-N.NET Ranksystem</title>
|
||||
<link href="../libs/combined_wi.css?v=<?PHP echo $currvers; ?>" rel="stylesheet">
|
||||
<script src="../libs/combined_wi.js?v=<?PHP echo $currvers; ?>"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
$('.required-icon').tooltip({
|
||||
placement: 'left',
|
||||
title: 'Required field'
|
||||
});
|
||||
});
|
||||
$(function() {
|
||||
$('#password').password().on('show.bs.password', function(e) {
|
||||
$('#eventLog').text('On show event');
|
||||
$('#methods').prop('checked', true);
|
||||
}).on('hide.bs.password', function(e) {
|
||||
$('#eventLog').text('On hide event');
|
||||
$('#methods').prop('checked', false);
|
||||
});
|
||||
$('#methods').click(function() {
|
||||
$('#password').password('toggle');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="index.php">TSN Ranksystem - Webinterface <?PHP echo $currvers;?></a>
|
||||
<?PHP if(isset($_SESSION[$rspathhex.'newversion']) && version_compare(substr($_SESSION[$rspathhex.'newversion'], 0, 5), substr($currvers, 0, 5), '>') && $_SESSION[$rspathhex.'newversion'] != '') {
|
||||
echo '<a class="navbar-brand" href="//ts-n.net/ranksystem.php?changelog" target="_blank">'.$lang['winav9'].' ['.$_SESSION[$rspathhex.'newversion'].']</a>';
|
||||
} ?>
|
||||
</div>
|
||||
<?PHP if(basename($_SERVER['SCRIPT_NAME']) == "stats.php") { ?>
|
||||
<ul class="nav navbar-left top-nav">
|
||||
<li class="navbar-form navbar-right">
|
||||
<button onclick="window.open('../stats/list_rankup.php?admin=true','_blank'); return false;" class="btn btn-primary" name="adminlist">
|
||||
<i class="fa fa-fw fa-list"></i> <?PHP echo $lang['wihladm']; ?>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<?PHP } ?>
|
||||
<ul class="nav navbar-right top-nav">
|
||||
<?PHP
|
||||
if($_SERVER['SERVER_PORT'] == 443 || $_SERVER['SERVER_PORT'] == 80) {
|
||||
echo '<li><a href="//',$_SERVER['SERVER_NAME'],substr(dirname($_SERVER['SCRIPT_NAME']),0,-12),'stats/"><i class="fa fa-fw fa-bar-chart"></i> ',$lang['winav6'],'</a></li>';
|
||||
} else {
|
||||
echo '<li><a href="//',$_SERVER['SERVER_NAME'],':',$_SERVER['SERVER_PORT'],substr(dirname($_SERVER['SCRIPT_NAME']),0,-12),'stats/"><i class="fa fa-fw fa-bar-chart"></i> ',$lang['winav6'],'</a></li>';
|
||||
}
|
||||
if(isset($_SESSION[$rspathhex.'username']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass) { ?>
|
||||
<li>
|
||||
<a href="changepassword.php"><i class="fa fa-lock"></i> <?PHP echo $lang['pass2']; ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<form class="navbar-form navbar-center" method="post">
|
||||
<div class="form-group">
|
||||
<button type="submit" name="logout" class="btn btn-primary"><?PHP echo $lang['wilogout']; ?> <span class="glyphicon glyphicon-log-out" aria-hidden="true"></span></button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<?PHP } ?>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-globe"></i> <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a href="?lang=ar"><span class="flag-icon flag-icon-arab"></span> AR - العربية</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=cz"><span class="flag-icon flag-icon-cz"></span> CZ - čeština</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=de"><span class="flag-icon flag-icon-de"></span> DE - Deutsch</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=en"><span class="flag-icon flag-icon-gb"></span> EN - english</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=fr"><span class="flag-icon flag-icon-fr"></span> FR - français</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=it"><span class="flag-icon flag-icon-it"></span> IT - Italiano</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=nl"><span class="flag-icon flag-icon-nl"></span> NL - Nederlands</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=pl"><span class="flag-icon flag-icon-pl"></span> PL - polski</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=pt"><span class="flag-icon flag-icon-ptbr"></span> PT - Português</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=ro"><span class="flag-icon flag-icon-ro"></span> RO - Română</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=ru"><span class="flag-icon flag-icon-ru"></span> RU - Pусский</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="collapse navbar-collapse navbar-ex1-collapse">
|
||||
<ul class="nav navbar-nav side-nav">
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "ts.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="ts.php"><i class="fa fa-fw fa-headphones"></i> <?PHP echo $lang['winav1']; ?></a>
|
||||
</li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "db.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="db.php"><i class="fa fa-fw fa-database"></i> <?PHP echo $lang['winav2']; ?></a>
|
||||
</li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "core.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="core.php"><i class="fa fa-fw fa-cogs"></i> <?PHP echo $lang['winav3']; ?></a>
|
||||
</li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "other.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="other.php"><i class="fa fa-fw fa-wrench"></i> <?PHP echo $lang['winav4']; ?></a>
|
||||
</li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "msg.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="msg.php"><i class="fa fa-fw fa-envelope"></i> <?PHP echo $lang['winav5']; ?></a>
|
||||
</li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "stats.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="stats.php"><i class="fa fa-fw fa-bar-chart"></i> <?PHP echo $lang['winav6']; ?></a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "addon_assign_groups.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="javascript:;" data-toggle="collapse" data-target="#addons"><i class="fa fa-fw fa-puzzle-piece"></i> <?PHP echo $lang['winav12']; ?> <i class="fa fa-fw fa-caret-down"></i></a>
|
||||
<ul id="addons" class="collapse">
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "addon_assign_groups.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="addon_assign_groups.php"><?PHP echo $lang['stag0001']; ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "admin.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="javascript:;" data-toggle="collapse" data-target="#demo"><i class="fa fa-fw fa-users"></i> <?PHP echo $lang['winav7']; ?> <i class="fa fa-fw fa-caret-down"></i></a>
|
||||
<ul id="demo" class="collapse">
|
||||
<li>
|
||||
<a href="admin.php"><?PHP echo $lang['wihladm1']; ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "bot.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="bot.php"><i class="fa fa-fw fa-power-off"></i> <?PHP echo $lang['winav8']; ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<?PHP
|
||||
if($adminuuid==NULL && $_SESSION[$rspathhex.'username'] == $webuser && !isset($err_msg)) {
|
||||
$err_msg = $lang['winav11']; $err_lvl = 3;
|
||||
}
|
||||
|
||||
if(!isset($_SERVER['HTTPS']) && !isset($err_msg) || $_SERVER['HTTPS'] != "on" && !isset($err_msg)) {
|
||||
$host = "<a href=\"https://".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\')."\">";
|
||||
$err_msg = sprintf($lang['winav10'], $host,'</a>!<br>', '<br>'); $err_lvl = 2;
|
||||
}
|
||||
|
||||
function error_handling($msg,$type = NULL) {
|
||||
switch ($type) {
|
||||
case NULL: echo '<div class="alert alert-success alert-dismissible">'; break;
|
||||
case 1: echo '<div class="alert alert-info alert-dismissible">'; break;
|
||||
case 2: echo '<div class="alert alert-warning alert-dismissible">'; break;
|
||||
case 3: echo '<div class="alert alert-danger alert-dismissible">'; break;
|
||||
}
|
||||
echo '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>',$msg,'</div>';
|
||||
}
|
||||
?>
|
||||
<?PHP
|
||||
$job_check = $mysqlcon->query("SELECT * FROM `$dbname`.`job_check`")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
|
||||
if((time() - $job_check['last_update']['timestamp']) < 259200 && !isset($_SESSION[$rspathhex.'upinfomsg'])) {
|
||||
if(!isset($err_msg)) {
|
||||
$err_msg = '<i class="fa fa-fw fa-info-circle"></i> '.sprintf($lang['upinf2'], date("Y-m-d H:i",$job_check['last_update']['timestamp']), '<a href="//ts-n.net/ranksystem.php?changelog" target="_blank"><i class="fa fa-fw fa-book"></i> ', '</a>'); $err_lvl = 1;
|
||||
$_SESSION[$rspathhex.'upinfomsg'] = 1;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?PHP echo $language; ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="version" content="<?PHP echo $currvers; ?>">
|
||||
<link rel="icon" href="../tsicons/rs.png">
|
||||
<title>TS-N.NET Ranksystem</title>
|
||||
<link href="../libs/combined_wi.css?v=<?PHP echo $currvers; ?>" rel="stylesheet">
|
||||
<script src="../libs/combined_wi.js?v=<?PHP echo $currvers; ?>"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
$('.required-icon').tooltip({
|
||||
placement: 'left',
|
||||
title: 'Required field'
|
||||
});
|
||||
});
|
||||
$(function() {
|
||||
$('#password').password().on('show.bs.password', function(e) {
|
||||
$('#eventLog').text('On show event');
|
||||
$('#methods').prop('checked', true);
|
||||
}).on('hide.bs.password', function(e) {
|
||||
$('#eventLog').text('On hide event');
|
||||
$('#methods').prop('checked', false);
|
||||
});
|
||||
$('#methods').click(function() {
|
||||
$('#password').password('toggle');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="index.php">TSN Ranksystem - Webinterface <?PHP echo $currvers;?></a>
|
||||
<?PHP if(isset($_SESSION[$rspathhex.'newversion']) && version_compare(substr($_SESSION[$rspathhex.'newversion'], 0, 5), substr($currvers, 0, 5), '>') && $_SESSION[$rspathhex.'newversion'] != '') {
|
||||
echo '<a class="navbar-brand" href="//ts-n.net/ranksystem.php?changelog" target="_blank">'.$lang['winav9'].' ['.$_SESSION[$rspathhex.'newversion'].']</a>';
|
||||
} ?>
|
||||
</div>
|
||||
<?PHP if(basename($_SERVER['SCRIPT_NAME']) == "stats.php") { ?>
|
||||
<ul class="nav navbar-left top-nav">
|
||||
<li class="navbar-form navbar-right">
|
||||
<button onclick="window.open('../stats/list_rankup.php?admin=true','_blank'); return false;" class="btn btn-primary" name="adminlist">
|
||||
<i class="fa fa-fw fa-list"></i> <?PHP echo $lang['wihladm']; ?>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<?PHP } ?>
|
||||
<ul class="nav navbar-right top-nav">
|
||||
<?PHP
|
||||
if($_SERVER['SERVER_PORT'] == 443 || $_SERVER['SERVER_PORT'] == 80) {
|
||||
echo '<li><a href="//',$_SERVER['SERVER_NAME'],substr(dirname($_SERVER['SCRIPT_NAME']),0,-12),'stats/"><i class="fa fa-fw fa-bar-chart"></i> ',$lang['winav6'],'</a></li>';
|
||||
} else {
|
||||
echo '<li><a href="//',$_SERVER['SERVER_NAME'],':',$_SERVER['SERVER_PORT'],substr(dirname($_SERVER['SCRIPT_NAME']),0,-12),'stats/"><i class="fa fa-fw fa-bar-chart"></i> ',$lang['winav6'],'</a></li>';
|
||||
}
|
||||
if(isset($_SESSION[$rspathhex.'username']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass) { ?>
|
||||
<li>
|
||||
<a href="changepassword.php"><i class="fa fa-lock"></i> <?PHP echo $lang['pass2']; ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<form class="navbar-form navbar-center" method="post">
|
||||
<div class="form-group">
|
||||
<button type="submit" name="logout" class="btn btn-primary"><?PHP echo $lang['wilogout']; ?> <span class="glyphicon glyphicon-log-out" aria-hidden="true"></span></button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<?PHP } ?>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-globe"></i> <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a href="?lang=ar"><span class="flag-icon flag-icon-arab"></span> AR - العربية</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=cz"><span class="flag-icon flag-icon-cz"></span> CZ - čeština</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=de"><span class="flag-icon flag-icon-de"></span> DE - Deutsch</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=en"><span class="flag-icon flag-icon-gb"></span> EN - English</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=fr"><span class="flag-icon flag-icon-fr"></span> FR - français</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=it"><span class="flag-icon flag-icon-it"></span> IT - Italiano</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=nl"><span class="flag-icon flag-icon-nl"></span> NL - Nederlands</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=pl"><span class="flag-icon flag-icon-pl"></span> PL - polski</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=ro"><span class="flag-icon flag-icon-ro"></span> RO - Română</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=ru"><span class="flag-icon flag-icon-ru"></span> RU - Pусский</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?lang=pt"><span class="flag-icon flag-icon-ptbr"></span> PT - Português</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="collapse navbar-collapse navbar-ex1-collapse">
|
||||
<ul class="nav navbar-nav side-nav">
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "ts.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="ts.php"><i class="fa fa-fw fa-headphones"></i> <?PHP echo $lang['winav1']; ?></a>
|
||||
</li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "db.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="db.php"><i class="fa fa-fw fa-database"></i> <?PHP echo $lang['winav2']; ?></a>
|
||||
</li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "core.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="core.php"><i class="fa fa-fw fa-cogs"></i> <?PHP echo $lang['winav3']; ?></a>
|
||||
</li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "other.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="other.php"><i class="fa fa-fw fa-wrench"></i> <?PHP echo $lang['winav4']; ?></a>
|
||||
</li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "msg.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="msg.php"><i class="fa fa-fw fa-envelope"></i> <?PHP echo $lang['winav5']; ?></a>
|
||||
</li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "stats.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="stats.php"><i class="fa fa-fw fa-bar-chart"></i> <?PHP echo $lang['winav6']; ?></a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "addon_assign_groups.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="javascript:;" data-toggle="collapse" data-target="#addons"><i class="fa fa-fw fa-puzzle-piece"></i> <?PHP echo $lang['winav12']; ?> <i class="fa fa-fw fa-caret-down"></i></a>
|
||||
<ul id="addons" class="collapse">
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "addon_assign_groups.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="addon_assign_groups.php"><?PHP echo $lang['stag0001']; ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "admin.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="javascript:;" data-toggle="collapse" data-target="#demo"><i class="fa fa-fw fa-users"></i> <?PHP echo $lang['winav7']; ?> <i class="fa fa-fw fa-caret-down"></i></a>
|
||||
<ul id="demo" class="collapse">
|
||||
<li>
|
||||
<a href="admin.php"><?PHP echo $lang['wihladm1']; ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<?PHP echo '<li'.(basename($_SERVER['SCRIPT_NAME']) == "bot.php" ? ' class="active">' : '>'); ?>
|
||||
<a href="bot.php"><i class="fa fa-fw fa-power-off"></i> <?PHP echo $lang['winav8']; ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<?PHP
|
||||
if($adminuuid==NULL && $_SESSION[$rspathhex.'username'] == $webuser && !isset($err_msg)) {
|
||||
$err_msg = $lang['winav11']; $err_lvl = 3;
|
||||
}
|
||||
|
||||
if(!isset($_SERVER['HTTPS']) && !isset($err_msg) || $_SERVER['HTTPS'] != "on" && !isset($err_msg)) {
|
||||
$host = "<a href=\"https://".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\')."\">";
|
||||
$err_msg = sprintf($lang['winav10'], $host,'</a>!<br>', '<br>'); $err_lvl = 2;
|
||||
}
|
||||
|
||||
function error_handling($msg,$type = NULL) {
|
||||
switch ($type) {
|
||||
case NULL: echo '<div class="alert alert-success alert-dismissible">'; break;
|
||||
case 1: echo '<div class="alert alert-info alert-dismissible">'; break;
|
||||
case 2: echo '<div class="alert alert-warning alert-dismissible">'; break;
|
||||
case 3: echo '<div class="alert alert-danger alert-dismissible">'; break;
|
||||
}
|
||||
echo '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>',$msg,'</div>';
|
||||
}
|
||||
?>
|
||||
@@ -1,237 +1,308 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) {
|
||||
$timezone = $_POST['timezone'];
|
||||
$timeformat = $_POST['dateformat'];
|
||||
$logpath = addslashes($_POST['logpath']);
|
||||
$language = $_POST['languagedb'];
|
||||
$adminuuid = $_POST['adminuuid'];
|
||||
if ($mysqlcon->exec("UPDATE $dbname.config set timezone='$timezone',dateformat='$timeformat',logpath='$logpath',language='$language',adminuuid='$adminuuid'") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], ' <form class="btn-group" name="restart" action="bot.php" method="POST"><button
|
||||
type="submit" class="btn btn-primary" name="restart"><i class="fa fa-fw fa-refresh"></i> '.$lang['wibot7'].'</button></form>');
|
||||
$err_lvl = NULL;
|
||||
}
|
||||
$logpath = $_POST['logpath'];
|
||||
$config['adminuuid'] = $_POST['adminuuid'];
|
||||
}
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihlvs']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" data-toggle="validator" name="update" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#witimedesc"><?php echo $lang['witime']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" data-live-search="true" name="timezone">
|
||||
<?PHP
|
||||
$timezonearr = DateTimeZone::listIdentifiers();
|
||||
foreach ($timezonearr as $timez) {
|
||||
if ($timez == $timezone) {
|
||||
echo '<option value="'.$timezone,'" selected=selected>',$timezone,'</option>';
|
||||
} else {
|
||||
echo '<option value="',$timez,'">',$timez,'</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#widaformdesc"><?php echo $lang['widaform']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="dateformat" value="<?php echo $timeformat; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wilogdesc"><?php echo $lang['wilog']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" data-pattern=".*(\/|\\)$" data-error="The Logpath must end with / or \" name="logpath" value="<?php echo $logpath; ?>" required>
|
||||
<div class="help-block with-errors"></div>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wivlangdesc"><?php echo $lang['wivlang']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" name="languagedb">
|
||||
<?PHP
|
||||
echo '<option data-subtext="العربية" value="ar"'.($language === 'ar' ? ' selected="selected"' : '').'>AR</option>';
|
||||
echo '<option data-subtext="čeština" value="cz"'.($language === 'cz' ? ' selected="selected"' : '').'>CZ</option>';
|
||||
echo '<option data-subtext="Deutsch" value="de"'.($language === 'de' ? ' selected="selected"' : '').'>DE</option>';
|
||||
echo '<option data-subtext="English" value="en"'.($language === 'en' ? ' selected="selected"' : '').'>EN</option>';
|
||||
echo '<option data-subtext="français" value="fr"'.($language === 'fr' ? ' selected="selected"' : '').'>FR</option>';
|
||||
echo '<option data-subtext="Italiano" value="it"'.($language === 'it' ? ' selected="selected"' : '').'>IT</option>';
|
||||
echo '<option data-subtext="Nederlands" value="nl"'.($language === 'nl' ? ' selected="selected"' : '').'>NL</option>';
|
||||
echo '<option data-subtext="polski" value="pl"'.($language === 'pl' ? ' selected="selected"' : '').'>PL</option>';
|
||||
echo '<option data-subtext="Português" value="pt"'.($language === 'pt' ? ' selected="selected"' : '').'>PT</option>';
|
||||
echo '<option data-subtext="Română" value="ro"'.($language === 'ro' ? ' selected="selected"' : '').'>RO</option>';
|
||||
echo '<option data-subtext="Pусский" value="ru"'.($language === 'ru' ? ' selected="selected"' : '').'>RU</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wiadmuuiddesc"><?php echo $lang['wiadmuuid']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<textarea class="form-control" data-pattern="^([A-Za-z0-9\\\/\+]{27}=,)*([A-Za-z0-9\\\/\+]{27}=)$" data-error="Check all unique IDs are correct and your list do not ends with a comma!" rows="1" name="adminuuid" maxlength="500"><?php echo $config['adminuuid']; ?></textarea>
|
||||
<div class="help-block with-errors"></div>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" name="update" class="btn btn-primary"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="witimedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['witime']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['witimedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="widaformdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['widaform']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['widaformdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wilogdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wilog']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wilogdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wivlangdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wivlang']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wivlangdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wiadmuuiddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wiadmuuid']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wiadmuuiddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('form[data-toggle="validator"]').validator({
|
||||
custom: {
|
||||
pattern: function ($el) {
|
||||
var pattern = new RegExp($el.data('pattern'));
|
||||
return pattern.test($el.val());
|
||||
}
|
||||
},
|
||||
delay: 100,
|
||||
errors: {
|
||||
pattern: "There should be an error in your value, please check all could be right!"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<?PHP
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
if(in_array('sha512', hash_algos())) {
|
||||
ini_set('session.hash_function', 'sha512');
|
||||
}
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
$newcsrf = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['update']) && $_POST['csrf_token'] != $_SESSION[$rspathhex.'csrf_token']) {
|
||||
echo $lang['errcsrf'];
|
||||
rem_session_ts3($rspathhex);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip() && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
if (isset($_POST['iphash'])) $iphash = 1; else $iphash = 0;
|
||||
$timezone = $_POST['timezone'];
|
||||
$timeformat = $_POST['dateformat'];
|
||||
$logpath = addslashes($_POST['logpath']);
|
||||
$language = $_POST['languagedb'];
|
||||
$_SESSION[$rspathhex.'language'] = $_POST['languagedb'];
|
||||
$adminuuid = $_POST['adminuuid'];
|
||||
if ($mysqlcon->exec("UPDATE `$dbname`.`config` SET `timezone`='$timezone',`dateformat`='$timeformat',`logpath`='$logpath',`language`='$language',`adminuuid`='$adminuuid',`iphash`='$iphash'") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], ' <form class="btn-group" name="restart" action="bot.php" method="POST"><input type="hidden" name="csrf_token" value="'.$newcsrf.'"><button
|
||||
type="submit" class="btn btn-primary" name="restart"><i class="fa fa-fw fa-refresh"></i> '.$lang['wibot7'].'</button></form>');
|
||||
$err_lvl = NULL;
|
||||
}
|
||||
$logpath = $_POST['logpath'];
|
||||
$config['adminuuid'] = $_POST['adminuuid'];
|
||||
if(!isset($language) || $language == "en") {
|
||||
require_once(substr(dirname(__FILE__),0,-12).'languages/core_en.php');
|
||||
} elseif($language == "ar") {
|
||||
require_once(substr(dirname(__FILE__),0,-12).'languages/core_ar.php');
|
||||
} elseif($language == "cz") {
|
||||
require_once(substr(dirname(__FILE__),0,-12).'languages/core_cz.php');
|
||||
} elseif($language == "de") {
|
||||
require_once(substr(dirname(__FILE__),0,-12).'languages/core_de.php');
|
||||
} elseif($language == "fr") {
|
||||
require_once(substr(dirname(__FILE__),0,-12).'languages/core_fr.php');
|
||||
} elseif($language == "it") {
|
||||
require_once(substr(dirname(__FILE__),0,-12).'languages/core_it.php');
|
||||
} elseif($language == "nl") {
|
||||
require_once(substr(dirname(__FILE__),0,-12).'languages/core_nl.php');
|
||||
} elseif($language == "pl") {
|
||||
require_once(substr(dirname(__FILE__),0,-12).'languages/core_pl.php');
|
||||
} elseif($language == "ro") {
|
||||
require_once(substr(dirname(__FILE__),0,-12).'languages/core_ro.php');
|
||||
} elseif($language == "ru") {
|
||||
require_once(substr(dirname(__FILE__),0,-12).'languages/core_ru.php');
|
||||
} elseif($language == "pt") {
|
||||
require_once(substr(dirname(__FILE__),0,-12).'languages/core_pt.php');
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION[$rspathhex.'csrf_token'] = $newcsrf;
|
||||
|
||||
require_once('nav.php');
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihlvs']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" data-toggle="validator" name="update" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#witimedesc"><?php echo $lang['witime']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" data-live-search="true" name="timezone">
|
||||
<?PHP
|
||||
$timezonearr = DateTimeZone::listIdentifiers();
|
||||
foreach ($timezonearr as $timez) {
|
||||
if ($timez == $timezone) {
|
||||
echo '<option value="'.$timezone,'" selected=selected>',$timezone,'</option>';
|
||||
} else {
|
||||
echo '<option value="',$timez,'">',$timez,'</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#widaformdesc"><?php echo $lang['widaform']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="dateformat" value="<?php echo $timeformat; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wilogdesc"><?php echo $lang['wilog']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" data-pattern=".*(\/|\\)$" data-error="The Logpath must end with / or \" name="logpath" value="<?php echo $logpath; ?>" required>
|
||||
<div class="help-block with-errors"></div>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wivlangdesc"><?php echo $lang['wivlang']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" name="languagedb">
|
||||
<?PHP
|
||||
echo '<option data-subtext="العربية" value="ar"'.($language === 'ar' ? ' selected="selected"' : '').'>AR</option>';
|
||||
echo '<option data-subtext="čeština" value="cz"'.($language === 'cz' ? ' selected="selected"' : '').'>CZ</option>';
|
||||
echo '<option data-subtext="Deutsch" value="de"'.($language === 'de' ? ' selected="selected"' : '').'>DE</option>';
|
||||
echo '<option data-subtext="English" value="en"'.($language === 'en' ? ' selected="selected"' : '').'>EN</option>';
|
||||
echo '<option data-subtext="français" value="fr"'.($language === 'fr' ? ' selected="selected"' : '').'>FR</option>';
|
||||
echo '<option data-subtext="Italiano" value="it"'.($language === 'it' ? ' selected="selected"' : '').'>IT</option>';
|
||||
echo '<option data-subtext="Nederlands" value="nl"'.($language === 'nl' ? ' selected="selected"' : '').'>NL</option>';
|
||||
echo '<option data-subtext="polski" value="pl"'.($language === 'pl' ? ' selected="selected"' : '').'>PL</option>';
|
||||
echo '<option data-subtext="Română" value="ro"'.($language === 'ro' ? ' selected="selected"' : '').'>RO</option>';
|
||||
echo '<option data-subtext="Pусский" value="ru"'.($language === 'ru' ? ' selected="selected"' : '').'>RU</option>';
|
||||
echo '<option data-subtext="Português" value="pt"'.($language === 'pt' ? ' selected="selected"' : '').'>PT</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wiadmuuiddesc"><?php echo $lang['wiadmuuid']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<textarea class="form-control" data-pattern="^([A-Za-z0-9\\\/\+]{27}=,)*([A-Za-z0-9\\\/\+]{27}=)$" data-error="Check all unique IDs are correct and your list do not ends with a comma!" rows="1" name="adminuuid" maxlength="500"><?php echo $config['adminuuid']; ?></textarea>
|
||||
<div class="help-block with-errors"></div>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolhadesc"><?php echo $lang['wishcolha']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($iphash == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="iphash" value="',$iphash,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="iphash" value="',$iphash,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" name="update" class="btn btn-primary"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="witimedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['witime']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['witimedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="widaformdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['widaform']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['widaformdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wilogdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wilog']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wilogdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wivlangdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wivlang']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wivlangdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wiadmuuiddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wiadmuuid']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wiadmuuiddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolhadesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolha']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolhadesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('form[data-toggle="validator"]').validator({
|
||||
custom: {
|
||||
pattern: function ($el) {
|
||||
var pattern = new RegExp($el.data('pattern'));
|
||||
return pattern.test($el.val());
|
||||
}
|
||||
},
|
||||
delay: 100,
|
||||
errors: {
|
||||
pattern: "There should be an error in your value, please check all could be right!"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,159 +1,176 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/phpcommand.php');
|
||||
|
||||
function enter_logfile($logpath,$timezone,$loglevel,$logtext) {
|
||||
$file = $logpath.'ranksystem.log';
|
||||
if ($loglevel == 1) {
|
||||
$loglevel = " CRITICAL ";
|
||||
} elseif ($loglevel == 2) {
|
||||
$loglevel = " ERROR ";
|
||||
} elseif ($loglevel == 3) {
|
||||
$loglevel = " WARNING ";
|
||||
} elseif ($loglevel == 4) {
|
||||
$loglevel = " NOTICE ";
|
||||
} elseif ($loglevel == 5) {
|
||||
$loglevel = " INFO ";
|
||||
}
|
||||
$input = DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ").$loglevel.$logtext."\n";
|
||||
$loghandle = fopen($file, 'a');
|
||||
fwrite($loghandle, $input);
|
||||
if (filesize($file) > 5242880) {
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Logfile filesie of 5 MiB reached.. Rotate logfile.\n");
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Restart Bot to continue with new log file...\n");
|
||||
fclose($loghandle);
|
||||
$file2 = "$file.old";
|
||||
if (file_exists($file2)) unlink($file2);
|
||||
rename($file, $file2);
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
exec("del /F ".substr(__DIR__,0,-12).'logs/pid');
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."worker.php start", 0, false);
|
||||
exit;
|
||||
} else {
|
||||
exec("rm -f ".substr(__DIR__,0,-12).'logs/pid');
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php start");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if(($last_access = $mysqlcon->query("SELECT last_access,count_access FROM $dbname.config")) === false) {
|
||||
$err_msg .= print_r($mysqlcon->errorInfo(), true);
|
||||
}
|
||||
$last_access = $last_access->fetchAll();
|
||||
|
||||
if (($last_access[0]['last_access'] + 1) >= time()) {
|
||||
$again = $last_access[0]['last_access'] + 2 - time();
|
||||
$err_msg = sprintf($lang['errlogin2'],$again);
|
||||
$err_lvl = 3;
|
||||
} elseif (isset($_POST['resetpw']) && ($adminuuid==NULL || count($adminuuid) == 0)) {
|
||||
$err_msg = $lang['wirtpw1']; $err_lvl=3;
|
||||
} elseif (isset($_POST['resetpw'])) {
|
||||
$nowtime = time();
|
||||
if($mysqlcon->exec("UPDATE $dbname.config SET last_access='$nowtime', count_access = count_access + 1") === false) { }
|
||||
|
||||
require_once(substr(__DIR__,0,-12).'libs/ts3_lib/TeamSpeak3.php');
|
||||
try {
|
||||
$ts3 = TeamSpeak3::factory("serverquery://".$ts['user'].":".$ts['pass']."@".$ts['host'].":".$ts['query']."/?server_port=".$ts['voice']."&blocking=0");
|
||||
|
||||
try {
|
||||
usleep($slowmode);
|
||||
$ts3->selfUpdate(array('client_nickname' => "Ranksystem - Reset Password"));
|
||||
} catch (Exception $e) { }
|
||||
|
||||
usleep($slowmode);
|
||||
$allclients = $ts3->clientList();
|
||||
$adminuuid_flipped = array_flip($adminuuid);
|
||||
|
||||
foreach ($allclients as $client) {
|
||||
if(in_array($client['client_unique_identifier'] , $adminuuid)) {
|
||||
$uuid = $client['client_unique_identifier'];
|
||||
$checkuuid = 1;
|
||||
if($client['connection_client_ip'] == getclientip()) {
|
||||
$checkip = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($checkuuid)) {
|
||||
$err_msg = $lang['wirtpw2']; $err_lvl = 3;
|
||||
} elseif (!isset($checkip)) {
|
||||
$err_msg = $lang['wirtpw3']; $err_lvl = 3;
|
||||
} else {
|
||||
usleep($slowmode);
|
||||
$pwd = substr(str_shuffle("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#*+;:-_~?=%&$<24>!()"),0,12);
|
||||
$webpass = password_hash($pwd, PASSWORD_DEFAULT);
|
||||
if($mysqlcon->exec("UPDATE $dbname.config set webpass='$webpass', last_access='0'") === false) {
|
||||
$err_msg = $lang['isntwidbmsg'].print_r($mysqlcon->errorInfo(), true); $err_lvl = 3;
|
||||
} else {
|
||||
try {
|
||||
$ts3->clientGetByUid($uuid)->message(sprintf($lang['wirtpw4'], $webuser, $pwd, '[URL=http'.(!empty($_SERVER['HTTPS'])?"s":"").'://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']).']','[/URL]'));
|
||||
$err_msg = sprintf($lang['wirtpw5'],'<a href="http'.(!empty($_SERVER['HTTPS'])?"s":"").'://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']).'/">','</a>'); $err_lvl = 1;
|
||||
enter_logfile($logpath,$timezone,3,sprintf($lang['wirtpw6'],getclientip()));
|
||||
} catch (Exception $e) {
|
||||
$err_msg = 'TeamSpeak '.$lang['error'].$e->getCode().': '.$e->getMessage(); $err_lvl = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$err_msg = 'TeamSpeak '.$lang['error'].$e->getCode().': '.$e->getMessage(); $err_lvl = 3;
|
||||
}
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div id="login-overlay" class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel"><?PHP echo $lang['wirtpw7'].' - '.$lang['wi']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form id="resetForm" method="POST">
|
||||
<p><?PHP echo $lang['wirtpw8']; ?></p>
|
||||
<p><?PHP echo $lang['wirtpw9']; ?>
|
||||
<ul>
|
||||
<li><?PHP echo $lang['wirtpw10']; ?></li>
|
||||
<li><?PHP echo $lang['wirtpw11']; ?></li>
|
||||
<li><?PHP echo $lang['wirtpw12']; ?></li>
|
||||
</ul>
|
||||
</p>
|
||||
<br>
|
||||
<p>
|
||||
<button type="submit" class="btn btn-success btn-block" name="resetpw"><?PHP echo $lang['wirtpw7']; ?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<?PHP
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
if(in_array('sha512', hash_algos())) {
|
||||
ini_set('session.hash_function', 'sha512');
|
||||
}
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
require_once('../other/phpcommand.php');
|
||||
|
||||
function enter_logfile($logpath,$timezone,$loglevel,$logtext) {
|
||||
$file = $logpath.'ranksystem.log';
|
||||
if ($loglevel == 1) {
|
||||
$loglevel = " CRITICAL ";
|
||||
} elseif ($loglevel == 2) {
|
||||
$loglevel = " ERROR ";
|
||||
} elseif ($loglevel == 3) {
|
||||
$loglevel = " WARNING ";
|
||||
} elseif ($loglevel == 4) {
|
||||
$loglevel = " NOTICE ";
|
||||
} elseif ($loglevel == 5) {
|
||||
$loglevel = " INFO ";
|
||||
}
|
||||
$input = DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ").$loglevel.$logtext."\n";
|
||||
$loghandle = fopen($file, 'a');
|
||||
fwrite($loghandle, $input);
|
||||
if (filesize($file) > 5242880) {
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Logfile filesie of 5 MiB reached.. Rotate logfile.\n");
|
||||
fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Restart Bot to continue with new log file...\n");
|
||||
fclose($loghandle);
|
||||
$file2 = "$file.old";
|
||||
if (file_exists($file2)) unlink($file2);
|
||||
rename($file, $file2);
|
||||
if (substr(php_uname(), 0, 7) == "Windows") {
|
||||
exec("del /F ".substr(__DIR__,0,-12).'logs/pid');
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
$oExec = $WshShell->Run("cmd /C ".$phpcommand." ".substr(__DIR__,0,-12)."worker.php start", 0, false);
|
||||
exit;
|
||||
} else {
|
||||
exec("rm -f ".substr(__DIR__,0,-12).'logs/pid');
|
||||
exec($phpcommand." ".substr(__DIR__,0,-12)."worker.php start");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if(($last_access = $mysqlcon->query("SELECT `last_access`,`count_access` FROM `$dbname`.`config`")) === false) {
|
||||
$err_msg .= print_r($mysqlcon->errorInfo(), true);
|
||||
}
|
||||
$last_access = $last_access->fetchAll();
|
||||
|
||||
if (isset($_POST['resetpw']) && $_POST['csrf_token'] != $_SESSION[$rspathhex.'csrf_token']) {
|
||||
echo $lang['errcsrf'];
|
||||
rem_session_ts3($rspathhex);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (($last_access[0]['last_access'] + 1) >= time()) {
|
||||
$again = $last_access[0]['last_access'] + 2 - time();
|
||||
$err_msg = sprintf($lang['errlogin2'],$again);
|
||||
$err_lvl = 3;
|
||||
} elseif (isset($_POST['resetpw']) && ($adminuuid==NULL || count($adminuuid) == 0)) {
|
||||
$err_msg = $lang['wirtpw1']; $err_lvl=3;
|
||||
} elseif (isset($_POST['resetpw']) && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
$nowtime = time();
|
||||
if($mysqlcon->exec("UPDATE `$dbname`.`config` SET `last_access`='$nowtime',`count_access`=`count_access` + 1") === false) { }
|
||||
|
||||
require_once(substr(__DIR__,0,-12).'libs/ts3_lib/TeamSpeak3.php');
|
||||
try {
|
||||
$ts3 = TeamSpeak3::factory("serverquery://".$ts['user'].":".$ts['pass']."@".$ts['host'].":".$ts['query']."/?server_port=".$ts['voice']."&blocking=0");
|
||||
|
||||
try {
|
||||
usleep($slowmode);
|
||||
$ts3->selfUpdate(array('client_nickname' => "Ranksystem - Reset Password"));
|
||||
} catch (Exception $e) { }
|
||||
|
||||
usleep($slowmode);
|
||||
$allclients = $ts3->clientList();
|
||||
$adminuuid_flipped = array_flip($adminuuid);
|
||||
|
||||
foreach ($allclients as $client) {
|
||||
if(in_array($client['client_unique_identifier'] , $adminuuid)) {
|
||||
$uuid = $client['client_unique_identifier'];
|
||||
$checkuuid = 1;
|
||||
if($client['connection_client_ip'] == getclientip()) {
|
||||
$checkip = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($checkuuid)) {
|
||||
$err_msg = $lang['wirtpw2']; $err_lvl = 3;
|
||||
} elseif (!isset($checkip)) {
|
||||
$err_msg = $lang['wirtpw3']; $err_lvl = 3;
|
||||
} else {
|
||||
usleep($slowmode);
|
||||
$pwd = substr(str_shuffle("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#*+;:-_~?=%&$<24>!()"),0,12);
|
||||
$webpass = password_hash($pwd, PASSWORD_DEFAULT);
|
||||
if($mysqlcon->exec("UPDATE `$dbname`.`config` SET `webpass`='$webpass',`last_access`='0'") === false) {
|
||||
$err_msg = $lang['isntwidbmsg'].print_r($mysqlcon->errorInfo(), true); $err_lvl = 3;
|
||||
} else {
|
||||
try {
|
||||
$ts3->clientGetByUid($uuid)->message(sprintf($lang['wirtpw4'], $webuser, $pwd, '[URL=http'.(!empty($_SERVER['HTTPS'])?"s":"").'://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']).']','[/URL]'));
|
||||
$err_msg = sprintf($lang['wirtpw5'],'<a href="http'.(!empty($_SERVER['HTTPS'])?"s":"").'://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']).'/">','</a>'); $err_lvl = 1;
|
||||
enter_logfile($logpath,$timezone,3,sprintf($lang['wirtpw6'],getclientip()));
|
||||
} catch (Exception $e) {
|
||||
$err_msg = 'TeamSpeak '.$lang['error'].$e->getCode().': '.$e->getMessage(); $err_lvl = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$err_msg = 'TeamSpeak '.$lang['error'].$e->getCode().': '.$e->getMessage(); $err_lvl = 3;
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION[$rspathhex.'csrf_token'] = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
|
||||
require_once('nav.php');
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div id="login-overlay" class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel"><?PHP echo $lang['wirtpw7'].' - '.$lang['wi']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form id="resetForm" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<p><?PHP echo $lang['wirtpw8']; ?></p>
|
||||
<p><?PHP echo $lang['wirtpw9']; ?>
|
||||
<ul>
|
||||
<li><?PHP echo $lang['wirtpw10']; ?></li>
|
||||
<li><?PHP echo $lang['wirtpw11']; ?></li>
|
||||
<li><?PHP echo $lang['wirtpw12']; ?></li>
|
||||
</ul>
|
||||
</p>
|
||||
<br>
|
||||
<p>
|
||||
<button type="submit" class="btn btn-success btn-block" name="resetpw"><?PHP echo $lang['wirtpw7']; ?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,487 +1,504 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) {
|
||||
|
||||
if (isset($_POST['showexcld'])) $showexcld = 1; else $showexcld = 0;
|
||||
if (isset($_POST['showcolrg'])) $showcolrg = 1; else $showcolrg = 0;
|
||||
if (isset($_POST['showcolcld'])) $showcolcld = 1; else $showcolcld = 0;
|
||||
if (isset($_POST['showcoluuid'])) $showcoluuid = 1; else $showcoluuid = 0;
|
||||
if (isset($_POST['showcoldbid'])) $showcoldbid = 1; else $showcoldbid = 0;
|
||||
if (isset($_POST['showcolls'])) $showcolls = 1; else $showcolls = 0;
|
||||
if (isset($_POST['showcolot'])) $showcolot = 1; else $showcolot = 0;
|
||||
if (isset($_POST['showcolit'])) $showcolit = 1; else $showcolit = 0;
|
||||
if (isset($_POST['showcolat'])) $showcolat = 1; else $showcolat = 0;
|
||||
if (isset($_POST['showcolas'])) $showcolas = 1; else $showcolas = 0;
|
||||
if (isset($_POST['showcolnx'])) $showcolnx = 1; else $showcolnx = 0;
|
||||
if (isset($_POST['showcolsg'])) $showcolsg = 1; else $showcolsg = 0;
|
||||
if (isset($_POST['showhighest'])) $showhighest = 1; else $showhighest = 0;
|
||||
if (isset($_POST['showgrpsince'])) $showgrpsince = 1; else $showgrpsince = 0;
|
||||
if (isset($_POST['shownav'])) $shownav = 1; else $shownav = 0;
|
||||
if ($mysqlcon->exec("UPDATE $dbname.config set showexcld='$showexcld',showcolrg='$showcolrg',showcolcld='$showcolcld',showcoluuid='$showcoluuid',showcoldbid='$showcoldbid',showcolls='$showcolls',showcolot='$showcolot',showcolit='$showcolit',showcolat='$showcolat',showcolas='$showcolas',showcolnx='$showcolnx',showcolsg='$showcolsg',showhighest='$showhighest',showgrpsince='$showgrpsince',shownav='$shownav'") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc'];
|
||||
$err_lvl = NULL;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihlsty']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" name="update" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolrgdesc"><?php echo $lang['wishcolrg']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolrg == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolrg" value="',$showcolrg,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolrg" value="',$showcolrg,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolclddesc"><?php echo $lang['wishcolcld']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolcld == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolcld" value="',$showcolcld,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolcld" value="',$showcolcld,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcoluuiddesc"><?php echo $lang['wishcoluuid']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcoluuid == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcoluuid" value="',$showcoluuid,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcoluuid" value="',$showcoluuid,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcoldbiddesc"><?php echo $lang['wishcoldbid']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcoldbid == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcoldbid" value="',$showcoldbid,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcoldbid" value="',$showcoldbid,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcollsdesc"><?php echo $lang['wishcolls']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolls == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolls" value="',$showcolls,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolls" value="',$showcolls,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolotdesc"><?php echo $lang['wishcolot']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolot == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolot" value="',$showcolot,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolot" value="',$showcolot,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolitdesc"><?php echo $lang['wishcolit']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolit == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolit" value="',$showcolit,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolit" value="',$showcolit,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolatdesc"><?php echo $lang['wishcolat']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolat == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolat" value="',$showcolat,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolat" value="',$showcolat,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolasdesc"><?php echo $lang['wishcolas']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolas == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolas" value="',$showcolas,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolas" value="',$showcolas,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolgsdesc"><?php echo $lang['wishcolgs']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showgrpsince == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showgrpsince" value="',$showgrpsince,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showgrpsince" value="',$showgrpsince,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolnxdesc"><?php echo $lang['wishcolnx']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolnx == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolnx" value="',$showcolnx,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolnx" value="',$showcolnx,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolsgdesc"><?php echo $lang['wishcolsg']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolsg == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolsg" value="',$showcolsg,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolsg" value="',$showcolsg,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishexclddesc"><?php echo $lang['wishexcld']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showexcld == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showexcld" value="',$showexcld,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showexcld" value="',$showexcld,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishhiclddesc"><?php echo $lang['wishhicld']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showhighest == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showhighest" value="',$showhighest,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showhighest" value="',$showhighest,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishnavdesc"><?php echo $lang['wishnav']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($shownav == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="shownav" value="',$shownav,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="shownav" value="',$shownav,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" name="update" class="btn btn-primary"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="wishexclddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishexcld']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishexclddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolrgdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolrg']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolrgdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolclddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolcld']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolclddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcoluuiddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcoluuid']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcoluuiddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcoldbiddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcoldbid']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcoldbiddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcollsdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolls']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcollsdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolotdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolot']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolotdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolitdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolit']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolitdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolatdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolat']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolatdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolasdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolas']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolasdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolgsdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolgs']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolgsdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolnxdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolnx']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolnxdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolsgdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolsg']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolsgdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishhiclddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishhicld']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishhiclddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishnavdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishnav']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishnavdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<?PHP
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
if(in_array('sha512', hash_algos())) {
|
||||
ini_set('session.hash_function', 'sha512');
|
||||
}
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['update']) && $_POST['csrf_token'] != $_SESSION[$rspathhex.'csrf_token']) {
|
||||
echo $lang['errcsrf'];
|
||||
rem_session_ts3($rspathhex);
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip() && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
|
||||
if (isset($_POST['showexcld'])) $showexcld = 1; else $showexcld = 0;
|
||||
if (isset($_POST['showcolrg'])) $showcolrg = 1; else $showcolrg = 0;
|
||||
if (isset($_POST['showcolcld'])) $showcolcld = 1; else $showcolcld = 0;
|
||||
if (isset($_POST['showcoluuid'])) $showcoluuid = 1; else $showcoluuid = 0;
|
||||
if (isset($_POST['showcoldbid'])) $showcoldbid = 1; else $showcoldbid = 0;
|
||||
if (isset($_POST['showcolls'])) $showcolls = 1; else $showcolls = 0;
|
||||
if (isset($_POST['showcolot'])) $showcolot = 1; else $showcolot = 0;
|
||||
if (isset($_POST['showcolit'])) $showcolit = 1; else $showcolit = 0;
|
||||
if (isset($_POST['showcolat'])) $showcolat = 1; else $showcolat = 0;
|
||||
if (isset($_POST['showcolas'])) $showcolas = 1; else $showcolas = 0;
|
||||
if (isset($_POST['showcolnx'])) $showcolnx = 1; else $showcolnx = 0;
|
||||
if (isset($_POST['showcolsg'])) $showcolsg = 1; else $showcolsg = 0;
|
||||
if (isset($_POST['showhighest'])) $showhighest = 1; else $showhighest = 0;
|
||||
if (isset($_POST['showgrpsince'])) $showgrpsince = 1; else $showgrpsince = 0;
|
||||
if (isset($_POST['shownav'])) $shownav = 1; else $shownav = 0;
|
||||
if ($mysqlcon->exec("UPDATE `$dbname`.`config` SET `showexcld`='$showexcld',`showcolrg`='$showcolrg',`showcolcld`='$showcolcld',`showcoluuid`='$showcoluuid',`showcoldbid`='$showcoldbid',`showcolls`='$showcolls',`showcolot`='$showcolot',`showcolit`='$showcolit',`showcolat`='$showcolat',`showcolas`='$showcolas',`showcolnx`='$showcolnx',`showcolsg`='$showcolsg',`showhighest`='$showhighest',`showgrpsince`='$showgrpsince',`shownav`='$shownav'") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc'];
|
||||
$err_lvl = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION[$rspathhex.'csrf_token'] = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihlsty']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" name="update" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolrgdesc"><?php echo $lang['wishcolrg']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolrg == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolrg" value="',$showcolrg,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolrg" value="',$showcolrg,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolclddesc"><?php echo $lang['wishcolcld']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolcld == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolcld" value="',$showcolcld,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolcld" value="',$showcolcld,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcoluuiddesc"><?php echo $lang['wishcoluuid']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcoluuid == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcoluuid" value="',$showcoluuid,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcoluuid" value="',$showcoluuid,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcoldbiddesc"><?php echo $lang['wishcoldbid']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcoldbid == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcoldbid" value="',$showcoldbid,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcoldbid" value="',$showcoldbid,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcollsdesc"><?php echo $lang['wishcolls']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolls == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolls" value="',$showcolls,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolls" value="',$showcolls,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolotdesc"><?php echo $lang['wishcolot']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolot == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolot" value="',$showcolot,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolot" value="',$showcolot,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolitdesc"><?php echo $lang['wishcolit']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolit == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolit" value="',$showcolit,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolit" value="',$showcolit,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolatdesc"><?php echo $lang['wishcolat']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolat == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolat" value="',$showcolat,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolat" value="',$showcolat,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolasdesc"><?php echo $lang['wishcolas']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolas == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolas" value="',$showcolas,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolas" value="',$showcolas,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolgsdesc"><?php echo $lang['wishcolgs']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showgrpsince == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showgrpsince" value="',$showgrpsince,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showgrpsince" value="',$showgrpsince,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolnxdesc"><?php echo $lang['wishcolnx']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolnx == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolnx" value="',$showcolnx,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolnx" value="',$showcolnx,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishcolsgdesc"><?php echo $lang['wishcolsg']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showcolsg == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showcolsg" value="',$showcolsg,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showcolsg" value="',$showcolsg,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishexclddesc"><?php echo $lang['wishexcld']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showexcld == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showexcld" value="',$showexcld,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showexcld" value="',$showexcld,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishhiclddesc"><?php echo $lang['wishhicld']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($showhighest == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="showhighest" value="',$showhighest,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="showhighest" value="',$showhighest,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wishnavdesc"><?php echo $lang['wishnav']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<?PHP if ($shownav == 1) {
|
||||
echo '<input class="switch-animate" type="checkbox" checked data-size="mini" name="shownav" value="',$shownav,'">';
|
||||
} else {
|
||||
echo '<input class="switch-animate" type="checkbox" data-size="mini" name="shownav" value="',$shownav,'">';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" name="update" class="btn btn-primary"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="wishexclddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishexcld']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishexclddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolrgdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolrg']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolrgdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolclddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolcld']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolclddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcoluuiddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcoluuid']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcoluuiddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcoldbiddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcoldbid']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcoldbiddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcollsdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolls']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcollsdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolotdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolot']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolotdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolitdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolit']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolitdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolatdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolat']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolatdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolasdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolas']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolasdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolgsdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolgs']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolgsdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolnxdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolnx']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolnxdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishcolsgdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishcolsg']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishcolsgdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishhiclddesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishhicld']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishhiclddesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wishnavdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wishnav']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wishnavdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,391 +1,409 @@
|
||||
<?PHP
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) {
|
||||
$tshost = $_POST['tshost'];
|
||||
$tsquery = $_POST['tsquery'];
|
||||
$tsvoice = $_POST['tsvoice'];
|
||||
$tsuser = $_POST['tsuser'];
|
||||
$tspass = $_POST['tspass'];
|
||||
$queryname = $_POST['queryname'];
|
||||
$queryname2 = $_POST['queryname2'];
|
||||
$defchid = $_POST['defchid'];
|
||||
$slowmode = $_POST['slowmode'];
|
||||
$avatar_delay= $_POST['avatar_delay'];
|
||||
if ($mysqlcon->exec("UPDATE $dbname.config set tshost='$tshost',tsquery='$tsquery',tsvoice='$tsvoice',tsuser='$tsuser',tspass='$tspass',queryname='$queryname',queryname2='$queryname2',slowmode='$slowmode',defchid='$defchid',avatar_delay='$avatar_delay'") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], ' <form class="btn-group" name="restart" action="bot.php" method="POST"><button
|
||||
type="submit" class="btn btn-primary" name="restart"><i class="fa fa-fw fa-refresh"></i> '.$lang['wibot7'].'</button></form>');
|
||||
$err_lvl = NULL;
|
||||
}
|
||||
$ts['host'] = $_POST['tshost'];
|
||||
$ts['query'] = $_POST['tsquery'];
|
||||
$ts['voice'] = $_POST['tsvoice'];
|
||||
$ts['user'] = $_POST['tsuser'];
|
||||
$ts['pass'] = $_POST['tspass'];
|
||||
}
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihlts']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" data-toggle="validator" name="update" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group required-field-block">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3hostdesc"><?php echo $lang['wits3host']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" data-pattern="^[^.]+[^:]*$" data-error="Do not enter the port inside this field. You should enter the port (e.g. 9987) inside the TS3-Voice-Port!" name="tshost" value="<?php echo $ts['host']; ?>" maxlength="64" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3querydesc"><?php echo $lang['wits3query']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block-spin">
|
||||
<input type="text" class="form-control" name="tsquery" value="<?php echo $ts['query']; ?>" required>
|
||||
<script>
|
||||
$("input[name='tsquery']").TouchSpin({
|
||||
min: 0,
|
||||
max: 65535,
|
||||
verticalbuttons: true,
|
||||
prefix: 'TCP:'
|
||||
});
|
||||
</script>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3voicedesc"><?php echo $lang['wits3voice']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block-spin">
|
||||
<input type="text" class="form-control" name="tsvoice" value="<?php echo $ts['voice']; ?>" required>
|
||||
<script>
|
||||
$("input[name='tsvoice']").TouchSpin({
|
||||
min: 0,
|
||||
max: 65535,
|
||||
verticalbuttons: true,
|
||||
prefix: 'UDP:'
|
||||
});
|
||||
</script>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3querusrdesc"><?php echo $lang['wits3querusr']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" name="tsuser" value="<?php echo $ts['user']; ?>" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3querpwdesc"><?php echo $lang['wits3querpw']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="password" class="form-control" name="tspass" id="tspass" value="<?php echo $ts['pass']; ?>" data-toggle="password" data-placement="before" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 ">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3qnmdesc"><?php echo $lang['wits3qnm']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" name="queryname" value="<?php echo $queryname; ?>" maxlength="30" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3qnm2desc"><?php echo $lang['wits3qnm2']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" name="queryname2" value="<?php echo $queryname2; ?>" maxlength="30" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3dchdesc"><?php echo $lang['wits3dch']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="defchid" value="<?php echo $defchid; ?>">
|
||||
<script>
|
||||
$("input[name='defchid']").TouchSpin({
|
||||
min: 0,
|
||||
max: 2147483647,
|
||||
verticalbuttons: true,
|
||||
prefix: 'ID:'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3smdesc"><?php echo $lang['wits3sm']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" id="basic" name="slowmode">
|
||||
<?PHP
|
||||
echo '<option data-subtext="[recommended]" value="0"'; if($slowmode=="0") echo ' selected="selected"'; echo '>disabled (Realtime)</option>';
|
||||
echo '<option data-divider="true"> </option>';
|
||||
echo '<option data-subtext="(0,2 seconds)" value="200000"'; if($slowmode=="200000") echo ' selected="selected"'; echo '>Low delay</option>';
|
||||
echo '<option data-subtext="(0,5 seconds)" value="500000"'; if($slowmode=="500000") echo ' selected="selected"'; echo '>Middle delay</option>';
|
||||
echo '<option data-subtext="(1,0 seconds)" value="1000000"'; if($slowmode=="1000000") echo ' selected="selected"'; echo '>High delay</option>';
|
||||
echo '<option data-subtext="(2,0 seconds)" value="2000000"'; if($slowmode=="2000000") echo ' selected="selected"'; echo '>Huge delay</option>';
|
||||
echo '<option data-subtext="(5,0 seconds)" value="5000000"'; if($slowmode=="5000000") echo ' selected="selected"'; echo '>Ultra delay</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3avatdesc"><?php echo $lang['wits3avat']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="avatar_delay" value="<?php echo $avatar_delay; ?>">
|
||||
<script>
|
||||
$("input[name='avatar_delay']").TouchSpin({
|
||||
min: 0,
|
||||
max: 65535,
|
||||
verticalbuttons: true,
|
||||
prefix: 'Sec.:'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="update"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3hostdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3host']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3hostdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3querydesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3query']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3querydesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3voicedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3voice']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3voicedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3querusrdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3querusr']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3querusrdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3querpwdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3querpw']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3querpwdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3qnmdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3qnm']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3qnmdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3qnm2desc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3qnm2']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3qnm2desc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3dchdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3dch']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3dchdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3smdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3sm']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3smdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3avatdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3avat']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3avatdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('form[data-toggle="validator"]').validator({
|
||||
custom: {
|
||||
pattern: function ($el) {
|
||||
var pattern = new RegExp($el.data('pattern'));
|
||||
return pattern.test($el.val());
|
||||
}
|
||||
},
|
||||
delay: 100,
|
||||
errors: {
|
||||
pattern: "There should be an error in your value, please check all could be right!"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
<?PHP
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
if(in_array('sha512', hash_algos())) {
|
||||
ini_set('session.hash_function', 'sha512');
|
||||
}
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
session_start();
|
||||
|
||||
require_once('../other/config.php');
|
||||
|
||||
function getclientip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_X_FORWARDED']))
|
||||
return $_SERVER['HTTP_X_FORWARDED'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED_FOR']))
|
||||
return $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
elseif(!empty($_SERVER['HTTP_FORWARDED']))
|
||||
return $_SERVER['HTTP_FORWARDED'];
|
||||
elseif(!empty($_SERVER['REMOTE_ADDR']))
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['logout'])) {
|
||||
rem_session_ts3($rspathhex);
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION[$rspathhex.'username']) || $_SESSION[$rspathhex.'username'] != $webuser || $_SESSION[$rspathhex.'password'] != $webpass || $_SESSION[$rspathhex.'clientip'] != getclientip()) {
|
||||
header("Location: //".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['update']) && $_POST['csrf_token'] != $_SESSION[$rspathhex.'csrf_token']) {
|
||||
echo $lang['errcsrf'];
|
||||
rem_session_ts3($rspathhex);
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once('nav.php');
|
||||
$newcsrf = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
|
||||
if (isset($_POST['update']) && $_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip() && $_POST['csrf_token'] == $_SESSION[$rspathhex.'csrf_token']) {
|
||||
$tshost = $_POST['tshost'];
|
||||
$tsquery = $_POST['tsquery'];
|
||||
$tsvoice = $_POST['tsvoice'];
|
||||
$tsuser = $_POST['tsuser'];
|
||||
$tspass = $_POST['tspass'];
|
||||
$queryname = $_POST['queryname'];
|
||||
$queryname2 = $_POST['queryname2'];
|
||||
$defchid = $_POST['defchid'];
|
||||
$slowmode = $_POST['slowmode'];
|
||||
$avatar_delay= $_POST['avatar_delay'];
|
||||
if ($mysqlcon->exec("UPDATE `$dbname`.`config` SET `tshost`='$tshost',`tsquery`='$tsquery',`tsvoice`='$tsvoice',`tsuser`='$tsuser',`tspass`='$tspass',`queryname`='$queryname',`queryname2`='$queryname2',`slowmode`='$slowmode',`defchid`='$defchid',`avatar_delay`='$avatar_delay'") === false) {
|
||||
$err_msg = print_r($mysqlcon->errorInfo(), true);
|
||||
$err_lvl = 3;
|
||||
} else {
|
||||
$err_msg = $lang['wisvsuc']." ".sprintf($lang['wisvres'], ' <form class="btn-group" name="restart" action="bot.php" method="POST"><input type="hidden" name="csrf_token" value="'.$newcsrf.'"><button
|
||||
type="submit" class="btn btn-primary" name="restart"><i class="fa fa-fw fa-refresh"></i> '.$lang['wibot7'].'</button></form>');
|
||||
$err_lvl = NULL;
|
||||
}
|
||||
$ts['host'] = $_POST['tshost'];
|
||||
$ts['query'] = $_POST['tsquery'];
|
||||
$ts['voice'] = $_POST['tsvoice'];
|
||||
$ts['user'] = $_POST['tsuser'];
|
||||
$ts['pass'] = $_POST['tspass'];
|
||||
}
|
||||
|
||||
$_SESSION[$rspathhex.'csrf_token'] = $newcsrf;
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<?PHP if(isset($err_msg)) error_handling($err_msg, $err_lvl); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
<?php echo $lang['wihlts']; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" data-toggle="validator" name="update" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?PHP echo $_SESSION[$rspathhex.'csrf_token']; ?>">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group required-field-block">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3hostdesc"><?php echo $lang['wits3host']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" data-pattern="^[^.]+[^:]*$" data-error="Do not enter the port inside this field. You should enter the port (e.g. 9987) inside the TS3-Voice-Port!" name="tshost" value="<?php echo $ts['host']; ?>" maxlength="64" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3querydesc"><?php echo $lang['wits3query']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block-spin">
|
||||
<input type="text" class="form-control" name="tsquery" value="<?php echo $ts['query']; ?>" required>
|
||||
<script>
|
||||
$("input[name='tsquery']").TouchSpin({
|
||||
min: 0,
|
||||
max: 65535,
|
||||
verticalbuttons: true,
|
||||
prefix: 'TCP:'
|
||||
});
|
||||
</script>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3voicedesc"><?php echo $lang['wits3voice']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block-spin">
|
||||
<input type="text" class="form-control" name="tsvoice" value="<?php echo $ts['voice']; ?>" required>
|
||||
<script>
|
||||
$("input[name='tsvoice']").TouchSpin({
|
||||
min: 0,
|
||||
max: 65535,
|
||||
verticalbuttons: true,
|
||||
prefix: 'UDP:'
|
||||
});
|
||||
</script>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3querusrdesc"><?php echo $lang['wits3querusr']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" name="tsuser" value="<?php echo $ts['user']; ?>" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3querpwdesc"><?php echo $lang['wits3querpw']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="password" class="form-control" name="tspass" id="tspass" value="<?php echo $ts['pass']; ?>" data-toggle="password" data-placement="before" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 ">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3qnmdesc"><?php echo $lang['wits3qnm']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" name="queryname" value="<?php echo $queryname; ?>" maxlength="30" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3qnm2desc"><?php echo $lang['wits3qnm2']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8 required-field-block">
|
||||
<input type="text" class="form-control" name="queryname2" value="<?php echo $queryname2; ?>" maxlength="30" required>
|
||||
<div class="required-icon"><div class="text">*</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3dchdesc"><?php echo $lang['wits3dch']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="defchid" value="<?php echo $defchid; ?>">
|
||||
<script>
|
||||
$("input[name='defchid']").TouchSpin({
|
||||
min: 0,
|
||||
max: 2147483647,
|
||||
verticalbuttons: true,
|
||||
prefix: 'ID:'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3smdesc"><?php echo $lang['wits3sm']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<select class="selectpicker show-tick form-control" id="basic" name="slowmode">
|
||||
<?PHP
|
||||
echo '<option data-subtext="[recommended]" value="0"'; if($slowmode=="0") echo ' selected="selected"'; echo '>disabled (Realtime)</option>';
|
||||
echo '<option data-divider="true"> </option>';
|
||||
echo '<option data-subtext="(0,2 seconds)" value="200000"'; if($slowmode=="200000") echo ' selected="selected"'; echo '>Low delay</option>';
|
||||
echo '<option data-subtext="(0,5 seconds)" value="500000"'; if($slowmode=="500000") echo ' selected="selected"'; echo '>Middle delay</option>';
|
||||
echo '<option data-subtext="(1,0 seconds)" value="1000000"'; if($slowmode=="1000000") echo ' selected="selected"'; echo '>High delay</option>';
|
||||
echo '<option data-subtext="(2,0 seconds)" value="2000000"'; if($slowmode=="2000000") echo ' selected="selected"'; echo '>Huge delay</option>';
|
||||
echo '<option data-subtext="(5,0 seconds)" value="5000000"'; if($slowmode=="5000000") echo ' selected="selected"'; echo '>Ultra delay</option>';
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#wits3avatdesc"><?php echo $lang['wits3avat']; ?><i class="help-hover glyphicon glyphicon-question-sign"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="avatar_delay" value="<?php echo $avatar_delay; ?>">
|
||||
<script>
|
||||
$("input[name='avatar_delay']").TouchSpin({
|
||||
min: 0,
|
||||
max: 65535,
|
||||
verticalbuttons: true,
|
||||
prefix: 'Sec.:'
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary" name="update"><?php echo $lang['wisvconf']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3hostdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3host']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3hostdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3querydesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3query']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3querydesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3voicedesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3voice']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3voicedesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3querusrdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3querusr']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3querusrdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3querpwdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3querpw']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3querpwdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3qnmdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3qnm']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3qnmdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3qnm2desc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3qnm2']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3qnm2desc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3dchdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3dch']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3dchdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3smdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3sm']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3smdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="wits3avatdesc" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><?php echo $lang['wits3avat']; ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $lang['wits3avatdesc']; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?PHP echo $lang['stnv0002']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('form[data-toggle="validator"]').validator({
|
||||
custom: {
|
||||
pattern: function ($el) {
|
||||
var pattern = new RegExp($el.data('pattern'));
|
||||
return pattern.test($el.val());
|
||||
}
|
||||
},
|
||||
delay: 100,
|
||||
errors: {
|
||||
pattern: "There should be an error in your value, please check all could be right!"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user