<?php
class ManagementPanelAddon {
public function _Requirements() {
return array (
"AddonsAPI" => true,
"ConfigurationFileAccess" => true,
"FileSystemAccess" => true
);
}
public function _Run() {
$_Common = array (
"SL_DIRECTORY" => "SecureLab's Directory",
"SL_FUNCTIONS" => "Enable magic functions",
"SL_MAGIC_METHODS" => "Enable magic methods",
"ALLOW_SITE_MANAGEMENT" => "Allow SecureLab to manage my site",
"ALLOW_ADDONS_USING" => "Allow Addons using",
"ALLOW_SCRIPTS_USING" => "Allow SecureLab's scripts using",
"PROTECT_SYSTEM_FILES" => "Protect files in work area by hash",
"ALLOW_ADDONS_AUTOLOAD" => "Allow autoloading of Addons",
"DEVELOPERS_TOOLS_ENABLE" => "Enable developer tools component",
"ALLOW_USE_AS_FUNCTION" => "Allow using main class as function",
"DISALLOW_VIEW_IN_FRAME" => "Disallow viewing site in frame",
"ALLOW_DEBUGGING_AFTER_INIT" => "Allow system to debug after starting"
);
if(!empty( $_POST )) {
include( SECURELAB_CONFIGURATION_DIR );
$_SESSION["__php"] = $SLPublicMainConfig;
$Add = "<?php\r\n\r\n\$SLPublicMainConfig = array();\r\n\r\n// System\r\n";
if( $_POST["system_DEVELOPERS_TOOLS_ENABLE"] == null ) {
$_POST["system_DEVELOPERS_TOOLS_ENABLE"] = "on";
}
foreach( $_Common as $PostKey => $PostValue ) {
if( $_POST["system_" . $PostKey] == "on" ) {
$Add .= '$SLPublicMainConfig["SYSTEM"]["' . $PostKey . '"] = 1;' . "\r\n";
} else {
$Add .= '$SLPublicMainConfig["SYSTEM"]["' . $PostKey . '"] = 0;' . "\r\n";
}
}
$Add .= "\r\n" . '?>';
$File = fopen( SECURELAB_CONFIGURATION_DIR, "w+" );
fwrite( $File, $Add );
fclose( $File );
$Notice = "<div class=\"notice\" onclick=\"document.getElementById('selectactionnotify').style.display = 'block';document.getElementById('selectactionnotify').style.opacity = '1';\"> Configuration successfully saved. Please, click here to select action.</div>";
}
include( SECURELAB_CONFIGURATION_DIR );
$Elements["SYSTEM"] = null;
foreach( $SLPublicMainConfig["SYSTEM"] as $ConfigurationKey => $ConfigurationValue ) {
if( ($ConfigurationValue == 1 || $ConfigurationValue == 0) and is_numeric( $ConfigurationValue ) ) {
$Elements["SYSTEM"] .= "<label class=\"checkbox\"><input type=\"checkbox\" " . ( $ConfigurationValue == 1 ? "checked" : null ) . ( $ConfigurationKey == "DEVELOPERS_TOOLS_ENABLE" ? " disabled" : null ) . " name=\"system_" . $ConfigurationKey . "\"> <span" . ( $ConfigurationKey == "DEVELOPERS_TOOLS_ENABLE" ? " style=\"color: red;\"" : null ) . ">" . $_Common[ $ConfigurationKey ] . "</span></label><br />";
}
}
$_DEF["HTML_OUTPUT"] = '<!doctype html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="windows-1251">
<title>SecureLab Management</title>
<link rel="stylesheet" href="' . ADDON_CURRENT_DIR . '/main.css" media="screen" />
</head>
<body style="margin-bottom: -500px;">
<div class="notification" id="selectactionnotify">
<b>What do you want?</b> <br />
<div class="notificationmenu currentmenu" onclick="document.location = document.location;">apply changes right now →</div>
<div class="notificationmenu" style="margin-top: 5px;">cancel all changes</div>
</div>
<table style="width: 100%;margin: -2px;height: 100%;margin-bottom: -500px;">
<tr style="height: 100%;margin-bottom: -500px;">
<td class="block1" style="width: 30%;height: 100%;margin-bottom: -500px;">
<div class="paddingbox" style="margin-bottom: -500px;">
<h1 class="header">SecureLab <span>management</span></h1>
<div class="selected">
Preferances
</div>
</div>
</td>
<td class="block2" style="width: 64%;height: 100%;margin-bottom: -500px;">
<div style="position: absolute;width: 25px;height: 920px;background: white;margin-left: 840px;"></div>
<div class="paddingbox" style="margin-top: 0px;margin-bottom: -500px;">
<a class="tab active">System configuration</a>
<a class="tab">User configuration</a>
<a class="tab">Trust certificates</a><br /><br />
<div style="height: 698px;overflow-y:auto;width: 800px;">
' . $Notice . '
<table>
<tr>
<td><div class="congfhead">System</div>
<form action="" method="post">' . $Elements["SYSTEM"] . '
<input type="submit" value=" apply changes " /></form>
</td>
<td valign="top" style="padding-left: 25px;">
<img src="http://icons.iconarchive.com/icons/artua/mac/256/System-Preferences-icon.png" style="margin-top: 80px;margin-left: 60px;" alt="" />
</td>
</tr>
<tr>
<td valign="top" style="padding-top: 50px;">
<div class="congfhead">Filters prefs - GET</div>
</td>
<td valign="top" style="padding-left: 25px;padding-top: 50px;">
<img src="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/256/Actions-view-filter-icon.png" style="margin-top: 80px;margin-left: 60px;" alt="" />
</td>
</tr>
</table></div>
</div>
</td>
</tr>
</table>
</body>
</html>';
print $_DEF["HTML_OUTPUT"];
}
}
?>