From 325edaa66a5b3a8c907a3a521b4ceea26ea0210c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 19 Jul 2005 11:06:12 +0000 Subject: r8598: move provisioning to /install/ directory from /esptest/ (This used to be commit 318402ee4e8900e0d8ed1dce1e201f63ac4a908f) --- swat/install/index.esp | 6 +++++ swat/install/menu.js | 5 +++++ swat/install/newuser.esp | 41 ++++++++++++++++++++++++++++++++++ swat/install/provision.esp | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 swat/install/index.esp create mode 100644 swat/install/menu.js create mode 100644 swat/install/newuser.esp create mode 100644 swat/install/provision.esp (limited to 'swat/install') diff --git a/swat/install/index.esp b/swat/install/index.esp new file mode 100644 index 0000000000..ee16bec34a --- /dev/null +++ b/swat/install/index.esp @@ -0,0 +1,6 @@ +<% page_header("columns", "Server Installation", "/install/menu.js"); +%> + +

Installation

+ +<% page_footer(); %> diff --git a/swat/install/menu.js b/swat/install/menu.js new file mode 100644 index 0000000000..e8f99f7cac --- /dev/null +++ b/swat/install/menu.js @@ -0,0 +1,5 @@ +/* show a menu for the esp test pages */ +simple_menu( + "Installation", + "Provisioning", session_uri("/install/provision.esp"), + "New User", session_uri("/install/newuser.esp")); diff --git a/swat/install/newuser.esp b/swat/install/newuser.esp new file mode 100644 index 0000000000..21a2cb361b --- /dev/null +++ b/swat/install/newuser.esp @@ -0,0 +1,41 @@ +<% page_header("columns", "Add a user", "/install/menu.js"); + + libinclude("base.js"); + libinclude("provision.js"); +%> + +

Add a user

+ +<% +var f = FormObj("newuser", 3, 2); +var i; + +f.element[0].label = "User Name"; +f.element[0].name = "USERNAME"; +f.element[1].label = "Unix Name"; +f.element[1].name = "UNIXNAME"; +f.element[2].label = "Password"; +f.element[2].name = "PASSWORD"; +f.submit[0] = "Add"; +f.submit[1] = "Cancel"; + +if (form['submit'] == "Cancel") { + redirect("/"); +} + +if (form['submit'] == "Add" && + form.USERNAME != undefined) { + if (form.UNIXNAME == undefined) { + form.UNIXNAME = form.USERNAME; + } + if (form.PASSWORD == undefined) { + form.PASSWORD = randpass(); + } + newuser(form.USERNAME, form.UNIXNAME, form.PASSWORD, writefln); +} else { + display_form(f); +} +%> + + +<% page_footer(); %> diff --git a/swat/install/provision.esp b/swat/install/provision.esp new file mode 100644 index 0000000000..5c0aa4e77e --- /dev/null +++ b/swat/install/provision.esp @@ -0,0 +1,55 @@ +<% page_header("columns", "Provisioning", "/install/menu.js"); + + libinclude("base.js"); + libinclude("provision.js"); +%> + +

Samba4 provisioning

+ +<% +var f = FormObj("Provisioning", 9, 2); +var i, subobj = provision_guess(); + +f.element[0].label = "Realm"; +f.element[0].name = "REALM"; +f.element[1].label = "Domain Name"; +f.element[1].name = "DOMAIN"; +f.element[2].label = "Host Name"; +f.element[2].name = "HOSTNAME"; +f.element[3].label = "Administrator Password"; +f.element[3].name = "ADMINPASS"; +f.element[4].label = "Domain SID"; +f.element[4].name = "DOMAINSID"; +f.element[5].label = "Host GUID"; +f.element[5].name = "HOSTGUID"; +f.element[6].label = "Base DN"; +f.element[6].name = "BASEDN"; +f.element[7].label = "Host IP"; +f.element[7].name = "HOSTIP"; +f.element[8].label = "Default Site"; +f.element[8].name = "DEFAULTSITE"; +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 + + +<% page_footer(); %> -- cgit