68 lines
2.7 KiB
PHP
68 lines
2.7 KiB
PHP
<?php
|
|
$yn = $_POST['YN'];
|
|
$yb = $_POST['YB'];
|
|
$user1 = $_POST['user'];
|
|
$pass1 = $_POST['pass'];
|
|
$servicesvisible1 = $_POST['servicesvisible'];
|
|
$clockvisible1 = $_POST['clockvisible'];
|
|
$kknowledgefeedvisible1 = $_POST['kknowledgefeedvisible'];
|
|
$webclipfeedvisible1 = $_POST['webclipfeedvisible'];
|
|
$konvosvisible1 = $_POST['konvosvisible'];
|
|
$kodivisible1 = $_POST['kodivisible'];
|
|
|
|
//
|
|
$fl='../config.php';
|
|
/*read operation ->*/ $tmp = fopen($fl, "r"); $content=fread($tmp,filesize($fl)); fclose($tmp);
|
|
|
|
// here goes your update
|
|
// Server Updates
|
|
$content = preg_replace( '/\$yourname = \"(.*?)\";/', '$yourname = "'.$yn.'";', $content);
|
|
$content = preg_replace( '/\$base = \"(.*?)\";/', '$base = "'.$yb.'";', $content);
|
|
// User/Pass Update
|
|
$content = preg_replace( '/\$user = \"(.*?)\";/', '$user = "'.$user1.'";', $content);
|
|
$content = preg_replace( '/\$pass = \"(.*?)\";/', '$pass = "'.$pass1.'";', $content);
|
|
// servicesvisible Settings
|
|
if (empty($sabvis1)) {
|
|
$content = preg_replace( '/\$sabvisible = \"(.*?)\";/', '$sabvisible = "0";', $content);
|
|
} else {
|
|
$content = preg_replace( '/\$sabvisible = \"(.*?)\";/', '$sabvisible = "1";', $content);
|
|
}
|
|
// clockvisible Settings
|
|
if (empty($clockvisible1)) {
|
|
$content = preg_replace( '/\$clockvisible = \"(.*?)\";/', '$clockvisible = "0";', $content);
|
|
} else {
|
|
$content = preg_replace( '/\$clockvisible = \"(.*?)\";/', '$clockvisible = "1";', $content);
|
|
}
|
|
// kknowledgefeedvisible Settings
|
|
if (empty($kknowledgefeedvisible1)) {
|
|
$content = preg_replace( '/\$kknowledgefeedvisible = \"(.*?)\";/', '$kknowledgefeedvisible = "0";', $content);
|
|
} else {
|
|
$content = preg_replace( '/\$kknowledgefeedvisible = \"(.*?)\";/', '$kknowledgefeedvisible = "1";', $content);
|
|
}
|
|
// webclipfeedvisible Settings
|
|
if (empty($webclipfeedvisible1)) {
|
|
$content = preg_replace( '/\$webclipfeedvisible = \"(.*?)\";/', '$webclipfeedvisible = "0";', $content);
|
|
} else {
|
|
$content = preg_replace( '/\$webclipfeedvisible = \"(.*?)\";/', '$webclipfeedvisible = "1";', $content);
|
|
}
|
|
// konvosvisible Settings
|
|
if (empty($konvosvisible1)) {
|
|
$content = preg_replace( '/\$konvosvisible = \"(.*?)\";/', '$konvosvisible = "0";', $content);
|
|
} else {
|
|
$content = preg_replace( '/\$konvosvisible = \"(.*?)\";/', '$konvosvisible = "1";', $content);
|
|
}
|
|
// kodivisible Settings
|
|
if (empty($kodivisible1)) {
|
|
$content = preg_replace( '/\$kodivisible = \"(.*?)\";/', '$kodivisible = "0";', $content);
|
|
} else {
|
|
$content = preg_replace( '/\$kodivisible = \"(.*?)\";/', '$kodivisible = "1";', $content);
|
|
}
|
|
/*write operation ->*/ $tmp =fopen($fl, "w"); fwrite($tmp, $content); fclose($tmp);
|
|
|
|
//sleep for 5 seconds
|
|
|
|
|
|
header("Location: re1.php");
|
|
die();
|
|
|
|
?>
|