提交 1f5fe413 编写于 作者: O Olivier Dagenais

Enhance the current user link in the header.

1 - Link to user's ID, which is properly escaped.
2 - Display user's full name if possible, otherwise their ID.
上级 9b53643c
...@@ -173,8 +173,17 @@ ${h.initPageVariables(context)} ...@@ -173,8 +173,17 @@ ${h.initPageVariables(context)}
<st:nbsp/> <st:nbsp/>
<j:choose> <j:choose>
<j:when test="${!h.isAnonymous()}"> <j:when test="${!h.isAnonymous()}">
<j:set var="user" value="${app.getUser(app.authentication.name)}"/>
<j:choose>
<j:when test="${user.fullName == null || user.fullName.trim().isEmpty()}">
<j:set var="userName" value="${user.id}"/>
</j:when>
<j:otherwise>
<j:set var="userName" value="${user.fullName}"/>
</j:otherwise>
</j:choose>
<span style="white-space:nowrap"> <span style="white-space:nowrap">
<a href="${rootURL}/user/${app.authentication.name}" class="model-link inside"><b>${app.authentication.name}</b></a> <a href="${rootURL}/user/${user.id}" class="model-link inside"><b>${userName}</b></a>
<j:if test="${app.securityRealm.canLogOut()}"> <j:if test="${app.securityRealm.canLogOut()}">
| |
<a href="${rootURL}/logout"><b>${%logout}</b></a> <a href="${rootURL}/logout"><b>${%logout}</b></a>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册