summaryrefslogtreecommitdiff
path: root/swat/esptest/newuser.esp
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/newuser.esp
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/newuser.esp')
-rw-r--r--swat/esptest/newuser.esp41
1 files changed, 41 insertions, 0 deletions
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(); %>