summaryrefslogtreecommitdiff
path: root/swat.obsolete/install/newuser.esp
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-12-31 20:12:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:35:23 -0500
commitd1e09e2e6f9db62bbab84abb53e23ee73764178a (patch)
tree18e57f756611c9d3e10fb41bf7c09eeb795028dd /swat.obsolete/install/newuser.esp
parent710dfce70ca9024d2f026518638bb193e914f4a0 (diff)
downloadsamba-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/newuser.esp')
-rw-r--r--swat.obsolete/install/newuser.esp50
1 files changed, 50 insertions, 0 deletions
diff --git a/swat.obsolete/install/newuser.esp b/swat.obsolete/install/newuser.esp
new file mode 100644
index 0000000000..1b341ff665
--- /dev/null
+++ b/swat.obsolete/install/newuser.esp
@@ -0,0 +1,50 @@
+<% page_header("columns", "Add a user", "install");
+
+ include("/scripting/forms.js");
+ libinclude("base.js");
+ libinclude("provision.js");
+%>
+
+<h1>Add a user</h1>
+
+<%
+var f = FormObj("newuser", 0, 2);
+var i;
+var rand = random_init();
+
+f.add("USERNAME", "User Name");
+f.add("UNIXNAME", "Unix Name");
+f.add("PASSWORD", "Password", "password");
+f.add("CONFIRM", "Confirm Password", "password");
+f.submit[0] = "Add";
+f.submit[1] = "Cancel";
+
+if (form['submit'] == "Cancel") {
+ redirect("/");
+}
+
+
+if (form['submit'] == "Add" &&
+ form.USERNAME != undefined) {
+ var goodpass = (form.CONFIRM == form.PASSWORD);
+
+ if (!goodpass) {
+ write("<h3>Passwords don't match. Please try again.</h3>");
+ f.display();
+ } else {
+ if (form.UNIXNAME == undefined) {
+ form.UNIXNAME = form.USERNAME;
+ }
+ if (form.PASSWORD == undefined) {
+ form.PASSWORD = rand.randpass();
+ }
+ newuser(form.USERNAME, form.UNIXNAME, form.PASSWORD, writefln,
+ session.authinfo.session_info, session.authinfo.credentials);
+ }
+} else {
+ f.display();
+}
+%>
+
+
+<% page_footer(); %>