source: greenstone3/trunk/web/interfaces/classic/transform/authen.xsl@ 14413

Last change on this file since 14413 was 14413, checked in by qq6, 14 years ago

authentication interface

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