web.userprofile.edit.jsp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.wso2.carbon.identity.user.profile.ui Show documentation
Show all versions of org.wso2.carbon.identity.user.profile.ui Show documentation
This is the core module of the project.
The newest version!
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"
prefix="carbon" %>
<%@page import="org.apache.axis2.context.ConfigurationContext" %>
<%@page import="org.wso2.carbon.CarbonConstants" %>
<%@page import="org.wso2.carbon.identity.user.profile.stub.types.UserFieldDTO" %>
<%@page import="org.wso2.carbon.identity.user.profile.stub.types.UserProfileDTO" %>
<%@page import="org.wso2.carbon.identity.user.profile.ui.client.UserProfileCient" %>
<%@page import="org.wso2.carbon.ui.CarbonUIMessage" %>
<%@page import="org.wso2.carbon.ui.CarbonUIUtil" %>
<%@page import="org.wso2.carbon.user.mgt.ui.Util" %>
<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
<%@page import="java.net.URLEncoder" %>
<%!
private static final String ACCOUNT_LOCKED_CLAIM_URI = "http://wso2.org/claims/identity/accountLocked";
private static final String ACCOUNT_DISABLED_CLAIM_URI = "http://wso2.org/claims/identity/accountDisabled";
%>
<%@ page import="java.util.ResourceBundle" %>
<%@ page import="org.owasp.encoder.Encode" %>
<%@ page import="org.wso2.carbon.identity.user.profile.ui.client.UserProfileUIUtil" %>
<%@ page import="org.wso2.carbon.identity.user.profile.ui.client.UserProfileUIException" %>
<%
boolean readOnlyUserStore = false;
String profile = request.getParameter("profile");
String fromUserMgt = request.getParameter("fromUserMgt");
String noOfProfiles = request.getParameter("noOfProfiles");
String ACCOUNT_DISABLED = "http://wso2.org/claims/identity/accountDisabled";
String currentUser = (String) session.getAttribute("logged-user");
String encryptedUsername = request.getParameter("username");
String decryptedUsername = null;
boolean isLockable = true;
if (noOfProfiles == null) {
noOfProfiles = "0";
}
if (fromUserMgt == null) fromUserMgt = "false";
UserProfileDTO userProfile = null;
UserFieldDTO[] userFields = null;
String forwardTo = null;
String[] profileConfigs = null;
String BUNDLE = "org.wso2.carbon.identity.user.profile.ui.i18n.Resources";
ResourceBundle resourceBundle = ResourceBundle.getBundle(BUNDLE, request.getLocale());
try {
if (encryptedUsername != null) {
decryptedUsername = UserProfileUIUtil.getDecryptedUsername(encryptedUsername);
}
String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(),
session);
ConfigurationContext configContext = (ConfigurationContext) config
.getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
UserProfileCient client = new UserProfileCient(cookie, backendServerURL,
configContext);
userProfile = client.getUserProfile(decryptedUsername, profile);
if ("readonly".equals(userProfile.getProfileConifuration())){
readOnlyUserStore = true;
}
if (userProfile != null) {
userFields = client.getOrderedUserFields(userProfile.getFieldValues());
profileConfigs = userProfile.getProfileConfigurations();
}
isLockable = UserProfileUIUtil.isAccountLockable(decryptedUsername);
} catch (Exception e) {
String message = resourceBundle.getString("error.while.loading.user.profile.data");
CarbonUIMessage.sendCarbonUIMessage(message, CarbonUIMessage.ERROR, request);
forwardTo = "../admin/error.jsp";
}
%>
<%
if (forwardTo != null) {
%>
<%
return;
}
%>
<%
if ("true".equals(fromUserMgt)) {
%>
<%
if (!readOnlyUserStore) {
%>
<%=Encode.forHtml(decryptedUsername)%>
<%
} else {
%>
<%=Encode.forHtml(decryptedUsername)%>
<%
}
} else {
%>
<%
if (!readOnlyUserStore) {
%>
<%
} else {
%>
<%
}
}
%>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy