alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

<?xml version="1.0" encoding="UTF-8"?>
<!--
 * changepass.xsl is a set of named templates that can be used to display
 * all the prompts needed to change a password in a larger setup page.
 * Each of these templates assumes that it is in a table.  Furthermore, the
 * template that should be called directly is "changepass", and it should
 * get a parameter named "cptmpl" which is the name of the changepass
 * template to use.  It will then call the appropriate template.
 *
 * This file should be included in an xml which uses this functionality via
 * the <xsl:inculde> directive.
 *
 * I don't really like the way this works right now, however, it does work.
 * It feels like there should be a better way to do it.
--> 
<!--
 * Copyright (C) 2000 Devin Kowatch
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:template name="changepass_header">
    <xsl:param name="cptmpl">normchangepass 
    <xsl:param name="verbose">yes
    <xsl:param name="sd"/>

    <xsl:choose>
      
      <!-- a normal password change -->
      <xsl:when test="$cptmpl = 'normchangepass'">
      <!-- do nothing special -->
      </xsl:when>

      <!-- an OTP password change -->
      <xsl:when test="$cptmpl = 'otpchangepass'">
        <xsl:if test="$verbose = 'yes'">
          Enter A new challenge and you password into your OTP generator.
          Then input the result into the Password box below. <BR/>
        </xsl:if>
        New Challenge: 
        <xsl:value-of select='$sd[@name="new challenge"]/@value'/>
      </xsl:when>

    </xsl:choose>
  </xsl:template>

  <xsl:template name="changepass_input">
    <xsl:param name="cptmpl">normchangepass
    <xsl:param name="tag">password
    <xsl:param name="sd"/>
    <xsl:variable name="plen" select="$sd[@name='pass len']/@value"/>

    <xsl:choose>
      <!-- a normal password change box -->
      <xsl:when test="$cptmpl = 'normchangepass'">
        <INPUT TYPE="PASSWORD" NAME="{$tag}" SIZE="{$plen}"/>
      </xsl:when>

      <!-- an OTP password change box -->
      <xsl:when test="$cptmpl = 'otpchangepass'">
        <INPUT TYPE="TEXT" NAME="{$tag}" SIZE="{$plen}"/> 
      </xsl:when>

    </xsl:choose>
  </xsl:template>

</xsl:stylesheet>
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.