Samba4 unixAuth test
<%
/* if its a post then the user has filled in the form, so
report the values
*/
if (request['REQUEST_METHOD'] == "POST") {
/* if they cancelled then take them back to the list of tests */
if (form['submit'] == "Cancel") {
redirect("index.esp");
}
username = form['Username'];
password = form['Password'];
if (form['submit'] == "Logout") {
res = unixAuth("logout", "logout");
}
if (form['submit'] == "Login") {
res = unixAuth(username, password);
if (res != 0) {
write ("
Unsuccessful authentication\n");
} else {
write ("
Successfully authenticated\n");
}
}
}
write ("
AUTHENTICATED = " + session['AUTHENTICATED'] + "\n");
write ("
USERNAME = " + session['USERNAME'] + "\n");
write ("
PRIVILEGE = " + session['PRIVILEGE'] + "\n");
%>