config tool

This commit is contained in:
Karl Hudgell 2015-12-12 23:17:13 +00:00
parent c751ffefbc
commit fc0c5cf088
18 changed files with 647 additions and 89 deletions

View File

@ -1,49 +1,16 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<body>
<head> <form action="upload.php" method="post" enctype="multipart/form-data">
<meta charset="utf-8"/> Select image to upload:
<title>KLanding Pic Uploader</title> <br />
<br />
<input type="file" name="fileToUpload" id="fileToUpload">
<br />
<br />
<input type="submit" value="Upload Image" name="submit">
</form>
<!-- Google web fonts --> </body>
<link href="http://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700" rel='stylesheet' />
<!-- The main CSS file -->
<link href="/assets/css/style.css" rel="stylesheet" />
</head>
<body>
<form id="upload" method="post" action="upload.php" enctype="multipart/form-data">
<div id="drop">
Drop Here
<a>Browse</a>
<input type="file" name="upl" multiple />
</div>
<ul>
<!-- The file uploads will be shown here -->
</ul>
</form>
<footer>
</footer>
<!-- JavaScript Includes -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="/assets/js/jquery.knob.js"></script>
<!-- jQuery File Upload Dependencies -->
<script src="/assets/js/jquery.ui.widget.js"></script>
<script src="/assets/js/jquery.iframe-transport.js"></script>
<script src="/assets/js/jquery.fileupload.js"></script>
<!-- Our main JS file -->
<script src="/assets/js/script.js"></script>
</body>
</html> </html>

3
config/default.php Normal file
View File

@ -0,0 +1,3 @@
KLanding Config Page
Use this page to configure your KLanding page.

View File

@ -1,8 +1,16 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
<meta HTTP-EQUIV="REFRESH" content="3; url=/config/redirect.html"> <title>KLanding Config</title>
</head> </head>
<body> <frameset rows="10%,80%,10%">
Your config has been updated, the page will reload with new entries.. <frame name="top" frameborder="0" src="menu.php" />
</body> <frame name="main" frameborder="0" src="default.php" />
<frame name="bottom" frameborder="0" src="menu.php" />
<noframes>
<body>
Your browser does not support frames.
</body>
</noframes>
</frameset>
</html> </html>

2
config/menu.php Normal file
View File

@ -0,0 +1,2 @@
<a href="set1.php" target="main">General</a> - <a href="set2.php" target="main">SAB/Couch/Sick</a> - <a href="set3.php" target="main">Others</a> - <a href="set4.php" target="main">Drive Space</a> - <a href="set5.php" target="main">RSS/Server Statuses</a> - <a href="PicUpload.html" target="main">Picture Upload</a>

8
config/re1.php Normal file
View File

@ -0,0 +1,8 @@
<html>
<head>
<meta HTTP-EQUIV="REFRESH" content="3; url=/config/redirect.html">
</head>
<body>
Your config has been updated, the page will reload with new entries..
</body>
</html>

View File

@ -1,6 +1,6 @@
<html> <html>
<head> <head>
<meta HTTP-EQUIV="REFRESH" content="2; url=/config/set.php"> <meta HTTP-EQUIV="REFRESH" content="2; url=default.php">
</head> </head>
<body> <body>
Your config is being loaded, please wait.. Your config is being loaded, please wait..

21
config/set1.php Normal file
View File

@ -0,0 +1,21 @@
<?php include '../config.php';?>
<form action="write1.php" method="post">
Your Name: <input type="text" value="<?php echo $yourname ?>" name="YN" /><br />
Server Address: <input type="text" value="<?php echo $base ?>" name="YB" /><br />
<br />
Username: <input type="text" value="<?php echo $user ?>" name="user" /><br />
Password: <input type="text" value="<?php echo $pass ?>" name="pass" /><br />
<br />
<br />
Services Widget Enabled: <input name="servicesvisible" id="id" type="checkbox" <?php if($servicesvisible > "0") echo "checked=checked; "; ?> /><br />
Clock Widget Enabled: <input name="clockvisible" id="id" type="checkbox" <?php if($clockvisible > "0") echo "checked=checked; "; ?> /><br />
KKnowledge Widget Enabled: <input name="kknowledgefeedvisible" id="id" type="checkbox" <?php if($kknowledgefeedvisible > "0") echo "checked=checked; "; ?> /><br />
Klips Widget Enabled: <input name="webclipfeedvisible" id="id" type="checkbox" <?php if($webclipfeedvisible > "0") echo "checked=checked; "; ?> /><br />
Konvos Widget Enabled: <input name="konvosvisible" id="id" type="checkbox" <?php if($konvosvisible > "0") echo "checked=checked; "; ?> /><br />
<br />
Enable Kodi (MovieLib): <input name="kodivisible" id="id" type="checkbox" <?php if($kodivisible > "0") echo "checked=checked; "; ?> /><br />
<br />
<input type="submit" name="submit" value="Update" />
</form>

