s4-smbd: use tevent_re_initialise()
[ira/wip.git] / swat2 / install / newuser.esp
1 <% page_header("columns", "Add a user", "install"); 
2
3   include("/scripting/forms.js");
4   libinclude("base.js");
5   libinclude("provision.js");
6 %>
7
8 <h1>Add a user</h1>
9
10 <%
11 var f = FormObj("newuser", 0, 2);
12 var i;
13 var rand = random_init();
14
15 f.add("USERNAME", "User Name");
16 f.add("UNIXNAME", "Unix Name");
17 f.add("PASSWORD", "Password", "password");
18 f.add("CONFIRM", "Confirm Password", "password");
19 f.submit[0] = "Add";
20 f.submit[1] = "Cancel";
21
22 if (form['submit'] == "Cancel") {
23         redirect("/");
24 }
25
26
27 if (form['submit'] == "Add" && 
28     form.USERNAME != undefined) {
29         var goodpass = (form.CONFIRM == form.PASSWORD);
30
31         if (!goodpass) {
32                 write("<h3>Passwords don't match.  Please try again.</h3>");
33                 f.display();
34         } else {
35                 if (form.UNIXNAME == undefined) {
36                         form.UNIXNAME = form.USERNAME;
37                 }
38                 if (form.PASSWORD == undefined) {
39                         form.PASSWORD = rand.randpass();
40                 }
41                 newuser(form.USERNAME, form.UNIXNAME, form.PASSWORD, writefln, 
42                         session.authinfo.session_info, session.authinfo.credentials);
43         }
44 } else {
45         f.display();
46 }
47 %>
48
49
50 <% page_footer(); %>