- Timestamp:
- 2009-01-06T14:26:10+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/trunk/web/interfaces/default/transform/authen.xsl
r17017 r18316 15 15 <!-- the main page layout template is here --> 16 16 <xsl:template match="page"> 17 18 <head>19 20 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->21 <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>22 23 24 25 </head>26 27 28 29 30 31 32 17 <html> 18 <head> 19 <title> 20 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title--> 21 <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text> 22 </title> 23 <xsl:call-template name="globalStyle"/> 24 <xsl:call-template name="pageStyle"/> 25 </head> 26 <body> 27 <div id="globalwrapper"> 28 <xsl:call-template name="response" /> 29 <xsl:call-template name="greenstoneFooter"/> 30 </div> 31 </body> 32 </html> 33 33 </xsl:template> 34 34 … … 66 66 <td><xsl:if test="$un_s!=''"> 67 67 <xsl:if test="$asn!='' and $asn!='0'"> 68 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/> : <xsl:value-of select="$un_s"/>68 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/> : <xsl:value-of select="$un_s"/> 69 69 </xsl:if> 70 70 </xsl:if></td> … … 83 83 <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''"> 84 84 <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="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_users')"/></a> 85 86 87 <a href="{$library_name}?a=g&rt=r&sa=authen&s=Authentication&s1.asn=&s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_users')"/></a>88 89 85 </xsl:when> 86 <xsl:otherwise> 87 <a href="{$library_name}?a=g&rt=r&sa=authen&s=Authentication&s1.asn=&s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_users')"/></a> 88 </xsl:otherwise> 89 </xsl:choose></li> 90 90 91 91 <!--add a new user--> … … 100 100 </xsl:choose> 101 101 </li> 102 102 103 103 <!-- change password--> 104 104 <li> … … 138 138 <xsl:otherwise> 139 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 140 <p align="left"> 141 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_3')"/><br/></p> 142 <xsl:if test="$err='un-pw-err'"> 143 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.wrong_password_warning')"/></font></p> 144 </xsl:if> 145 <xsl:if test="$err='no-permission' and $info='Login'"> 146 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p> 147 </xsl:if> 148 <xsl:if test="$err='as-false'"> 149 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status_false')"/></font></p> 150 </xsl:if> 151 <xsl:call-template name="login"> 152 <xsl:with-param name="sub_action" select="$sub_action"/> 153 <xsl:with-param name="authen_service" select="$authen_service"/> 154 <xsl:with-param name="pro_action" select="$pro_action"/> 155 </xsl:call-template> 156 156 157 157 </xsl:otherwise> 158 </xsl:choose>158 </xsl:choose> 159 159 </xsl:if> 160 160 … … 179 179 <xsl:if test="$pro_action='AddUser'"> 180 180 <xsl:if test="$err!='' and $err!='no-permission' and $err!='un-exist' and $err!='un-err' and $err!='pw-err'"> 181 181 <p align="left"><font color='red'><xsl:value-of select="$err" /></font></p> 182 182 </xsl:if> 183 183 … … 185 185 <p align="left"> 186 186 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_2')"/><br/> 187 </p>187 </p> 188 188 <xsl:if test="$err='no-permission'"> 189 189 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p> … … 204 204 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.unsername_err')"/></font></p> 205 205 </xsl:if> 206 <xsl:if test="$err='un-exist'">206 <xsl:if test="$err='un-exist'"> 207 207 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_has_existed')"/></font></p> 208 208 </xsl:if> … … 306 306 <p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_initial')"/></font></p> 307 307 </xsl:if> 308 308 <xsl:if test="$err='un-exist'"> 309 309 <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_has_existed')"/></font></p> 310 310 </xsl:if> … … 344 344 </xsl:template> 345 345 346 <!--template name="login"-->346 <!--template name="login"--> 347 347 <xsl:template name="login"> 348 348 <xsl:param name="sub_action"/> … … 374 374 <input type="submit" value="submit"></input></td> 375 375 </tr> 376 376 </table> 377 377 </form> 378 378 </div> 379 379 </xsl:template> 380 380 381 <!--template name="listusers"-->381 <!--template name="listusers"--> 382 382 <xsl:template name="listusers" > 383 <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_of_current_users_title')"/></h2>383 <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_of_current_users_title')"/></h2> 384 384 385 385 <table id='mainTable' align="left" border="0" cellspacing="1" cellpadding="3" width="100%" > … … 392 392 </tr> 393 393 <xsl:for-each select="/page/pageResponse/authenticationNode/service/userNodeList/userNode"> 394 395 <td bgcolor="#eeeeee"><xsl:value-of select="@umun"/></td>396 <td id="status" bgcolor="#eeeeee">394 <tr> 395 <td bgcolor="#eeeeee"><xsl:value-of select="@umun"/></td> 396 <td id="status" bgcolor="#eeeeee"> 397 397 <script type="text/javascript"> 398 398 <xsl:text disable-output-escaping="yes"> 399 399 var status="</xsl:text><xsl:value-of select="@umas"/><xsl:text disable-output-escaping="yes">"; 400 400 if (status=="true"){ 401 401 document.getElementById("status").innerHTML="enabled"; 402 402 } 403 403 if (status=="false"){ 404 404 document.getElementById("status").innerHTML="disabled"; 405 405 } 406 406 </xsl:text> 407 407 </script> 408 408 </td> 409 <td id="group" bgcolor="#eeeeee">410 409 <td id="group" bgcolor="#eeeeee"> 410 <script type="text/javascript"> 411 411 <xsl:text disable-output-escaping="yes"> 412 412 var groups="</xsl:text><xsl:value-of select="@umgp"/><xsl:text disable-output-escaping="yes">"; … … 414 414 var new_groups=""; 415 415 for (j=0; j < split_groups.length ; j++){ 416 417 418 416 new_groups+=split_groups[j]+" <br /> "; 417 } 418 document.getElementById('group').innerHTML=new_groups; 419 419 </xsl:text> 420 420 </script> 421 421 </td> 422 <td bgcolor="#eeeeee"><xsl:value-of select="@umc"/></td>423 <td bgcolor="#eeeeee">422 <td bgcolor="#eeeeee"><xsl:value-of select="@umc"/></td> 423 <td bgcolor="#eeeeee"> 424 424 <form name="ListUsersForm" method="get" action="{$library_name}"> 425 425 <input type='hidden' name='a' value='g'/> … … 437 437 <input type="submit"><xsl:attribute name="name">s1.aup</xsl:attribute><xsl:attribute name="value">DeleteUser</xsl:attribute></input> 438 438 </form> 439 </td>439 </td> 440 440 </tr> 441 441 </xsl:for-each> 442 442 </table> 443 443 </xsl:template> 444 444 445 <!--template name="modifypassword"-->446 <xsl:template name="modifypassword" >445 <!--template name="modifypassword"--> 446 <xsl:template name="modifypassword" > 447 447 <xsl:param name="sub_action"/> 448 448 <xsl:param name="authen_service"/> … … 464 464 465 465 <table align="center"><tr><td align="right"> 466 <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>466 <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> 467 467 <tr><td align="right"> 468 <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>468 <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> 469 469 <tr><td align="right"> 470 <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>470 <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> 471 471 <tr><td></td><td> 472 <input type="submit" value="submit"></input></td>473 474 475 476 477 </xsl:template> 478 479 <!--template name="deleteuser"-->472 <input type="submit" value="submit"></input></td> 473 </tr> 474 </table> 475 </form> 476 </div> 477 </xsl:template> 478 479 <!--template name="deleteuser"--> 480 480 <xsl:template name="deleteuser"> 481 481 <xsl:param name="sub_action"/> … … 502 502 </xsl:template> 503 503 504 <!--template name="edituser"-->504 <!--template name="edituser"--> 505 505 <xsl:template name="edituser" > 506 506 <xsl:param name="sub_action"/> … … 554 554 <td align="right"> <select id="groups" size="0"> 555 555 <script type="text/javascript"> 556 556 <xsl:text disable-output-escaping="yes"> 557 557 var group_arr=Array("administrator","all-collections-editor","personal-collections-editor"); 558 558 var group_string=document.getElementById("group").value; … … 560 560 var find=0; 561 561 for (i=0; i < group_arr.length; i++){ 562 563 564 565 566 567 568 569 570 571 572 573 562 find=0; 563 for (j=0; j < group_arr.length; j++){ 564 if (split_group_string[j]==group_arr[i]){ 565 find=1; 566 } 567 } 568 if (find==0){ 569 op = document.createElement('option'); 570 op.innerHTML = group_arr[i]; 571 op.setAttribute("value", group_arr[i]); 572 document.getElementById("groups").appendChild(op); 573 } 574 574 } 575 575 576 576 </xsl:text> 577 577 </script> … … 590 590 var find=0; 591 591 for (i=0; i < split_group_string.length; i++){ 592 593 594 592 if (split_group_string[i]==group){ 593 find=1; 594 } 595 595 } 596 596 if (find==0){ 597 598 599 600 597 op = document.createElement('option'); 598 op.innerHTML = group; 599 op.setAttribute("value", group); 600 document.getElementById("collects").appendChild(op); 601 601 } 602 602 </xsl:text> 603 603 </script> 604 604 </xsl:for-each> 605 605 </select> 606 606 </td> … … 610 610 <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"/> 611 611 612 </textarea></div></td></tr>612 </textarea></div></td></tr> 613 613 <tr> 614 614 615 <td></td><td>615 <td></td><td> 616 616 <input type="submit" value="submit"><xsl:attribute name="name">s1.cm</xsl:attribute></input> 617 618 619 617 <xsl:if test="$pro_action!='AddUser'"> 618 <input type="submit" value="cancel"><xsl:attribute name="name">s1.cm</xsl:attribute></input> 619 </xsl:if> 620 620 </td><td></td></tr> 621 621 </table> … … 625 625 </xsl:template> 626 626 627 <!-- addGroup() javascript -->627 <!-- addGroup() javascript --> 628 628 <xsl:template name="addGroup"> 629 629 <script type="text/javascript"> 630 630 <xsl:text disable-output-escaping="yes"> 631 631 function addGroup(g){ 632 633 634 635 636 if (document.getElementById("editForm")!=null){632 var itemSelected; 633 var splitGroup; 634 var groupExit; 635 636 if (document.getElementById("editForm")!=null){ 637 637 //itemSelected=document.getElementById("editForm").groups.options.selectedIndex; 638 638 itemSelected=document.getElementById(g).options.selectedIndex; 639 639 if (document.getElementById(g).options[itemSelected].text!=""){ 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 }657 }640 if (document.getElementById("group").value==""){ 641 document.getElementById("group").value=document.getElementById("group").value+document.getElementById(g).options[itemSelected].text; 642 }else{ 643 splitGroup=document.getElementById("group").value.split(","); 644 for (var i=0; i < splitGroup.length; i++){ 645 if (splitGroup[i]==document.getElementById(g).options[itemSelected].text){ 646 alert(document.getElementById(g).options[itemSelected].text + " has been added."); 647 groupExit=1; 648 break; 649 } 650 } 651 if (groupExit!=1) { 652 document.getElementById("group").value=document.getElementById("group").value+","+document.getElementById(g).options[itemSelected].text; 653 } 654 } 655 document.getElementById(g).options[itemSelected]=new Option("",itemSelected); 656 } 657 } 658 658 } 659 659 </xsl:text>
Note:
See TracChangeset
for help on using the changeset viewer.