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 "