Permalink
Browse files

LPS-27390 Made scope selection working at Site Membership porltet's t…

…abs' navigation
  • Loading branch information...
vilmospapp authored and KocsisDaniel committed May 17, 2012
1 parent 1221eae commit 823815cb4ed556bce60444bf529b1e047f40c6f5
@@ -129,12 +129,18 @@ public static Group getGroup(HttpServletRequest request) throws Exception {
String cmd = ParamUtil.getString(request, Constants.CMD);
+ long doAsGroupId = ParamUtil.getLong(request, "doAsGroupId");
long groupId = ParamUtil.getLong(request, "groupId");
Group group = null;
if (groupId > 0) {
- group = GroupLocalServiceUtil.getGroup(groupId);
+ if ((doAsGroupId != 0) && (doAsGroupId != groupId)) {
+ group = GroupLocalServiceUtil.getGroup(doAsGroupId);
+ }
+ else {
+ group = GroupLocalServiceUtil.getGroup(groupId);
+ }
}
else if (!cmd.equals(Constants.ADD)) {
group = themeDisplay.getScopeGroup();
@@ -20,9 +20,13 @@
String redirect = ParamUtil.getString(request, "redirect");
String backURL = ParamUtil.getString(request, "backURL", redirect);
-long groupId = ParamUtil.getLong(request, "groupId");
+Group group = (Group)request.getAttribute(WebKeys.GROUP);
-Group group = GroupServiceUtil.getGroup(groupId);
+if (group == null) {
+ group = themeDisplay.getScopeGroup();
+}
+
+long groupId = group.getGroupId();
Organization organization = null;

0 comments on commit 823815c

Please sign in to comment.