summaryrefslogtreecommitdiff
path: root/swat/install/samba3.esp
blob: 729dcc74fdcd6ac28470bc4e2d13ca2bfd227e78 (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", "Upgrade", "install"); 

 /* frontend to Samba3 upgrade.
	Based on provision.esp
	(C) Jelmer Vernooij 2005
	Published under the GNU GPL
  */

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

<h1>Import from Samba3</h1>

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

if (form['submit'] == "Import") {
	var samba3 = samba3_read(form['LIBDIR'], form['SMBCONF']);

	var subobj = upgrade_provision(samba3);
	var f = FormObj("Import from Samba3", 0, 2);

	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");

	for (i=0;i<f.element.length;i++) {
		f.element[i].value = subobj[f.element[i].name];
	}

	f.add("SMBCONF", "", "hidden", form['SMBCONF']);
	f.add("LIBDIR", "", "hidden", form['LIBDIR']);

	f.submit[0] = "Continue";
	f.submit[1] = "Cancel";
	f.display();	
} else if (form['submit'] == "Continue") {
	var samba3 = samba3_read(form['LIBDIR'], form['SMBCONF']);
	assert(samba3 != undefined);
	var subobj = upgrade_provision(samba3);
	for (r in form) {
		subobj[r] = form[r];
	}
	provision(subobj, writefln, true);
	upgrade(subobj, samba3, writefln);
} else {
	var f = FormObj("Import from Samba3", 0, 2);

	f.add("SMBCONF", "smb.conf file", "text", "/etc/samba/smb.conf");
	f.add("LIBDIR", "Lib directory", "text", "/var/lib/samba");
	f.submit[0] = "Import";
	f.submit[1] = "Cancel";

	write('<p>Warning: This will erase your current configuration!</p>');
	f.display();
}
%>

<% page_footer(); %>