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

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