1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-29 21:47:30 +03:00
Jelmer Vernooij 488d737fb0 r9816: Work on testsuite for upgrade
Add 'paths' object to provision code.
2007-10-10 13:35:04 -05:00

78 lines
1.9 KiB
Plaintext

<% 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];
}
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);
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(); %>