<? include "config.inc.php";?>
<html>
<head>
<title>Setup phpWebEd</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body { margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0px }
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
<tr align="center" bgcolor="#DDDDDD">
<td height="30"><font face="Verdana, Arial, Helvetica, sans-serif" size="+1">
<i>Edit</i> your Website <i>Online</i> with <b>phpWebEd/axWebEd</b> </font></td>
</tr>
<tr>
<td align="center" valign="top">
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b><br>
phpWebEd <? echo $phpWebEd_version;?> Setup</b></font></p>
<form method="post" action="<? echo $PHP_SELF;?>">
<?
if ($name == $phpWebEd_username && $pass == $phpWebEd_userpass) {
if ($save != "") {
if (!($fp = @fopen("config.inc.php", 'r'))) {
echo "<br><b>Error reading file "config.inc.php".<br><br>Setup could not be finished!</b>";
}
else {
$buf = fread($fp,filesize("config.inc.php"));
fclose($fp);
$url = trim($url);
$dir = trim($dir);
if (substr($url, -1) == "/") $url = substr($url, 0, strlen($url)-1);
if (substr($dir, -1) == "/") $dir = substr($dir, 0, strlen($dir)-1);
$buf = ereg_replace("(phpWebEd_url = \")([^\"]*)(\";)", "\\1$url\\3", $buf);
$buf = ereg_replace("(phpWebEd_dir = \")([^\"]*)(\";)", "\\1$dir\\3", $buf);
$buf = ereg_replace("(homepage_url = \")([^\"]*)(\";)", "\\1" . trim($homepage) . "\\3", $buf);
$buf = ereg_replace("(phpWebEd_username = \")([^\"]*)(\";)", "\\1" . trim($username) . "\\3", $buf);
$buf = ereg_replace("(phpWebEd_userpass = \")([^\"]*)(\";)", "\\1" . trim($userpass) . "\\3", $buf);
$buf = ereg_replace("(phpWebEd_language = \")([^\"]*)(\";)", "\\1$language\\3", $buf);
$buf = ereg_replace("(only_trusted_tags = )([01])(;)", "\\1" . (int)$safe_tags . "\\3", $buf);
$axopt2 = "";
if (isset($axopt)) {
while (list(, $value) = each ($axopt)) {
$axopt2 .= "$value ";
}
}
$buf = ereg_replace("(axWebEd_options = \")([^\"]*)(\";)", "\\1" . trim($axopt2) . "\\3", $buf);
if (!($fp = @fopen("config.inc.php", 'w'))) {
echo "<br><b>Error writing file "config.inc.php".<br><br>Setup could not be finished!</b>";
}
else {
fwrite($fp, $buf);
fclose($fp);
?>
<table border="0" width="100%">
<tr>
<td width="40"> </td>
<td>
<p>Setup has finished.</p>
<p>You can now prepare your web pages for editing with phpWebEd
or axWebEd. Add the following PHP code to every page you want
to edit:</p>
<p><font color="#000066"><html><br>
<head><br>
...<br>
<body><br>
...</font><br>
<font color="#660000"><?<br>
include("<i><path_to_phpwebed></i>/config.inc.php");<br>
content("<i><unique_title></i>");<br>
?></font><br>
<font color="#000066">...</font><br>
<font color="#660000"><? content("<i><unique_title></i>");?></font><br>
<font color="#000066">...<br>
</body><br>
</html> </font></p>
<p>For more information see <a href="readme.html">readme.html</a>,
<a href="../example1.php">example1.php</a> or <a href="../example2.php">example2.php</a></p>
<p> </p>
</td>
<td width="40"> </td>
</tr></table>
<?
}
}
}
else {
?>
<table border="0" width="100%">
<tr>
<td align="right" rowspan="17" width="40"> </td>
<td colspan="2"><font color="#990000">Important Note:</font> To setup
and use phpWebEd, the "contents" directory must have the
permission rwxrwxrwx (777), the files "config.inc.php",
"logins.txt" and all files within "contents"
must have the permissions rw-rw-rw- (666). If you have not set them,
please do so now. <i>The permissions must be set before setup can
continue!</i></td>
<td align="right" rowspan="17" width="40"> </td>
</tr>
<tr>
<td colspan="2"><br>
The following two settings were determined automatically. You should
change them only if it seems to be wrong or if you know what you
are doing.</td>
</tr>
<tr>
<td align="right" nowrap><b>URL to phpWebEd:</b></td>
<td>
<input type="text" name="url" size="50" value="<? echo "http://" . $HTTP_SERVER_VARS["HTTP_HOST"] . str_replace("setup.php", "", $HTTP_SERVER_VARS["REQUEST_URI"]);?>">
</td>
</tr>
<tr>
<td align="right" nowrap><b>Full server path:</b></td>
<td>
<input type="text" name="dir" size="50" value="<? echo str_replace("setup.php", "", $HTTP_SERVER_VARS["PATH_TRANSLATED"]);?>">
</td>
</tr>
<tr>
<td colspan="2"><br>
The next setting indicates the page where you want to start after
login. From this page you can navigate through your site and edit
all pages you have prepared for phpWebEd.</td>
</tr>
<tr>
<td align="right"><b>Homepage:</b></td>
<td>
<input type="text" name="homepage" size="50" value="<?
if ($homepage_url == "") echo "http://" . $HTTP_SERVER_VARS["HTTP_HOST"] . "/";
else echo $homepage_url;?>">
</td>
</tr>
<tr>
<td colspan="2"><br>
Choose the language for phpWebEd.</td>
</tr>
<tr>
<td align="right"><b>Language:</b></td>
<td>
<select name="language">
<option <? if ($phpWebEd_language == "dutch") echo "selected";?>>dutch</option>
<option <? if ($phpWebEd_language == "english") echo "selected";?>>english</option>
<option <? if ($phpWebEd_language == "french") echo "selected";?>>french</option>
<option <? if ($phpWebEd_language == "german") echo "selected";?>>german</option>
<option <? if ($phpWebEd_language == "italian") echo "selected";?>>italian</option>
<option <? if ($phpWebEd_language == "spanish") echo "selected";?>>spanish</option>
<option <? if ($phpWebEd_language == "slovak") echo "selected";?>>slovak</option>
<option <? if ($phpWebEd_language == "danish") echo "selected";?>>danish</option>
</select>
</td>
</tr>
<tr>
<td colspan="2"><br>
The next setting is for security reasons only. If disabled, users
may enter dangerous Javascript or PHP instructions. For a list of
"trusted" tags see "config.inc.php".</td>
</tr>
<tr>
<td align="right" nowrap><b>Only trusted HTML:</b></td>
<td>
<input type="checkbox" name="safe_tags" value="1" <? if ($only_trusted_tags == 1) echo "checked";?>>
</td>
</tr>
<tr>
<td colspan="2"><br>
If you have <a href="http://www.m-tecs.net/axwebed/" target="_blank">axWebEd</a> (Version 2.1 or higher) installed, you may disable
some of its features. </td>
</tr>
<tr>
<td align="right" nowrap><b>axWebEd options:</b></td>
<td>
<nobr><input type="checkbox" name="axopt[]" value="nohtml" <? if (strstr($axWebEd_options, "nohtml")) echo "checked";?>>
disable "HTML" tab</nobr>
<nobr><input type="checkbox" name="axopt[]" value="noimage" <? if (strstr($axWebEd_options, "noimage")) echo "checked";?>>
disable "Image" button</nobr>
<nobr><input type="checkbox" name="axopt[]" value="notable" <? if (strstr($axWebEd_options, "notable")) echo "checked";?>>
disable "Insert Table" button</nobr>
<nobr><input type="checkbox" name="axopt[]" value="nostyle" <? if (strstr($axWebEd_options, "nostyle")) echo "checked";?>>
disable "Styles" dropdown</nobr>
<nobr><input type="checkbox" name="axopt[]" value="nofont" <? if (strstr($axWebEd_options, "nofont")) echo "checked";?>>
disable "Font" button</nobr>
</td>
</tr>
<tr>
<td colspan="2"><br>
Now choose your username and password. Remember both!</td>
</tr>
<tr>
<td align="right"><b>Username:</b></td>
<td>
<input type="text" name="username" size="20" value="<?=$phpWebEd_username?>">
</td>
</tr>
<tr>
<td align="right"><b>Password:</b></td>
<td>
<input type="text" name="userpass" size="20" value="<?=$phpWebEd_userpass?>">
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="hidden" name="name" value="<?=$name?>">
<input type="hidden" name="pass" value="<?=$pass?>">
<input type="submit" name="save" value="Save settings">
</td>
</tr>
</table>
<?
}
} else {
if ($login != "" || $save != "") $errstr = "Access Denied!";
?>
<table border="0" cellspacing="0" cellpadding="2" bgcolor="#CCCCCC">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="10" bgcolor="#FFFFFF">
<tr align="center">
<td colspan="2"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font size="3">Login</font></b></font></td>
</tr>
<? if (isset($errstr)) echo "<tr align=\"center\"><td colspan=\"2\">
<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\"><b>$errstr</b></font></td></tr>";?>
<tr>
<td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<b> Username</b></font></td>
<td>
<input type="text" name="name">
</td>
</tr>
<tr>
<td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<b>Password</b></font></td>
<td>
<input type="password" name="pass">
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" name="login" value="Login">
</td>
</tr>
</table>
</td>
</tr>
</table>
<?
}
?>
</form>
<p> </p>
</td>
</tr>
<tr bgcolor="#DDDDDD" align="center">
<td height="20"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">phpWebEd
<? echo "$phpWebEd_version";?>
- Copyright © 2001-2002 Holger Mauermann - <a href="http://www.m-tecs.net/">www.m-tecs.net</a></font>
</td>
</tr>
</table>
</body>
</html>