";
exit();
}
if (!is_numeric($_POST["indexpagelimitspecify"]) || $_POST["indexpagelimitspecify"] == "" || $_POST["indexpagelimitspecify"] <= 0)
{
echo errorMessage() . "Error: The index page limit is not an integer, a negative number, or is blank.";
exit();
}
if (!is_numeric($_POST["statspagelimitspecify"]) || $_POST["statspagelimitspecify"] == "" || $_POST["statspagelimitspecify"] <= 0)
{
echo errorMessage() . "Error: The statistics page limit is not an integer, a negative number, or is blank.";
exit();
}
if (!is_numeric($_POST["report_interval"]) || $_POST["report_interval"] == "" || $_POST["report_interval"] <= 0)
{
echo errorMessage() . "Error: The maximum reannounce interval is not an integer, a negative number, or is blank.";
exit();
}
if (!is_numeric($_POST["min_interval"]) || $_POST["min_interval"] == "" || $_POST["min_interval"] <= 0)
{
echo errorMessage() . "Error: The minimum reannounce interval is not an integer, a negative number, or is blank.";
exit();
}
if (!is_numeric($_POST["maxpeers"]) || $_POST["maxpeers"] == "" || $_POST["maxpeers"] > 300 || $_POST["maxpeers"] <= 0)
{
echo errorMessage() . "Error: The number of peers to send in one request is not an integer, over 300, a negative number, zero, or blank.";
exit();
}
if ($_POST["upload_username"] == "")
{
echo errorMessage() . "Error: The upload username is blank.";
exit();
}
if ($_POST["admin_username"] == "")
{
echo errorMessage() . "Error: The admin username is blank.";
exit();
}
if ($_POST["dbhost"] == "")
{
echo errorMessage() . "Error: The database hostname is blank.";
exit();
}
if ($_POST["dbuser"] == "")
{
echo errorMessage() . "Error: The database username is blank.";
exit();
}
if ($_POST["dbpass"] == "")
{
echo errorMessage() . "Error: The database password is blank.";
exit();
}
if ($_POST["database"] == "")
{
echo errorMessage() . "Error: The database name is blank.";
exit();
}
if ($_POST["rss_link"] != "" && Substr($_POST["rss_link"], 0, 7) != "http://")
{
echo errorMessage() . "Error: The RSS website URL does not start with http://";
exit();
}
if ($_POST["website_url"] == "" || Substr($_POST["website_url"], 0, 7) != "http://")
{
echo errorMessage() . "Error: The website URL list does not start with http:// or is blank.";
exit();
}
if ($_POST["announce_url0"] == "" || Substr($_POST["announce_url0"], 0, 7) != "http://")
{
echo errorMessage() . "Error: The announce URL list does not start with http:// or is blank.";
exit();
}
if (!is_numeric($_POST["max_upload_rate"]) || $_POST["max_upload_rate"] == "" || $_POST["max_upload_rate"] <= 0)
{
echo errorMessage() . "Error: The maximum upload rate is not an integer, a negative number, or is blank.";
exit();
}
if (!is_numeric($_POST["max_uploads"]) || $_POST["max_uploads"] == "" || $_POST["max_uploads"] <= 0)
{
echo errorMessage() . "Error: The maximum uploads is not an integer, a negative number, or is blank.";
exit();
}
if ($_POST["dateformat"] == "")
{
echo errorMessage() . "Error: The date format is blank.";
exit();
}
if ($_POST["timezone"] == "")
{
echo errorMessage() . "Error: The timezone is blank.";
exit();
}
if ($_POST["upload_username"] == $_POST["admin_username"])
{
echo errorMessage() . "Error: The admin username cannot be the same as the upload username.";
exit();
}
//calculate new MD5 password if needed
if ($_POST["upload_password"] != "")
{
$_POST["upload_password"] = md5($_POST["upload_username"].$_POST["upload_password"]);
}
else
$_POST["upload_password"] = $_POST["old_upload_password"];
if ($_POST["admin_password"] != "")
{
$_POST["admin_password"] = md5($_POST["admin_username"].$_POST["admin_password"]);
}
else
$_POST["admin_password"] = $_POST["old_admin_password"];
//check if config.php has write access
if (is_writable("config.php"))
{
//go through checkboxes and change "on" to "true"
if (isset($_POST["hiddentracker"]))
$hiddentracker = "true";
else
$hiddentracker = "false";
if (isset($_POST["enablerss"]))
$enablerss = "true";
else
$enablerss = "false";
if (isset($_POST["scrape"]))
$scrape = "true";
else
$scrape = "false";
if (isset($_POST["customtitle"]))
$customtitle = "true";
else
$customtitle = "false";
if (isset($_POST["NAT"]))
$NAT = "true";
else
$NAT = "false";
if (isset($_POST["persist"]))
$persist = "true";
else
$persist = "false";
if (isset($_POST["ip_override"]))
$ip_override = "true";
else
$ip_override = "false";
if (isset($_POST["countbytes"]))
$countbytes = "true";
else
$countbytes = "false";
//write config.php file
$fd = fopen("config.php", "w") or die(errorMessage() . "Warning: write to config.php!");
fwrite($fd,
""
);
fclose($fd);
echo "
config.php file was edited successfully!
\n";
//run RSS generator
require_once("rss_generator.php");
}
else
{
echo errorMessage() . "config.php was not able to be written. Please check the permissions and try again.\n";
}
}
?>