diff options
author | Derrell Lipman <derrell@samba.org> | 2006-12-31 20:12:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:35:23 -0500 |
commit | d1e09e2e6f9db62bbab84abb53e23ee73764178a (patch) | |
tree | 18e57f756611c9d3e10fb41bf7c09eeb795028dd /swat.obsolete/install/provision.esp | |
parent | 710dfce70ca9024d2f026518638bb193e914f4a0 (diff) | |
download | samba-d1e09e2e6f9db62bbab84abb53e23ee73764178a.tar.gz samba-d1e09e2e6f9db62bbab84abb53e23ee73764178a.tar.bz2 samba-d1e09e2e6f9db62bbab84abb53e23ee73764178a.zip |
r20446: rename swat directory to swat.obsolete; keeping it around since there is lots of useful info in it.
(This used to be commit 5f9f72a9cfab80561b23284001b67c4ea961757b)
Diffstat (limited to 'swat.obsolete/install/provision.esp')
-rw-r--r-- | swat.obsolete/install/provision.esp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/swat.obsolete/install/provision.esp b/swat.obsolete/install/provision.esp new file mode 100644 index 0000000000..ee9673d507 --- /dev/null +++ b/swat.obsolete/install/provision.esp @@ -0,0 +1,79 @@ +<% page_header("columns", "Provisioning", "install"); + + include("/scripting/forms.js"); + libinclude("base.js"); + libinclude("provision.js"); +%> + +<h1>Samba4 provisioning</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("HOSTNAME", "Hostname"); +f.add("ADMINPASS", "Administrator Password", "password"); +f.add("CONFIRM", "Confirm Password", "password"); +f.add("DOMAINSID", "Domain SID"); +f.add("HOSTIP", "Host IP"); +f.add("DEFAULTSITE", "Default Site"); +f.submit[0] = "Provision"; +f.submit[1] = "Cancel"; + +if (form['submit'] == "Cancel") { + redirect("/"); +} + +if (form['submit'] == "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]; +} + +if (form['submit'] == "Provision") { + lp.set("realm", subobj.REALM); + var goodpass = (subobj.CONFIRM == subobj.ADMINPASS); + + if (!goodpass) { + write("<h3>Passwords don't match. Please try again.</h3>"); + f.display(); + } else if (subobj.ADMINPASS == "") { + write("<h3>You must choose an administrator password. Please try again.</h3>"); + f.display(); + } else if (!provision_validate(subobj, writefln)) { + f.display(); + } else { + var paths = provision_default_paths(subobj); + if (!provision(subobj, writefln, false, paths, + session.authinfo.session_info, session.authinfo.credentials)) { + writefln("Provision failed!"); + } else if (!provision_dns(subobj, writefln, paths, + session.authinfo.session_info, session.authinfo.credentials)) { + writefln("DNS Provision failed!"); + } else { + writefln("Provision Complete!"); + } + } +} else { + f.display(); +} +%> + + +<% page_footer(); %> |