From 66d91c8b1fe15e515b746cb9da2d22bbbab45967 Mon Sep 17 00:00:00 2001 From: thanhvc Date: Fri, 20 Nov 2015 12:11:46 +0700 Subject: [PATCH 1/3] SOC-5177 My Pages of a deleted user Fix description: show current viewer profile if profile owner is deleted. --- .../main/java/org/exoplatform/social/webui/Utils.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java b/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java index 86f21378f8..cb9e70ec86 100644 --- a/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java +++ b/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java @@ -99,7 +99,16 @@ public class Utils { * @since 1.2.0 GA */ public static String getOwnerRemoteId() { - String currentUserName = URLUtils.getCurrentUser(); + String currentUserName = URLUtils.getCurrentUser(); + if (currentUserName != null && currentUserName.length() > 0) { + Identity identity = getIdentityManager().getOrCreateIdentity(OrganizationIdentityProvider.NAME, currentUserName, false); + //if the user's deleted + if (identity.isDeleted()) { + currentUserName = null; + } + } + + // if (currentUserName == null || currentUserName.equals("")) { return getViewerRemoteId(); } From ea7ea6e831307896df36e3bd458c686e12bde4dc Mon Sep 17 00:00:00 2001 From: NgocTM Date: Fri, 20 Nov 2015 14:51:55 +0700 Subject: [PATCH 2/3] SOC-5177 My Pages of a deleted user Fix description: Update condition to check if user is deleted. --- .../webui/src/main/java/org/exoplatform/social/webui/Utils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java b/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java index cb9e70ec86..56ce96db80 100644 --- a/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java +++ b/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java @@ -103,7 +103,7 @@ public static String getOwnerRemoteId() { if (currentUserName != null && currentUserName.length() > 0) { Identity identity = getIdentityManager().getOrCreateIdentity(OrganizationIdentityProvider.NAME, currentUserName, false); //if the user's deleted - if (identity.isDeleted()) { + if (identity.isDeleted() && identity.isEnable()) { currentUserName = null; } } From 5d870024d621de21d37c52868cf905d142f8a18d Mon Sep 17 00:00:00 2001 From: NgocTM Date: Mon, 23 Nov 2015 09:36:32 +0700 Subject: [PATCH 3/3] Revert "SOC-5177 My Pages of a deleted user" This reverts commit ea7ea6e831307896df36e3bd458c686e12bde4dc. --- .../webui/src/main/java/org/exoplatform/social/webui/Utils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java b/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java index 56ce96db80..cb9e70ec86 100644 --- a/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java +++ b/component/webui/src/main/java/org/exoplatform/social/webui/Utils.java @@ -103,7 +103,7 @@ public static String getOwnerRemoteId() { if (currentUserName != null && currentUserName.length() > 0) { Identity identity = getIdentityManager().getOrCreateIdentity(OrganizationIdentityProvider.NAME, currentUserName, false); //if the user's deleted - if (identity.isDeleted() && identity.isEnable()) { + if (identity.isDeleted()) { currentUserName = null; } }