Project

General

Profile

1 4158 daigle
<%@ page     language="java"  import="java.util.Vector,edu.ucsb.nceas.metacat.util.OrganizationUtil"%>
2 1929 brooke
<!--
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$'
11
  *     '$Date$'
12
  * '$Revision$'
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 4080 daigle
34
<%
35 4158 daigle
	Vector<String> organizationList = OrganizationUtil.getOrganizations();
36 4080 daigle
%>
37
38 1929 brooke
<!-- *********************** START LOGIN TABLE ************************* -->
39
<html>
40
<head>
41
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
42 3780 daigle
  <link href="<%=STYLE_SKINS_URL%>/default/default.css" rel="stylesheet" type="text/css">
43 1929 brooke
  <script language="javascript"
44 3780 daigle
    type="text/javascript" src="<%=STYLE_SKINS_URL%>/default/default.js">
45 1929 brooke
  </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 2219 sgarg
    <%=(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 1929 brooke
  </script>
83
</head>
84
85
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
86 5601 leinfelder
  <table width="750px" align="center" border="0" cellspacing="0" cellpadding="0" class="group group_border">
87 1929 brooke
    <tr>
88 5601 leinfelder
      <th class="sectionheader">login &amp; registration</th>
89 1929 brooke
      </td>
90
    </tr>
91
    <tr>
92
      <td colspan="3">
93 5601 leinfelder
        <table width="100%" class="subpanel" border="0" cellpadding="0" cellspacing="0">
94 1929 brooke
          <tr>
95
            <td width="10">
96 3780 daigle
              <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10" height="10">
97 5601 leinfelder
				<a name="loginanchor"></a>
98 1929 brooke
            </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 4080 daigle
                  privileges:
104 1929 brooke
                </p>
105
                <%= loginStatus %>
106
            </td>
107
            <td width="10">
108 3780 daigle
              <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10" height="10">
109 1929 brooke
            </td>
110
          </tr>
111
          <tr>
112
            <td width="10">
113 3780 daigle
              <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10" height="10">
114 1929 brooke
            </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 3476 tao
                  <td  align="left"
127 1929 brooke
                    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 3780 daigle
                    <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10">
133 1929 brooke
                  </td>
134 3476 tao
                  <td align="left" class="text_plain">
135 3988 tao
                    <a href="<%=CGI_URL%>/ldapweb.cgi?cfg=default" target="_top">
136 1929 brooke
                    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 4080 daigle
                      <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 1929 brooke
                    </select>
157
                  </td>
158
                  <td width="10px">
159 3780 daigle
                    <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10" >
160 1929 brooke
                  </td>
161 3476 tao
                  <td align="left" class="text_plain">
162 3988 tao
                    <a href="<%=CGI_URL%>/ldapweb.cgi?stage=resetpass&cfg=default" target="_top">forgot your password?</a>
163 1929 brooke
                  </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 3780 daigle
                    <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10">
177 1929 brooke
                  </td>
178 3476 tao
                  <td align="left" class="text_plain">
179 3988 tao
                    <a href="<%=CGI_URL%>/ldapweb.cgi?stage=changepass&cfg=default" target="_top">change your password</a>
180 1929 brooke
                  </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 3780 daigle
                    <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10">
190 1929 brooke
                  </td>
191
                  <td>
192 3780 daigle
                    <img src="<%=STYLE_SKINS_URL%>/default/images/transparent1x1.gif" width="10">
193 1929 brooke
                  </td>
194
                </tr>
195
              </table>
196
              </form>
197
            </td>
198
          </tr>
199
        </table>
200
      </td>
201
    </tr>
202
  </table>
203
</body>