r8722: make the menu handling considerably saner and easier to follow. The whole
[sfrench/samba-autobuild/.git] / swat / install / newuser.esp
index 21a2cb361bf35ae1b8bb7e552340474b80705699..9baba7c6f4a518184a435323455fe3175ccc1637 100644 (file)
@@ -1,5 +1,6 @@
-<% page_header("columns", "Add a user", "/install/menu.js"); 
+<% page_header("columns", "Add a user", "install"); 
 
 
+  include("/scripting/forms.js");
   libinclude("base.js");
   libinclude("provision.js");
 %>
   libinclude("base.js");
   libinclude("provision.js");
 %>
@@ -9,6 +10,7 @@
 <%
 var f = FormObj("newuser", 3, 2);
 var i;
 <%
 var f = FormObj("newuser", 3, 2);
 var i;
+var rand = random_init();
 
 f.element[0].label = "User Name";
 f.element[0].name  = "USERNAME";
 
 f.element[0].label = "User Name";
 f.element[0].name  = "USERNAME";
@@ -29,11 +31,11 @@ if (form['submit'] == "Add" &&
                form.UNIXNAME = form.USERNAME;
        }
        if (form.PASSWORD == undefined) {
                form.UNIXNAME = form.USERNAME;
        }
        if (form.PASSWORD == undefined) {
-               form.PASSWORD = randpass();
+               form.PASSWORD = rand.randpass();
        }
        newuser(form.USERNAME, form.UNIXNAME, form.PASSWORD, writefln);
 } else {
        }
        newuser(form.USERNAME, form.UNIXNAME, form.PASSWORD, writefln);
 } else {
-       display_form(f);
+       f.display();
 }
 %>
 
 }
 %>