source: greenstone3/trunk/web/interfaces/default/transform/authen.xsl@ 14357

Last change on this file since 14357 was 14357, checked in by qq6, 17 years ago

fixed a bug

File size: 30.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 extension-element-prefixes="java util"
7 exclude-result-prefixes="java util">
8
9 <xsl:include href="style.xsl"/>
10 <xsl:include href="service-params.xsl"/>
11
12 <xsl:output method="html"/>
13
14 <xsl:param name="library_name"/>
15
16 <xsl:template name="pageTitle">
17 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.authentication')"/>
18 </xsl:template>
19
20 <xsl:template name="pageStyle"/>
21
22 <xsl:template match="page">
23 <html>
24 <xsl:call-template name="pageHead" />
25 <xsl:call-template name="addGroup" />
26 <xsl:call-template name="loadGroup" />
27 <xsl:call-template name="trans" />
28 <body onLoad="loadGroup()" >
29 <div id="globalwrapper">
30 <xsl:variable name="authen_service" select="/page/pageRequest/paramList/param[@name='s']/@value"/>
31 <xsl:variable name="sub_action" select="/page/pageRequest/@subaction"/>
32 <xsl:variable name="asn_param" select ="/page/pageRequest/paramList/param[@name='s1.asn']/@value"/>
33 <xsl:variable name="uan" select ="/page/pageRequest/paramList/param[@name='s1.uan']/@value"/>
34 <xsl:variable name="pro_action" select ="/page/pageResponse/authenticationNode/service/@aup"/>
35 <xsl:variable name="au_node" select ="/page/pageResponse/authenticationNode"/>
36 <xsl:variable name="asn" select ="/page/pageResponse/authenticationNode/service/@asn"/>
37 <xsl:variable name="info" select ="/page/pageResponse/authenticationNode/service/@info"/>
38 <xsl:variable name="err" select ="/page/pageResponse/authenticationNode/service/@err"/>
39 <xsl:variable name="rt" select="/page/pageRequest/paramList/param[@name='rt']/@value"/>
40 <xsl:variable name="un_s" select="/page/pageResponse/authenticationNode/service/@un"/>
41 <xsl:variable name="pw_s" select="/page/pageResponse/authenticationNode/service/@pw"/>
42
43 <div id="title" align="left" >
44 <table align="left" border="0" width="100%">
45 <tr align="left">
46 <td><h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.authentication')"/></h2></td>
47 <td><xsl:if test="$un_s!=''">
48 <xsl:if test="$asn!='' and $asn!='0'">
49 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/> : <xsl:value-of select="$un_s"/>
50 </xsl:if>
51 </xsl:if></td>
52 </tr>
53 </table>
54 </div>
55
56 <div id="navbar">
57 <ul id="navbarlist">
58 <!--greenstone home-->
59 <li><a href="{$library_name}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.greenstone_home')"/></a></li>
60
61 <!--list users-->
62 <li>
63 <xsl:choose>
64 <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
65 <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=ListUsers&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_users')"/></a>
66 </xsl:when>
67 <xsl:otherwise>
68 <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_users')"/></a>
69 </xsl:otherwise>
70 </xsl:choose></li>
71
72 <!--add a new user-->
73 <li>
74 <xsl:choose>
75 <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
76 <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=AddUser&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw=&amp;s1.umun=&amp;s1.umpw=&amp;s1.umgp=&amp;s1.umas=&amp;s1.umc="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user')"/></a>
77 </xsl:when>
78 <xsl:otherwise>
79 <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user')"/></a>
80 </xsl:otherwise>
81 </xsl:choose>
82 </li>
83
84 <!-- change password-->
85 <li>
86 <xsl:choose>
87 <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
88 <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=ModifyPassword&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw=&amp;s1.umpw1=&amp;s1.umpw2=&amp;s1.umpw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/></a>
89 </xsl:when>
90 <xsl:otherwise>
91 <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/></a>
92 </xsl:otherwise>
93 </xsl:choose>
94 </li>
95
96 <li>
97 <xsl:choose>
98 <xsl:when test="$un_s!='' and $asn!='' and $asn!='0'">
99 <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login&amp;s1.un=&amp;s1.pw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.logout')"/></a>
100 </xsl:when>
101 <xsl:otherwise>
102 <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login')"/></a>
103 </xsl:otherwise>
104 </xsl:choose>
105 </li>
106 </ul>
107 </div>
108
109 <table align="left" border="0" width="100%">
110 <tr>
111 <td>
112 <div id="content" align="center">
113 <!-- login -->
114 <xsl:if test="$pro_action='Login'">
115 <xsl:choose>
116 <xsl:when test="$asn!='' and $asn!='0'">
117 <p align="left"> <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_successfully')"/></p>
118 </xsl:when>
119 <xsl:otherwise>
120
121 <p align="left">
122 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_3')"/><br/></p>
123 <xsl:if test="$err='un-pw-err'">
124 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.wrong_password_warning')"/></font></p>
125 </xsl:if>
126 <xsl:if test="$err='no-permission' and $info='Login'">
127 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
128 </xsl:if>
129 <xsl:if test="$err='as-false'">
130 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status_false')"/></font></p>
131 </xsl:if>
132 <xsl:call-template name="login">
133 <xsl:with-param name="sub_action" select="$sub_action"/>
134 <xsl:with-param name="authen_service" select="$authen_service"/>
135 <xsl:with-param name="pro_action" select="$pro_action"/>
136 </xsl:call-template>
137
138 </xsl:otherwise>
139 </xsl:choose>
140 </xsl:if>
141
142 <!-- list users-->
143 <xsl:if test="$pro_action='ListUsers'">
144
145 <xsl:if test="$asn='1' and $info='all-un'">
146 <xsl:call-template name="listusers" >
147 </xsl:call-template>
148 </xsl:if>
149
150 <xsl:if test="$info='Login'">
151 <p align="left">
152 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_2')"/><br/></p>
153 <xsl:if test="$err='no-permission' and $info='Login'">
154 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
155 </xsl:if>
156 </xsl:if>
157 </xsl:if>
158
159 <!-- add a new user-->
160 <xsl:if test="$pro_action='AddUser'">
161 <xsl:if test="$err!='' and $err!='no-permission' and $err!='un-exist'">
162 <p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
163 </xsl:if>
164
165 <xsl:if test="$asn!='1'">
166 <p align="left">
167 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_2')"/><br/>
168 </p>
169 <xsl:if test="$err='no-permission'">
170 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
171 </xsl:if>
172 </xsl:if>
173
174 <xsl:if test="count(/page/pageResponse/authenticationNode/service/userNodeList) = 1">
175 <xsl:call-template name="listusers" >
176 </xsl:call-template>
177 </xsl:if>
178
179 <xsl:if test="$info='adduser_interface'">
180 <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user_title')"/></h2>
181 <xsl:if test="$err='pw-err'">
182 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_err')"/></font></p>
183 </xsl:if>
184 <xsl:if test="$err='un-err'">
185 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.unsername_err')"/></font></p>
186 </xsl:if>
187 <xsl:if test="$err='un-exist'">
188 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_has_existed')"/></font></p>
189 </xsl:if>
190 <xsl:call-template name="edituser" >
191 <xsl:with-param name="sub_action" select="$sub_action"/>
192 <xsl:with-param name="authen_service" select="$authen_service"/>
193 <xsl:with-param name="pro_action" select="$pro_action"/>
194 <xsl:with-param name="umun_s" />
195 <xsl:with-param name="umpw_s" />
196 <xsl:with-param name="umas_s" />
197 <xsl:with-param name="umgp_s" />
198 <xsl:with-param name="umc_s" />
199 <xsl:with-param name="oumun_s" />
200 <xsl:with-param name="un_s" select="$un_s"/>
201 <xsl:with-param name="pw_s" select="$pw_s"/>
202 <xsl:with-param name="asn" select="$asn"/>
203 </xsl:call-template>
204
205 </xsl:if>
206 </xsl:if>
207
208 <!-- modify the passwrod of a user-->
209 <xsl:if test="$pro_action='ModifyPassword'">
210
211 <xsl:if test="$err!='' and $err!='umpw1-err' and $err!='umpw2-err' and $err!='pw-umpw-nm-err' and $err!='umpw-null-err' and $err!='umpw1-umpw2-nm-err' and $err!='umpw1-umpw2-null-err'"><p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
212 </xsl:if>
213
214 <xsl:if test="$err=''">
215 <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_title')"/></h2>
216 <p align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_successed_content')"/></p>
217 </xsl:if>
218
219 <xsl:if test="$asn!='0' and $info='modify_interface'">
220 <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_title')"/></h2>
221 <p align="left"><font color="grey"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_describe_line_1')"/></font></p>
222
223 <xsl:if test="$err='umpw1-err'">
224 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.new_password_invalid')"/></font></p>
225 </xsl:if>
226 <xsl:if test="$err='umpw2-err'">
227 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retyped_password_invalid')"/></font></p>
228 </xsl:if>
229 <xsl:if test="$err='pw-umpw-nm-err' or $err='umpw-null-err'">
230 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.old_password_warning')"/></font></p>
231 </xsl:if>
232 <xsl:if test="$err='umpw1-umpw2-nm-err'">
233 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.two_password_not_match')"/></font></p>
234 </xsl:if>
235 <xsl:if test="$err='umpw1-umpw2-null-err'">
236 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_empty_warning')"/></font></p>
237 </xsl:if>
238
239 <xsl:call-template name="modifypassword">
240 <xsl:with-param name="sub_action" select="$sub_action"/>
241 <xsl:with-param name="authen_service" select="$authen_service"/>
242 <xsl:with-param name="pro_action" select="$pro_action"/>
243 <xsl:with-param name="un_s" select="$un_s"/>
244 <xsl:with-param name="pw_s" select="$pw_s"/>
245 <xsl:with-param name="asn" select="$asn"/>
246 </xsl:call-template>
247 </xsl:if>
248 </xsl:if>
249
250 <!-- delete a user -->
251 <xsl:if test="$pro_action='DeleteUser'">
252 <xsl:if test="$err!=''">
253 <p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
254 </xsl:if>
255
256 <xsl:if test="$info='confirm'">
257 <xsl:call-template name="deleteuser">
258 <xsl:with-param name="sub_action" select="$sub_action"/>
259 <xsl:with-param name="authen_service" select="$authen_service"/>
260 <xsl:with-param name="pro_action" select="$pro_action"/>
261 <xsl:with-param name="un_s" select="$un_s"/>
262 <xsl:with-param name="umun_s" select="/page/pageResponse/authenticationNode/service/@umun"/>
263 <xsl:with-param name="asn" select="$asn"/>
264 </xsl:call-template>
265 </xsl:if>
266 <xsl:if test="count(/page/pageResponse/authenticationNode/service/userNodeList) = 1">
267 <xsl:call-template name="listusers" >
268 </xsl:call-template>
269 </xsl:if>
270 </xsl:if>
271
272 <!-- edit the user's info -->
273 <xsl:if test="$pro_action='EditUser'">
274 <xsl:if test="$err!='' and $err!='umpw-err' and $err!='umun-err' and $err!='ini-umpw-err' and $err!='un-exist'">
275 <p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
276 </xsl:if>
277
278 <xsl:if test="$info='edituser-interface'">
279 <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.edit_user_information')"/></h2>
280 <xsl:if test="$err='umpw-err'">
281 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_err')"/></font></p>
282 </xsl:if>
283 <xsl:if test="$err='umun-err'">
284 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.unsername_err')"/></font></p>
285 </xsl:if>
286 <xsl:if test="$err='ini-umpw-err'">
287 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_initial')"/></font></p>
288 </xsl:if>
289 <xsl:if test="$err='un-exist'">
290 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_has_existed')"/></font></p>
291 </xsl:if>
292 <xsl:call-template name="edituser" >
293 <xsl:with-param name="sub_action" select="$sub_action"/>
294 <xsl:with-param name="authen_service" select="$authen_service"/>
295 <xsl:with-param name="pro_action" select="$pro_action"/>
296 <xsl:with-param name="umun_s" select="/page/pageResponse/authenticationNode/service/@umun"/>
297 <xsl:with-param name="umpw_s" select="/page/pageResponse/authenticationNode/service/@umpw"/>
298 <xsl:with-param name="umas_s" select="/page/pageResponse/authenticationNode/service/@umas"/>
299 <xsl:with-param name="umgp_s" select="/page/pageResponse/authenticationNode/service/@umgp"/>
300 <xsl:with-param name="umc_s" select="/page/pageResponse/authenticationNode/service/@umc"/>
301 <xsl:with-param name="oumun_s" select="/page/pageResponse/authenticationNode/service/@oumun"/>
302 <xsl:with-param name="un_s" select="$un_s"/>
303 <xsl:with-param name="pw_s" select="$pw_s"/>
304 <xsl:with-param name="asn" select="$asn"/>
305 </xsl:call-template>
306 </xsl:if>
307 <xsl:if test="$info='all-un'">
308 <xsl:if test="count(/page/pageResponse/authenticationNode/service/userNodeList) = 1">
309 <xsl:call-template name="listusers" >
310 </xsl:call-template>
311 </xsl:if>
312 </xsl:if>
313 </xsl:if>
314
315 </div>
316 </td>
317 </tr>
318 </table>
319
320 <xsl:call-template name="greenstoneFooter" />
321
322 </div>
323 </body>
324 </html>
325 </xsl:template>
326
327 <!--template name="login"-->
328 <xsl:template name="login">
329 <xsl:param name="sub_action"/>
330 <xsl:param name="authen_service"/>
331 <xsl:param name="pro_action"/>
332 <div>
333 <form id="LoginForm" method="get" action="{$library_name}">
334 <input type='hidden' name='a' value='g'/>
335 <input type='hidden' name='sa' value='{$sub_action}'/>
336 <input type='hidden' name='s' value='{$authen_service}'/>
337 <input type='hidden' name='rt' value='r'/>
338 <input type='hidden' name='s1.asn' value='0'/>
339 <input type='hidden' name='s1.uan' value='1'/>
340 <input type='hidden' name='s1.aup' value='{$pro_action}'/>
341 <input type='hidden' name='s1.umpw1' value=''/>
342 <input type='hidden' name='s1.umpw2' value=''/>
343 <input type='hidden' name='s1.umc' value=''/>
344 <input type='hidden' name='s1.umgp' value=''/>
345 <input type='hidden' name='s1.umun' value=''/>
346 <input type='hidden' name='s1.umpw' value=''/>
347 <input type='hidden' name='s1.umas' value=''/>
348
349 <table align="center">
350 <tr>
351 <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></td><td><input type="string" name="s1.un" size="10" value=""/></td><td></td>
352 </tr>
353 <tr>
354 <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/></td><td><input type="password" name="s1.pw" size="10" value=""/></td><td>
355 <input type="submit" value="submit"></input></td>
356 </tr>
357 </table>
358 </form>
359 </div>
360 </xsl:template>
361
362 <!--template name="listusers"-->
363 <xsl:template name="listusers" >
364 <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_of_current_users_title')"/></h2>
365
366 <table id='mainTable' align="left" border="0" cellspacing="1" cellpadding="3" width="100%" >
367 <tr>
368 <th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></th>
369 <th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status')"/></th>
370 <th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/></th>
371 <th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/></th>
372 <th bgcolor="#d0d0d0"></th>
373 </tr>
374 <xsl:for-each select="/page/pageResponse/authenticationNode/service/userNodeList/userNode">
375 <tr>
376 <td bgcolor="#eeeeee"><xsl:value-of select="@umun"/></td>
377 <td bgcolor="#eeeeee"><xsl:value-of select="@umas"/></td>
378 <td bgcolor="#eeeeee"><xsl:value-of select="@umgp"/></td>
379 <td bgcolor="#eeeeee"><xsl:value-of select="@umc"/></td>
380 <td bgcolor="#eeeeee">
381 <form name="ListUsersForm" method="get" action="{$library_name}">
382 <input type='hidden' name='a' value='g'/>
383 <input type='hidden' name='sa' value='authen'/>
384 <input type='hidden' name='s' value='Authentication'/>
385 <input type='hidden' name='rt' value='r'/>
386 <input type='hidden' name='s1.asn' value='1'/>
387 <input type='hidden' name='s1.uan' value='1'/>
388
389 <input type='hidden'><xsl:attribute name="name">s1.oumun</xsl:attribute><xsl:attribute name="value"><xsl:value-of select="@umun"/></xsl:attribute></input>
390 <input type='hidden'><xsl:attribute name="name">s1.umun</xsl:attribute><xsl:attribute name="value"><xsl:value-of select="@umun"/></xsl:attribute></input>
391 <input type='hidden' name='s1.cm' value=''/>
392
393 <input type="submit"><xsl:attribute name="name">s1.aup</xsl:attribute><xsl:attribute name="value">EditUser</xsl:attribute></input>
394 <input type="submit"><xsl:attribute name="name">s1.aup</xsl:attribute><xsl:attribute name="value">DeleteUser</xsl:attribute></input>
395 </form>
396 </td>
397 </tr>
398 </xsl:for-each>
399 </table><script type="text/javascript"><xsl:text disable-output-escaping="yes">trans();</xsl:text></script>
400 </xsl:template>
401
402 <!--template name="modifypassword"-->
403 <xsl:template name="modifypassword" >
404 <xsl:param name="sub_action"/>
405 <xsl:param name="authen_service"/>
406 <xsl:param name="pro_action"/>
407 <xsl:param name="un_s"/>
408 <xsl:param name="pw_s"/>
409 <xsl:param name="asn"/>
410 <div>
411 <form id="modifyForm" method="get" action="{$library_name}">
412 <input type='hidden' name='a' value='g'/>
413 <input type='hidden' name='sa' value='{$sub_action}'/>
414 <input type='hidden' name='s' value='{$authen_service}'/>
415 <input type='hidden' name='rt' value='r'/>
416 <input type='hidden' name='s1.un' value='{$un_s}'/>
417 <input type='hidden' name='s1.pw' value='{$pw_s}'/>
418 <input type='hidden' name='s1.asn' value='{$asn}'/>
419 <input type='hidden' name='s1.uan' value='1'/>
420 <input type='hidden' name='s1.aup' value='{$pro_action}'/>
421
422 <table align="center"><tr><td align="right">
423 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.old_password')"/></td><td><input type="password" name="s1.umpw" size="10" value=""/></td></tr>
424 <tr><td align="right">
425 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.new_password')"/></td><td><input type="password" name="s1.umpw1" size="10" value=""/></td></tr>
426 <tr><td align="right">
427 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retype_new_password')"/></td><td><input type="password" name="s1.umpw2" size="10" value=""/></td></tr>
428 <tr><td></td><td>
429 <input type="submit" value="submit"></input></td>
430 </tr>
431 </table>
432 </form>
433 </div>
434 </xsl:template>
435
436<!--template name="deleteuser"-->
437 <xsl:template name="deleteuser">
438 <xsl:param name="sub_action"/>
439 <xsl:param name="authen_service"/>
440 <xsl:param name="pro_action"/>
441 <xsl:param name="un_s"/>
442 <xsl:param name="umun_s"/>
443 <xsl:param name="asn"/>
444 <div >
445 <form id="deleteForm" method="get" action="{$library_name}">
446 <input type='hidden' name='a' value='g'/>
447 <input type='hidden' name='sa' value='{$sub_action}'/>
448 <input type='hidden' name='s' value='{$authen_service}'/>
449 <input type='hidden' name='rt' value='r'/>
450 <input type='hidden' name='s1.aup' value='{$pro_action}'/>
451 <input type='hidden' name='s1.asn' value='{$asn}'/>
452 <input type='hidden' name='s1.uan' value='1'/>
453 <input type='hidden' name='s1.umun' value='{$umun_s}'/>
454 <p><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.do_you_really_want_to_permanently_remove_user')"/> <xsl:value-of select="$umun_s"/>" ?</font></p>
455 <input type="submit" value="yes"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
456 <input type="submit" value="no"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
457 </form>
458 </div>
459 </xsl:template>
460
461<!--template name="edituser"-->
462 <xsl:template name="edituser" >
463 <xsl:param name="sub_action"/>
464 <xsl:param name="authen_service"/>
465 <xsl:param name="pro_action"/>
466 <xsl:param name="un_s"/>
467 <xsl:param name="pw_s"/>
468 <xsl:param name="umun_s"/>
469 <xsl:param name="umpw_s"/>
470 <xsl:param name="umas_s"/>
471 <xsl:param name="umgp_s"/>
472 <xsl:param name="umc_s"/>
473 <xsl:param name="oumun_s"/>
474 <xsl:param name="asn"/>
475 <div>
476 <form id="editForm" method="get" action="{$library_name}">
477 <input type='hidden' name='a' value='g'/>
478 <input type='hidden' name='sa' value='{$sub_action}'/>
479 <input type='hidden' name='s' value='{$authen_service}'/>
480 <input type='hidden' name='rt' value='r'/>
481 <input type='hidden' name='s1.asn' value='{$asn}'/>
482 <input type='hidden' name='s1.uan' value='1'/>
483 <input type='hidden' name='s1.aup' value='{$pro_action}'/>
484 <input type='hidden' name='s1.un' value='{$un_s}'/>
485 <input type='hidden' name='s1.pw' value='{$pw_s}'/>
486
487 <table align="left"><tr><td>
488 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></td><td><input type="text" name="s1.umun" size="15" value="{$umun_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username_describe')"/></font></td></tr>
489 <tr><td>
490 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/></td><td><input type="password" name="s1.umpw" size="15" value="{$umpw_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_describe')"/></font></td></tr>
491 <tr><td>
492 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status')"/></td><td>
493 <select name="s1.umas">
494 <xsl:if test="$umas_s=''">
495 <option value="true" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
496 <option value="false"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
497 </xsl:if>
498 <xsl:if test="$umas_s='true'">
499 <option value="true" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
500 <option value="false"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
501 </xsl:if>
502 <xsl:if test="$umas_s='false'">
503 <option value="true"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
504 <option value="false" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
505 </xsl:if>
506 </select></td><td></td></tr>
507 <tr><td>
508 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/></td><td><input type="text" id="group" name="s1.umgp" size="70" value="{$umgp_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups_describe')"/></font></td></tr>
509 <tr>
510 <td></td>
511 <td align="right"> <select name="groups" size="0">
512 </select></td><td><input type="button" name="addGroupButton" value="add" onClick="addGroup()"/></td>
513 </tr>
514 <tr><td>
515 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/></td><td colspan="2"><div><textarea cols="40" rows="5" name="s1.umc"><xsl:value-of select="$umc_s"/>
516
517</textarea></div></td></tr>
518 <tr>
519
520<td></td><td>
521 <input type="submit" value="submit"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
522 <xsl:if test="$pro_action!='AddUser'">
523 <input type="submit" value="cancel"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
524 </xsl:if>
525 </td><td></td></tr>
526 </table>
527 <input type='hidden' name='s1.oumun' value='{$oumun_s}'/>
528 </form>
529 </div>
530 </xsl:template>
531
532<!-- addGroup() javascript -->
533 <xsl:template name="addGroup">
534 <script type="text/javascript">
535 <xsl:text disable-output-escaping="yes">
536 function addGroup(){
537 var itemSelected;
538 var splitGroup;
539 var groupExit;
540
541 if (document.getElementById("editForm")!=null){
542 itemSelected=document.getElementById("editForm").groups.options.selectedIndex;
543 if (document.getElementById("group").value==""){
544 document.getElementById("group").value=document.getElementById("group").value+document.getElementById("editForm").groups.options[itemSelected].text;
545 }else{
546 splitGroup=document.getElementById("group").value.split(",");
547 for (var i=0; i &lt; splitGroup.length; i++){
548 if (splitGroup[i]==document.getElementById("editForm").groups.options[itemSelected].text){
549 alert(document.getElementById("editForm").groups.options[itemSelected].text + " has been added.");
550 groupExit=1;
551 break;
552 }
553 }
554 if (groupExit!=1) {
555 document.getElementById("group").value=document.getElementById("group").value+","+document.getElementById("editForm").groups.options[itemSelected].text;
556 }
557 }
558 document.getElementById("editForm").groups.options[itemSelected]=new Option("",itemSelected);
559 }
560 }
561 </xsl:text>
562 </script>
563 </xsl:template>
564
565<!-- loadGroup() javascript -->
566 <xsl:template name="loadGroup">
567 <script type="text/javascript">
568 <xsl:text disable-output-escaping="yes">
569 function loadGroup(){
570 // three constant group "administrator","all-collections-editor","personal-collections-editor"
571
572 var group_arr=Array("administrator","all-collections-editor","personal-collections-editor");
573 var find;
574
575 if (document.getElementById("editForm")!=null){
576 document.getElementById("editForm").groups.length=3;
577 if (document.getElementById("group").value=="") {
578 for (i=0; i &lt; 3;i++){
579 document.getElementById("editForm").groups.options[i]=new Option(group_arr[i],i);
580 }
581 }else{
582 var group_string=document.getElementById("group").value;
583 var split_group_string=group_string.split(",");
584 for (i=0; i &lt; 3; i++){
585 find=0
586 for (j=0; j &lt; split_group_string.length ; j++){
587 if (split_group_string[j]==group_arr[i]){
588 find=1;
589 //break;
590 }
591 }
592 if (find==0){
593 document.getElementById("editForm").groups.options[i]=new Option(group_arr[i],i);
594 }
595 }
596 }
597 }
598 }
599 </xsl:text>
600 </script>
601 </xsl:template>
602
603<!-- trans() javascript translates "true" to enable, "false" to "disable", splits groups into lines-->
604 <xsl:template name="trans">
605 <script type="text/javascript">
606 <xsl:text disable-output-escaping="yes">
607 function trans(){
608 // trnasform "true" to "enabled", "false" to "disabled" for 'account status', and split one line of groups into several lines
609 if (document.getElementById('mainTable')!=null){
610 var num= document.getElementById('mainTable').getElementsByTagName('tr').length;
611 for (i=1; i &lt; num; i++){
612 if (document.getElementById('mainTable').getElementsByTagName('tr')[i].cells[1].innerHTML=="true"){
613 document.getElementById('mainTable').getElementsByTagName('tr')[i].cells[1].innerHTML="enabled";
614 }
615 if (document.getElementById('mainTable').getElementsByTagName('tr')[i].cells[1].innerHTML=="false"){
616 document.getElementById('mainTable').getElementsByTagName('tr')[i].cells[1].innerHTML="disabled";
617 }
618 var groups=document.getElementById('mainTable').getElementsByTagName('tr')[i].cells[2].innerHTML;
619 var split_groups= groups.split(",");
620 var new_groups="";
621 for (j=0; j &lt; split_groups.length ; j++){
622 new_groups+=split_groups[j]+" &lt;br /&gt; ";
623 }
624 document.getElementById('mainTable').getElementsByTagName('tr')[i].cells[2].innerHTML=new_groups;
625 }
626 }
627 }
628 </xsl:text>
629 </script>
630 </xsl:template>
631
632 <xsl:template name="styleSheet">
633 <link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/>
634 </xsl:template>
635
636</xsl:stylesheet>
637
Note: See TracBrowser for help on using the repository browser.