diff options
author | Derrell Lipman <derrell@samba.org> | 2007-01-03 19:57:40 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:36:06 -0500 |
commit | 2e7c59c24470766e37309c7a8bfa4c7b81c57614 (patch) | |
tree | c44c89911868c52f25ca66bdefa68e13248db8e6 /webapps/install/newuser.esp | |
parent | 57f5bf78fa9fc9d190c3cb25251e686a1488f790 (diff) | |
download | samba-2e7c59c24470766e37309c7a8bfa4c7b81c57614.tar.gz samba-2e7c59c24470766e37309c7a8bfa4c7b81c57614.tar.bz2 samba-2e7c59c24470766e37309c7a8bfa4c7b81c57614.zip |
r20515: Continued work on the Web Application Framework. Until we get all of the
functionality of the old scripts incorporated into the new framework, the old
scripts need to still be available. I've reverted to having the old scripts
be the default pages, and added an option to access the preview of the new
SWAT.
(This used to be commit b43620d4b8eff815f4a6dc02522a8dfc9fdcaef4)
Diffstat (limited to 'webapps/install/newuser.esp')
-rw-r--r-- | webapps/install/newuser.esp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/webapps/install/newuser.esp b/webapps/install/newuser.esp new file mode 100644 index 0000000000..1b341ff665 --- /dev/null +++ b/webapps/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(); %> |