<%@ page contentType="text/html; charset=UTF-8" %> <%-- - - Copyright (C) 2004-2008 Jive Software, 2017-2025 Ignite Realtime Foundation. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> <%@ page import="org.jivesoftware.openfire.PresenceManager, org.jivesoftware.openfire.admin.AdminManager, org.jivesoftware.openfire.group.Group, org.jivesoftware.openfire.user.User, org.jivesoftware.openfire.user.UserManager, org.jivesoftware.openfire.user.UserNotFoundException" errorPage="error.jsp" %> <%@ page import="org.jivesoftware.util.JiveGlobals"%> <%@ page import="org.jivesoftware.util.LocaleUtils"%> <%@ page import="org.jivesoftware.util.ParamUtils"%> <%@ page import="org.jivesoftware.util.StringUtils"%> <%@ page import="org.xmpp.packet.JID"%><%@ page import="org.xmpp.packet.Presence"%> <%@ page import="java.net.URLEncoder" %> <%@ page import="java.util.Collection" %> <%@ page import="java.util.Map" %> <%@ page import="java.nio.charset.StandardCharsets" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib uri="admin" prefix="admin" %> <% // Get parameters // boolean cancel = request.getParameter("cancel") != null; boolean delete = request.getParameter("delete") != null; boolean password = request.getParameter("password") != null; String username = ParamUtils.getParameter(request,"username"); // Handle a cancel if (cancel) { response.sendRedirect("user-summary.jsp"); return; } // Handle a delete if (delete) { response.sendRedirect("user-delete.jsp?username=" + URLEncoder.encode(username, StandardCharsets.UTF_8)); return; } // Handle password change if (password) { response.sendRedirect("user-password.jsp?username=" + URLEncoder.encode(username, StandardCharsets.UTF_8)); return; } // Load the user object User user = null; try { user = webManager.getUserManager().getUser(username); } catch (UserNotFoundException unfe) { } PresenceManager presenceManager = webManager.getPresenceManager(); boolean lockedOut = false; boolean pendingLockOut = false; if (webManager.getLockOutManager().getDisabledStatus(username) != null) { // User is locked out. Check if he is locket out now if (webManager.getLockOutManager().isAccountDisabled(username)) { lockedOut = true; } else { pendingLockOut = true; } } pageContext.setAttribute("username", username); %> <fmt:message key="user.properties.title"/>

<% if (request.getParameter("success") != null) { %> <% } else if (request.getParameter("locksuccess") != null) { %> <% } else if (request.getParameter("unlocksuccess") != null) { %> <% } else if (request.getParameter("editsuccess") != null) { %> <% } else if (user == null) { %> <% } %>
<% if (user == null) { %> <% } else { %> <% } %>
: <%= StringUtils.escapeHTMLTags(JID.unescapeNode(user.getUsername())) %> <% if (lockedOut) { %><fmt:message key='user.properties.locked'/><% } %> <% if (pendingLockOut) { %><fmt:message key='user.properties.locked_set'/><% } %>
: <% if (presenceManager.isAvailable(user)) { Presence presence = presenceManager.getPresence(user); %> <% if (presence.getShow() == null) { %> " alt=""> <% } %> <% if (presence.getShow() == Presence.Show.chat) { %> " alt=""> <% } %> <% if (presence.getShow() == Presence.Show.away) { %> " alt=""> <% } %> <% if (presence.getShow() == Presence.Show.xa) { %> " alt=""> <% } %> <% if (presence.getShow() == Presence.Show.dnd) { %> " alt=""> <% } %> <% } else { %> <fmt:message key="> () <% } %>
: <%= AdminManager.getInstance().isUserAdmin(user.getUsername(), true) ? LocaleUtils.getLocalizedString("global.yes") : LocaleUtils.getLocalizedString("global.no") %>
: <% if ("".equals(user.getName())) { %> <% } else { %> <%= StringUtils.escapeHTMLTags(user.getName()) %> <% } %>
: <% if (user.getEmail() == null) { %> <% } else { %> <%= StringUtils.escapeHTMLTags(user.getEmail()) %> <% } %>  
: <% if (user.getCreationDate() == null) { %> <% } else { %> <%= JiveGlobals.formatDate(user.getCreationDate()) %> <% } %>  
: <% Collection groups = webManager.getGroupManager().getGroups(user); if (groups.isEmpty()) { %> <% } else { int count = 0; for (Group group : groups) { if (count != 0) { out.print(", "); } out.print(StringUtils.escapeHTMLTags(group.getName())); count++; } } %>
<% if (user != null) { %>
<% for(Map.Entry properties : user.getProperties().entrySet()) { %> <% } %>
<%= StringUtils.escapeHTMLTags(properties.getKey()) %>: <%= StringUtils.escapeHTMLTags(properties.getValue()) %>
<% if (!UserManager.getUserProvider().isReadOnly()) { %>

">
<% } %> <% } %>