summaryrefslogtreecommitdiff
path: root/swat/esptest
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-19 00:08:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:29:38 -0500
commit948183cb389195827892c5960b4cbcb3d1f8a645 (patch)
treea7f46eaac5ddcf6202955791fe1f03fe1f72aba3 /swat/esptest
parent762a6a14e8e99b079a226350eec8605edc51a8f9 (diff)
downloadsamba-948183cb389195827892c5960b4cbcb3d1f8a645.tar.gz
samba-948183cb389195827892c5960b4cbcb3d1f8a645.tar.bz2
samba-948183cb389195827892c5960b4cbcb3d1f8a645.zip
r8560: added a newuser page in swat
(This used to be commit da366042f48c70b4cd2e6efcae23a7f1777d3ed4)
Diffstat (limited to 'swat/esptest')
-rw-r--r--swat/esptest/menu.js1
-rw-r--r--swat/esptest/newuser.esp41
2 files changed, 42 insertions, 0 deletions
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");
+%>
+
+<h1>Add a user</h1>
+
+<%
+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(); %>