summaryrefslogtreecommitdiffstats
path: root/swat
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-31 15:47:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:36:16 -0500
commit52bcf4c5a3a371e13530fe83c8b4ca06dad10b8f (patch)
tree08b86f5676a5cc35595c12114bba2d33a2b5e852 /swat
parent2f23a8cec1537439fef3456389d55d95c5e78493 (diff)
downloadsamba-52bcf4c5a3a371e13530fe83c8b4ca06dad10b8f.tar.gz
samba-52bcf4c5a3a371e13530fe83c8b4ca06dad10b8f.tar.xz
samba-52bcf4c5a3a371e13530fe83c8b4ca06dad10b8f.zip
r9831: Check whether the two admin passwords entered were equal.
(This used to be commit d02834f88d6a26f77549ec9db8f2492eacc9b043)
Diffstat (limited to 'swat')
-rw-r--r--swat/install/samba3.esp31
1 files changed, 24 insertions, 7 deletions
diff --git a/swat/install/samba3.esp b/swat/install/samba3.esp
index 5228ca6f863..32ee25fc417 100644
--- a/swat/install/samba3.esp
+++ b/swat/install/samba3.esp
@@ -19,11 +19,13 @@ if (form['submit'] == "Cancel") {
redirect("/");
}
-if (form['submit'] == "Import") {
+function confirm_form()
+{
var samba3 = samba3_read(form['LIBDIR'], form['SMBCONF']);
var subobj = upgrade_provision(samba3);
var f = FormObj("Import from Samba3", 0, 2);
+ subobj.ADMINPASS = "";
f.add("REALM", "Realm");
f.add("DOMAIN", "Domain Name");
@@ -46,6 +48,10 @@ if (form['submit'] == "Import") {
f.submit[0] = "Continue";
f.submit[1] = "Cancel";
f.display();
+}
+
+if (form['submit'] == "Import") {
+ confirm_form();
} else if (form['submit'] == "Continue") {
var samba3 = samba3_read(form['LIBDIR'], form['SMBCONF']);
assert(samba3 != undefined);
@@ -53,14 +59,25 @@ if (form['submit'] == "Import") {
for (r in form) {
subobj[r] = form[r];
}
- var paths = provision_default_paths(subobj);
- provision(subobj, writefln, true, paths);
- upgrade(subobj, samba3, writefln, paths);
+ var goodpass = (subobj.CONFIRM == subobj.ADMINPASS);
- writefln("Reloading smb.conf\n");
- var lp = loadparm_init();
- lp.reload();
+ if (!goodpass) {
+ write("<h3>Passwords don't match. Please try again.</h3>");
+ confirm_form();
+ } else if (subobj.ADMINPASS == "") {
+ write("<h3>You must choose an administrator password. Please try again.</h3>");
+ confirm_form();
+ } else {
+ var paths = provision_default_paths(subobj);
+
+ provision(subobj, writefln, true, paths);
+ upgrade(subobj, samba3, writefln, paths);
+
+ writefln("Reloading smb.conf\n");
+ var lp = loadparm_init();
+ lp.reload();
+ }
} else {
var f = FormObj("Import from Samba3", 0, 2);