View File

@ -1,12 +1,6 @@
<?php include '../config.php';?> <?php include '../config.php';?>
<form action="write.php" method="post"> <form action="write2.php" method="post">
Your Name: <input type="text" value="<?php echo $yourname ?>" name="YN" /><br />
Server Address: <input type="text" value="<?php echo $base ?>" name="YB" /><br />
<br />
Username: <input type="text" value="<?php echo $user ?>" name="user" /><br />
Password: <input type="text" value="<?php echo $pass ?>" name="pass" /><br />
<br />
SAB Enabled: <input name="sabvisible" id="id" type="checkbox" <?php if($sabvisible > "0") echo "checked=checked; "; ?> /><br /> SAB Enabled: <input name="sabvisible" id="id" type="checkbox" <?php if($sabvisible > "0") echo "checked=checked; "; ?> /><br />
SAB Port: <input type="text" value="<?php echo $sabport ?>" name="sabport" /><br /> SAB Port: <input type="text" value="<?php echo $sabport ?>" name="sabport" /><br />
SAB Name: <input type="text" value="<?php echo $sabname ?>" name="sabname" /><br /> SAB Name: <input type="text" value="<?php echo $sabname ?>" name="sabname" /><br />

48
config/set3.php Normal file
View File

@ -0,0 +1,48 @@
<?php include '../config.php';?>
<form action="write3.php" method="post">
<div style="width:100%;"> <!-- Main Div -->
<div style="float:left; width:50%;">
FTP Enabled: <input name="ftpvisible" id="id" type="checkbox" <?php if($ftpvisible > "0") echo "checked=checked; "; ?> /><br />
FTP Port: <input type="text" value="<?php echo $ftpport ?>" name="ftpport" /><br />
FTP Name: <input type="text" value="<?php echo $ftpname ?>" name="ftpname" /><br />
FTP Pic: <input type="text" value="<?php echo $ftppicname ?>" name="ftppicname" /><br />
<br />
Torrent Enabled: <input name="torrentvisible" id="id" type="checkbox" <?php if($torrentvisible > "0") echo "checked=checked; "; ?> /><br />
Torrent Type : <input type="radio" name="torrenttype" value="1" <?php if($torrenttype < "2") echo "checked=checked; "; ?>>uTorrent / <input type="radio" name="torrenttype" value="2" <?php if($torrenttype > "1") echo "checked=checked; "; ?>>Transmission<br />
Torrent Port: <input type="text" value="<?php echo $torrentport ?>" name="torrentport" /><br />
Torrent Name: <input type="text" value="<?php echo $torrentname ?>" name="torrentname" /><br />
Torrent Pic: <input type="text" value="<?php echo $torrentpicname ?>" name="torrentpicname" /><br />
<br />
Madsonic Enabled: <input name="madsonicvisible" id="id" type="checkbox" <?php if($madsonicvisible > "0") echo "checked=checked; "; ?> /><br />
Madsonic Port: <input type="text" value="<?php echo $madsonicport ?>" name="madsonicport" /><br />
Madsonic Name: <input type="text" value="<?php echo $madsonicname ?>" name="madsonicname" /><br />
Madsonic Pic: <input type="text" value="<?php echo $madsonicpicname ?>" name="madsonicpicname" /><br />
</div>
<div style="float:right; width:50%; ">
<br />
Plex Enabled: <input name="plexvisible" id="id" type="checkbox" <?php if($plexvisible > "0") echo "checked=checked; "; ?> /><br />
Plex Port: <input type="text" value="<?php echo $plexport ?>" name="plexport" /><br />
Plex Name: <input type="text" value="<?php echo $plexname ?>" name="plexname" /><br />
Plex Pic: <input type="text" value="<?php echo $plexpicname ?>" name="plexpicname" /><br />
<br />
Squeezebox Enabled: <input name="squeezevisible" id="id" type="checkbox" <?php if($squeezevisible > "0") echo "checked=checked; "; ?> /><br />
Squeezebox Port: <input type="text" value="<?php echo $squeezeport ?>" name="squeezeport" /><br />
Squeezebox Name: <input type="text" value="<?php echo $squeezename ?>" name="squeezename" /><br />
Squeezebox Pic: <input type="text" value="<?php echo $squeezepicname ?>" name="squeezepicname" /><br />
<br />
Jdownloader Enabled: <input name="jdownloadervisible" id="id" type="checkbox" <?php if($jdownloadervisible > "0") echo "checked=checked; "; ?> /><br />
Jdownloader Name: <input type="text" value="<?php echo $jdownloadername ?>" name="jdownloadername" /><br />
Jdownloader Pic: <input type="text" value="<?php echo $jdownloaderpicname ?>" name="jdownloaderpicname" /><br />
<br />
</div>
</div>
<div>
<input type="submit" name="submit" value="Update" />
</div>
</div>
</form>

