Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Jivka Bojilova
5
  *    Copyright: 2000 Regents of the University of California and the
6
  *               National Center for Ecological Analysis and Synthesis
7
  *  For Details: http://www.nceas.ucsb.edu/
8
  *
9
  *   '$Author: leinfelder $'
10
  *     '$Date: 2008-06-17 13:16:32 -0700 (Tue, 17 Jun 2008) $'
11
  * '$Revision: 4006 $'
12
  * 
13
  * This program is free software; you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License as published by
15
  * the Free Software Foundation; either version 2 of the License, or
16
  * (at your option) any later version.
17
  *
18
  * This program is distributed in the hope that it will be useful,
19
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
  * GNU General Public License for more details.
22
  *
23
  * You should have received a copy of the GNU General Public License
24
  * along with this program; if not, write to the Free Software
25
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
  *
27
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
28
  * convert an XML file with information about login action
29
  * into an HTML format suitable for rendering with modern web browsers.
30
-->
31

    
32
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
33

    
34
 <xsl:output method="html"/>
35
 <xsl:param name="contextURL"/>
36
 <xsl:param name="servletURL"/>
37
 <xsl:param name="cgi-prefix"/>
38
 <xsl:param name="userManagementURL"/>
39
 <xsl:param name="qformat">sanparks</xsl:param>
40
 <xsl:param name="redirect">true</xsl:param>
41
 <xsl:template match="/">
42
  	<xsl:choose>
43
  	<xsl:when test="count(login) &gt; 0">
44
  		<xsl:choose>
45
  			<xsl:when test="$redirect = 'true'">
46
  				<script language="JavaScript">
47
					<![CDATA[
48
			            function redirect() {
49
			                location.href = "]]><xsl:value-of select="$cgi-prefix" /><![CDATA[/register-dataset.cgi?cfg=sanparks";
50
			            }
51
			            redirect();]]>
52
		         </script>
53
  			</xsl:when>
54
  			<xsl:otherwise>
55
  			
56
				<h3>Welcome, <xsl:value-of select="login/name"/>  </h3>
57
				<form name="logoutForm" id="logoutForm" method="post" onsubmit="submitLogoutFormIntoDiv('{$servletURL}', this, 'loginSection'); return false;">
58
					<input name="qformat" value="sanparks" type="hidden" />
59
					<input name="action" type="hidden" value="logout"/>
60
					<table>
61
						<tr valign="top">
62
							<td><p class="regtext">You are currently logged in.</p></td>
63
							<td align="right">
64
								<input name="action" type="submit" value="Logout" class="button_login" />
65
							</td>
66
						</tr>
67
						<tr valign="top">
68
							<td colspan="2"><p class="regtext">(<xsl:value-of select="login/message"/>)</p></td>
69
						</tr>	
70
						<tr>	
71
							<td colspan="2" class="regtext" align="center" valign="top">				
72
								<!-- reset pass --> 
73
								<a href="{$userManagementURL}" target="_parent">
74
									reset your password
75
								</a>
76
								|
77
								<!-- change pass --> 
78
								<a href="{$userManagementURL}" target="_parent">
79
									change your password
80
								</a>
81
							</td>
82
						</tr>
83
					</table>
84
				</form>
85
				
86
				<!-- File Upload Form --> 
87
				<br/>		
88
				<h3>Data Package Upload</h3>
89
				
90
				<table width="100%">
91
					<tr valign="top">
92
						<td align="right">
93
							<form method="post" action="{$contextURL}/style/skins/sanparks/upload.jsp">
94
								<input type="submit" value="Go >" class="button_login" />
95
							</form>
96
						</td>
97
					</tr>
98
				</table>
99
			</xsl:otherwise>
100
		</xsl:choose>		
101
	</xsl:when>
102
  	<xsl:otherwise>
103
		<h3>Login
104
		<a href="{$userManagementURL}" target="_new">
105
			<span class="regtext"> (request an account...)</span>
106
		</a>
107
		</h3>
108
		<form name="loginForm" id="loginForm" method="post" onsubmit="submitLoginFormIntoDivAndReload('{$servletURL}', this, 'loginSection'); return false;">
109
			<input name="qformat" type="hidden" value="sanparks" />
110
			<input name="action" type="hidden" value="login"/>
111
			<table>
112
				<tr valign="top">
113
					<td><span class="required">User name</span></td>
114
					<td><input name="shortusername" type="text" value="" style="width: 140" /></td>
115
					<td><input name="username" type="hidden" value="" /></td>
116
					
117
				</tr>
118
				<tr>
119
					<td><span class="required">Organization</span></td>
120
					<td><select name="organization" style="width: 140">
121
						<option value="SANParks" selected="">SANParks</option>
122
						<option value="SAEON">SAEON</option>
123
						<option value="NCEAS">NCEAS</option>
124
						<option value="unaffiliated">unaffiliated</option>
125
						</select></td>
126
				</tr>
127
				<tr>
128
					<td><span class="required">Password</span></td>
129
					<td><input name="password" value="" type="password"
130
						style="width: 140" maxlength="50" /></td>
131
				</tr>
132
				<tr>
133
					<td colspan="2" align="center">
134
						<input name="action" value="login" type="submit" class="button_login" />
135
					</td>
136
				</tr>
137
			</table>
138
		</form>
139
		
140
		<!-- File Upload Form --> 
141
		<br/>		
142
		<h3>Data Package Upload</h3>
143
		<p class="regtext">You must be logged into your user account before uploading a data set.</p>
144
		
145
	</xsl:otherwise>
146

    
147
	</xsl:choose>
148
  </xsl:template>
149
</xsl:stylesheet>
150

    
(23-23/36)