function edit_xinetd_conf($service)
{
    $xinetd_conf = '/etc/xinetd.conf';
    $contents = unix_nl(rf($xinetd_conf));
    $lines = explode("\n", $contents);
    $j = sizeof($lines);
    for ($i = 0; $i < sizeof($lines); $i++) {
        if (grep($lines[$i], $service, 'w')) {
            $fundstelle_anfang = $i;
            $j = $i;
            $parts = explode($lines[$i], $contents);
        }
        if ($j < sizeof($lines)) {
            if (strstr($lines[$i], '}')) {
                $fundstelle_ende = $i;
                $j = sizeof($lines);
            }
        }
    }
    if (isset($fundstelle_anfang) && isset($fundstelle_ende)) {
        for ($i = $fundstelle_anfang; $i <= $fundstelle_ende; $i++) {
            if (strstr($lines[$i], 'disable')) {
                $disable = explode('=', $lines[$i]);
                $disable[1] = ' yes';
                $lines[$i] = implode('=', $disable);
            }
        }
    }
    $fundstelle_anfang = NULL;
    $fundstelle_ende = NULL;
    $contents = implode("\n", $lines);
    wf($xinetd_conf, $contents);
}
Exemplo n.º 2
0
                echo "<h3>1. " . $text["no_db"] . "</h3>";
                echo "<pre>" . html_nl($sql9) . "</pre>";
            }
            if ($db->query($sql10) !== TRUE) {
                echo "<h3>1. " . $text["no_db"] . "</h3>";
                echo "<pre>" . html_nl($sql10) . "</pre>";
            }
            if ($db->query($sql11) !== TRUE) {
                echo "<h3>1. " . $text["no_db"] . "</h3>";
                echo "<pre>" . html_nl($sql11) . "</pre>";
            }
            $db->close();
            echo "<h3>1. " . $text["db_created"] . "</h3>";
        }
        $config_file = "<?php\n\$config = array(\n\t// Database\n\t'dbhost' => '" . $_POST["dbhost"] . "',\n\t'dbname' => '" . $_POST["dbname"] . "',\n\t'dbuser' => '" . $_POST["dbuser"] . "',\n\t'dbpassword' => '" . $_POST["dbpassword"] . "',\n\t'dbprefix' => '" . $_POST["dbprefix"] . "',\n\n\t// User\n\t'salt' => '" . $_POST["salt"] . "',\n\n\t// Logfiles\n\t'log' => '" . $_POST["logfiles"] . "', // NO, NORMAL, PARANOID, DEBUG\n\n\t// deadline Server time\n\t'dlyear' => " . $_POST["dlyear"] . ",\n\t'dlday' => " . $_POST["dlday"] . ",\n\t'dlmonth' => " . $_POST["dlmonth"] . ",\n\t'dlhour' => " . $_POST["dlhour"] . ",\n\t'dlminute' => " . $_POST["dlminute"] . ",\n\t'dlsecond' => " . $_POST["dlsecond"] . ",\n\n\t// jury goal\n\t'goal' => " . $_POST["goal"] . ",\n\n\t// language\n\t'language' => '" . $_POST["language"] . "', // de-at, de, en, sr\n\n\t// category Commons\n\t'catadd' => array(\n\t\t" . $_POST["catadd"] . "\n\t),\n\t'catremove' => array(\n\t\t" . $_POST["catremove"] . "\n\t),\n\n\t'license' => array(\n\t\t" . $_POST["license"] . "\n\t),\n\n\t// general settings\n\t'title' => '" . $_POST["title"] . "',\n\t'name' => '" . $_POST["name"] . "',\n\t'version' => '" . $_POST["version"] . "',\n\t'url' => '" . $_POST["url"] . "',\n\t'mail' => '" . $_POST["mail"] . "',\n\t'logo' => '" . $_POST["logo"] . "',\n\t'icon' => '" . $_POST["icon"] . "',\n\t'time' => '" . $_POST["time"] . "', // commons loves UTC but MESZ is +2\n);\n?>\n";
        save_file("config/config.php", unix_nl($config_file));
        if (file_exists("config/config.php")) {
            echo "<h3>2. " . $text["config_created"] . "</h3>";
        } else {
            echo "<h3>2. " . $text["no_config"] . "</h3>";
            echo "<pre>" . html_replace($config_file) . "</pre>";
        }
        echo "<h3>3. " . $text["clean_up"] . "</h3>";
    } else {
        ?>
		
	<table border=0 cellpadding=0px width=1000px style="text-align: left; table-layout:fixed;">
			
			<tr valign="top" style="background-color: #EAEAEA;">
				<td style="width: 160px;">
					<h3><?php