From 948183cb389195827892c5960b4cbcb3d1f8a645 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 19 Jul 2005 00:08:00 +0000 Subject: r8560: added a newuser page in swat (This used to be commit da366042f48c70b4cd2e6efcae23a7f1777d3ed4) --- swat/esptest/menu.js | 1 + swat/esptest/newuser.esp | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 swat/esptest/newuser.esp (limited to 'swat') diff --git a/swat/esptest/menu.js b/swat/esptest/menu.js index d2a145cc5c..62aa46072b 100644 --- a/swat/esptest/menu.js +++ b/swat/esptest/menu.js @@ -2,6 +2,7 @@ simple_menu( "ESP Tests", "Provisioning", session_uri("/esptest/provision.esp"), + "New User", session_uri("/esptest/newuser.esp"), "ldb database", session_uri("/esptest/ldb.esp"), "samr calls", session_uri("/esptest/samr.esp"), "html forms", session_uri("/esptest/formtest.esp"), diff --git a/swat/esptest/newuser.esp b/swat/esptest/newuser.esp new file mode 100644 index 0000000000..2e4341fbee --- /dev/null +++ b/swat/esptest/newuser.esp @@ -0,0 +1,41 @@ +<% page_header("columns", "Add a user"); + + 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(); %> -- cgit