27
config/set4.php Normal file
View File

@ -0,0 +1,27 @@
<?php include '../config.php';?>
<form action="write4.php" method="post">
Drive Space Enabled: <input name="drivespacevisible" id="id" type="checkbox" <?php if($drivespacevisible > "0") echo "checked=checked; "; ?> /><br />
<br />
Drive 1 Enabled: <input name="drive1visible" id="id" type="checkbox" <?php if($drive1visible > "0") echo "checked=checked; "; ?> /><br />
Drive 1 Name: <input type="text" value="<?php echo $drive1 ?>" name="drive1" /><br />
<br />
Drive 2 Enabled: <input name="drive2visible" id="id" type="checkbox" <?php if($drive2visible > "0") echo "checked=checked; "; ?> /><br />
Drive 2 Name: <input type="text" value="<?php echo $drive2 ?>" name="drive2" /><br />
<br />
Drive 3 Enabled: <input name="drive3visible" id="id" type="checkbox" <?php if($drive3visible > "0") echo "checked=checked; "; ?> /><br />
Drive 3 Name: <input type="text" value="<?php echo $drive3 ?>" name="drive3" /><br />
<br />
Drive 4 Enabled: <input name="drive4visible" id="id" type="checkbox" <?php if($drive4visible > "0") echo "checked=checked; "; ?> /><br />
Drive 4 Name: <input type="text" value="<?php echo $drive4 ?>" name="drive4" /><br />
<br />
Drive 5 Enabled: <input name="drive5visible" id="id" type="checkbox" <?php if($drive5visible > "0") echo "checked=checked; "; ?> /><br />
Drive 5 Name: <input type="text" value="<?php echo $drive5 ?>" name="drive5" /><br />
<br />
Drive 6 Enabled: <input name="drive6visible" id="id" type="checkbox" <?php if($drive6visible > "0") echo "checked=checked; "; ?> /><br />
Drive 6 Name: <input type="text" value="<?php echo $drive6 ?>" name="drive6" /><br />
<br />
Drive 7 Enabled: <input name="drive7visible" id="id" type="checkbox" <?php if($drive7visible > "0") echo "checked=checked; "; ?> /><br />
Drive 7 Name: <input type="text" value="<?php echo $drive7 ?>" name="drive7" /><br />
<input type="submit" name="submit" value="Update" />
</form>

51
config/set5.php Normal file
View File

