config wizard: initial checkin

This commit is contained in:
Roland Gruber 2004-01-02 14:52:28 +00:00
parent 57c9d916ba
commit 52fa60dd38
10 changed files with 2009 additions and 0 deletions

View File

@ -0,0 +1,65 @@
<?php
/*
$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
Configuration wizard - shows saved settings
*/
include_once('../../lib/config.inc');
include_once('../../lib/ldap.inc');
include_once('../../lib/status.inc');
// start session
session_save_path("../../sess");
@session_start();
setlanguage();
// check master password
$cfg = new CfgMain();
if ($cfg->password != $_SESSION['confwiz_masterpwd']) {
require("../config/conflogin.php");
exit;
}
echo $_SESSION['header'];
echo "<title>" . _("Configuration wizard") . "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head><body>\n";
echo ("<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"new_window\">".
"<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a></p><hr><br><br>\n");
echo ("<b>" . _("The following settings were saved to profile:") . " </b>" . $_SESSION['confwiz_config']->file . "<br><br>");
$_SESSION['confwiz_config']->printconf();
echo ("<br><br><br><br><br><a href=\"../login.php\" target=\"_top\">" . _("Back to Login") . "</a>");
echo("</body></html>");
// remove config wizard settings
unset($_SESSION['confwiz_config']);
unset($_SESSION['confwiz_ldap']);
unset($_SESSION['confwiz_masterpwd']);
?>

View File

