1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00
samba-mirror/swat/install/newuser.esp
Rafal Szczesniak 1254a6da23 r8969: Make password field a password field, that is - prevent them from
displaying plain text.

rafal
(This used to be commit b91e6053485ada50f66aa763e0ccff3b71991fa5)
2007-10-10 13:31:01 -05:00

45 lines
897 B
Plaintext

<% 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", 3, 2);
var i;
var rand = random_init();
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].type = "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 = rand.randpass();
}
newuser(form.USERNAME, form.UNIXNAME, form.PASSWORD, writefln);
} else {
f.display();
}
%>
<% page_footer(); %>