summaryrefslogtreecommitdiff
path: root/webapps/install/vampire.esp
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2007-01-03 19:57:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:36:06 -0500
commit2e7c59c24470766e37309c7a8bfa4c7b81c57614 (patch)
treec44c89911868c52f25ca66bdefa68e13248db8e6 /webapps/install/vampire.esp
parent57f5bf78fa9fc9d190c3cb25251e686a1488f790 (diff)
downloadsamba-2e7c59c24470766e37309c7a8bfa4c7b81c57614.tar.gz
samba-2e7c59c24470766e37309c7a8bfa4c7b81c57614.tar.bz2
samba-2e7c59c24470766e37309c7a8bfa4c7b81c57614.zip
r20515: Continued work on the Web Application Framework. Until we get all of the
functionality of the old scripts incorporated into the new framework, the old scripts need to still be available. I've reverted to having the old scripts be the default pages, and added an option to access the preview of the new SWAT. (This used to be commit b43620d4b8eff815f4a6dc02522a8dfc9fdcaef4)
Diffstat (limited to 'webapps/install/vampire.esp')
-rw-r--r--webapps/install/vampire.esp120
1 files changed, 120 insertions, 0 deletions
diff --git a/webapps/install/vampire.esp b/webapps/install/vampire.esp
new file mode 100644
index 0000000000..9ce874cd18
--- /dev/null
+++ b/webapps/install/vampire.esp
@@ -0,0 +1,120 @@
+<% page_header("columns", "Windows to Samba Migration", "install");
+
+ include("/scripting/forms.js");
+ libinclude("base.js");
+ libinclude("provision.js");
+
+ var misc = misc_init();
+%>
+
+<h1>Windows to Samba4 domain migration</h1>
+
+<%
+var f = FormObj("Provisioning", 0, 2);
+var i;
+var lp = loadparm_init();
+
+if (lp.get("realm") == "") {
+ lp.set("realm", lp.get("workgroup") + ".example.com");
+}
+
+
+var subobj = provision_guess();
+/* Don't supply default password for web interface */
+subobj.ADMINPASS = "";
+
+f.add("REALM", "DNS Domain Name");
+f.add("DOMAIN", "NetBIOS Domain Name");
+f.add("ADMIN", "Administrator Username");
+f.add("ADMINPASS", "Administrator Password", "password");
+f.add("HOSTNAME", "My Hostname");
+f.add("HOSTIP", "My Host's IP");
+f.add("DEFAULTSITE", "Default Site");
+f.submit[0] = "Migrate";
+f.submit[1] = "Cancel";
+
+if (form['submit'] == "Cancel") {
+ redirect("/");
+}
+
+if (form['submit'] == "Migrate") {
+ 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];
+}
+
+if (form['submit'] == "Migrate") {
+ lp.set("realm", subobj.REALM);
+ if (subobj.ADMINPASS == "") {
+ write("<h3>We need the administrator password for the " + subobj.DOMAIN + " domain to proceed. Please try again.</h3>");
+ f.display();
+ } else if (!provision_validate(subobj, writefln)) {
+ f.display();
+ } else if (strupper(lp.get("server role")) == "PDC") {
+ writefln("You need to set 'server role' to 'member server' before starting the migration process");
+ } else {
+ var creds = credentials_init();
+ var samdb;
+ creds.set_username(form.ADMIN);
+ creds.set_password(form.ADMINPASS);
+ creds.set_domain(form.DOMAIN);
+ creds.set_realm(form.REALM);
+
+ var info = new Object();
+ var paths = provision_default_paths(subobj);
+ var session_info = session.authinfo.session_info;
+ var credentials = session.authinfo.credentials;
+
+ info.credentials = credentials;
+ info.session_info = session_info;
+ info.message = writefln;
+ info.subobj = subobj;
+
+ /* Setup a basic database structure, but don't setup any users */
+ if (!provision(subobj, writefln, true, paths,
+ session_info, credentials)) {
+ writefln("Provision failed!");
+
+ /* Join domain */
+ } else if (!join_domain(form.DOMAIN, form.HOSTNAME, misc.SEC_CHAN_BDC, creds, writefln)) {
+ writefln("Domain Join failed!");
+
+ /* Vampire */
+ } else if (!vampire(form.DOMAIN, session.authinfo.session_info,
+ session.authinfo.credentials, writefln)) {
+ writefln("Failed to syncronsise remote domain into local database!");
+ } else if (!provision_dns(subobj, writefln, paths,
+ session.authinfo.session_info, session.authinfo.credentials)) {
+ writefln("DNS Provision failed!");
+ } else if (!(samdb = open_ldb(info, paths.samdb, false))) {
+ writefln("Opening " + paths.samdb + " failed!");
+ info.samdb = samdb;
+ } else if (!setup_name_mappings(info, samdb)) {
+ writefln("Setup of name mappings failed!");
+ } else {
+ var zonepath = paths.dns;
+ %>
+<h3>Database migrated!</h3>
+
+You need to do the following to complete the process:
+
+<ul>
+<li>Install the <b>@@zonepath</b> zone file into your bind install, and restart bind
+<li>Change your smb.conf to set "server role = pdc"
+<li>Shutdown your existing PDC and any other DCs
+<li>Restart smbd
+</ul>
+ <%
+ }
+ }
+} else {
+ f.display();
+}
+%>
+
+
+<% page_footer(); %>