fixed a bug in config.php

changed appearrance of wizard
This commit is contained in:
Roland Gruber 2003-03-01 12:22:35 +00:00
parent cea46df0a2
commit 1850f10ded
4 changed files with 27 additions and 21 deletions

View File

@ -138,11 +138,10 @@ class Config {
// prints current preferences
function printconf() {
echo _("SSL: " ) . $this->SSL . "</br>";
echo _("Host: ") . $this->Host . "</br>";
echo _("Port: ") . $this->Port . "</br>";
echo _("Passwd: ") . $this->Passwd . "</br>";
echo _("Admins: "); for ($i = 0; $i < sizeof($this->Admins); $i++) { echo $this->Admins[$i] . "&nbsp;&nbsp;&nbsp;"; }
echo _("<b>SSL: </b>" ) . $this->SSL . "</br>";
echo _("<b>Host: </b>") . $this->Host . "</br>";
echo _("<b>Port: </b>") . $this->Port . "</br>";
echo _("<b>Admins: </b>") . $this->Adminstring;
}
function get_SSL() {

View File

@ -33,10 +33,11 @@ $Id$
</title>
</head>
<body>
<b> <? echo _("Password to enter preferences:"); ?> </b><br><br>
<br><b><big><big><p align="center"> LDAP Account Manager</b></big></big></p><br><br>
<b><p align="center"> <? echo _("Password to enter preferences:"); ?> </b></p>
<form action="confmain.php" method="post">
<input type="password" name="passwd">
<input type="submit" name="submit" value=<? echo _("Ok"); ?> >
<p align="center"><input type="password" name="passwd">
<input type="submit" name="submit" value=<? echo _("Ok"); ?> ></p>
</form>
</body>
</html>

View File

@ -43,19 +43,24 @@ echo ("<head>\n");
echo ("<title>" . _("LDAP Account Manager Configuration") . "</title>\n");
echo ("</head>\n");
echo ("<body>\n");
echo ("<br><b><big><big><p align=\"center\"> LDAP Account Manager</b></big></big></p><br><br>\n");
echo ("<form action=\"confsave.php\" method=\"post\">\n");
echo ("<b>" . _("Hostname") . ": </b> <input type=\"text\" name=\"host\" value=\"" . $conf->get_Host() . "\"><br>\n");
echo ("<b>" . _("Portnumber") . ": </b> <input type=\"text\" name=\"port\" value=\"" . $conf->get_Port() . "\"><br>\n");
if ($conf->get_SSL() == "True") echo ("<b>" . _("Use SSL") . ": </b> <input type=\"checkbox\" name=\"ssl\" checked><br><br>\n");
else echo ("<b>" . _("Use SSL") . ": </b> <input type=\"checkbox\" name=\"ssl\"><br><br>\n");
echo ("<b>" . _("List of valid users") . ": </b> <input type=\"text\" name=\"admins\" value=\"" . $conf->get_Adminstring() . "\"><br>\n");
echo _("Usernames must be seperated by semicolons (e.g. cn=admin,dc=yourcompany,dc=com ; uid=root,ou=people,dc=yourcompany,cd=com)\n");
echo ("<br><br><br>\n");
echo ("<b>" . _("New Password") . ": </b> <input type=\"password\" name=\"pass1\"><br>\n");
echo ("<b>" . _("Reenter Password") . ": </b> <input type=\"password\" name=\"pass2\"><br>\n");
echo ("<p align=\"center\"><table border=\"0\">");
echo ("<tr><th><p align=\"right\"><b>" . _("Hostname") . ": </b></th> <th><p align=\"left\"><input type=\"text\" name=\"host\" value=\"" . $conf->get_Host() . "\"></th></tr>\n");
echo ("<tr><th><p align=\"right\"><b>" . _("Portnumber") . ": </b></th> <th><p align=\"left\"><input type=\"text\" size=5 name=\"port\" value=\"" . $conf->get_Port() . "\"></th>\n");
echo _("<th><p align=\"left\">Default is 389, use 636 for SSL connections</th></tr>\n");
if ($conf->get_SSL() == "True") echo ("<tr><th><p align=\"right\"><b>" . _("Use SSL") . ": </b></th> <th><p align=\"left\"><input type=\"checkbox\" name=\"ssl\" checked></th></tr>\n");
else echo ("<tr><th><p align=\"right\"><b>" . _("Use SSL") . ": </b></th> <th><p align=\"left\"><input type=\"checkbox\" name=\"ssl\"></th></tr>\n");
echo ("<tr><th><p align=\"right\"><b>" . _("List of valid users") . ": </b></th> <th><input size=50 type=\"text\" name=\"admins\" value=\"" . $conf->get_Adminstring() . "\"></th>\n");
echo _("<th><p align=\"left\">Usernames must be seperated by semicolons<br>(e.g. cn=admin,dc=yourcompany,dc=com ; uid=root,ou=people,dc=yourcompany,cd=com)</th></tr>\n");
echo ("<tr><th>&nbsp</th></tr>");
echo ("<tr><th><p align=\"right\"><b>" . _("New Password") . ": </b></th> <th><p align=\"left\"><input type=\"password\" name=\"pass1\"></th></tr>\n");
echo ("<tr><th><p align=\"right\"><b>" . _("Reenter Password") . ": </b></th> <th><p align=\"left\"><input type=\"password\" name=\"pass2\"></th></tr>\n");
echo ("<input type=\"hidden\" name=\"passwd\" value=\"" . $passwd . "\"><br>\n");
echo ("<br><br><br>\n");
echo ("<input type=\"submit\" name=\"submitconf\" value=\"" . _("Ok") . ">\n");
echo ("<tr><th>&nbsp</th></tr>\n");
echo ("<tr><th>&nbsp</th></tr>\n");
echo ("<tr><th></th><th><p align=\"left\"><input type=\"submit\" name=\"submitconf\" value=\"" . _("Submit") . "></th></tr>\n");
echo ("</table>\n");
echo ("</form>\n");
echo ("</body>\n");
echo ("</html>\n");

View File

@ -54,6 +54,9 @@ $conf->set_Adminstring($admins);
if ($ssl == "on") $conf->set_SSL("True");
else $conf->set_SSL("False");
echo ("<br><b><big><big><p align=\"center\"> LDAP Account Manager</b></big></big></p><br><br>");
// check if password was changed
if ($pass1 != $pass2) {
echo _("<b>" . _("Passwords are different!") . "</b>");
@ -66,6 +69,4 @@ if ($pass1 != "") {
// save settings
echo ("<b>" . _("Saving the following settings:") . "</b><br><br>");
$conf->printconf();
if ($conf->save()) echo ("<br><br><b>" . _("Failed!") . "</b>");
else echo ("<br><br><b>" . _("Successfully saved!") . "</b>");
?>