summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2012-10-08 03:45:26 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2012-10-08 04:12:10 +0200
commit36b46912bbd2d5f8e2544f56e536f536a6405f32 (patch)
tree9a3a9e7a45008284f1505568550db899c6a9c7fb
parent859ec82577740e113ebf1f4ae2d89baafcf41075 (diff)
downloadeurephia-36b46912bbd2d5f8e2544f56e536f536a6405f32.tar.gz
eurephia-36b46912bbd2d5f8e2544f56e536f536a6405f32.tar.xz
eurephia-36b46912bbd2d5f8e2544f56e536f536a6405f32.zip
eurephiadm/users: Display remote IP address when displaying the lastlog on a user
In commit 35b61c51435d9f9095ced8949c045d50ac3c7018 the lastlog layout was changed. However, when displaying the lastlog for a particular user (eurephiadm users -s -l) the first column which was set to be username was empty. This patch will put the users remote IP address in the first column instead, while preserving the 'eurephiadm lastlog' layout. Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
-rw-r--r--xslt/eurephiadm/lastlog.xsl36
1 files changed, 31 insertions, 5 deletions
diff --git a/xslt/eurephiadm/lastlog.xsl b/xslt/eurephiadm/lastlog.xsl
index b92f473..0cb1d40 100644
--- a/xslt/eurephiadm/lastlog.xsl
+++ b/xslt/eurephiadm/lastlog.xsl
@@ -20,6 +20,7 @@
*
-->
<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="*"/>
@@ -38,7 +39,21 @@
</xsl:template>
<xsl:template match="lastlog" mode="list">
- <xsl:text> Username Login Logout Status&#10;</xsl:text>
+ <xsl:param name="submode"/>
+
+ <xsl:variable name="firstcol_label">
+ <xsl:choose>
+ <xsl:when test="name(../..) = 'UserAccount'">
+ <xsl:text> Remote IP</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> Username </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:value-of select="$firstcol_label"/>
+ <xsl:text> Login Logout Status&#10;</xsl:text>
<xsl:text>-------------------------------------------------------------------------------&#10;</xsl:text>
<xsl:apply-templates select="session" mode="list"/>
<xsl:text>-------------------------------------------------------------------------------&#10;</xsl:text>
@@ -46,10 +61,21 @@
<xsl:template match="lastlog/session" mode="list">
<xsl:text> </xsl:text>
- <xsl:call-template name="left-align">
- <xsl:with-param name="value" select="username"/>
- <xsl:with-param name="width" select="24"/>
- </xsl:call-template><xsl:text> </xsl:text>
+ <xsl:choose>
+ <xsl:when test="name(../../..) = 'UserAccount'">
+ <xsl:call-template name="left-align">
+ <xsl:with-param name="value" select="connection/remote_host"/>
+ <xsl:with-param name="width" select="24"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="left-align">
+ <xsl:with-param name="value" select="username"/>
+ <xsl:with-param name="width" select="24"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
<xsl:call-template name="left-align">
<xsl:with-param name="value" select="login"/>
<xsl:with-param name="width" select="19"/>