4 changed files with 210 additions and 27 deletions
-
60lam/config/config.php
-
42lam/config/conflogin.php
-
64lam/config/confmain.php
-
71lam/config/confsave.php
@ -0,0 +1,42 @@ |
|||
<? |
|||
/* |
|||
$Id$ |
|||
|
|||
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) |
|||
Copyright (C) 2003 Roland Gruber |
|||
|
|||
This program is free software; you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation; either version 2 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program; if not, write to the Free Software |
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|||
|
|||
|
|||
Login page to change the preferences. |
|||
*/ |
|||
?>
|
|||
|
|||
<html> |
|||
<head> |
|||
<title> |
|||
<? |
|||
echo _("Login"); |
|||
?>
|
|||
</title> |
|||
</head> |
|||
<body> |
|||
<b> <? echo _("Password to enter preferences:"); ?> </b><br><br>
|
|||
<form action="confmain.php" method="post"> |
|||
<input type="password" name="passwd"> |
|||
<input type="submit" name="submit" value=<? echo _("Ok"); ?> >
|
|||
</form> |
|||
</body> |
|||
</html> |
@ -0,0 +1,64 @@ |
|||
<? |
|||
/* |
|||
$Id$ |
|||
|
|||
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) |
|||
Copyright (C) 2003 Roland Gruber |
|||
|
|||
This program is free software; you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation; either version 2 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program; if not, write to the Free Software |
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|||
|
|||
|
|||
|
|||
|
|||
*/ |
|||
|
|||
// check if password was entered
|
|||
if (! $passwd) { |
|||
require('conflogin.php'); |
|||
exit; |
|||
} |
|||
|
|||
// check if password is valid
|
|||
include_once ('config.php'); |
|||
$conf = new Config(); |
|||
if (!(($conf->get_Passwd()) == $passwd)) { |
|||
require('conflogin.php'); |
|||
exit; |
|||
} |
|||
|
|||
echo ("<html>\n"); |
|||
echo ("<head>\n"); |
|||
echo ("<title>" . _("LDAP Account Manager Configuration") . "</title>\n"); |
|||
echo ("</head>\n"); |
|||
echo ("<body>\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 ("<input type=\"hidden\" name=\"passwd\" value=\"" . $passwd . "\"><br>\n"); |
|||
echo ("<br><br><br>\n"); |
|||
echo ("<input type=\"submit\" name=\"submitconf\" value=\"" . _("Ok") . ">\n"); |
|||
echo ("</form>\n"); |
|||
echo ("</body>\n"); |
|||
echo ("</html>\n"); |
|||
|
|||
?>
|
|||
|
@ -0,0 +1,71 @@ |
|||
<? |
|||
/* |
|||
$Id$ |
|||
|
|||
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) |
|||
Copyright (C) 2003 Roland Gruber |
|||
|
|||
This program is free software; you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation; either version 2 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program; if not, write to the Free Software |
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|||
|
|||
|
|||
|
|||
|
|||
*/ |
|||
|
|||
include_once ('config.php'); |
|||
$conf = new Config(); |
|||
|
|||
// check if password is correct
|
|||
if ($passwd != $conf->get_Passwd()) { |
|||
require('confmain.php'); |
|||
exit; |
|||
} |
|||
|
|||
// check new preferences
|
|||
if (chop($host) == "") { |
|||
echo _("<b>" . _("Hostname is empty!") . "</b>"); |
|||
exit; |
|||
} |
|||
if (chop($port) == "") { |
|||
echo _("<b>" . _("Portnumber is empty!") . "</b>"); |
|||
exit; |
|||
} |
|||
if (chop($admins) == "") { |
|||
echo _("<b>" . _("List of admin users is empty!") . "</b>"); |
|||
exit; |
|||
} |
|||
|
|||
// set new preferences
|
|||
$conf->set_Host($host); |
|||
$conf->set_Port($port); |
|||
$conf->set_Adminstring($admins); |
|||
if ($ssl == "on") $conf->set_SSL("True"); |
|||
else $conf->set_SSL("False"); |
|||
|
|||
// check if password was changed
|
|||
if ($pass1 != $pass2) { |
|||
echo _("<b>" . _("Passwords are different!") . "</b>"); |
|||
exit; |
|||
} |
|||
if ($pass1 != "") { |
|||
$conf->set_Passwd($pass1); |
|||
echo ("<b>" . _("Password changed!") . "</b><br><br>"); |
|||
} |
|||
// 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>"); |
|||
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue