Project

General

Profile

1
<%@ page     language="java"  import="java.util.Vector,edu.ucsb.nceas.metacat.util.OrganizationUtil"%>
2
<!--
3
/**
4
  *  '$RCSfile$'
5
  *      Authors: Matt Jones, CHad Berkley
6
  *    Copyright: 2000 Regents of the University of California and the
7
  *               National Center for Ecological Analysis and Synthesis
8
  *  For Details: http://www.nceas.ucsb.edu/
9
  *
10
  *   '$Author: tao $'
11
  *     '$Date: 2014-01-23 09:29:41 -0800 (Thu, 23 Jan 2014) $'
12
  * '$Revision: 8526 $'
13
  * 
14
  * This program is free software; you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License as published by
16
  * the Free Software Foundation; either version 2 of the License, or
17
  * (at your option) any later version.
18
  *
19
  * This program is distributed in the hope that it will be useful,
20
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
  * GNU General Public License for more details.
23
  *
24
  * You should have received a copy of the GNU General Public License
25
  * along with this program; if not, write to the Free Software
26
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27
  *
28
  */
29
-->
30

    
31
<%@ include file="settings.jsp"%>
32
<%@ include file="session_vars.jsp"%>
33

    
34
<% 
35
	Vector<String> organizationList = OrganizationUtil.getOrganizations();
36
%>
37

    
38
<!-- *********************** START LOGIN TABLE ************************* -->
39
<html>
40
<head>
41
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
42
  <link href="<%=STYLE_SKINS_URL%>/default/default.css" rel="stylesheet" type="text/css">
43
  <script language="javascript" 
44
    type="text/javascript" src="<%=STYLE_SKINS_URL%>/default/default.js">
45
  </script>
46
  <script language="javascript" type="text/javascript">
47
    var popupMsg = "If you need to create a new account, \n"
48
                   +"click the \"create new account\" link";
49
    function trim(stringToTrim) {
50
      return stringToTrim.replace(/^\s*/, '').replace(/\s*$/,'');
51
    }
52
    function allowSubmit(formObj) {
53
      if (trim(formObj.elements["loginAction"].value)!="Login") return true;
54
      //trim username & passwd:
55
      var username = trim(formObj.elements["username"].value);
56
      var organization = trim(formObj.elements["organization"].value);
57
      var password = trim(formObj.elements["password"].value);
58
      if (username=="") {
59
        alert("You must type a username. \n"+popupMsg);
60
                formObj.elements["username"].focus();
61
        return false;
62
      } 
63
      if (organization=="") {
64
        alert("You must select an organization.\n"+popupMsg); 
65
                formObj.elements["organization"].focus();
66
        return false;
67
      } 
68
      if (password=="") {
69
        alert("You must type a password. \n"+popupMsg);
70
              formObj.elements["password"].focus();
71
        return false;
72
      }
73
      return true;
74
    } 
75
    <%=(isLoggedIn)?
76
        "   document.cookie = \"JSESSIONID=" + sess_sessionId + ";"
77
        +"                  path="          + CONTEXT_NAME  +  "\";\n"
78
        :"  document.cookie = \"JSESSIONID=" + sess_sessionId + ";"
79
        +"                  path="          + CONTEXT_NAME  +  ";"
80
        +"                  expires=Thu, 01-Jan-70 00:00:01 GMT\";\n"
81
    %>
82
  </script>
83
</head>
84

    
85
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
86
  <table width="750px" align="center" border="0" cellspacing="0" cellpadding="0" class="group group_border">
87
    <tr> 
88
      <th class="sectionheader">login &amp; registration</th>
89
      </td>
90
    </tr>
91
    <tr>
92
      <td colspan="3">
93
        <table width="100%" class="subpanel" border="0" cellpadding="0" cellspacing="0">
94
          <tr>
95
            <td width="10">
96
              <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10" height="10">
97
				<a name="loginanchor"></a>
98
            </td>
99
            <td class="text_example">
100
                <p>
101
                  Logging into your account enables you to search any 
102
                  additional, non-public data for which you may have access 
103
                  privileges:
104
                </p>
105
                <%= loginStatus %>
106
            </td>
107
            <td width="10">
108
              <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10" height="10">
109
            </td>
110
          </tr>
111
          <tr> 
112
            <td width="10">
113
              <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10" height="10">
114
            </td>
115
            <td> 
116
              <form name="loginform" method="post" action="index.jsp" 
117
                target="_top" onSubmit="return allowSubmit(this);">
118
                <input type="hidden" name="action"  value="login">
119
                <input type="hidden" name="ldapusername"  value="">
120
                <input type="hidden" name="qformat" value="default">
121
              <table width="100%" border="0" cellpadding="0" cellspacing="0">
122
                <tr valign="middle"> 
123
                  <td align="left" valign="middle" class="text_plain_smaller">
124
                    username:
125
                  </td>
126
                  <td  align="left" 
127
                    style="padding-top: 2px; padding-bottom: 2px;">
128
                    <input name="username" type="text" style="width: 140px;" 
129
                      value="<%=typedUserName%>" <%=loginEnabledDisabled%>>
130
                  </td>
131
                  <td width="10px">
132
                    <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10">
133
                  </td>
134
                  <td align="left" class="text_plain">
135
                    <a href="<%=USER_MANAGEMENT_URL%>" target="_top">
136
                    create a new account</a>
137
                  </td>
138
                </tr>
139
                <tr valign="middle">
140
                  <td height="28" align="left" 
141
                    valign="middle" class="text_plain_smaller">
142
                    organization:
143
                  </td>
144
                  <td align="left" 
145
                    style="padding-top: 2px; padding-bottom: 2px;">
146
                    <select name="organization" style="width:140px;" 
147
                      <%=loginEnabledDisabled%> >
148
                      <option value="" <%=((posted_organization.length()<1)?     "selected":"")%>>&#8212; choose one &#8212;</option>
149
<%
150
			for (String orgName : organizationList) {
151
%>         
152
                      <option value="<%= orgName %>"   <%=((posted_organization.equalsIgnoreCase(orgName))?     "selected":"")%>><%= orgName %></option>
153
<%
154
			}
155
%>                      
156
                    </select>
157
                  </td>
158
                  <td width="10px">
159
                    <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10" >
160
                  </td>
161
                  <td align="left" class="text_plain">
162
                    <a href="<%=USER_MANAGEMENT_URL%>" target="_top">forgot your password?</a>
163
                  </td>
164
                </tr>
165
                <tr valign="middle"> 
166
                  <td width="85" align="left" valign="middle" 
167
                    class="text_plain_smaller">
168
                    password:
169
                  </td>
170
                  <td> 
171
                    <input name="password" type="password" maxlength="50" 
172
                      style="width:140px;" value="<%=posted_password%>" 
173
                    <%=loginEnabledDisabled%>>
174
                  </td>
175
                  <td width="10px">
176
                    <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10">
177
                  </td>
178
                  <td align="left" class="text_plain">
179
                    <a href="<%=USER_MANAGEMENT_URL%>" target="_top">change your password</a> 
180
                  </td>
181
                </tr>
182
                <tr>
183
                  <td align="center" colspan="2" class="<%= ((isLoggedIn)? "buttonBG_logout": "buttonBG_login") %>">
184
                    <input type="submit" name="loginAction" 
185
                      value="<%=loginButtonLabel%>" class="button_login" />
186
                  </td>
187
                  </td>
188
                  <td width="10">
189
                    <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10">
190
                  </td>
191
                  <td>
192
                    <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10">
193
                  </td>
194
                </tr>
195
              </table>
196
              </form>
197
            </td>
198
          </tr>
199
        </table>
200
      </td>
201
    </tr>
202
  </table>
203
</body>    
(12-12/19)