2003-03-05 16:05:23 +00:00
|
|
|
<?php
|
2003-02-25 21:28:17 +00:00
|
|
|
/*
|
|
|
|
$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.
|
2003-05-02 16:52:19 +00:00
|
|
|
|
2003-02-25 21:28:17 +00:00
|
|
|
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.
|
2003-05-02 16:52:19 +00:00
|
|
|
|
2003-02-25 21:28:17 +00:00
|
|
|
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
|
|
|
|
|
2003-05-02 16:52:19 +00:00
|
|
|
|
2003-03-08 10:10:19 +00:00
|
|
|
confsave saves the new preferences to lam.conf
|
2003-05-02 16:52:19 +00:00
|
|
|
|
2003-02-25 21:28:17 +00:00
|
|
|
*/
|
|
|
|
|
2003-03-23 18:38:47 +00:00
|
|
|
// start session
|
2003-04-23 19:13:55 +00:00
|
|
|
session_save_path("../../sess");
|
2003-03-17 19:14:22 +00:00
|
|
|
session_start();
|
|
|
|
|
2003-04-23 19:13:55 +00:00
|
|
|
include_once ('../../lib/config.inc');
|
2003-02-25 21:28:17 +00:00
|
|
|
$conf = new Config();
|
|
|
|
|
2003-05-02 16:52:19 +00:00
|
|
|
// get data if register_globals is off
|
|
|
|
if ($_POST['passwd']) $passwd = $_POST['passwd'];
|
|
|
|
if ($_POST['passwd1']) $passwd1 = $_POST['passwd1'];
|
|
|
|
if ($_POST['passwd2']) $passwd2 = $_POST['passwd2'];
|
|
|
|
if ($_POST['serverurl']) $serverurl = $_POST['serverurl'];
|
|
|
|
if ($_POST['admins']) $admins = $_POST['admins'];
|
|
|
|
if ($_POST['suffusers']) $suffusers = $_POST['suffusers'];
|
|
|
|
if ($_POST['suffgroups']) $suffgroups = $_POST['suffgroups'];
|
|
|
|
if ($_POST['suffhosts']) $suffhosts = $_POST['suffhosts'];
|
|
|
|
if ($_POST['minUID']) $minUID = $_POST['minUID'];
|
|
|
|
if ($_POST['maxUID']) $maxUID = $_POST['maxUID'];
|
|
|
|
if ($_POST['minGID']) $minGID = $_POST['minGID'];
|
|
|
|
if ($_POST['maxGID']) $maxGID = $_POST['maxGID'];
|
|
|
|
if ($_POST['minMach']) $minMach = $_POST['minMach'];
|
|
|
|
if ($_POST['maxMach']) $maxMach = $_POST['maxMach'];
|
|
|
|
if ($_POST['usrlstattr']) $usrlstattr = $_POST['usrlstattr'];
|
|
|
|
if ($_POST['grplstattr']) $grplstattr = $_POST['grplstattr'];
|
|
|
|
if ($_POST['hstlstattr']) $hstlstattr = $_POST['hstlstattr'];
|
|
|
|
|
|
|
|
// check if password is correct
|
2003-03-08 10:10:19 +00:00
|
|
|
// if not: load login page
|
2003-02-25 21:28:17 +00:00
|
|
|
if ($passwd != $conf->get_Passwd()) {
|
2003-03-08 10:10:19 +00:00
|
|
|
require('conflogin.php');
|
2003-02-25 21:28:17 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2003-04-23 19:13:55 +00:00
|
|
|
echo ("<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"new_window\"><img src=\"../../graphics/banner.jpg\" border=1></a></p><hr><br><br>");
|
2003-03-18 21:39:52 +00:00
|
|
|
|
2003-02-25 21:28:17 +00:00
|
|
|
// check new preferences
|
2003-04-18 15:50:01 +00:00
|
|
|
if (chop($serverurl) == "") {
|
|
|
|
echo _("<font color=\"red\"><b>" . _("Server Address is empty!") . "</b></font>");
|
2003-03-23 17:39:39 +00:00
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
2003-02-25 21:28:17 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if (chop($admins) == "") {
|
2003-03-23 17:39:39 +00:00
|
|
|
echo _("<font color=\"red\"><b>" . _("List of admin users is empty!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
2003-02-25 21:28:17 +00:00
|
|
|
exit;
|
|
|
|
}
|
2003-03-05 18:38:19 +00:00
|
|
|
if (chop($suffusers) == "") {
|
2003-03-23 17:39:39 +00:00
|
|
|
echo _("<font color=\"red\"><b>" . _("UserSuffix is empty!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
2003-03-05 18:38:19 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if (chop($suffgroups) == "") {
|
2003-03-23 17:39:39 +00:00
|
|
|
echo _("<font color=\"red\"><b>" . _("UserSuffix is empty!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
2003-05-02 17:47:35 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if (chop($suffhosts) == "") {
|
|
|
|
echo _("<font color=\"red\"><b>" . _("HostSuffix is empty!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
2003-03-05 18:38:19 +00:00
|
|
|
exit;
|
|
|
|
}
|
2003-03-13 14:40:19 +00:00
|
|
|
if (chop($minUID) == "") {
|
2003-03-23 17:39:39 +00:00
|
|
|
echo _("<font color=\"red\"><b>" . _("MinUID is empty!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
2003-03-13 14:40:19 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if (chop($maxUID) == "") {
|
2003-03-23 17:39:39 +00:00
|
|
|
echo _("<font color=\"red\"><b>" . _("MaxUID is empty!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
2003-03-13 14:40:19 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if (chop($minGID) == "") {
|
2003-03-23 17:39:39 +00:00
|
|
|
echo _("<font color=\"red\"><b>" . _("MinGID is empty!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
2003-03-13 14:40:19 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if (chop($maxGID) == "") {
|
2003-03-23 17:39:39 +00:00
|
|
|
echo _("<font color=\"red\"><b>" . _("MaxGID is empty!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
2003-03-13 14:40:19 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if (chop($minMach) == "") {
|
2003-03-23 17:39:39 +00:00
|
|
|
echo _("<font color=\"red\"><b>" . _("MinMachine is empty!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
2003-03-13 14:40:19 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if (chop($maxMach) == "") {
|
2003-03-23 17:39:39 +00:00
|
|
|
echo _("<font color=\"red\"><b>" . _("MaxMachine is empty!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
2003-03-13 14:40:19 +00:00
|
|
|
exit;
|
|
|
|
}
|
2003-03-30 19:51:47 +00:00
|
|
|
if (chop($usrlstattr) == "") {
|
|
|
|
echo _("<font color=\"red\"><b>" . _("No attributes in user list!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if (chop($grplstattr) == "") {
|
|
|
|
echo _("<font color=\"red\"><b>" . _("No attributes in group list!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if (chop($hstlstattr) == "") {
|
|
|
|
echo _("<font color=\"red\"><b>" . _("No attributes in host list!") . "</b></font>");
|
|
|
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
|
|
|
exit;
|
|
|
|
}
|
2003-02-25 21:28:17 +00:00
|
|
|
|
|
|
|
// set new preferences
|
2003-04-18 15:50:01 +00:00
|
|
|
$conf->set_ServerURL($serverurl);
|
2003-02-25 21:28:17 +00:00
|
|
|
$conf->set_Adminstring($admins);
|
2003-03-05 18:38:19 +00:00
|
|
|
$conf->set_UserSuffix($suffusers);
|
|
|
|
$conf->set_GroupSuffix($suffgroups);
|
|
|
|
$conf->set_HostSuffix($suffhosts);
|
2003-03-13 14:40:19 +00:00
|
|
|
$conf->set_minUID($minUID);
|
|
|
|
$conf->set_maxUID($maxUID);
|
|
|
|
$conf->set_minGID($minGID);
|
|
|
|
$conf->set_maxGID($maxGID);
|
|
|
|
$conf->set_minMachine($minMach);
|
|
|
|
$conf->set_maxMachine($maxMach);
|
2003-03-30 19:51:47 +00:00
|
|
|
$conf->set_userlistAttributes($usrlstattr);
|
|
|
|
$conf->set_grouplistAttributes($grplstattr);
|
|
|
|
$conf->set_hostlistAttributes($hstlstattr);
|
2003-02-25 21:28:17 +00:00
|
|
|
|
|
|
|
// check if password was changed
|
|
|
|
if ($pass1 != $pass2) {
|
|
|
|
echo _("<b>" . _("Passwords are different!") . "</b>");
|
|
|
|
exit;
|
|
|
|
}
|
2003-03-08 10:10:19 +00:00
|
|
|
// set new password
|
2003-02-25 21:28:17 +00:00
|
|
|
if ($pass1 != "") {
|
|
|
|
$conf->set_Passwd($pass1);
|
|
|
|
echo ("<b>" . _("Password changed!") . "</b><br><br>");
|
|
|
|
}
|
2003-03-08 10:10:19 +00:00
|
|
|
// save settings and display new settings
|
2003-03-01 16:57:54 +00:00
|
|
|
$conf->save();
|
2003-03-30 19:51:47 +00:00
|
|
|
echo ("<b>" . _("The following settings were saved:") . "</b><br><br>");
|
2003-02-25 21:28:17 +00:00
|
|
|
$conf->printconf();
|
2003-04-23 19:13:55 +00:00
|
|
|
echo ("<br><br><br><br><br><a href=\"../login.php\" target=\"_top\">" . _("Back to Login") . "</a>");
|
2003-03-05 18:38:19 +00:00
|
|
|
|
2003-03-08 10:10:19 +00:00
|
|
|
?>
|