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 "\n"; echo "\n"; echo _("Configuration wizard"); echo "\n"; echo "\n"; StatusMessage("ERROR", $error, ""); echo "



" . _("Back to profile login") . "

\n"; echo "\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 "\n"; echo _("Configuration wizard"); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "

\n"; echo "\"LDAP\n"; echo "

\n"; echo "
\n"; // formular echo "
\n"; echo "

" . _("Welcome to LAM Configuration wizard.") . "

\n"; echo "

\n"; echo "This druid will help you to create a configuration file for LAM and set up LDAP.\n"; echo "

\n"; echo "

\n"; echo "\n"; // profile name echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; // password echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; // master password echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo _("Please enter a name for the new profile. The name may contain letters, digits and -_.") . "\n"; echo "
 
\n"; echo "" . _("Profile name") . ":\n"; echo "\n"; echo "\n"; echo "
 
\n"; echo _("Configuration profiles are protected with a password from unauthorised access. Please enter it here.") . "\n"; echo "
 
\n"; echo "" . _("Password") . ":\n"; echo "\n"; echo "\n"; echo "
\n"; echo "" . _("Reenter Password") . ":\n"; echo "\n"; echo "\n"; echo "
 
 
\n"; echo _("Please enter your configuration master password. This password is \"lam\" by default.") . "\n"; echo "
 
\n"; echo "" . _("Master password") . ":\n"; echo "\n"; echo "\n"; echo "
\n"; echo "


\n"; // next/cancel button echo "

\n"; echo "\n"; echo "\n"; echo "

\n"; echo "
\n"; echo "\n\n"; ?>