r9735: More work on generating a valid Samba4 configuration using the
[sfrench/samba-autobuild/.git] / swat / install / samba3.esp
index ead694a107b00b2a87987779f0bb432416773451..6fa246bb1c2acd352e6e68ade5f7eef71ac6a18b 100644 (file)
@@ -9,30 +9,40 @@
 <h1>Import from Samba3</h1>
 
 <%
-var f = FormObj("Import from Samba3", 0, 2);
-var i;
-
-f.add("SMBCONF", "smb.conf file");
-f.add("LIBDIR", "Lib directory");
-f.submit[0] = "Import";
-f.submit[1] = "Cancel";
-
 if (form['submit'] == "Cancel") {
        redirect("/");
 }
 
 if (form['submit'] == "Import") {
-       for (r in form) {
-               subobj[r] = form[r];
-       }
-}
+       write("LIBDIR: " + form['LIBDIR'] + "\n" + "SMBCONF: " + form['SMBCONF']);
+       var samba3 = samba3_read(form['SMBCONF'], form['LIBDIR']);
+
+       domainname = samba3.get_param("global", "workgroup");
+       var sec = samba3.find_domainsecrets(domainname);
+       write("<p>Import data from Samba3 installation.</p>\n");
+       write("<table>\n");
+       write("<tr><td>Domain name</td><td>" + domainname + "</td></tr>\n");
+       write("<tr><td>Domain SID</td><td>" + sec.sid + "</td></tr>\n");
+       write("<tr><td>Domain GUID</td><td>" + sec.guid + "</td></tr>\n");
+       write("</table>");
+
+       var f = FormObj("Import from Samba3", 0, 2);
+       f.submit[0] = "Continue";
+       f.submit[1] = "Cancel";
+       f.display();    
+} else if (form['submit'] == "Continue") {
+       // FIXME                  
+} else {
+       var f = FormObj("Import from Samba3", 0, 2);
 
-f.element[0].value = "/etc/samba/smb.conf";
-f.element[1].value = "/var/lib/samba";
+       f.add("SMBCONF", "smb.conf file");
+       f.add("LIBDIR", "Lib directory");
+       f.submit[0] = "Import";
+       f.submit[1] = "Cancel";
+
+       f.element[0].value = "/etc/samba/smb.conf";
+       f.element[1].value = "/var/lib/samba";
 
-if (form['submit'] == "import") {
-       //              provision(subobj, writefln, false);
-} else {
        f.display();
 }
 %>