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

Last change on this file since 14344 was 14344, checked in by qq6, 15 years ago

fixed some error messages

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