@ -0,0 +1,576 @@
<?php
/*
$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
Configuration wizard - server settings second part
*/
include_once('../../lib/config.inc');
include_once('../../lib/ldap.inc');
include_once('../../lib/status.inc');
// start session
session_save_path("../../sess");
@session_start();
setlanguage();
// check master password
$cfg = new CfgMain();
if ($cfg->password != $_SESSION['confwiz_masterpwd']) {
require("../config/conflogin.php");
exit;
}
// check if user clicked cancel button
if ($_POST['cancel']) {
@unlink("../../config/" . $_SESSION['confwiz_config']->file . ".conf");
metarefresh('../config/conflogin.php');
}
// check if all suffixes exist
$conf = $_SESSION['confwiz_config'];
$new_suffs = array();
if ($conf->get_UserSuffix() && ($conf->get_UserSuffix() != "")) {
$info = @ldap_search($_SESSION['confwiz_ldap']->server, $conf->get_UserSuffix(), "", array());
$res = @ldap_get_entries($_SESSION['confwiz_ldap']->server, $info);
if (!$res && !in_array($conf->get_UserSuffix(), $new_suffs)) $new_suffs[] = $conf->get_UserSuffix();
}
if ($conf->get_GroupSuffix() && ($conf->get_GroupSuffix() != "")) {
$info = @ldap_search($_SESSION['confwiz_ldap']->server, $conf->get_GroupSuffix(), "", array());
$res = @ldap_get_entries($_SESSION['confwiz_ldap']->server, $info);
if (!$res && !in_array($conf->get_GroupSuffix(), $new_suffs)) $new_suffs[] = $conf->get_GroupSuffix();
}
if ($conf->get_HostSuffix() && ($conf->get_HostSuffix() != "")) {
$info = @ldap_search($_SESSION['confwiz_ldap']->server, $conf->get_HostSuffix(), "", array());
$res = @ldap_get_entries($_SESSION['confwiz_ldap']->server, $info);
if (!$res && !in_array($conf->get_HostSuffix(), $new_suffs)) $new_suffs[] = $conf->get_HostSuffix();
}
if ($conf->is_samba3() && $conf->get_DomainSuffix() && ($conf->get_DomainSuffix() != "")) {
$info = @ldap_search($_SESSION['confwiz_ldap']->server, $conf->get_DomainSuffix(), "", array());
$res = @ldap_get_entries($_SESSION['confwiz_ldap']->server, $info);
if (!$res && !in_array($conf->get_DomainSuffix(), $new_suffs)) $new_suffs[] = $conf->get_DomainSuffix();
}
if (sizeof($new_suffs) > 0) {
// check if user wanted to create suffixes
if ($_POST['createsuff']) {
$fail = array();
$errors = array();
// add entries
for ($i = 0; $i < sizeof($new_suffs); $i++) {
// check if entry is already present
$info = @ldap_search($_SESSION['confwiz_ldap']->server, $new_suffs[$i], "", array());
$res = @ldap_get_entries($_SESSION['confwiz_ldap']->server, $info);
if ($res) continue;
$suff = $new_suffs[$i];
// generate DN and attributes
$tmp = explode(",", $suff);
$name = explode("=", $tmp[0]);
array_shift($tmp);
$end = implode(",", $tmp);
if ($name[0] != "ou") { // add root entry
$attr = array();
$attr[$name[0]] = $name[1];
$attr['objectClass'] = 'organization';
$dn = $suff;
if (!@ldap_add($_SESSION['confwiz_ldap']->server(), $dn, $attr)) {
$fail[] = $suff;
continue;
}
}
else { // add organizational unit
$name = $name[1];
$attr = array();
$attr['objectClass'] = "organizationalunit";
$attr['ou'] = $name;
$dn = $suff;
if (!@ldap_add($_SESSION['confwiz_ldap']->server(), $dn, $attr)) {
// check if we have to add parent entries
if (ldap_errno($_SESSION['confwiz_ldap']->server()) == 32) {
$temp = explode(",", $suff);
$subsuffs = array();
// make list of subsuffixes
for ($k = 0; $k < sizeof($temp); $k++) {
$part = explode("=", $temp[$k]);
if ($part[0] == "ou") $subsuffs[] = implode(",", array_slice($temp, $k));
else {
$subsuffs[] = implode(",", array_slice($temp, $k));
break;
}
}
// create missing entries
for ($k = sizeof($subsuffs) - 1; $k >= 0; $k--) {
// check if subsuffix is present
$info = @ldap_search($_SESSION['confwiz_ldap']->server, $subsuffs[$k], "", array());
$res = @ldap_get_entries($_SESSION['confwiz_ldap']->server, $info);
if (!$res) {
$suffarray = explode(",", $subsuffs[$k]);
$headarray = explode("=", $suffarray[0]);
if ($headarray[0] == "ou") { // add ou entry
$attr = array();
$attr['objectClass'] = 'organizationalunit';
$attr['ou'] = $headarray[1];
$dn = $subsuffs[$k];
if (!@ldap_add($_SESSION['confwiz_ldap']->server(), $dn, $attr)) {
$fail[] = $suff;
$error[] = ldap_error($_SESSION['confwiz_ldap']->server());
break;
}
}
else { // add root entry
$attr = array();
$attr['objectClass'] = 'organization';
$attr[$headarray[0]] = $headarray[1];
$dn = $subsuffs[$k];
if (!@ldap_add($_SESSION['confwiz_ldap']->server(), $dn, $attr)) {
$fail[] = $suff;
$error[] = ldap_error($_SESSION['confwiz_ldap']->server());
break;
}
}
}
}
}
else {
$fail[] = $suff;
$error[] = ldap_error($_SESSION['confwiz_ldap']->server());
}
}
}
}
// show errors
if (sizeof($fail) > 0) {
echo $_SESSION['header'];
echo "<title>";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head><body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
echo "<p>&nbsp;</p>\n";
// print failed suffixes
for ($i = 0; $i < sizeof($fail); $i++) {
StatusMessage("ERROR", _("Failed to create entry!") . "<br>" . $error[$i], $fail[$i]);
}
echo "<p>&nbsp;</p>\n";
echo "<p><br><br><a href=\"server2.php\">" . _("Back to server settings") . "</a></p>\n";
echo "</body></html>\n";
exit;
}
}
// show needed suffixes
else {
echo $_SESSION['header'];
echo "<title>";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head><body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
echo "<p>&nbsp;</p>\n";
echo "<p><font color=\"red\"><b>" . _("The following suffix(es) are missing in LDAP. LAM will create them for you.") . "</b></font></p>\n";
echo "<p>&nbsp;</p>\n";
// print missing suffixes
for ($i = 0; $i < sizeof($new_suffs); $i++) {
echo "<p><b>" . $new_suffs[$i] . "</b></p>\n";
}
echo "<p>&nbsp;</p>\n";
echo "<form action=\"ldaptest.php\" method=\"post\">\n";
echo "<input type=\"submit\" name=\"createsuff\" value=\"" . _("Create") . "\">";
echo "<input type=\"submit\" name=\"cancel\" value=\"" . _("Cancel") . "\">";
echo "</form>\n";
echo "</body></html>\n";
exit;
}
}
// check if domain object is present
if ($_SESSION['confwiz_config']->is_samba3()) {
// get list of domains
$domlist = $_SESSION['confwiz_ldap']->search_domains($_SESSION['confwiz_config']->get_domainSuffix());
if (sizeof($domlist) < 1) {
if ($_POST['createdom']) {
// check input
$suffix = $_SESSION['confwiz_config']->get_DomainSuffix();
$server = $_SESSION['confwiz_ldap']->server;
$filter = "(|(sambasid=" . $_POST['dom_SID'] . ")(sambadomainname=" . $_POST['dom_name'] . "))";
$sr = @ldap_search($server, $suffix, $filter, array());
$info = @ldap_get_entries($_SESSION["confwiz_ldap"]->server, $sr);
$errors = array();
// check for existing domains
if ($info["count"] > 0) {
$errors[] = _("This Samba 3 domain is already present!");
}
// check domain name
if (!eregi("^[a-z0-9_\\-]+$", $_POST['dom_name'])) {
$errors[] = _("Domain name is invalid!");
}
// check SID
if (!eregi("^S-[0-9]-[0-9]-[0-9]{2,2}-[0-9]*-[0-9]*-[0-9]*$", $_POST['dom_SID'])) {
$errors[] = _("Samba 3 domain SID is invalid!");
}
// check numbers
if ($_POST['dom_nextRID'] && !is_numeric($_POST['dom_nextRID'])) {
$errors[] = _("Next RID is not a number!");
}
if ($_POST['dom_nextUserRID'] && !is_numeric($_POST['dom_nextUserRID'])) {
$errors[] = _("Next user RID is not a number!");
}
if ($_POST['dom_nextGroupRID'] && !is_numeric($_POST['dom_nextGroupRID'])) {
$errors[] = _("Next group RID is not a number!");
}
if (!is_numeric($_POST['dom_RIDbase'])) {
$errors[] = _("Algorithmic RID base is not a number!");
}
// try to create domain if no error occured
if (sizeof($errors) < 1) {
$DN = "sambaDomainName" . "=" . $_POST['dom_name'] . "," . $_POST['dom_suffix'];
$attr = array();
$attr['objectclass'] = "sambaDomain";
$attr['sambaDomainName'] = $_POST['dom_name'];
$attr['sambaSID'] = $_POST['dom_SID'];
if ($_POST['dom_nextRID']) $attr['sambaNextRid'] = $_POST['dom_nextRID'];
if ($_POST['dom_nextGroupRID']) $attr['sambaNextGroupRid'] = $_POST['dom_nextGroupRID'];
if ($_POST['dom_nextUserRID']) $attr['sambaNextUserRid'] = $_POST['dom_nextUserRID'];
$attr['sambaAlgorithmicRidBase'] = $_POST['dom_RIDbase'];
// write to LDAP
if (! @ldap_add($_SESSION['confwiz_ldap']->server(), $DN, $attr)) {
$errors[] = _("Failed to add domain!") . "\n<br>" . ldap_error($_SESSION['confwiz_ldap']->server());
}
else {
// remember domain SID
$_SESSION["confwiz_domainsid"] = $_POST['dom_SID'];
}
}
// show error messages
if (sizeof($errors) > 1) {
echo $_SESSION['header'];
echo "<title>";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head><body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
echo "<p>&nbsp;</p>\n";
// print errors
for ($i = 0; $i < sizeof($errors); $i++) {
StatusMessage("ERROR", $errors[$i], "");
}
echo "<p>&nbsp;</p>\n";
echo "<p><br><br><a href=\"server2.php\">" . _("Back to server settings") . "</a></p>\n";
echo "</body></html>\n";
exit;
}
}
else {
// get possible suffixes
$domsuff = $_SESSION['confwiz_ldap']->search_units($_SESSION['confwiz_config']->get_domainSuffix());
echo $_SESSION['header'];
echo "<title>";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head><body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
echo "<p>&nbsp;</p>\n";
echo "<p>". _("No domains found, please create one.") . "</p>\n";
echo "<p>&nbsp;</p>\n";
echo "<form action=\"ldaptest.php\" method=\"post\">\n";
echo "<fieldset class=\"domedit\">\n";
echo "<legend class=\"domedit\"><b>" . _("Domain Settings") . "</b></legend>\n";
echo "<table border=0>\n";
// domain name
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Domain name") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<input type=\"text\" name=\"dom_name\">\n";
echo "</td>\n";
echo ("<td><a href=\"../help.php?HelpNumber=651\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
echo "</tr>\n";
echo "<tr>\n";
echo "<td>&nbsp;</td><td>&nbsp;</td>\n";
echo "</tr>\n";
// domain SID
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Domain SID") . ": </b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<input type=\"text\" size=\"50\" name=\"dom_SID\">\n";
echo "</td>\n";
echo ("<td><a href=\"../help.php?HelpNumber=653\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
echo "</tr>\n";
echo "<tr>\n";
echo "<td>&nbsp;</td><td>&nbsp;</td>\n";
echo "</tr>\n";
// next RID
echo "<tr>\n";
echo "<td><b>" . _("Next RID") . " " . _("(optional)") . ": </b></td>\n";
echo "<td>\n";
echo "<input type=\"text\" name=\"dom_nextRID\">\n";
echo "</td>\n";
echo ("<td><a href=\"../help.php?HelpNumber=654\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
echo "</tr>\n";
// next user RID
echo "<tr>\n";
echo "<td><b>" . _("Next User RID") . " " . _("(optional)") . ": </b></td>\n";
echo "<td>\n";
echo "<input type=\"text\" name=\"dom_nextUserRID\">\n";
echo "</td>\n";
echo ("<td><a href=\"../help.php?HelpNumber=655\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
echo "</tr>\n";
// next group RID
echo "<tr>\n";
echo "<td><b>" . _("Next Group RID") . " " . _("(optional)") . ": </b></td>\n";
echo "<td>\n";
echo "<input type=\"text\" name=\"dom_nextGroupRID\">\n";
echo "</td>\n";
echo ("<td><a href=\"../help.php?HelpNumber=656\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
echo "</tr>\n";
echo "<tr>\n";
echo "<td>&nbsp;</td><td>&nbsp;</td>\n";
echo "</tr>\n";
// algorithmic RID base
echo "<tr>\n";
echo "<td><b>" . _("Algorithmic RID Base") . ": </b></td>\n";
echo "<td>\n";
echo "<input type=\"text\" name=\"dom_RIDbase\" value=\"1000\">\n";
echo "</td>\n";
echo ("<td><a href=\"../help.php?HelpNumber=657\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
echo "</tr>\n";
echo "<tr>\n";
echo "<td>&nbsp;</td><td>&nbsp;</td>\n";
echo "</tr>\n";
// domain suffix
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Suffix") . ": </b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<select name=\"dom_suffix\">\n";
for ($i = 0; $i < sizeof($domsuff); $i++) {
echo "<option>" . $domsuff[$i] . "</option>\n";
}
echo "</select>";
echo "</td>\n";
echo ("<td><a href=\"../help.php?HelpNumber=652\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
echo "</tr>\n";
echo "<tr>\n";
echo "<td>&nbsp;</td><td>&nbsp;</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</fieldset>\n";
echo "<p>&nbsp;</p>\n";
echo "<input type=\"submit\" name=\"createdom\" value=\"" . _("Create") . "\">";
echo "<input type=\"submit\" name=\"cancel\" value=\"" . _("Cancel") . "\">";
echo "</form>\n";
echo "</body></html>\n";
exit;
}
}
else {
// remember domain SID
$_SESSION["confwiz_domainsid"] = $domlist[0]->SID;
}
}
// check if essential default Samba groups are present
if ($_SESSION['confwiz_config']->is_samba3() && !$_POST['creategroups'] && !$_POST['ignoregroups']) {
$d512 = $d513 = $d514 = false;
$suffix = $_SESSION['confwiz_config']->get_groupSuffix();
$domSID = $_SESSION['confwiz_domainsid'];
$filter = "(objectclass=sambagroupmapping)";
$server = $_SESSION['confwiz_ldap']->server;
$sr = @ldap_search($server, $suffix, $filter, array("sambaSID"));
if ($sr) {
$info = @ldap_get_entries($_SESSION["confwiz_ldap"]->server, $sr);
if ($info) {
// check SIDs
array_shift($info);
for ($i = 0; $i < sizeof($info); $i++) {
if ($info[$i]['sambasid']['0'] == $domSID . "-512") {
$d512 = true;
}
elseif ($info[$i]['sambasid']['0'] == $domSID . "-513") {
$d513 = true;
}
elseif ($info[$i]['sambasid']['0'] == $domSID . "-514") {
$d514 = true;
}
}
}
}
// make a list of missing groups
$missing_groups = array();
if (!$d512) {
$temp = array();
$temp['sambasid'] = $domSID . "-512";
$temp['displayname'] = "Domain Admins";
$temp['cn'] = "domainadmins";
$missing_groups[] = $temp;
}
if (!$d513) {
$temp = array();
$temp['sambasid'] = $domSID . "-513";
$temp['displayname'] = "Domain Users";
$temp['cn'] = "domainusers";
$missing_groups[] = $temp;
}
if (!$d514) {
$temp = array();
$temp['sambasid'] = $domSID . "-514";
$temp['displayname'] = "Domain Guests";
$temp['cn'] = "domainguests";
$missing_groups[] = $temp;
}
$_SESSION['conwiz_missing_groups'] = $missing_groups;
if (sizeof($missing_groups) > 0) {
// show user a list of missing groups
echo $_SESSION['header'];
echo "<title>";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head><body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
echo "<p>&nbsp;</p>\n";
echo "<p>" . _("LAM detected that one or more essential Samba groups are missing. They are listed below.") .
" " . _("LAM can create them for you or you have to create them manually later.") . "</p>\n";
echo "<p>&nbsp;</p>\n";
for ($i = 0; $i < sizeof($missing_groups); $i++) {
echo "<p><b>" . _("Windows group name") . ": </b>" . $missing_groups[$i]['displayname'] . "<p>\n";
echo "<p><b>" . _("Unix group name") . ": </b>" . $missing_groups[$i]['cn'] . "<p>\n";
echo "<p><b>" . _("Group SID") . ": </b>" . $missing_groups[$i]['sambasid'] . "<p>\n";
echo "<p>&nbsp;</p>\n";
echo "<p>&nbsp;</p>\n";
}
echo "<form action=\"ldaptest.php\" method=\"post\">\n";
echo "<input type=\"submit\" name=\"creategroups\" value=\"" . _("Create") . "\">";
echo "<input type=\"submit\" name=\"ignoregroups\" value=\"" . _("Ignore") . "\">";
echo "<input type=\"submit\" name=\"cancel\" value=\"" . _("Cancel") . "\">";
echo "</form>\n";
echo "</body></html>\n";
exit;
}
}
// create needed Samab groups
if ($_SESSION['confwiz_config']->is_samba3() && $_POST['creategroups']) {
$suffix = $_SESSION['confwiz_config']->get_groupSuffix();
$domSID = $_SESSION['confwiz_domainsid'];
$filter = "(objectclass=posixgroup)";
$server = $_SESSION['confwiz_ldap']->server;
$sr = @ldap_search($server, $suffix, $filter, array("gidnumber"));
if ($sr) {
$info = @ldap_get_entries($_SESSION["confwiz_ldap"]->server, $sr);
if ($info) {
array_shift($info);
// create list of GID numbers
$gid_numbers = array();
for ($i = 0; $i < sizeof($info); $i++) {
// ignore GIDs that are out of range
if ($info[$i]['gidnumber'][0] <= $_SESSION['confwiz_config']->get_maxGID()) {
if ($info[$i]['gidnumber'][0] >= $_SESSION['confwiz_config']->get_minGID()) {
$gid_numbers[] = $info[$i]['gidnumber'][0];
}
}
}
// if no GIDs are used add (minGID -1)
if (sizeof($gid_numbers) < 1) $gid_numbers[] = $_SESSION['confwiz_config']->get_minGID() - 1;
sort($gid_numbers);
$missing_groups = $_SESSION['conwiz_missing_groups'];
$errors = array();
// check if free GID numbers exist
if ($gid_numbers[sizeof($gid_numbers) - 1] < $_SESSION['confwiz_config']->get_maxGID() - 3) {
$gidnumber = $gid_numbers[sizeof($gid_numbers) - 1];
for ($i = 0; $i < sizeof($missing_groups); $i++) {
$gidnumber++;
$attributes = array();
$attributes['objectclass'][] = 'posixGroup';
$attributes['objectclass'][] = 'sambaGroupMapping';
$attributes['sambaGroupType'] = 2;
$attributes['gidnumber'] = $gidnumber;
$attributes['sambaSID'] = $missing_groups[$i]['sambasid'];
$attributes['description'] = $missing_groups[$i]['displayname'];
$attributes['displayname'] = $missing_groups[$i]['displayname'];
$attributes['cn'] = $missing_groups[$i]['cn'];
$dn = 'cn=' . $attributes['cn'] . ',' . $_SESSION['confwiz_config']->get_groupSuffix();
if (!ldap_add($_SESSION['confwiz_ldap']->server(), $dn, $attributes)) {
$errors[] = 'Unable to create group:' . " " . $missing_groups[$i]['cn'];
}
}
}
// not enough free GIDs
else {
$errors[] = 'There are not enough free GID numbers in the GID range!';
}
if (sizeof($errors) < 1) {
metarefresh('final.php');
}
else {
echo $_SESSION['header'];
echo "<title>";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head><body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
echo "<p>&nbsp;</p>\n";
// print errors
for ($i = 0; $i < sizeof($errors); $i++) {
StatusMessage("ERROR", $errors[$i], '');
}
echo "<p>&nbsp;</p>\n";
echo "<p><br><br><a href=\"server2.php\">" . _("Back to server settings") . "</a></p>\n";
echo "</body></html>\n";
exit;
}
}
}
exit;
}
// if nothing is missing go to last page
metarefresh('final.php');
?>

View File

@ -0,0 +1,155 @@
<?php
/*
$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
Configuration wizard - lamdaemon and PDF text
*/
include_once('../../lib/config.inc');
include_once('../../lib/ldap.inc');
include_once('../../lib/status.inc');
// start session
session_save_path("../../sess");
@session_start();
setlanguage();
// check master password
$cfg = new CfgMain();
if ($cfg->password != $_SESSION['confwiz_masterpwd']) {
require("../config/conflogin.php");
exit;
}
// check if user clicked on cancel button
if ($_POST['cancel']) {
@unlink("../../config/" . $_SESSION['confwiz_config']->file . ".conf");
metarefresh('../config/conflogin.php');
exit;
}
// check if user clicked on next button
if ($_POST['submit']) {
$errors = array();
if (!$_SESSION['confwiz_config']->set_scriptpath($_POST['scriptpath'])) {
$errors[] = _("Script path is invalid!");
}
if (!$_SESSION['confwiz_config']->set_scriptserver($_POST['scriptserver'])) {
$errors[] = _("Script server is invalid!");
}
if (!$_SESSION['confwiz_config']->set_pdftext($_POST['pdf_usertext'])) {
$errors[] = _("Saving PDF text failed!");
}
// if no errors save and go back to optional.php
if (sizeof($errors) < 1) {
$_SESSION['confwiz_config']->save();
$_SESSION['confwiz_optional']['daemon'] = 'done';
metarefresh('optional.php');
}
else {
// errors occured
echo $_SESSION['header'];
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "</head><body>\n";
for ($i = 0; $i < sizeof($errors); $i++) {
StatusMessage("ERROR", $errors[$i], "");
}
echo "<p><br><br><a href=\"o_daemon.php\">" . _("Back to lamdaemon and PDF settings.") . "</a></p>\n";
echo "</body></html>\n";
exit;
}
}
echo $_SESSION['header'];
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head>\n";
echo "<body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
// formular
echo "<form action=\"o_daemon.php\" method=\"post\">\n";
echo "<p>&nbsp;</p>\n";
// lamdaemon
echo "<p>" . _("If you want to manage quotas and homedirectories with LAM you need to setup lamdaemon.pl.") .
"<br><br>" .
_("This is the server and path where the lamdaemon.pl script is stored. LDAP Account Manager will make a SSH connection to this server with username and password provided at login.") .
"<br><br><b>" . _("Use it at your own risk and read the documentation for lamdaemon before you use it!") . "</b><br><br></p>\n";
echo ("<table border=0>");
echo ("<tr><td align=\"right\"><b>".
_("Server of external script") . ": </b></td>".
"<td><input size=50 type=\"text\" name=\"scriptserver\" value=\"" . $_SESSION['confwiz_config']->get_scriptServer() . "\"></td>\n");
echo ("</tr>\n");
echo ("<tr><td align=\"right\"><b>".
_("Path to external script") . ": </b></td>".
"<td><input size=50 type=\"text\" name=\"scriptpath\" value=\"" . $_SESSION['confwiz_config']->get_scriptPath() . "\"></td>\n");
echo ("</tr>\n");
echo "</table>\n";
echo "<p><br></p>\n";
// PDF text
echo "<p>" . _("This text will appear on top of every user PDF file.") . "</p>\n";
echo ("<table border=0>");
echo ("<tr><td align=\"right\"><b>".
_("Text for user PDF") . ": </b></td>".
"<td><textarea name=\"pdf_usertext\" cols=\"80\" rows=\"5\">" . $_SESSION['confwiz_config']->get_pdftext() . "</textarea></td>\n");
echo ("</tr>\n");
echo "</table>\n";
echo "<p><br></p>\n";
// next/cancel button
echo "<p>\n";
echo "<input type=\"submit\" name=\"submit\" value=\"" . _("Next") . "\">\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"" . _("Cancel") . "\">\n";
echo "</p>\n";
echo "</form>\n";
echo "</body>\n</html>\n";
?>

View File

@ -0,0 +1,175 @@
<?php
/*
$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
Configuration wizard - language and admins
*/
include_once('../../lib/config.inc');
include_once('../../lib/ldap.inc');
include_once('../../lib/status.inc');
// start session
session_save_path("../../sess");
@session_start();
setlanguage();
// check master password
$cfg = new CfgMain();
if ($cfg->password != $_SESSION['confwiz_masterpwd']) {
require("../config/conflogin.php");
exit;
}
// check if user clicked on cancel button
if ($_POST['cancel']) {
@unlink("../../config/" . $_SESSION['confwiz_config']->file . ".conf");
metarefresh('../config/conflogin.php');
exit;
}
// check if user clicked on next button
if ($_POST['submit']) {
$errors = array();
if (!$_SESSION['confwiz_config']->set_defaultLanguage($_POST['lang'])) {
$errors[] = _("Language is not defined!");
}
if (!$_SESSION['confwiz_config']->set_Adminstring($_POST['admins'])) {
$errors[] = _("List of admin users is empty or invalid!");
}
// if no errors save and go back to optional.php
if (sizeof($errors) < 1) {
$_SESSION['confwiz_config']->save();
$_SESSION['confwiz_optional']['lang'] = 'done';
metarefresh('optional.php');
}
else {
// errors occured
echo $_SESSION['header'];
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "</head><body>\n";
for ($i = 0; $i < sizeof($errors); $i++) {
StatusMessage("ERROR", $errors[$i], "");
}
echo "<p><br><br><a href=\"o_lang.php\">" . _("Back to language and admin settings.") . "</a></p>\n";
echo "</body></html>\n";
exit;
}
}
echo $_SESSION['header'];
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head>\n";
echo "<body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
// formular
echo "<form action=\"o_lang.php\" method=\"post\">\n";
echo "<p>&nbsp;</p>\n";
// language
echo "<p>" . _("Please select your prefered language.") . "<br>\n";
echo _("This defines the language of the login window and sets this language as the default language. Users can change the language at login.") .
"<br><br></p>\n";
echo ("<table border=0>");
echo ("<tr>");
echo ("<td><b>" . _("Default language") . ":</b></td><td>\n");
// read available languages
$languagefile = "../../config/language";
if(is_file($languagefile))
{
$file = fopen($languagefile, "r");
$i = 0;
while(!feof($file))
{
$line = fgets($file, 1024);
if($line == "\n" || $line[0] == "#" || $line == "") continue; // ignore comment and empty lines
$languages[$i] = chop($line);
$i++;
}
fclose($file);
// generate language list
echo ("<select name=\"lang\">");
for ($i = 0; $i < sizeof($languages); $i++) {
$entry = explode(":", $languages[$i]);
if ($_SESSION['confwiz_config']->get_defaultLanguage() != $languages[$i]) echo("<option value=\"" . $languages[$i] . "\">" . $entry[2] . "</option>\n");
else echo("<option selected value=\"" . $languages[$i] . "\">" . $entry[2] . "</option>\n");
}
echo ("</select>\n");
}
else
{
echo _("Unable to load available languages. Setting English as default language. For further instructions please contact the Admin of this site.");
}
echo ("</td>\n");
echo ("</tr>\n");
echo "</table>\n";
echo "<p><br></p>\n";
echo "<p><br></p>\n";
// admin users
echo "<p>" . _("If you want more than one user to login to LAM please enter its DN(s) here. Multiple entries are seperated by semicolons.") . "</p>\n";
echo "<p><b>" . _("Example") . ": </b>cn=admin,dc=yourdomain,dc=org;cn=manager,dc=yourdomain,dc=org<br><br></p>\n";
echo ("<table border=0>");
echo ("<tr><td align=\"right\"><b>".
_("List of valid users") . " *: </b></td>".
"<td colspan=2><input size=50 type=\"text\" name=\"admins\" value=\"" . $_SESSION['confwiz_config']->get_Adminstring() . "\"></td>\n");
echo ("</tr>\n");
echo "</table>\n";
echo "<p><br></p>\n";
// next/cancel button
echo "<p>\n";
echo "<input type=\"submit\" name=\"submit\" value=\"" . _("Next") . "\">\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"" . _("Cancel") . "\">\n";
echo "</p>\n";
echo "</form>\n";
echo "</body>\n</html>\n";
?>

View File

@ -0,0 +1,160 @@
<?php
/*
$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
Configuration wizard - list attributes
*/
include_once('../../lib/config.inc');
include_once('../../lib/ldap.inc');
include_once('../../lib/status.inc');
// start session
session_save_path("../../sess");
@session_start();
setlanguage();
// check master password
$cfg = new CfgMain();
if ($cfg->password != $_SESSION['confwiz_masterpwd']) {
require("../config/conflogin.php");
exit;
}
// check if user clicked on cancel button
if ($_POST['cancel']) {
@unlink("../../config/" . $_SESSION['confwiz_config']->file . ".conf");
metarefresh('../config/conflogin.php');
exit;
}
// check if user clicked on next button
if ($_POST['submit']) {
$errors = array();
if (!$_SESSION['confwiz_config']->set_userlistAttributes($_POST['usrlstattr'])) {
$errors[] = _("User list attributes are invalid!");
}
if (!$_SESSION['confwiz_config']->set_grouplistAttributes($_POST['grplstattr'])) {
$errors[] = _("Group list attributes are invalid!");
}
if (!$_SESSION['confwiz_config']->set_hostlistAttributes($_POST['hstlstattr'])) {
$errors[] = _("Host list attributes are invalid!");
}
// if no errors save and go back to optional.php
if (sizeof($errors) < 1) {
$_SESSION['confwiz_config']->save();
$_SESSION['confwiz_optional']['lists'] = 'done';
metarefresh('optional.php');
}
else {
// errors occured
echo $_SESSION['header'];
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "</head><body>\n";
for ($i = 0; $i < sizeof($errors); $i++) {
StatusMessage("ERROR", $errors[$i], "");
}
echo "<p><br><br><a href=\"o_lists.php\">" . _("Back to list settings.") . "</a></p>\n";
echo "</body></html>\n";
exit;
}
}
echo $_SESSION['header'];
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head>\n";
echo "<body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
// formular
echo "<form action=\"o_lists.php\" method=\"post\">\n";
echo "<p>&nbsp;</p>\n";
echo "<p><b>" . _("Please enter which attributes should be displayed in the list views.") . "</b></p>\n";
echo "<p>" . _("This can be a list of predefined attributes which have a description and are translated or you can write your own description.") .
" " . _("Predefined attributes are of type \"#attribute\".") .
" " . _("If you want to input your own description it would look like this: \"attribute:description\".") .
"<br>" . _("The entries are separated by semicolons.") .
"<br><br><br><b>" .
_("Example") .
": </b>#homeDirectory;#uid;#uidNumber;#gidNumber;mail:Mail address<br><br><br><u><b>" .
_("Predefined values") . ":</b></u><br><br><b>" .
_("Users") .
": </b>#uid, #uidNumber, #gidNumber, #cn, #host, #givenName, #sn, #homeDirectory, #loginShell, #mail, #gecos".
"<br><b>" .
_("Groups") .
": </b>#cn, #gidNumber, #memberUID, #member, #description".
"<br><b>" .
_("Hosts") .
": </b>#uid, #cn, #rid, #description" . "<br><br></p>\n";
echo "<p>&nbsp;</p>\n";
echo ("<table border=0>");
// user list attributes
echo ("<tr><td align=\"right\"><b>".
_("Attributes in User List") . " *:</b></td>".
"<td><input size=50 type=\"text\" name=\"usrlstattr\" value=\"" . $_SESSION['confwiz_config']->get_userlistAttributes() . "\"></td>");
echo ("</tr>\n");
// group list attributes
echo ("<tr><td align=\"right\"><b>".
_("Attributes in Group List") . " *:</b></td>".
"<td><input size=50 type=\"text\" name=\"grplstattr\" value=\"" . $_SESSION['confwiz_config']->get_grouplistAttributes() . "\"></td>");
echo ("</tr>\n");
// host list attributes
echo ("<tr><td align=\"right\"><b>".
_("Attributes in Host List") . " *:</b></td>".
"<td><input size=50 type=\"text\" name=\"hstlstattr\" value=\"" . $_SESSION['confwiz_config']->get_hostlistAttributes() . "\"></td>");
echo ("</tr>\n");
echo "</table>\n";
echo "<p><br></p>\n";
// next/cancel button
echo "<p>\n";
echo "<input type=\"submit\" name=\"submit\" value=\"" . _("Next") . "\">\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"" . _("Cancel") . "\">\n";
echo "</p>\n";
echo "</form>\n";
echo "</body>\n</html>\n";
?>

View File

@ -0,0 +1,164 @@
<?php
/*
$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
Configuration wizard - UID/GID ranges
*/
include_once('../../lib/config.inc');
include_once('../../lib/ldap.inc');
include_once('../../lib/status.inc');
// start session
session_save_path("../../sess");
@session_start();
setlanguage();
// check master password
$cfg = new CfgMain();
if ($cfg->password != $_SESSION['confwiz_masterpwd']) {
require("../config/conflogin.php");
exit;
}
// check if user clicked on cancel button
if ($_POST['cancel']) {
@unlink("../../config/" . $_SESSION['confwiz_config']->file . ".conf");
metarefresh('../config/conflogin.php');
exit;
}
// check if user clicked on next button
if ($_POST['submit']) {
$errors = array();
if (!$_SESSION['confwiz_config']->set_minUID($_POST['minUID'])) {
$errors[] = _("Minimum UID number is invalid!");
}
if (!$_SESSION['confwiz_config']->set_maxUID($_POST['maxUID'])) {
$errors[] = _("Maximum UID number is invalid!");
}
if (!$_SESSION['confwiz_config']->set_minGID($_POST['minGID'])) {
$errors[] = _("Minimum GID number is invalid!");
}
if (!$_SESSION['confwiz_config']->set_maxGID($_POST['maxGID'])) {
$errors[] = _("Maximum GID number is invalid!");
}
if (!$_SESSION['confwiz_config']->set_minMachine($_POST['minMach'])) {
$errors[] = _("Minimum Machine number is invalid!");
}
if (!$_SESSION['confwiz_config']->set_maxMachine($_POST['maxMach'])) {
$errors[] = _("Maximum Machine number is invalid!");
}
// if no errors save and go back to optional.php
if (sizeof($errors) < 1) {
$_SESSION['confwiz_config']->save();
$_SESSION['confwiz_optional']['ranges'] = 'done';
metarefresh('optional.php');
}
else {
// errors occured
echo $_SESSION['header'];
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "</head><body>\n";
for ($i = 0; $i < sizeof($errors); $i++) {
StatusMessage("ERROR", $errors[$i], "");
}
echo "<p><br><br><a href=\"o_ranges.php\">" . _("Back to range settings.") . "</a></p>\n";
echo "</body></html>\n";
exit;
}
}
echo $_SESSION['header'];
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head>\n";
echo "<body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
// formular
echo "<form action=\"o_ranges.php\" method=\"post\">\n";
echo "<p>&nbsp;</p>\n";
echo "<p><b>" . _("Please enter the UID/GID ranges for your accounts:") . "</b></p>\n";
echo "<p>&nbsp;</p>\n";
echo ("<table border=0>");
// minUID
echo ("<tr><td align=\"right\"><b>".
_("Minimum UID number") . " *: </b>".
"<input size=6 type=\"text\" name=\"minUID\" value=\"" . $_SESSION['confwiz_config']->get_minUID() . "\"></td>\n");
// maxUID
echo ("<td align=\"right\"><b>&nbsp;" . _("Maximum UID number") . " *: </b>".
"<input size=6 type=\"text\" name=\"maxUID\" value=\"" . $_SESSION['confwiz_config']->get_maxUID() . "\"></td>\n");
// UID text
echo ("<td><a href=\"../help.php?HelpNumber=203\" target=\"lamhelp\">" . _("Help") . "</a></td></tr>\n");
// minGID
echo ("<tr><td align=\"right\"><b>".
_("Minimum GID number") . " *: </b>".
"<input size=6 type=\"text\" name=\"minGID\" value=\"" . $_SESSION['confwiz_config']->get_minGID() . "\"></td>\n");
// maxGID
echo ("<td align=\"right\"><b>&nbsp;" . _("Maximum GID number")." *: </b>".
"<input size=6 type=\"text\" name=\"maxGID\" value=\"" . $_SESSION['confwiz_config']->get_maxGID() . "\"></td>\n");
// GID text
echo ("<td><a href=\"../help.php?HelpNumber=204\" target=\"lamhelp\">" . _("Help") . "</a></td></tr>\n");
// minMach
echo ("<tr><td align=\"right\"><b>".
_("Minimum Machine number") . " *: </b>".
"<input size=6 type=\"text\" name=\"minMach\" value=\"" . $_SESSION['confwiz_config']->get_minMachine() . "\"></td>\n");
// maxMach
echo ("<td align=\"right\"><b>&nbsp;" . _("Maximum Machine number") . " *: </b>".
"<input size=6 type=\"text\" name=\"maxMach\" value=\"" . $_SESSION['confwiz_config']->get_maxMachine() . "\"></td>\n");
// Machine text
echo ("<td><a href=\"../help.php?HelpNumber=205\" target=\"lamhelp\">" . _("Help") . "</a></td></tr>\n");
echo "</table>\n";
echo "<p><br></p>\n";
// next/cancel button
echo "<p>\n";
echo "<input type=\"submit\" name=\"submit\" value=\"" . _("Next") . "\">\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"" . _("Cancel") . "\">\n";
echo "</p>\n";
echo "</form>\n";
echo "</body>\n</html>\n";
?>

View File

@ -0,0 +1,80 @@
<?php
/*
$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
Configuration wizard - optional pages
*/
include_once('../../lib/config.inc');
include_once('../../lib/ldap.inc');
include_once('../../lib/status.inc');
// start session
session_save_path("../../sess");
@session_start();
setlanguage();
// check master password
$cfg = new CfgMain();
if ($cfg->password != $_SESSION['confwiz_masterpwd']) {
require("../config/conflogin.php");
exit;
}
// if no optional pages should be displayed go to ldaptest
if (sizeof($_SESSION['confwiz_optional']) < 1) {
metarefresh('ldaptest.php');
exit;
}
// UID/GID ranges
if ($_SESSION['confwiz_optional']['ranges'] == 'yes') {
metarefresh('o_ranges.php');
exit;
}
// list attributes
if ($_SESSION['confwiz_optional']['lists'] == 'yes') {
metarefresh('o_lists.php');
exit;
}
// language, admins
if ($_SESSION['confwiz_optional']['lang'] == 'yes') {
metarefresh('o_lang.php');
exit;
}
// lamdaemon and PDF text
if ($_SESSION['confwiz_optional']['daemon'] == 'yes') {
metarefresh('o_daemon.php');
exit;
}
// if all pages were displayed go to ldaptest
metarefresh('ldaptest.php');
?>

View File

@ -0,0 +1,202 @@
<?php
/*
$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
Configuration wizard - server settings
*/
include_once('../../lib/config.inc');
include_once('../../lib/ldap.inc');
include_once('../../lib/status.inc');
// start session
session_save_path("../../sess");
@session_start();
setlanguage();
// check master password
$cfg = new CfgMain();
if ($cfg->password != $_SESSION['confwiz_masterpwd']) {
require("../config/conflogin.php");
exit;
}
// check if user clicked on buttons
if ($_POST['submit'] || $_POST['cancel']) {
unset($error);
unset($ret);
if ($_POST['cancel']) {
@unlink("../../config/" . $_SESSION['confwiz_config']->file . ".conf");
metarefresh('../config/conflogin.php');
}
else {
// check server URL
if ($_SESSION['confwiz_config']->set_serverURL($_POST['serverurl'])) {
// set Samba version
if ($_POST['sambaversion'] == "2") $_SESSION['confwiz_config']->set_samba3("no");
else $_SESSION['confwiz_config']->set_samba3("yes");
$_SESSION['confwiz_config']->set_Adminstring($_POST['ldapadmin']);
// save settings
$_SESSION['confwiz_config']->save();
// create LDAP object and test connection
$_SESSION['confwiz_ldap'] = new Ldap($_SESSION['confwiz_config']);
$ret = $_SESSION['confwiz_ldap']->connect($_POST['ldapadmin'], $_POST['ldappwd']);
if ($ret === 0) {
metarefresh('server2.php');
}
elseif ($ret === False) $error = _("Cannot connect to specified LDAP-Server. Please try again.");
elseif ($ret == 81) $error = _("Cannot connect to specified LDAP-Server. Please try again.");
elseif ($ret == 49) $error = _("Wrong Password/Username combination. Try again.");
else $error = _("LDAP error, server says:") . "\n<br>($ret) " . ldap_err2str($ret);
}
else {
$error = _("Server Address is empty!");
}
// print error message if needed
if ($error) {
echo $_SESSION['header'];
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "</head><body>\n";
StatusMessage("ERROR", $error, "");
echo "<p><br><br><a href=\"server.php\">" . _("Back to last page") . "</a></p>\n";
echo "</body></html>\n";
}
// if all ok, go to next page
else {
metarefresh('server2.php');
}
}
exit;
}
// check if back button was pressed
$back = false;
if ($_GET['back'] || $_POST['back']) {
$back = true;
$auth = $_SESSION['confwiz_ldap']->decrypt();
}
echo $_SESSION['header'];
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head>\n";
echo "<body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
// formular
echo "<form action=\"server.php\" method=\"post\">\n";
echo "<br><br>\n";
echo "<table border=0>\n";
// server URL
echo "<tr>\n";
echo "<td colspan=2>\n";
echo _("Please enter the URL of your LDAP server.") . "<br><br><b>" .
_("Examples") . ":</b><br><br>ldap://myserver.mydomain.org<br>ldaps:myserver.mydomain.org<br>localhost:389" . "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Server address") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
if ($back) echo "<input type=\"text\" name=\"serverurl\" value =\"" . $_SESSION['confwiz_config']->get_ServerURL() . "\">\n";
else echo "<input type=\"text\" name=\"serverurl\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
// admin user+password
echo "<tr>\n";
echo "<td colspan=2>\n";
echo _("To connect to your LDAP server please enter now the DN of your administrative user and the password.") . "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("LDAP admin DN") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
if ($back) echo "<input type=\"text\" name=\"ldapadmin\" value=\"" . $auth[0] . "\">\n";
else echo "<input type=\"text\" name=\"ldapadmin\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Password") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
if ($back) echo "<input type=\"password\" name=\"ldappwd\" value=\"" . $auth[1] . "\">\n";
else echo "<input type=\"password\" name=\"ldappwd\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
// master password
echo "<tr>\n";
echo "<td colspan=2>\n";
echo _("Which Samba version do you use?") . "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Samba version") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<select name=\"sambaversion\">\n";
echo "<option value=3>3</option>";
if ($back && !$_SESSION['confwiz_config']->is_samba3()) echo "<option selected value=2>2.x</option>";
else echo "<option value=2>2.x</option>";
echo "</select>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<p><br></p>\n";
// next/cancel button
echo "<p>\n";
echo "<input type=\"submit\" name=\"submit\" value=\"" . _("Next") . "\">\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"" . _("Cancel") . "\">\n";
echo "</p>\n";
echo "</form>\n";
echo "</body>\n</html>\n";
?>

View File

@ -0,0 +1,243 @@
<?php
/*
$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
Configuration wizard - server settings second part
*/
include_once('../../lib/config.inc');
include_once('../../lib/ldap.inc');
include_once('../../lib/status.inc');
// start session
session_save_path("../../sess");
@session_start();
setlanguage();
// check master password
$cfg = new CfgMain();
if ($cfg->password != $_SESSION['confwiz_masterpwd']) {
require("../config/conflogin.php");
exit;
}
// check if user clicked on buttons
if ($_POST['submit'] || $_POST['cancel'] || $_POST['back']) {
unset($error);
unset($ret);
if ($_POST['cancel']) {
@unlink("../../config/" . $_SESSION['confwiz_config']->file . ".conf");
metarefresh('../config/conflogin.php');
}
elseif ($_POST['back']) {
metarefresh('server.php?back=true');
}
else {
// set input values
$errors = array();
if (!$_SESSION['confwiz_config']->set_UserSuffix($_POST['usersuffix'])) {
$error = _("UserSuffix is invalid!");
}
if (!$_SESSION['confwiz_config']->set_GroupSuffix($_POST['groupsuffix'])) {
$error = _("GroupSuffix is invalid!");
}
if (!$_SESSION['confwiz_config']->set_HostSuffix($_POST['hostsuffix'])) {
$error = _("HostSuffix is invalid!");
}
if ($_SESSION['confwiz_config']->is_samba3() && !$_SESSION['confwiz_config']->set_DomainSuffix($_POST['domainsuffix'])) {
$error = _("DomainSuffix is invalid!");
}
if (!$_SESSION['confwiz_config']->set_pwdhash($_POST['pwdhash'])) {
$error = _("Password hash is invalid!");
}
if (!$_SESSION['confwiz_config']->set_cacheTimeout($_POST['cachetimeout'])) {
$error = _("Cache timeout is invalid!");
}
$_SESSION['confwiz_config']->save();
// print error message if needed
if (sizeof($errors) > 0) {
echo $_SESSION['header'];
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "</head><body>\n";
for ($i = 0; $i < sizeof($errors); $i++) {
StatusMessage("ERROR", $errors[$i], "");
}
echo "<p><br><br><a href=\"server2.php\">" . _("Back to last page") . "</a></p>\n";
echo "</body></html>\n";
}
// if all ok, go to next page
else {
$_SESSION['confwiz_optional'] = array();
if ($_POST['ranges']) $_SESSION['confwiz_optional']['ranges'] = 'yes';
if ($_POST['lists']) $_SESSION['confwiz_optional']['lists'] = 'yes';
if ($_POST['lang']) $_SESSION['confwiz_optional']['lang'] = 'yes';
if ($_POST['daemon']) $_SESSION['confwiz_optional']['daemon'] = 'yes';
metarefresh('optional.php');
}
}
exit;
}
echo $_SESSION['header'];
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head>\n";
echo "<body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
// formular
echo "<form action=\"server2.php\" method=\"post\">\n";
echo "<br><br>\n";
echo "<table border=0>\n";
// suffixes
echo "<tr>\n";
echo "<td colspan=2>\n";
echo _("Please enter the suffixes of your LDAP tree where LAM should store the accounts.");
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("UserSuffix") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<input type=\"text\" size=50 name=\"usersuffix\" value=\"" . $_SESSION['confwiz_config']->get_userSuffix() . "\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("GroupSuffix") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<input type=\"text\" size=50 name=\"groupsuffix\" value=\"" . $_SESSION['confwiz_config']->get_groupSuffix() . "\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("HostSuffix") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<input type=\"text\" size=50 name=\"hostsuffix\" value=\"" . $_SESSION['confwiz_config']->get_hostSuffix() . "\">\n";
echo "</td>\n";
echo "</tr>\n";
if ($_SESSION['confwiz_config']->is_samba3()) {
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("DomainSuffix") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<input type=\"text\" size=50 name=\"domainsuffix\" value=\"" . $_SESSION['confwiz_config']->get_domainSuffix() . "\">\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
// password hash
echo "<tr>\n";
echo "<td colspan=2>\n";
echo _("LAM supports CRYPT, SHA, SSHA, MD5 and SMD5 to generate the hash value of an user password. SSHA and CRYPT are the most common but CRYPT does not support passwords greater than 8 letters. We do not recommend to use plain text passwords.") . "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Password hash type") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<select name=\"pwdhash\">\n<option selected>" . $_SESSION['confwiz_config']->get_pwdhash() . "</option>\n";
if ($_SESSION['confwiz_config']->get_pwdhash() != "CRYPT") echo("<option>CRYPT</option>\n");
if ($_SESSION['confwiz_config']->get_pwdhash() != "SHA") echo("<option>SHA</option>\n");
if ($_SESSION['confwiz_config']->get_pwdhash() != "SSHA") echo("<option>SSHA</option>\n");
if ($_SESSION['confwiz_config']->get_pwdhash() != "MD5") echo("<option>MD5</option>\n");
if ($_SESSION['confwiz_config']->get_pwdhash() != "SMD5") echo("<option>SMD5</option>\n");
if ($_SESSION['confwiz_config']->get_pwdhash() != "PLAIN") echo("<option>PLAIN</option>\n");
echo ("</select>\n");
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
// cache timeout
echo "<tr>\n";
echo "<td colspan=2>\n";
echo _("LAM caches its LDAP searches, you can set the cache time here. Shorter times will stress LDAP more but decrease the possibility that changes are not identified.") . "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Cache timeout") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<select name=\"cachetimeout\">\n<option selected>".$_SESSION['confwiz_config']->get_cacheTimeout()."</option>\n";
if ($_SESSION['confwiz_config']->get_cacheTimeout() != 0) echo("<option>0</option>\n");
if ($_SESSION['confwiz_config']->get_cacheTimeout() != 1) echo("<option>1</option>\n");
if ($_SESSION['confwiz_config']->get_cacheTimeout() != 2) echo("<option>2</option>\n");
if ($_SESSION['confwiz_config']->get_cacheTimeout() != 5) echo("<option>5</option>\n");
if ($_SESSION['confwiz_config']->get_cacheTimeout() != 10) echo("<option>10</option>\n");
if ($_SESSION['confwiz_config']->get_cacheTimeout() != 15) echo("<option>15</option>\n");
echo ("</select>\n");
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<p><br></p>\n";
// optional pages
echo "<fieldset><legend><b>" . _("Optional settings") . "</b></legend>\n";
echo "<p>" . _("Please select here if you want to make additional changes to your configuration profile or if LAM should use default values.") .
"<br></p>\n";
echo "<input type=\"checkbox\" name=\"ranges\">" . _("Ranges for UID and GID numbers") . "<br>\n";
echo "<input type=\"checkbox\" name=\"lists\">" . _("Attributes in list views") . "<br>\n";
echo "<input type=\"checkbox\" name=\"lang\">" . _("Language and additional admin users") . "<br>\n";
echo "<input type=\"checkbox\" name=\"daemon\">" . _("Lamdaemon settings and PDF text") . "<br>\n";
echo "</fieldset>\n";
echo "<p><br></p>\n";
// next/cancel button
echo "<p>\n";
echo "<input type=\"submit\" name=\"submit\" value=\"" . _("Next") . "\">\n";
echo "<input type=\"submit\" name=\"back\" value=\"" . _("Back") . "\">\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"" . _("Cancel") . "\">\n";
echo "</p>\n";
echo "</form>\n";
echo "</body>\n</html>\n";
?>

View File

@ -0,0 +1,189 @@
<?php
/*
$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
Start page of configuration wizard.
*/
include_once('../../lib/config.inc');
include_once('../../lib/status.inc');
// start session
session_save_path("../../sess");
@session_start();
setlanguage();
// check if user clicked on buttons
if ($_POST['submit'] || $_POST['cancel']) {
unset($error);
if ($_POST['cancel']) {
metarefresh('../config/conflogin.php');
}
else {
// check if master password is correct
$cfg = new CfgMain();
if ($cfg->password != $_POST['masterpwd']) {
$error = _("Master password is wrong!");
}
// check if passwords are equal and not empty
elseif ($_POST['passwd1'] && ($_POST['passwd1'] != "") && ($_POST['passwd1'] == $_POST['passwd2'])) {
// check if profile name is valid
if (eregi("^[a-z0-9\-_]+$", $_POST['profname']) && !in_array($_POST['profname'], getConfigProfiles())) {
// create new profile file
@copy("../../config/lam.conf_sample", "../../config/" . $_POST['profname'] . ".conf");
@chmod ("../../config/" . $_POST['profname'] . ".conf", 0600);
$file = is_file("../../config/" . $_POST['profname'] . ".conf");
if ($file) {
// load as config and write new password
$conf = new Config($_POST['profname']);
$conf->Passwd = $_POST['passwd1'];
$conf->save();
$_SESSION['confwiz_config'] = $conf;
$_SESSION['confwiz_masterpwd'] = $_POST['masterpwd'];
}
else $error = _("Unable to create new profile!");
}
else $error = _("Profile name is invalid!");
}
else $error = _("Profile passwords are different or empty!");
// print error message if needed
if ($error) {
echo $_SESSION['header'];
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "</head><body>\n";
StatusMessage("ERROR", $error, "");
echo "<p><br><br><a href=\"../config/conflogin.php\">" . _("Back to profile login") . "</a></p>\n";
echo "</body></html>\n";
}
// if all ok, go to next page
else {
metarefresh('server.php');
}
}
exit;
}
// remove variables of older wizard calls
unset($_SESSION['conwiz_masterpwd']);
unset($_SESSION['confwiz_config']);
echo $_SESSION['header'];
echo "<title>\n";
echo _("Configuration wizard");
echo "</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head>\n";
echo "<body>\n";
echo "<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\">\n";
echo "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a>\n";
echo "</p>\n";
echo "<hr>\n";
// formular
echo "<form action=\"start.php\" method=\"post\">\n";
echo "<h2 align=\"center\">" . _("Welcome to LAM Configuration wizard.") . "</h2>\n";
echo "<p align=\"center\">\n";
echo "This druid will help you to create a configuration file for LAM and set up LDAP.\n";
echo "</p>\n";
echo "<br><br>\n";
echo "<table border=0>\n";
// profile name
echo "<tr>\n";
echo "<td colspan=2>\n";
echo _("Please enter a name for the new profile. The name may contain letters, digits and -_.") . "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Profile name") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<input type=\"text\" name=\"profname\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
// password
echo "<tr>\n";
echo "<td colspan=2>\n";
echo _("Configuration profiles are protected with a password from unauthorised access. Please enter it here.") . "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Password") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<input type=\"password\" name=\"passwd1\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Reenter Password") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<input type=\"password\" name=\"passwd2\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
// master password
echo "<tr>\n";
echo "<td colspan=2>\n";
echo _("Please enter your configuration master password. This password is \"lam\" by default.") . "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr><td colspan=2>&nbsp;</td></tr>\n";
echo "<tr>\n";
echo "<td>\n";
echo "<b>" . _("Master password") . ":</b>\n";
echo "</td>\n";
echo "<td>\n";
echo "<input type=\"password\" name=\"masterpwd\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<p><br></p>\n";
// next/cancel button
echo "<p>\n";
echo "<input type=\"submit\" name=\"submit\" value=\"" . _("Next") . "\">\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"" . _("Cancel") . "\">\n";
echo "</p>\n";
echo "</form>\n";
echo "</body>\n</html>\n";
?>