summaryrefslogtreecommitdiff
path: root/swat.obsolete/login.esp
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-12-31 20:12:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:35:23 -0500
commitd1e09e2e6f9db62bbab84abb53e23ee73764178a (patch)
tree18e57f756611c9d3e10fb41bf7c09eeb795028dd /swat.obsolete/login.esp
parent710dfce70ca9024d2f026518638bb193e914f4a0 (diff)
downloadsamba-d1e09e2e6f9db62bbab84abb53e23ee73764178a.tar.gz
samba-d1e09e2e6f9db62bbab84abb53e23ee73764178a.tar.bz2
samba-d1e09e2e6f9db62bbab84abb53e23ee73764178a.zip
r20446: rename swat directory to swat.obsolete; keeping it around since there is lots of useful info in it.
(This used to be commit 5f9f72a9cfab80561b23284001b67c4ea961757b)
Diffstat (limited to 'swat.obsolete/login.esp')
-rw-r--r--swat.obsolete/login.esp59
1 files changed, 59 insertions, 0 deletions
diff --git a/swat.obsolete/login.esp b/swat.obsolete/login.esp
new file mode 100644
index 0000000000..8d6c049d02
--- /dev/null
+++ b/swat.obsolete/login.esp
@@ -0,0 +1,59 @@
+<% page_header("plain", "SWAT Login", "");
+ libinclude("auth.js");
+ include("/scripting/forms.js");
+
+if (request['SESSION_EXPIRED'] == "True") {
+ write("<b>Your session has expired - please authenticate again<br /></b>\n");
+}
+
+var f = FormObj("login", 3, 1);
+f.element[0].label = "Username";
+f.element[0].value = form['Username'];
+f.element[1].label = "Password";
+f.element[1].value = form['Password'];
+f.element[1].type = "password";
+f.element[2].label = "Domain";
+f.element[2].type = "select";
+f.element[2].list = getDomainList();
+f.submit[0] = "Login";
+
+f.display();
+%>
+
+<%
+ if (request.REQUEST_METHOD == "POST") {
+ var creds = credentials_init();
+ creds.set_username(form.Username);
+ creds.set_password(form.Password);
+ creds.set_domain(form.Domain);
+ creds.set_workstation(request['REMOTE_HOST']);
+
+ auth = userAuth(creds, request['REMOTE_SOCKET_ADDRESS']);
+ if (auth == undefined) {
+ write("<b>Invalid login - please try again<br /></b>\n");
+ } else if (auth.result) {
+ session.AUTHENTICATED = true;
+ session.authinfo = new Object();
+
+ session.authinfo.username = auth.username;
+ session.authinfo.domain = auth.domain;
+ session.authinfo.credentials = creds;
+ session.authinfo.session_info = auth.session_info;
+
+ /* if the user was asking for the login page, then now
+ redirect them to the main page. Otherwise just
+ redirect them to the current page, which will now
+ show its true content */
+ if (request.REQUEST_URI == "/login.esp") {
+ redirect(session_uri("/"));
+ } else {
+ redirect(session_uri(request.REQUEST_URI));
+ }
+ } else if (auth.report == undefined) {
+ write("<b>Login failed - please try again<br /></b>\n");
+ } else {
+ write("<b>Login failed: " + auth.report + " - please try again<br /></b>\n");
+ }
+ }
+%>
+<% page_footer(); %>