Example #1
0
@($apache = new Config($us_usr . "/local/apache2/conf/httpd.conf", "#"));
$apache->Var_Name = array("ServerName", "ServerAdmin", "DirectoryIndex", "AddHandler server-parsed", "ServerSignature", "Listen");
$apache->Var_Text = array("" . $US['aconfig-sname'] . "", "" . $US['aconfig-wemail'] . "", "" . $US['aconfig-difiles'] . "", "" . $US['aconfig-ssi'] . "", "" . $US['aconfig-ssig'] . "", "" . $US['aconfig-listen'] . "");
$apache->Var_Help = array("http://httpd.apache.org/docs/mod/core.html#servername", "http://httpd.apache.org/docs/mod/core.html#serveradmin", "http://httpd.apache.org/docs/mod/mod_dir.html#directoryindex", "http://httpd.apache.org/docs/mod/mod_include.html", "http://httpd.apache.org/docs/mod/core.html#serversignature", "http://httpd.apache.org/docs/2.0/bind.html");
// import_request_variables("gP", "st");
if (@$_POST['Submit']) {
    $step = $_POST['Submit'];
} else {
    $step = 'dummay';
}
if ($step == "next") {
    echo "<p>" . $US['aconfig-text-0'] . "</p>";
} else {
    if ($step == "Save") {
        mpgUpdateRedirectFile();
        $apache->replace_values($_POST);
        echo "<p><font color=\"red\">" . $US['aconfig-text-1'] . "</font><p>";
    }
    ?>

        <form action="
<?php 
    echo $_SERVER["PHP_SELF"] . "\" name=\"f\" method=\"post\">";
    @$apache->echo_values();
    ?>
        <br />
        <input type="submit" value="<?php 
    echo $US['aconfig-save'];
    ?>
" name="Submit" />
        </form>
Example #2
0
    $PHPmod = False;
}
# --
$PHP = new Config("/usr/local/APACHE2/php.ini", ";");
$PHP->Var_Name = array("safe_mode =", "expose_php =", "register_globals =", "max_execution_time =", "memory_limit =", "display_errors =", "post_max_size =", "upload_max_filesize =", "magic_quotes_gpc =", "SMTP =", "sendmail_from =");
$PHP->Var_Text = array("Safe mode", "Show PHP in apache signature", "Register globals", "Maximum execution time of each script, in seconds", "Maximum amount of memory a script may consume (8MB)", "Print out errors (as a part of the output)", "Maximum size of POST data that PHP will accept", "Maximum allowed size for uploaded files", "magic_quotes_gpc", "SMTP (mail configuration)", "From (mail configuration)");
$PHP->Var_Help = array("http://php.benscom.com/manual/en/features.safe-mode.php", "http://www.php.net/manual/en/security.hiding.php#security.hiding", "http://www.php.net/release_4_1_0.php", "http://www.php.net/manual/en/configuration.php#ini.max-execution-time", "http://www.php.net/manual/en/configuration.php#ini.memory-limit", "http://www.php.net/manual/en/configuration.php#ini.display-errors", "http://www.php.net/manual/en/features.file-upload.php#features.file-upload.post-method", "http://www.php.net/manual/en/configuration.php#ini.upload-max-filesize", "http://www.php.net/manual/en/function.get-magic-quotes-gpc.php", "http://www.php.net/manual/en/ref.mail.php", "http://www.php.net/manual/en/ref.mail.php");
//-------------------------------------------------------------------- main program
//import_request_variables("gP", "st");
$step = $HTTP_POST_VARS['Submit'];
if ($step == "next") {
    echo "something<br>";
} else {
    if ($step == "Save") {
        $apache->replace_values($HTTP_POST_VARS);
        $PHP->replace_values($HTTP_POST_VARS);
        echo "\r\n\t<div class=\"resultMsg\">The changes have been sucssesfuly saved.</div>\r\n\t<div class=\"confirm\">The changes will have effect after restart of the server!</div>\r\n\t<br>";
    }
    echo "<form action=\"";
    echo $_SERVER["PHP_SELF"] . "\" name=f method=\"POST\">\r\n\t<table class=\"outer\">\r\n\t<tr><th colspan=\"2\">Apache configuration</th></tr>";
    $apache->echo_values();
    echo "</table>\r\n\t<br>";
    echo "<table class=\"outer\">\r\n\t<tr><th colspan=\"2\">PHP configuration</th></tr>";
    $PHP->echo_values();
    echo "\r\n\t<tr><td colspan=\"2\" class=\"foot\">\r\n    <input type=submit value=\"Save\" name=Submit>\r\n    </td></tr>\r\n\t</table>\r\n\t</form>\r\n\t<br>\r\n\t";
    if ($PHPmod == True) {
        echo "<div class=\"resultMsg\">At the moment PHP is loaded as Apache module.</div>";
    } else {
        echo "<div class=\"resultMsg\">At the moment PHP scripts are executed thought Apache CGI interface.</div>";
    }
}
Example #3
0
@($PHP = new Config($us_usr . "/local/PHP/php.ini", ";"));
$PHP->Var_Name = array("safe_mode =", "expose_php =", "register_globals =", "max_execution_time =", "memory_limit =", "display_errors =", "post_max_size =", "upload_max_filesize =");
$PHP->Var_Text = array("" . $US['pconfig-smode'] . "", "" . $US['pconfig-ssig'] . "", "" . $US['pconfig-rg'] . "", "" . $US['pconfig-mtexec'] . "", "" . $US['pconfig-mmexec'] . "", "" . $US['pconfig-perror'] . "", "" . $US['pconfig-mpsize'] . "", "" . $US['pconfig-musize'] . "");
$PHP->Var_Help = array("http://php.benscom.com/manual/en/features.safe-mode.php", "http://www.php.net/manual/en/security.hiding.php#security.hiding", "http://www.php.net/release_4_1_0.php", "http://www.php.net/manual/en/configuration.php#ini.max-execution-time", "http://www.php.net/manual/en/configuration.php#ini.memory-limit", "http://www.php.net/manual/en/configuration.php#ini.display-errors", "http://www.php.net/manual/en/features.file-upload.php#features.file-upload.post-method", "http://www.php.net/manual/en/configuration.php#ini.upload-max-filesize");
//--------------------------------------------------------------------
// import_request_variables("gP", "st");
if (isset($_POST['Submit'])) {
    $step = $_POST['Submit'];
} else {
    $step = 'dummay';
}
if ($step == "next") {
    echo "<p>" . $US['pconfig-text-0'] . "</p>";
} else {
    if ($step == "Save") {
        $PHP->replace_values($_POST);
        echo "<p><font color=\"red\">" . $US['pconfig-text-1'] . "</font></p>";
    }
    ?>

        <form action="
<?php 
    echo $_SERVER["PHP_SELF"] . "\" name=\"f\" method=\"post\">";
    @$PHP->echo_values();
    ?>
        <br />
        <input type="submit" value="<?php 
    echo $US['pconfig-save'];
    ?>
" name="Submit" />
        </form>