r26490: Update WHATSNEW. Unless some fancy new words arive soon, this is what
[samba.git] / swat / login.esp
index f263ef60776a82b169b353b28f3f4562b584c03c..9e9f6f99030d8c91c64bb1dc567f93cae9ff5b0e 100644 (file)
@@ -28,7 +28,7 @@ f.display();
                creds.set_domain(form.Domain);
                creds.set_workstation(request['REMOTE_HOST']);
 
-               auth = userAuth(creds);
+               auth = userAuth(creds, request['REMOTE_SOCKET_ADDRESS']);
                if (auth == undefined) {
                        write("<b>Invalid login - please try again<br /></b>\n");
                } else if (auth.result) {
@@ -38,6 +38,8 @@ f.display();
                        session.authinfo.username = auth.username;
                        session.authinfo.domain = auth.domain;
                        session.authinfo.credentials = creds;
+                       session.authinfo.session_info = auth.session_info;
+                       session.authinfo.user_class = auth.user_class;
                        
                        /* if the user was asking for the login page, then now
                           redirect them to the main page. Otherwise just
@@ -48,8 +50,10 @@ f.display();
                        } else {
                           redirect(session_uri(request.REQUEST_URI));
                        }
-               } else {
+               } 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");
                }
        }
 %>