@ -0,0 +1,51 @@
<?php include '../config.php';?>
<form action="write5.php" method="post">
<div style="width:100%;"> <!-- Main Div -->
<div style="float:left; width:50%;">
Set Server Upstate Monitor <br />
<br />
Server Status Enabled: <input name="serverstatusvisible" id="id" type="checkbox" <?php if($serverstatusvisible > "0") echo "checked=checked; "; ?> /><br />
<br />
Server 1 Enabled: <input name="server1visible" id="id" type="checkbox" <?php if($server1visible > "0") echo "checked=checked; "; ?> /><br />
Server 1 Name: <input type="text" value="<?php echo $server1name ?>" name="server1name" /><br />
Server 1 URL: <input type="text" value="<?php echo $server1url ?>" name="server1url" /><br />
<br />
Server 2 Enabled: <input name="server2visible" id="id" type="checkbox" <?php if($server2visible > "0") echo "checked=checked; "; ?> /><br />
Server 2 Name: <input type="text" value="<?php echo $server2name ?>" name="server2name" /><br />
Server 2 URL: <input type="text" value="<?php echo $server2url ?>" name="server2url" /><br />
<br />
Server 3 Enabled: <input name="server3visible" id="id" type="checkbox" <?php if($server3visible > "0") echo "checked=checked; "; ?> /><br />
Server 3 Name: <input type="text" value="<?php echo $server3name ?>" name="server3name" /><br />
Server 3 URL: <input type="text" value="<?php echo $server3url ?>" name="server3url" /><br />
<br />
Server 4 Enabled: <input name="server4visible" id="id" type="checkbox" <?php if($server4visible > "0") echo "checked=checked; "; ?> /><br />
Server 4 Name: <input type="text" value="<?php echo $server4name ?>" name="server4name" /><br />
Server 4 URL: <input type="text" value="<?php echo $server4url ?>" name="server4url" /><br />
</div>
<div style="float:right; width:50%; ">
Custom RSS Feeds <br />
<br />
Feed 1 Enabled: <input name="customfeed1visible" id="id" type="checkbox" <?php if($customfeed1visible > "0") echo "checked=checked; "; ?> /><br />
Feed 1 Name: <input type="text" value="<?php echo $customfeed1name ?>" name="customfeed1name" /><br />
Feed 1 URL: <input type="text" value="<?php echo $customfeed1url ?>" name="customfeed1url" /><br />
<br />
Feed 2 Enabled: <input name="customfeed2visible" id="id" type="checkbox" <?php if($customfeed2visible > "0") echo "checked=checked; "; ?> /><br />
Feed 2 Name: <input type="text" value="<?php echo $customfeed2name ?>" name="customfeed2name" /><br />
Feed 2 URL: <input type="text" value="<?php echo $customfeed2url ?>" name="customfeed2url" /><br />
<br />
Feed 3 Enabled: <input name="customfeed3visible" id="id" type="checkbox" <?php if($customfeed3visible > "0") echo "checked=checked; "; ?> /><br />
Feed 3 Name: <input type="text" value="<?php echo $customfeed3name ?>" name="customfeed3name" /><br />
Feed 3 URL: <input type="text" value="<?php echo $customfeed3url ?>" name="customfeed3url" /><br />
<br />
</div>
</div>
<div>
<input type="submit" name="submit" value="Update" />
</div>
</div>
</form>

View File

@ -1,22 +1,44 @@
<?php <?php
$target_dir = "../Pic/";
// A list of permitted file extensions $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$allowed = array('png', 'jpg', 'gif','zip'); $uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
if(isset($_FILES['upl']) && $_FILES['upl']['error'] == 0){ // Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
$extension = pathinfo($_FILES['upl']['name'], PATHINFO_EXTENSION); $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
if($check !== false) {
if(!in_array(strtolower($extension), $allowed)){ echo "File is an image - " . $check["mime"] . ".";
echo '{"status":"error"}'; $uploadOk = 1;
exit; } else {
} echo "File is not an image.";
$uploadOk = 0;
if(move_uploaded_file($_FILES['upl']['tmp_name'], 'Pic/'.$_FILES['upl']['name'])){ }
echo '{"status":"success"}';
exit;
}
} }
// Check if file already exists
echo '{"status":"error"}'; if (file_exists($target_file)) {
exit; echo "Sorry, file already exists.";
$uploadOk = 0;
}
// Check file size
if ($_FILES["fileToUpload"]["size"] > 500000) {
echo "Sorry, your file is too large.";
$uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
$uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo "Sorry, your file was not uploaded.";
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
}
?>

68
config/write1.php Normal file
View File

@ -0,0 +1,68 @@
<?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();
?>

View File

