summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-04-01 00:14:24 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-04-01 00:14:24 +0200
commite4a21814a495cc13f812c37c7d485d9c4c0888b0 (patch)
treea0a21e024b1d0f999a40ad1d2c32e008d8f08cbb /xslt
parentafdfa16296a9879c6c8fa1e0b8aebe8d1cddc2d6 (diff)
downloadeurephia-e4a21814a495cc13f812c37c7d485d9c4c0888b0.tar.gz
eurephia-e4a21814a495cc13f812c37c7d485d9c4c0888b0.tar.xz
eurephia-e4a21814a495cc13f812c37c7d485d9c4c0888b0.zip
Rewrote eurephiadm/usercerts to use XSLT for listing
Diffstat (limited to 'xslt')
-rw-r--r--xslt/eurephiadm/usercerts.xsl105
1 files changed, 105 insertions, 0 deletions
diff --git a/xslt/eurephiadm/usercerts.xsl b/xslt/eurephiadm/usercerts.xsl
new file mode 100644
index 0000000..38ea6fd
--- /dev/null
+++ b/xslt/eurephiadm/usercerts.xsl
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<!--
+ *
+ * GPLv2 only - Copyright (C) 2009
+ * David Sommerseth <dazo@users.sourceforge.net>
+ *
+ * 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; version 2
+ * of the License.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="text" encoding="UTF-8"/>
+ <xsl:strip-space elements="*"/>
+
+ <xsl:template match="/eurephia">
+ <xsl:apply-templates select="usercerts_links"/>
+ </xsl:template>
+
+ <xsl:template match="/eurephia/usercerts_links">
+ <xsl:text> UICID - Registered&#10;</xsl:text>
+ <xsl:text> U: [uid] Username&#10;</xsl:text>
+ <xsl:text> C: [certid] Common name/Organisation (cert.depth)&#10;</xsl:text>
+ <xsl:if test="$firewall = '1'">
+ <xsl:text> A: [accessprofile] Access profile name&#10;</xsl:text>
+ </xsl:if>
+ <xsl:text> ------------------------------------------------------------------------------&#10;</xsl:text>
+ <xsl:apply-templates select="usercert_link"/>
+ <xsl:text> ------------------------------------------------------------------------------&#10;</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="/eurephia/usercerts_links/usercert_link">
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="right-align">
+ <xsl:with-param name="value" select="@uicid"/>
+ <xsl:with-param name="width" select="5"/>
+ </xsl:call-template>
+ <xsl:text> - </xsl:text>
+ <xsl:value-of select="@registered"/>
+ <xsl:text>&#10; U: [</xsl:text>
+
+ <xsl:call-template name="right-align">
+ <xsl:with-param name="value" select="username/@uid"/>
+ <xsl:with-param name="width" select="3"/>
+ </xsl:call-template>
+ <xsl:text>] </xsl:text>
+ <xsl:choose>
+ <xsl:when test="username != ''"><xsl:value-of select="username"/></xsl:when>
+ <xsl:otherwise>(Unknown user account)</xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>&#10; C: [</xsl:text>
+
+ <xsl:call-template name="right-align">
+ <xsl:with-param name="value" select="certificate/@certid"/>
+ <xsl:with-param name="width" select="3"/>
+ </xsl:call-template>
+ <xsl:text>] </xsl:text>
+ <xsl:choose>
+ <xsl:when test="certificate/@depth != ''">
+ <xsl:value-of select="concat(certificate/common_name,'/',certificate/organisation, ' (',certificate/@depth,')')"/>
+ </xsl:when>
+ <xsl:otherwise>(Unknown certificate)</xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>&#10;</xsl:text>
+
+ <xsl:if test="$firewall = '1'">
+ <xsl:text> A: [</xsl:text>
+ <xsl:call-template name="right-align">
+ <xsl:with-param name="value" select="access_profile/@accessprofile"/>
+ <xsl:with-param name="width" select="3"/>
+ </xsl:call-template>
+ <xsl:text>] </xsl:text>
+ <xsl:value-of select="access_profile"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:if>
+
+ <xsl:if test="last() > position()">
+ <xsl:text>&#10;</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+
+ <xsl:template name="left-align">
+ <xsl:param name="value"/>
+ <xsl:param name="width"/>
+ <xsl:value-of select="substring(concat($value, ' '), 1, $width)"/>
+ </xsl:template>
+
+ <xsl:template name="right-align">
+ <xsl:param name="value"/>
+ <xsl:param name="width"/>
+ <xsl:value-of select="concat(substring(' ', 1, $width - string-length($value)), $value)"/>
+ </xsl:template>
+
+</xsl:stylesheet>