2005-07-23 14:58:09 +04:00
<% page_header("columns", "Provisioning", "install");
2005-07-12 15:46:34 +04:00
2005-07-23 13:05:34 +04:00
include("/scripting/forms.js");
2005-07-12 15:46:34 +04:00
libinclude("base.js");
libinclude("provision.js");
%>
<h1>Samba4 provisioning</h1>
<%
2005-08-27 10:29:12 +04:00
var f = FormObj("Provisioning", 0, 2);
2005-07-20 14:07:48 +04:00
var i;
var lp = loadparm_init();
if (lp.get("realm") == "") {
lp.set("realm", lp.get("workgroup") + ".example.com");
}
var subobj = provision_guess();
2005-08-10 23:25:07 +04:00
/* Don't supply default password for web interface */
subobj.ADMINPASS = "";
2005-07-12 15:46:34 +04:00
2005-08-10 23:25:07 +04:00
f.add("REALM", "Realm");
f.add("DOMAIN", "Domain Name");
f.add("HOSTNAME", "Hostname");
f.add("ADMINPASS", "Administrator Password", "password");
f.add("CONFIRM", "Confirm Password", "password");
f.add("DOMAINSID", "Domain SID");
f.add("HOSTGUID", "Host GUID");
f.add("BASEDN", "Base DN");
f.add("HOSTIP", "Host IP");
f.add("DEFAULTSITE", "Default Site");
2005-08-27 10:29:12 +04:00
f.submit[0] = "Provision";
f.submit[1] = "Cancel";
2005-07-12 15:46:34 +04:00
if (form['submit'] == "Cancel") {
redirect("/");
}
2005-08-27 10:29:12 +04:00
if (form['submit'] == "Provision") {
2005-07-12 15:46:34 +04:00
for (r in form) {
subobj[r] = form[r];
}
}
for (i=0;i<f.element.length;i++) {
f.element[i].value = subobj[f.element[i].name];
}
2005-07-20 14:07:48 +04:00
2005-08-27 10:29:12 +04:00
if (form['submit'] == "Provision") {
lp.set("realm", subobj.REALM);
var goodpass = (subobj.CONFIRM == subobj.ADMINPASS);
2005-07-20 14:07:48 +04:00
2005-08-27 10:29:12 +04:00
if (!goodpass) {
2005-08-10 23:25:07 +04:00
write("<h3>Passwords don't match. Please try again.</h3>");
2005-08-27 10:29:12 +04:00
f.display();
} else if (subobj.ADMINPASS == "") {
write("<h3>You must choose an administrator password. Please try again.</h3>");
f.display();
2005-09-13 03:52:25 +04:00
} else if (!provision_validate(subobj, writefln)) {
f.display();
2005-08-27 10:29:12 +04:00
} else {
2005-08-31 06:39:57 +04:00
provision(subobj, writefln, false, provision_default_paths(subobj));
2005-08-10 23:25:07 +04:00
}
2005-08-27 10:29:12 +04:00
} else {
2005-07-23 13:05:34 +04:00
f.display();
2005-07-12 15:46:34 +04:00
}
%>
<% page_footer(); %>