Author: prabath
Date: Sat Feb 9 12:10:44 2008
New Revision: 13495
Log:
update user approval on a given RP
Added:
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/UpdateOpenIDUserRPAction.java
Added:
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/UpdateOpenIDUserRPAction.java
==============================================================================
--- (empty file)
+++
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/UpdateOpenIDUserRPAction.java
Sat Feb 9 12:10:44 2008
@@ -0,0 +1,69 @@
+package org.wso2.solutions.identity.user.ui.action;
+
+import java.util.Map;
+
+import org.wso2.solutions.identity.persistence.IPPersistenceManager;
+import org.wso2.solutions.identity.persistence.dataobject.OpenIDUserRPDO;
+import org.wso2.solutions.identity.user.ui.UIConstants;
+
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionSupport;
+
+public class UpdateOpenIDUserRPAction extends ActionSupport {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2085782218965074522L;
+
+ private String rpUrl;
+
+ private String operation;
+
+ public String execute() throws Exception {
+ if (rpUrl != null && operation != null && rpUrl.length() > 0
+ && operation.length() > 0) {
+
+ Map session = ActionContext.getContext().getSession();
+ String user = (String) session.get(UIConstants.USER);
+
+ IPPersistenceManager db = IPPersistenceManager
+ .getPersistanceManager();
+ OpenIDUserRPDO[] rpdos = null;
+ OpenIDUserRPDO rpdo = null;
+
+ rpdos = db.getOpenIDUserRP(user, rpUrl);
+
+ if (rpdos != null && rpdos.length > 0) {
+ rpdo = rpdos[0];
+
+ if (operation.equals(UIConstants.CLAIM_UPDATE_DISABLE)) {
+ rpdo.setIsTrustedAlways(false);
+ } else if (operation.equals(UIConstants.CLAIM_UPDATE_ENABLE)) {
+ rpdo.setIsTrustedAlways(true);
+ }
+
+ db.update(rpdo);
+ }
+
+ }
+ return SUCCESS;
+ }
+
+ public String getRpUrl() {
+ return rpUrl;
+ }
+
+ public void setRpUrl(String rpUrl) {
+ this.rpUrl = rpUrl;
+ }
+
+ public String getOperation() {
+ return operation;
+ }
+
+ public void setOperation(String operation) {
+ this.operation = operation;
+ }
+
+}
_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev