Author: prabath
Date: Tue Feb 26 00:45:02 2008
New Revision: 14205
Log:
let users modify their existing user profiles
Added:
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/ClaimValue.java
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/UserProfile.java
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/EditUserProfileAction.java
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/EditUserProfileSubmitAction.java
trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/edituserprofile.jsp
Modified:
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/users/IdentityDefaultUserStoreAdmin.java
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/users/IdentityUserStoreAdmin.java
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDConsumer.java
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/UIConstants.java
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/ShowMainAction.java
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java
trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml
trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/main.jsp
Modified:
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/users/IdentityDefaultUserStoreAdmin.java
==============================================================================
---
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/users/IdentityDefaultUserStoreAdmin.java
(original)
+++
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/users/IdentityDefaultUserStoreAdmin.java
Tue Feb 26 00:45:02 2008
@@ -101,7 +101,6 @@
} else {
profileName = value;
}
-
}
}
}
@@ -113,8 +112,11 @@
ResultSet results = sqlStatement.executeQuery();
- if (results != null && results.next()) {
- isDefaultProfile = false;
+ if (results != null) {
+ if (results.next()) {
+ isDefaultProfile = false;
+ }
+ results.close();
} else {
// this is the first time user sets the attributes
isDefaultProfile = true;
@@ -198,4 +200,103 @@
}
}
}
+
+ /**
+ *
+ */
+ public void updateUserProperties(String userName, Map properties,
+ String profileName) throws UserManagerException {
+
+ String userId = data.getUserId(userName);
+
+ if (userId == null) {
+ throw new UserManagerException("nullUser");
+ }
+
+ Connection dbConnection = null;
+ String profileId = null;
+
+ try {
+
+ dbConnection = dataSource.getConnection();
+
+ if (dbConnection == null) {
+ throw new UserManagerException("null_connection");
+ }
+
+ dbConnection.setAutoCommit(false);
+
+ PreparedStatement sqlStatement = null;
+
+ sqlStatement = dbConnection
+ .prepareStatement("select profile_id from user_profile
where user_id=? and profile_name=?");
+
+ sqlStatement.setString(1, userId);
+ sqlStatement.setString(2, profileName);
+
+ ResultSet results = sqlStatement.executeQuery();
+
+ if (results != null) {
+ if (results.next()) {
+ profileId = results.getString(1);
+ }
+ results.close();
+ }
+
+ if (profileId == null)
+ throw new UserManagerException("errorModifyingUserStore");
+
+ sqlStatement = dbConnection
+ .prepareStatement("delete from user_profile_values where
profile_id=?");
+
+ sqlStatement.setString(1, profileId);
+
+ sqlStatement.executeUpdate();
+
+ sqlStatement = dbConnection
+ .prepareStatement("insert into user_profile_values
(attr_name, attr_value, profile_id, id) values (?, ?, ?, ?)");
+
+ if (properties != null) {
+ Iterator ite = properties.entrySet().iterator();
+ while (ite.hasNext()) {
+ Entry entry = (Entry) ite.next();
+ String key = (String) entry.getKey();
+ String value = (String) entry.getValue();
+ if (value != null) {
+ if (!key
+
.equalsIgnoreCase(IdentityConstants.PROFILE_NAME)) {
+ String idUserAttribute = UUIDGenerator.getUUID();
+ sqlStatement.setString(1, key);
+ sqlStatement.setString(2, value);
+ sqlStatement.setString(3, profileId);
+ sqlStatement.setString(4, idUserAttribute);
+ sqlStatement.executeUpdate();
+ } else {
+ profileName = value;
+ }
+ }
+ }
+ }
+
+ dbConnection.commit();
+
+ } catch (SQLException e) {
+ try {
+ dbConnection.rollback();
+ } catch (SQLException e1) {
+ log.debug(e);
+ throw new UserManagerException("errorModifyingUserStore", e);
+ }
+ log.debug(e);
+ throw new UserManagerException("errorModifyingUserStore", e);
+ } finally {
+ try {
+ if (dbConnection != null) {
+ dbConnection.close();
+ }
+ } catch (SQLException e) {
+ throw new UserManagerException("errorClosingConnection", e);
+ }
+ }
+ }
}
Modified:
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/users/IdentityUserStoreAdmin.java
==============================================================================
---
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/users/IdentityUserStoreAdmin.java
(original)
+++
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/users/IdentityUserStoreAdmin.java
Tue Feb 26 00:45:02 2008
@@ -21,5 +21,16 @@
*/
public void setUserProperties(String userName, Map properties,
String profileName) throws UserManagerException;
+
+ /**
+ * This updates user properties corresponding to the given user name and
the
+ * profile name.
+ * @param userName Unique user name
+ * @param properties Profile properties
+ * @param profileName Name of the profile
+ * @throws UserManagerException
+ */
+ public void updateUserProperties(String userName, Map properties,
+ String profileName) throws UserManagerException;
}
Modified:
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDConsumer.java
==============================================================================
---
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDConsumer.java
(original)
+++
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDConsumer.java
Tue Feb 26 00:45:02 2008
@@ -206,7 +206,7 @@
request.setAttribute(IdentityConstants.OpenId.OPENID_IDENTIFIER,
authSuccess.getIdentity());
- // OpenID Attribute Exchange 1.0 - Draft 07.
+ // OpenID Attribute Exchange 1.1 - Draft 1.0
if (authSuccess
.hasExtension(IdentityConstants.OpenId.ExchangeAttributes.NS_AX)) {
FetchResponse fetchResp = null;
Added:
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/ClaimValue.java
==============================================================================
--- (empty file)
+++
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/ClaimValue.java
Tue Feb 26 00:45:02 2008
@@ -0,0 +1,23 @@
+package org.wso2.solutions.identity.user.ui;
+
+import org.wso2.solutions.identity.persistence.dataobject.ClaimDO;
+
+public class ClaimValue {
+
+ private ClaimDO claim;
+ private String claimValue;
+
+ public ClaimDO getClaim() {
+ return claim;
+ }
+ public void setClaim(ClaimDO claim) {
+ this.claim = claim;
+ }
+ public String getClaimValue() {
+ return claimValue;
+ }
+ public void setClaimValue(String claimValue) {
+ this.claimValue = claimValue;
+ }
+
+}
Modified:
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/UIConstants.java
==============================================================================
---
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/UIConstants.java
(original)
+++
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/UIConstants.java
Tue Feb 26 00:45:02 2008
@@ -30,53 +30,55 @@
public final static String SHOW_LOGIN_ACTION = "ShowLogin.action";
public final static String INFOCARD_SUBMIT_ACTION =
"InfoCardSubmit.action";
-
+
public final static String USER_REGISTRATION_FORM_ACTION =
"ShowUserRegistration.action";
-
+
public final static String USER_REGISTRATION_CARD_ACTION =
"InfoCardUserRegisteration";
-
+
public final static String USER_REGISTRATION_FORM_SUBMIT_ACTION =
"UserRegistrationFormSubmit";
-
+
public final static String USER_REGISTRATION_CARD_SUBMIT_ACTION =
"InfoCardUserRegistrationSubmit";
public final static String LOGIN_JSP = "/jsp/login.jsp";
public final static String JSP_ERROR_PAGE = "/jsp/error.jsp";
-
+
public final static String CARD_ISSUER_CONFIG_PATH =
"WEB-INF/infocard-issuer-config.xml";
-
+
public final static String MAIN_PAGE_MESSAGES = "mainMessages";
-
+
public final static String OPENID_LOGIN_ACTION = "OpenIDLogin.action";
-
+
public final static String OPENID_SUBMIT_ACTION = "OpenIDSubmit.action";
-
+
public final static String OPENDID_CALLBACK_ACTION =
"OpenIDCallback.action";
-
+
public final static String OPENID_SERVER_PAGE = "/server";
-
+
public final static String OPENID_USER_PAGE = "/user";
-
+
public final static String OPENID_AUTH_ACTION =
"OpenIDAuthentication.action";
-
+
public final static String OPENID_INFO_CARD__DOWNLOAD_ACTION =
"OpenIDDownloadInfoCard.action";
-
- public final static String OPENID_INFO_CARD__SUBMIT_ACTION =
"OpenIDInfoCardSubmit.action";
-
+
+ public final static String OPENID_INFO_CARD__SUBMIT_ACTION =
"OpenIDInfoCardSubmit.action";
+
public final static String OPENID_AUTH_VERIFICATION_ACTION =
"OpenIDAuthVerification.action";
-
+
public final static String OPENID_USER_APPROVAL_ACTION =
"OpenIDUserApproval.action";
-
+
public final static String CLAIM_UPDATE_ENABLE = "enable";
public final static String CLAIM_UPDATE_DISABLE = "disable";
-
+
public final static String UPDATE_OPENID_USER_RP_ACTION =
"UpdateOpenIDUserRP.action";
-
+
public final static String ADD_USER_PROFILE_ACTION =
"AddUserProfile.action";
+
+ public final static String ADD_USER_PROFILE_SUBMIT_ACTION =
"AddUserProfileSubmit.action";
+
+ public final static String EDIT_USER_PROFILE_ACTION =
"EditUserProfile.action";
- public final static String ADD_USER_PROFILE_SUBMIT_ACTION =
"AddUserProfileSubmit.action";
-
-
-
+ public final static String EDIT_USER_PROFILE_SUBMIT_ACTION =
"EditUserProfileSubmit.action";
+
}
Added:
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/UserProfile.java
==============================================================================
--- (empty file)
+++
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/UserProfile.java
Tue Feb 26 00:45:02 2008
@@ -0,0 +1,26 @@
+package org.wso2.solutions.identity.user.ui;
+
+import org.wso2.solutions.identity.persistence.dataobject.ClaimDO;
+
+public class UserProfile {
+
+ private String profileName;
+ private boolean defaultProfile;
+
+ public String getProfileName() {
+ return profileName;
+ }
+
+ public void setProfileName(String profileName) {
+ this.profileName = profileName;
+ }
+
+ public boolean isDefaultProfile() {
+ return defaultProfile;
+ }
+
+ public void setDefaultProfile(boolean defaultProfile) {
+ this.defaultProfile = defaultProfile;
+ }
+
+}
Added:
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/EditUserProfileAction.java
==============================================================================
--- (empty file)
+++
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/EditUserProfileAction.java
Tue Feb 26 00:45:02 2008
@@ -0,0 +1,111 @@
+package org.wso2.solutions.identity.user.ui.action;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts2.StrutsStatics;
+import org.wso2.solutions.identity.UserStore;
+import org.wso2.solutions.identity.admin.ClaimsAdmin;
+import org.wso2.solutions.identity.admin.RelyingPartyAdmin;
+import org.wso2.solutions.identity.persistence.IPPersistenceManager;
+import org.wso2.solutions.identity.persistence.dataobject.ClaimDO;
+import org.wso2.solutions.identity.user.ui.ClaimValue;
+import org.wso2.solutions.identity.user.ui.UIConstants;
+import org.wso2.solutions.identity.users.IdentityDefaultRealm;
+import org.wso2.solutions.identity.users.IdentityUserStoreReader;
+
+import com.opensymphony.xwork2.ActionContext;
+
+public class EditUserProfileAction extends ManagedAction {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -6574411044104451252L;
+
+ private List claims = null;
+
+ private String profileName;
+
+ public String execute() throws Exception {
+
+ String userName = null;
+ HttpServletRequest request = null;
+ IdentityDefaultRealm realm = null;
+ IdentityUserStoreReader reader = null;
+ IPPersistenceManager db = null;
+ RelyingPartyAdmin admin = null;
+ Map userProperties = null;
+
+ request = (HttpServletRequest) ActionContext.getContext().get(
+ StrutsStatics.HTTP_REQUEST);
+
+ userName = (String)
request.getSession().getAttribute(UIConstants.USER);
+ profileName = (String) request.getParameter("profileName");
+
+ if (profileName == null) {
+ profileName = (String) request.getSession().getAttribute(
+ "profileName");
+ }
+
+ if (userName == null) {
+ this.addErrorMessage(getText("invalid_user_login"));
+ return ERROR;
+ }
+
+ if (profileName == null || profileName.trim().length() == 0) {
+ this.addErrorMessage(getText("profile_name_required"));
+ return ERROR;
+ }
+
+ realm = (IdentityDefaultRealm) UserStore.getInstance().getRealm();
+ reader = realm.getIdentityUserStoreReader();
+ userProperties = reader.getUserProperties(userName, profileName);
+
+ if (userProperties == null || userProperties.isEmpty())
+ return ERROR;
+
+ ClaimsAdmin ClaimsAdmin = new ClaimsAdmin();
+ ClaimDO[] claimDOs = ClaimsAdmin.getAllMappedEnabledClaims();
+
+ claims = new ArrayList();
+
+ ClaimValue claimValue = null;
+
+ for (int i = 0; i < claimDOs.length; i++) {
+ if (claimDOs[i].isUserEditable()) {
+ claimValue = new ClaimValue();
+ claimValue.setClaim(claimDOs[i]);
+ claimValue.setClaimValue((String) userProperties
+ .get(claimDOs[i].getAttrId()));
+ claims.add(claimValue);
+ }
+ }
+
+ request.getSession().removeAttribute("profileName");
+
+ loadMessages();
+
+ return SUCCESS;
+ }
+
+ public List getClaims() {
+ return claims;
+ }
+
+ public void setClaims(List claims) {
+ this.claims = claims;
+ }
+
+ public String getProfileName() {
+ return profileName;
+ }
+
+ public void setProfileName(String profileName) {
+ this.profileName = profileName;
+ }
+}
\ No newline at end of file
Added:
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/EditUserProfileSubmitAction.java
==============================================================================
--- (empty file)
+++
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/EditUserProfileSubmitAction.java
Tue Feb 26 00:45:02 2008
@@ -0,0 +1,105 @@
+package org.wso2.solutions.identity.user.ui.action;
+
+import java.util.HashMap;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts2.StrutsStatics;
+import org.wso2.solutions.identity.IdentityConstants;
+import org.wso2.solutions.identity.UserStore;
+import org.wso2.solutions.identity.admin.ClaimsAdmin;
+import org.wso2.solutions.identity.persistence.dataobject.ClaimDO;
+import org.wso2.solutions.identity.user.ui.UIConstants;
+import org.wso2.solutions.identity.users.IdentityDefaultRealm;
+import org.wso2.solutions.identity.users.IdentityUserStoreAdmin;
+import org.wso2.solutions.identity.users.IdentityUserStoreReader;
+import org.wso2.usermanager.UserManagerException;
+
+import com.opensymphony.xwork2.ActionContext;
+
+public class EditUserProfileSubmitAction extends ManagedAction {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2623758624614704079L;
+
+ /**
+ * This will get executed while adding a new user profile to an existing
+ * user.
+ */
+ public String execute() throws Exception {
+
+ String userName = null;
+ HttpServletRequest request = null;
+ ClaimsAdmin claimsAdmin = null;
+ ClaimDO[] claimDOs = null;
+ String profileName = null;
+
+ request = (HttpServletRequest) ActionContext.getContext().get(
+ StrutsStatics.HTTP_REQUEST);
+
+ userName = (String)
request.getSession().getAttribute(UIConstants.USER);
+
+ if (userName == null) {
+ this.addErrorMessage(getText("invalid_user_login"));
+ return ERROR;
+ }
+
+ profileName = (String) request.getParameter("profileName");
+
+ if (profileName == null || profileName.trim().length() == 0) {
+ this.addErrorMessage(getText("profile_name_required"));
+ return ERROR;
+ }
+
+ claimsAdmin = new ClaimsAdmin();
+ claimDOs = claimsAdmin.getAllMappedEnabledClaims();
+
+ HashMap<String, String> props = new HashMap<String, String>();
+ for (int i = 0; i < claimDOs.length; i++) {
+ String uri = claimDOs[i].getUri();
+ if (!uri.equals(IdentityConstants.CLAIM_PPID)) {
+
+ if (claimDOs[i].isRequired()
+ && (request.getParameter(uri) == null || request
+ .getParameter(uri).trim().length() == 0)) {
+ this.addErrorMessage(getText("required_feilds_missing"));
+ request.getSession().setAttribute("profileName",
profileName);
+ return ERROR;
+ }
+
+ if (request.getParameter(uri) != null
+ && request.getParameter(uri).trim().length() > 0)
+ props.put(uri, request.getParameter(uri));
+ }
+ }
+
+ try {
+
+ IdentityDefaultRealm realm = null;
+ IdentityUserStoreReader reader = null;
+ IdentityUserStoreAdmin admin = null;
+
+ realm = (IdentityDefaultRealm) UserStore.getInstance().getRealm();
+ admin = realm.getIdentityUserStoreAdmin();
+ reader = realm.getIdentityUserStoreReader();
+
+ if (reader.isExistingUserProfile(userName, profileName)) {
+ admin.updateUserProperties(userName, props, profileName);
+ } else {
+ request.getSession().setAttribute("profileName", profileName);
+ return ERROR;
+ }
+
+ } catch (UserManagerException e) {
+ String msg = getText("error_unexpected", new String[] { e
+ .getMessage() });
+ this.addErrorMessage(msg);
+ request.getSession().setAttribute("profileName", profileName);
+ return ERROR;
+ }
+
+ return SUCCESS;
+ }
+}
Modified:
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/ShowMainAction.java
==============================================================================
---
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/ShowMainAction.java
(original)
+++
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/ShowMainAction.java
Tue Feb 26 00:45:02 2008
@@ -28,9 +28,13 @@
import org.wso2.solutions.identity.persistence.dataobject.OpenIDUserRPDO;
import org.wso2.solutions.identity.persistence.dataobject.UserTrustedRPDO;
import org.wso2.solutions.identity.user.ui.UIConstants;
+import org.wso2.solutions.identity.user.ui.UserProfile;
+import org.wso2.solutions.identity.users.IdentityDefaultRealm;
+import org.wso2.solutions.identity.users.IdentityUserStoreReader;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -48,6 +52,8 @@
private List openIDUserRPs;
+ private List profiles;
+
private boolean enableOpenIDRegistration;
private boolean allowUserRegistration;
@@ -118,11 +124,53 @@
this.openIDUserRPs = Arrays.asList((OpenIDUserRPDO[]) rpdos);
}
+ if (allowUserRegistration) {
+
+ IdentityDefaultRealm realm = null;
+ IdentityUserStoreReader reader = null;
+ IPPersistenceManager db = null;
+ RelyingPartyAdmin rpAdmin = null;
+ String defaultProfileName = null;
+ List userProfiles = null;
+
+ profiles = new ArrayList();
+
+ realm = (IdentityDefaultRealm) UserStore.getInstance().getRealm();
+ reader = realm.getIdentityUserStoreReader();
+ userProfiles = reader.getUserProfileNames(user);
+
+ defaultProfileName = reader.getDefaultUserProfileName(user);
+
+ for (Iterator iterator = userProfiles.iterator(); iterator
+ .hasNext();) {
+ String name = (String) iterator.next();
+ UserProfile userProfile = new UserProfile();
+
+ userProfile.setProfileName(name);
+
+ if (name.equals(defaultProfileName)) {
+ userProfile.setDefaultProfile(true);
+ } else {
+ userProfile.setDefaultProfile(false);
+ }
+
+ profiles.add(userProfile);
+ }
+ }
+
this.loadMessages();
return SUCCESS;
}
+ public List getProfiles() {
+ return profiles;
+ }
+
+ public void setProfiles(List profiles) {
+ this.profiles = profiles;
+ }
+
public List getPersonalRPs() {
return personalRPs;
}
Modified:
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java
==============================================================================
---
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java
(original)
+++
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java
Tue Feb 26 00:45:02 2008
@@ -51,15 +51,19 @@
&& requestURL.toString().indexOf(
UIConstants.USER_REGISTRATION_CARD_SUBMIT_ACTION) < 0
&& requestURL.toString().indexOf(
- UIConstants.OPENID_SUBMIT_ACTION) < 0
+ UIConstants.OPENID_SUBMIT_ACTION) < 0
&& requestURL.toString().indexOf(
UIConstants.OPENID_INFO_CARD__SUBMIT_ACTION) < 0
&& requestURL.toString().indexOf(
UIConstants.ADD_USER_PROFILE_ACTION) < 0
&& requestURL.toString().indexOf(
+ UIConstants.EDIT_USER_PROFILE_ACTION) < 0
+ && requestURL.toString().indexOf(
UIConstants.ADD_USER_PROFILE_SUBMIT_ACTION) < 0
&& requestURL.toString().indexOf(
- UIConstants.OPENDID_CALLBACK_ACTION) < 0
+ UIConstants.EDIT_USER_PROFILE_SUBMIT_ACTION) < 0
+ && requestURL.toString().indexOf(
+ UIConstants.OPENDID_CALLBACK_ACTION) < 0
&& requestURL.indexOf(UIConstants.OPENID_AUTH_ACTION) < 0
&& requestURL
.indexOf(UIConstants.OPENID_AUTH_VERIFICATION_ACTION)
< 0
Modified: trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml
==============================================================================
--- trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml
(original)
+++ trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml
Tue Feb 26 00:45:02 2008
@@ -211,5 +211,18 @@
<result name="error" type="redirect">AddUserProfile.action</result>
</action>
+ <action name="EditUserProfile"
+
class="org.wso2.solutions.identity.user.ui.action.EditUserProfileAction">
+ <result name="success">/jsp/edituserprofile.jsp</result>
+ <result name="error" type="redirect">Login.action</result>
+ </action>
+
+ <action name="EditUserProfileSubmit"
+
class="org.wso2.solutions.identity.user.ui.action.EditUserProfileSubmitAction">
+ <result name="success" type="redirect">ShowMain.action</result>
+ <result name="input"
type="redirect">EditUserProfile.action</result>
+ <result name="error"
type="redirect">EditUserProfile.action</result>
+ </action>
+
</package>
</struts>
\ No newline at end of file
Added:
trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/edituserprofile.jsp
==============================================================================
--- (empty file)
+++
trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/edituserprofile.jsp
Tue Feb 26 00:45:02 2008
@@ -0,0 +1,79 @@
+<%@ taglib prefix="s" uri="/struts-tags"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>WSO2 Identity Solution</title>
+<link type="text/css" rel="stylesheet" href="css/styles.css" />
+</head>
+<body>
+<!-- Include the header -->
+<s:include value="header.jsp" />
+
+<table cellpadding="0" cellspacing="0" border="0" style="width: 100%;">
+ <tr>
+ <td class="right-back"></td>
+ <td class="content" valign="top">
+ <table cellpadding="0" cellspacing="0" border="0" style="width:
100%;">
+ <tr>
+ <td>
+ <h1>WSO2 Identity Provider</h1>
+ </td>
+ <td align="right" valign="top"><img
+
src="images/wso2-identity-content-rounded.jpg" align="top" /></td>
+ </tr>
+ </table>
+
+ <br>
+
+ <s:iterator value="errorMessages">
+ <div class="error-message"><s:property /></div>
+ </s:iterator> <s:iterator value="infoMessages">
+ <div class="info-message"><s:property /></div>
+ </s:iterator>
+
+ <table cellpadding="0" cellspacing="10" border="0"
+ class="login-header">
+ <tr>
+ <td valign="top" width="30%">
+ <form
action="EditUserProfileSubmit.action?profileName=<s:property
value="profileName"/>" method="post">
+ <strong>Update Profile: <s:property
value="profileName"/> </strong><br />
+ <!--todo -->
+ <div class="errors"><s:actionerror />
<s:fielderror /></div>
+ <i>Required fields <font
class="required">*</font> </i>
+ <table cellpadding="0" cellspacing="10"
border="0"
+ class="form-table">
+ <s:iterator value="claims">
+ <tr>
+ <td><s:property
value="claim.displayTag" /></td>
+ <td width="2"><s:if
test="claim.required==true">
+ <font
class="required">*</font>
+ </s:if></td>
+ <td><input type="text"
value="<s:property value="claimValue"/>" name="<s:property
value="claim.uri"/>"></td>
+ </tr>
+ </s:iterator>
+
+ <tr>
+ <td></td>
+ <td></td>
+ <td><input type="submit"
value="Update Profile" class="button">
+ <input type="button"
value="Cancel"
+
onClick="javascript:window.location = 'ShowMain.action'"
+ class="button"></td>
+ </tr>
+ </table>
+ </form>
+ </td>
+
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+<!-- Include footer -->
+<s:include value="footer.jsp" />
+
+</body>
+
+</html>
\ No newline at end of file
Modified: trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/main.jsp
==============================================================================
--- trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/main.jsp
(original)
+++ trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/main.jsp
Tue Feb 26 00:45:02 2008
@@ -45,9 +45,43 @@
</s:iterator> <br>
<!-- New STARTS Here -->
<div class="information">
+
<s:if test="%{allowUserRegistration}">
- <br/><br/><div><a href="AddUserProfile.action">Add new
profile</a></div><br/><br/>
+ <table cellpadding="0" cellspacing="0" border="0"
+ class="manage-table">
+ <tr>
+ <td>
+ <p class="heading-link">Manage user
profiles : <a href="AddUserProfile.action">Add new profile</a></p>
+
+ <table cellpadding="0" cellspacing="0"
border="0"
+ class="data-table">
+ <s:iterator value="profiles">
+ <tr>
+ <td
width="100%">
+ <div
style="line-height: 18px;">
+ <s:if
test="%{defaultProfile}">
+ <s:property
value="profileName" />
+ </s:if>
+ <s:else>
+ <a
href="EditUserProfile.action?profileName=<s:property value="profileName"/>">
+ <s:property
value="profileName" />
+ </a>
+ </s:else>
+ </div>
+ </td>
+
+
+
+ </tr>
+ </s:iterator>
+ </table>
+
+ </td>
+ </tr>
+ </table>
</s:if>
+
+
<table cellpadding="0" cellspacing="0" border="0"
style="width: 100%; margin-bottom: 10px;">
<tr>
_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev