~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to local/in/dhis-web-ga/LoginValidation.jsp

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<%@ page contentType="text/html ; charset=UTF-8"%>
 
2
 
 
3
<%@ page import="java.sql.*,java.util.*" %>
 
4
<%@ page session="true"%>
 
5
 
 
6
<!-- Bean Specification -->
 
7
<jsp:useBean id="LoginAction" scope="session" class="org.hisp.gtool.action.LoginAction" />
 
8
 
 
9
 
 
10
<% 
 
11
  String userName = request.getParameter("unameTF");
 
12
  String userPwd = request.getParameter("pwdTF");
 
13
  String dbState = request.getParameter("stateCB");
 
14
  String nextPage = request.getParameter("nextPageTF"); 
 
15
  int loginStatus = 0;
 
16
  
 
17
  int flag = 1;
 
18
  if(userName==null && userPwd ==null)  flag=2;
 
19
  
 
20
  try
 
21
  {     
 
22
        loginStatus = Integer.parseInt((String) session.getAttribute("loginStatus"));
 
23
  }
 
24
  catch(Exception e)
 
25
  {
 
26
    loginStatus = 0;
 
27
    userName = " ";
 
28
    userPwd = " ";
 
29
  }     
 
30
    
 
31
  boolean loginValid = true;
 
32
 
 
33
  if(loginStatus==0)
 
34
  {
 
35
        loginValid = LoginAction.loginValidation(userName,userPwd);
 
36
    if(loginValid) 
 
37
       {        
 
38
        session.setAttribute("loginStatus","1");
 
39
        session.setAttribute("loginUName",userName); 
 
40
        loginStatus = 1;       
 
41
       } 
 
42
  }
 
43
%>
 
44
<html>
 
45
        <head>
 
46
                <title></title>
 
47
                <script>
 
48
                        var loginStatus = <%=loginStatus%>;
 
49
                        var nextPage = '<%=nextPage%>';
 
50
                        var flag = <%=flag%>;
 
51
 
 
52
                        function fun1()
 
53
                        {                                               
 
54
                                if(loginStatus==0)      {parent.chartPane.location.href="LoginScreen.jsp";      }
 
55
                                else    
 
56
                                {
 
57
                                        if(nextPage=="orgUnitTree.jsp?optToDisplay=shortname" || nextPage=="orgUnitTree.jsp?optToDisplay=name")
 
58
                                                parent.ouTreeFrame.location.href=nextPage;       
 
59
                                        else
 
60
                                                {
 
61
                                                        if(flag==1) parent.ouTreeFrame.location.href="orgUnitTree.jsp?optToDisplay=shortname";   
 
62
                                                        parent.chartPane.location.href=nextPage;
 
63
                                                }
 
64
                                }
 
65
                        }                  
 
66
                </script>
 
67
        </head>
 
68
        <body onload="fun1()">
 
69
        </body>
 
70
</html>          
 
 
b'\\ No newline at end of file'