summaryrefslogtreecommitdiff
path: root/swat/install/provision.esp
blob: 9316445d7fc60b8f0787e6da02aac6305ceb55d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<% page_header("columns", "Provisioning", "install"); 

  include("/scripting/forms.js");
  libinclude("base.js");
  libinclude("provision.js");
%>

<h1>Samba4 provisioning</h1>

<%
var f = FormObj("Provisioning", 9, 2);
var i;
var lp = loadparm_init();

if (lp.get("realm") == "") {
	lp.set("realm", lp.get("workgroup") + ".example.com");
}


var subobj = provision_guess();

f.element[0].label = "Realm";
f.element[0].name  = "REALM";
f.element[1].label = "Domain Name";
f.element[1].name  = "DOMAIN";
f.element[2].label = "Host Name";
f.element[2].name  = "HOSTNAME";
f.element[3].label = "Administrator Password";
f.element[3].name  = "ADMINPASS";
f.element[3].type  = "password";
f.element[4].label = "Domain SID";
f.element[4].name  = "DOMAINSID";
f.element[5].label = "Host GUID";
f.element[5].name  = "HOSTGUID";
f.element[6].label = "Base DN";
f.element[6].name  = "BASEDN";
f.element[7].label = "Host IP";
f.element[7].name  = "HOSTIP";
f.element[8].label = "Default Site";
f.element[8].name  = "DEFAULTSITE";
f.submit[0] = "Initial provision";
f.submit[1] = "Provision";
f.submit[2] = "Cancel";

if (form['submit'] == "Cancel") {
	redirect("/");
}

if ((form['submit'] == "Provision") || (form['submit'] == "Initial provision")) {
	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];
}

lp.set("realm", subobj.REALM);

if (form['submit'] == "Provision") {
	provision(subobj, writefln, true);
} else if (form['submit'] == "Initial provision") {
	provision(subobj, writefln, false);
} else {
	f.display();
}
%>


<% page_footer(); %>