@ -1,8 +1,4 @@
<?php <?php
$yn = $_POST['YN'];
$yb = $_POST['YB'];
$user1 = $_POST['user'];
$pass1 = $_POST['pass'];
$sabvis1 = $_POST['sabvisible']; $sabvis1 = $_POST['sabvisible'];
$sabport1 = $_POST['sabport']; $sabport1 = $_POST['sabport'];
$sabname1 = $_POST['sabname']; $sabname1 = $_POST['sabname'];
@ -26,12 +22,6 @@ $fl='../config.php';
/*read operation ->*/ $tmp = fopen($fl, "r"); $content=fread($tmp,filesize($fl)); fclose($tmp); /*read operation ->*/ $tmp = fopen($fl, "r"); $content=fread($tmp,filesize($fl)); fclose($tmp);
// here goes your update // 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);
// SAB Settings // SAB Settings
// SAB Visible Update // SAB Visible Update
if (empty($sabvis1)) { if (empty($sabvis1)) {
@ -94,7 +84,7 @@ $content = preg_replace( '/\$cpkids = \"(.*?)\";/', '$cpkids = "'.$cpkids1.'";
//sleep for 5 seconds //sleep for 5 seconds
header("Location: index.php"); header("Location: re1.php");
die(); die();
?> ?>

119
config/write3.php Normal file
View File

@ -0,0 +1,119 @@
<?php
$torrentvisible1 = $_POST['torrentvisible'];
$torrentport1 = $_POST['$torrentport'];
$torrentname1 = $_POST['torrentname'];
$torrentpicname1 = $_POST['torrentpicname'];
$torrenttype1 = $_POST['torrenttype'];
$ftpvisible1 = $_POST['ftpvisible'];
$ftpname1 = $_POST['$ftpname'];
$ftppicname1 = $_POST['ftppicname'];
$ftpport1 = $_POST['ftpport'];
$madsonicvisible1 = $_POST['madsonicvisible'];
$madsonicname1 = $_POST['$madsonicname'];
$madsonicpicname1 = $_POST['madsonicpicname'];
$madsonicport1 = $_POST['madsonicport'];
$plexvisible1 = $_POST['plexvisible'];
$plexname1 = $_POST['$plexname'];
$plexpicname1 = $_POST['plexpicname'];
$plexport1 = $_POST['plexport'];
$squeezevisible1 = $_POST['squeezevisible'];
$squeezename1 = $_POST['$squeezename'];
$squeezepicname1 = $_POST['squeezepicname'];
$squeezeport1 = $_POST['squeezeport'];
$jdownloadervisible1 = $_POST['jdownloadervisible'];
$jdownloadername1 = $_POST['$jdownloadername'];
$jdownloaderpicname1 = $_POST['jdownloaderpicname'];
//
$fl='../config.php';
/*read operation ->*/ $tmp = fopen($fl, "r"); $content=fread($tmp,filesize($fl)); fclose($tmp);
// here goes your update
// Torrent Settings
// Torrent Visible Update
if (empty($torrentvisible1)) {
$content = preg_replace( '/\$torrentvisible = \"(.*?)\";/', '$torrentvisible = "0";', $content);
} else {
$content = preg_replace( '/\$torrentvisible = \"(.*?)\";/', '$torrentvisible = "1";', $content);
}
if ($torrenttype1 > "1") {
$content = preg_replace( '/\$torrenttype = \"(.*?)\";/', '$torrenttype = "2";', $content);
$content = preg_replace( '/\$torrentport = \"(.*?)\";/', '$torrentport = "9091";', $content);
} else {
$content = preg_replace( '/\$torrenttype = \"(.*?)\";/', '$torrenttype = "1";', $content);
$content = preg_replace( '/\$torrentport = \"(.*?)\";/', '$torrentport = "86";', $content);
}
$content = preg_replace( '/\$torrentname = \"(.*?)\";/', '$torrentname = "'.$torrentname1.'";', $content);
$content = preg_replace( '/\$torrentpicname = \"(.*?)\";/', '$torrentpicname = "'.$torrentpicname1.'";', $content);
// End of SAB Settings
// FTP Settings
// FTP Visible Update
if (empty($ftpvisible1)) {
$content = preg_replace( '/\$ftpvisible = \"(.*?)\";/', '$ftpvisible = "0";', $content);
} else {
$content = preg_replace( '/\$ftpvisible = \"(.*?)\";/', '$ftpvisible = "1";', $content);
}
$content = preg_replace( '/\$ftpport = \"(.*?)\";/', '$ftpport = "'.$ftpport1.'";', $content);
$content = preg_replace( '/\$ftpname = \"(.*?)\";/', '$ftpname = "'.$ftpname1.'";', $content);
$content = preg_replace( '/\$ftppicname = \"(.*?)\";/', '$ftppicname = "'.$ftppicname1.'";', $content);
// End of FTP Settigns
// Madsonic Settings
// Madsonic Visible Update
if (empty($madsonicvisible1)) {
$content = preg_replace( '/\$madsonicvisible = \"(.*?)\";/', '$madsonicvisible = "0";', $content);
} else {
$content = preg_replace( '/\$madsonicvisible = \"(.*?)\";/', '$madsonicvisible = "1";', $content);
}
$content = preg_replace( '/\$madsonicport = \"(.*?)\";/', '$madsonicport = "'.$madsonicport1.'";', $content);
$content = preg_replace( '/\$madsonicname = \"(.*?)\";/', '$madsonicname = "'.$madsonicname1.'";', $content);
$content = preg_replace( '/\$madsonicpicname = \"(.*?)\";/', '$madsonicpicname = "'.$madsonicpicname1.'";', $content);
// End of Madsonic Settigns
// Plex Settings
// Plex Visible Update
if (empty($plexvisible1)) {
$content = preg_replace( '/\$plexvisible = \"(.*?)\";/', '$plexvisible = "0";', $content);
} else {
$content = preg_replace( '/\$plexvisible = \"(.*?)\";/', '$plexvisible = "1";', $content);
}
$content = preg_replace( '/\$plexport = \"(.*?)\";/', '$plexport = "'.$plexport1.'";', $content);
$content = preg_replace( '/\$plexname = \"(.*?)\";/', '$plexname = "'.$plexname1.'";', $content);
$content = preg_replace( '/\$plexpicname = \"(.*?)\";/', '$plexpicname = "'.$plexpicname1.'";', $content);
// End of Plex Settigns
// Squeezebox Settings
// Squeezebox Visible Update
if (empty($squeezevisible1)) {
$content = preg_replace( '/\$squeezevisible = \"(.*?)\";/', '$squeezevisible = "0";', $content);
} else {
$content = preg_replace( '/\$squeezevisible = \"(.*?)\";/', '$squeezevisible = "1";', $content);
}
$content = preg_replace( '/\$squeezeport = \"(.*?)\";/', '$squeezeport = "'.$squeezeport1.'";', $content);
$content = preg_replace( '/\$squeezename = \"(.*?)\";/', '$squeezename = "'.$squeezename1.'";', $content);
$content = preg_replace( '/\$squeezepicname = \"(.*?)\";/', '$squeezepicname = "'.$squeezepicname1.'";', $content);
// End of Squeeze Settigns
// JDownloader Settings
// JDownloader Visible Update
if (empty($jdownloadervisible1)) {
$content = preg_replace( '/\$jdownloadervisible = \"(.*?)\";/', '$jdownloadervisible = "0";', $content);
} else {
$content = preg_replace( '/\$jdownloadervisible = \"(.*?)\";/', '$jdownloadervisible = "1";', $content);
}
$content = preg_replace( '/\$jdownloadername = \"(.*?)\";/', '$jdownloadername = "'.$jdownloadername1.'";', $content);
$content = preg_replace( '/\$jdownloaderpicname = \"(.*?)\";/', '$jdownloaderpicname = "'.$jdownloaderpicname1.'";', $content);
// End of Squeeze Settigns
/*write operation ->*/ $tmp =fopen($fl, "w"); fwrite($tmp, $content); fclose($tmp);
//sleep for 5 seconds
header("Location: re1.php");
die();
?>

108
config/write4.php Normal file
View File

@ -0,0 +1,108 @@
<?php
$drivespacevisible1 = $_POST['drivespacevisible'];
$drive1visible1 = $_POST['drive1visible'];
$drive1a = $_POST['drive1'];
$drive2visible1 = $_POST['drive2visible'];
$drive2a = $_POST['drive2'];
$drive3visible1 = $_POST['drive3visible'];
$drive3a = $_POST['drive3'];
$drive4visible1 = $_POST['drive4visible'];
$drive4a = $_POST['drive4'];
$drive5visible1 = $_POST['drive5visible'];
$drive5a = $_POST['drive5'];
$drive6visible1 = $_POST['drive6visible'];
$drive6a = $_POST['drive6'];
$drive7visible1 = $_POST['drive7visible'];
$drive7a = $_POST['drive7'];
//
$fl='../config.php';
/*read operation ->*/ $tmp = fopen($fl, "r"); $content=fread($tmp,filesize($fl)); fclose($tmp);
// here goes your update
// drive Visible Update
if (empty($drivespacevisible1)) {
$content = preg_replace( '/\$drivespacevisible = \"(.*?)\";/', '$drivespacevisible = "0";', $content);
} else {
$content = preg_replace( '/\$drivespacevisible = \"(.*?)\";/', '$drivespacevisible = "1";', $content);
}
// Drive1 Settings
// FTP Visible Update
if (empty($drive1visible1)) {
$content = preg_replace( '/\$drive1visible = \"(.*?)\";/', '$drive1visible = "0";', $content);
} else {
$content = preg_replace( '/\$drive1visible = \"(.*?)\";/', '$drive1visible = "1";', $content);
}
$content = preg_replace( '/\$drive1 = \"(.*?)\";/', '$drive1 = "'.$drive1a.'";', $content);
// End of Settigns
// Drive2 Settings
// FTP Visible Update
if (empty($drive2visible1)) {
$content = preg_replace( '/\$drive2visible = \"(.*?)\";/', '$drive2visible = "0";', $content);
} else {
$content = preg_replace( '/\$drive2visible = \"(.*?)\";/', '$drive2visible = "1";', $content);
}
$content = preg_replace( '/\$drive2 = \"(.*?)\";/', '$drive2 = "'.$drive2a.'";', $content);
// End of Settigns
// Drive3 Settings
// FTP Visible Update
if (empty($drive3visible1)) {
$content = preg_replace( '/\$drive3visible = \"(.*?)\";/', '$drive3visible = "0";', $content);
} else {
$content = preg_replace( '/\$drive3visible = \"(.*?)\";/', '$drive3visible = "1";', $content);
}
$content = preg_replace( '/\$drive3 = \"(.*?)\";/', '$drive3 = "'.$drive3a.'";', $content);
// End of Settigns
// Drive4 Settings
// FTP Visible Update
if (empty($drive4visible1)) {
$content = preg_replace( '/\$drive4visible = \"(.*?)\";/', '$drive4visible = "0";', $content);
} else {
$content = preg_replace( '/\$drive4visible = \"(.*?)\";/', '$drive4visible = "1";', $content);
}
$content = preg_replace( '/\$drive4 = \"(.*?)\";/', '$drive4 = "'.$drive4a.'";', $content);
// End of Settigns
// Drive5 Settings
// FTP Visible Update
if (empty($drive5visible1)) {
$content = preg_replace( '/\$drive5visible = \"(.*?)\";/', '$drive5visible = "0";', $content);
} else {
$content = preg_replace( '/\$drive5visible = \"(.*?)\";/', '$drive5visible = "1";', $content);
}
$content = preg_replace( '/\$drive5 = \"(.*?)\";/', '$drive5 = "'.$drive5a.'";', $content);
// End of Settigns
// Drive6 Settings
// FTP Visible Update
if (empty($drive6visible1)) {
$content = preg_replace( '/\$drive6visible = \"(.*?)\";/', '$drive6visible = "0";', $content);
} else {
$content = preg_replace( '/\$drive6visible = \"(.*?)\";/', '$drive6visible = "1";', $content);
}
$content = preg_replace( '/\$drive6 = \"(.*?)\";/', '$drive6 = "'.$drive6a.'";', $content);
// End of Settigns
// Drive7 Settings
// FTP Visible Update
if (empty($drive7visible1)) {
$content = preg_replace( '/\$drive7visible = \"(.*?)\";/', '$drive7visible = "0";', $content);
} else {
$content = preg_replace( '/\$drive7visible = \"(.*?)\";/', '$drive7visible = "1";', $content);
}
$content = preg_replace( '/\$drive7 = \"(.*?)\";/', '$drive7 = "'.$drive7a.'";', $content);
// End of Settigns
/*write operation ->*/ $tmp =fopen($fl, "w"); fwrite($tmp, $content); fclose($tmp);
//sleep for 5 seconds
header("Location: re1.php");
die();
?>

122
config/write5.php Normal file
View File

@ -0,0 +1,122 @@
<?php
$serverstatusvisible1 = $_POST['serverstatusvisible'];
$server1visible1 = $_POST['server1visible'];
$server1name1 = $_POST['server1name'];
$server1url1 = $_POST['server1url'];
$server2visible1 = $_POST['server2visible'];
$server2name1 = $_POST['server2name'];
$server2url1 = $_POST['server2url'];
$server3visible1 = $_POST['server3visible'];
$server3name1 = $_POST['server3name'];
$server3url1 = $_POST['server3url'];
$server4visible1 = $_POST['server4visible'];
$server4name1 = $_POST['server4name'];
$server4url1 = $_POST['server4url'];
$customfeed1visible1 = $_POST['customfeed1visible'];
$customfeed1name1 = $_POST['customfeed1name'];
$customfeed1url1 = $_POST['customfeed1url'];
$customfeed2visible1 = $_POST['customfeed2visible'];
$customfeed2name1 = $_POST['customfeed2name'];
$customfeed2url1 = $_POST['customfeed2url'];
$customfeed3visible1 = $_POST['customfeed3visible'];
$customfeed3name1 = $_POST['customfeed3name'];
$customfeed3url1 = $_POST['customfeed3url'];
//
$fl='../config.php';
/*read operation ->*/ $tmp = fopen($fl, "r"); $content=fread($tmp,filesize($fl)); fclose($tmp);
// here goes your update
// ServerStatus Visible Update
if (empty($serverstatusvisible1)) {
$content = preg_replace( '/\$serverstatusvisible = \"(.*?)\";/', '$serverstatusvisible = "0";', $content);
} else {
$content = preg_replace( '/\$serverstatusvisible = \"(.*?)\";/', '$serverstatusvisible = "1";', $content);
}
// Drive1 Settings
// FTP Visible Update
if (empty($server1visible1)) {
$content = preg_replace( '/\$server1visible = \"(.*?)\";/', '$server1visible = "0";', $content);
} else {
$content = preg_replace( '/\$server1visible = \"(.*?)\";/', '$server1visible = "1";', $content);
}
$content = preg_replace( '/\$server1name = \"(.*?)\";/', '$server1name = "'.$server1name1.'";', $content);
$content = preg_replace( '/\$server1url = \"(.*?)\";/', '$server1url = "'.$server1url1.'";', $content);
// End of Settigns
// Drive2 Settings
// FTP Visible Update
if (empty($server2visible1)) {
$content = preg_replace( '/\$server2visible = \"(.*?)\";/', '$server2visible = "0";', $content);
} else {
$content = preg_replace( '/\$server2visible = \"(.*?)\";/', '$server2visible = "1";', $content);
}
$content = preg_replace( '/\$server2name = \"(.*?)\";/', '$server2name = "'.$server2name1.'";', $content);
$content = preg_replace( '/\$server2url = \"(.*?)\";/', '$server2url = "'.$server2url1.'";', $content);
// End of Settigns
// Drive3 Settings
// FTP Visible Update
if (empty($server3visible1)) {
$content = preg_replace( '/\$server3visible = \"(.*?)\";/', '$server3visible = "0";', $content);
} else {
$content = preg_replace( '/\$server3visible = \"(.*?)\";/', '$server3visible = "1";', $content);
}
$content = preg_replace( '/\$server3name = \"(.*?)\";/', '$server3name = "'.$server3name1.'";', $content);
$content = preg_replace( '/\$server3url = \"(.*?)\";/', '$server3url = "'.$server3url1.'";', $content);
// End of Settigns
// Drive4 Settings
// FTP Visible Update
if (empty($server4visible1)) {
$content = preg_replace( '/\$server4visible = \"(.*?)\";/', '$server4visible = "0";', $content);
} else {
$content = preg_replace( '/\$server4visible = \"(.*?)\";/', '$server4visible = "1";', $content);
}
$content = preg_replace( '/\$server4name = \"(.*?)\";/', '$server4name = "'.$server4name1.'";', $content);
$content = preg_replace( '/\$server4url = \"(.*?)\";/', '$server4url = "'.$server4url1.'";', $content);
// End of Settigns
// RSS1 Settings
// FTP Visible Update
if (empty($customfeed1visible1)) {
$content = preg_replace( '/\$customfeed1visible = \"(.*?)\";/', '$customfeed1visible = "0";', $content);
} else {
$content = preg_replace( '/\$customfeed1visible = \"(.*?)\";/', '$customfeed1visible = "1";', $content);
}
$content = preg_replace( '/\$customfeed1name = \"(.*?)\";/', '$customfeed1name = "'.$customfeed1name1.'";', $content);
$content = preg_replace( '/\$customfeed1name = \"(.*?)\";/', '$customfeed1name = "'.$customfeed1name1.'";', $content);
// End of Settigns
// RSS2 Settings
// FTP Visible Update
if (empty($customfeed2visible1)) {
$content = preg_replace( '/\$customfeed2visible = \"(.*?)\";/', '$customfeed2visible = "0";', $content);
} else {
$content = preg_replace( '/\$customfeed2visible = \"(.*?)\";/', '$customfeed2visible = "1";', $content);
}
$content = preg_replace( '/\$customfeed2name = \"(.*?)\";/', '$customfeed2name = "'.$customfeed2name1.'";', $content);
$content = preg_replace( '/\$customfeed2name = \"(.*?)\";/', '$customfeed2name = "'.$customfeed2name1.'";', $content);
// End of Settigns
// RSS3 Settings
// FTP Visible Update
if (empty($customfeed3visible1)) {
$content = preg_replace( '/\$customfeed3visible = \"(.*?)\";/', '$customfeed3visible = "0";', $content);
} else {
$content = preg_replace( '/\$customfeed3visible = \"(.*?)\";/', '$customfeed3visible = "1";', $content);
}
$content = preg_replace( '/\$customfeed3name = \"(.*?)\";/', '$customfeed3name = "'.$customfeed3name1.'";', $content);
$content = preg_replace( '/\$customfeed3name = \"(.*?)\";/', '$customfeed3name = "'.$customfeed3name1.'";', $content);
// End of Settigns
/*write operation ->*/ $tmp =fopen($fl, "w"); fwrite($tmp, $content); fclose($tmp);
//sleep for 5 seconds
header("Location: re1.php");
die();
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 944 B