42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
$moduleurl = $_SERVER["REQUEST_URI"];
|
|
|
|
$ovpnconfdir = db_getconfval("ovpnconfdir");
|
|
$sqddir = db_getconfval("sqddir");
|
|
$ovpnconffile = db_getconfval("ovpnconffile");
|
|
// echo $ovpnconfdir."/".$ovpnconffile;
|
|
|
|
echo "
|
|
Change the OpenVPN Config...";
|
|
if ($_REQUEST["uebergabe3"] == "1")
|
|
{
|
|
$check_ok = "<b><br /><br />Die Daten wurden erfolgreich gespeichert!</b>";
|
|
echo $check_ok;
|
|
}
|
|
if ($_REQUEST["submit"] == "Speichern")
|
|
{
|
|
$fp = fopen($ovpnconfdir."/".$ovpnconffile,"w");
|
|
$data =$_REQUEST["inhalt"];
|
|
$data = str_replace("\r","",$data);
|
|
fputs($fp,$data);
|
|
fclose($fp);
|
|
|
|
echo "<meta http-equiv=\"Refresh\" content=\"4; url=".$moduleurl."&uebergabe3=1\">";
|
|
$check_ok = "<font color = 'red'><br /><br />Ihre Daten wurden erfolgreich geändert!<br>Bitte warten sie bis die Daten aktualisiert werden.</font>";
|
|
echo $check_ok;
|
|
}
|
|
echo "<form action=\"".$_SERVER["REQUEST_URI"]."\" method =\"post\">
|
|
<textarea name=\"inhalt\" rows=30 cols=120 wrap=\"virtual\">
|
|
";
|
|
|
|
include($ovpnconfdir."/".$ovpnconffile);
|
|
|
|
echo "
|
|
</textarea><br />
|
|
<input name=\"submit\" type=\"submit\" id=\"submit\" value=\"Speichern\" />
|
|
<input type=\"reset\" name=\"Submit2\" value=\"Reset\" />
|
|
|
|
</form>";
|
|
|
|
?>
|