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