java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java | 22 +++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
New commits: commit 16a2c8f9c3bcc73cb3455267f9b13089721a32f7 Author: Shannon Hughes shughes@redhat.com Date: Tue Mar 31 16:14:47 2009 -0400
489532 - unsubscribe multiorg shared channel when moving access from public to protected with deny selection
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java index 0111025..1ab296b 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java @@ -134,9 +134,17 @@ public class EditChannelAction extends RhnAction implements Listable { } else if (ctx.hasParam("deny")) { deny(form, errors, ctx); + if (errors.isEmpty()) { + createSuccessMessage(request, "message.channelupdated", + form.getString("name")); + } } else if (ctx.hasParam("grant")) { grant(form, errors, ctx); + if (errors.isEmpty()) { + createSuccessMessage(request, "message.channelupdated", + form.getString("name")); + } } if (!errors.isEmpty()) { request.setAttribute("channel_label", (String) form.get("label")); @@ -206,7 +214,19 @@ public class EditChannelAction extends RhnAction implements Listable { ActionErrors errors, RequestContext ctx) { Channel c = edit(form, errors, ctx); - // now remove all of the orgs to the "rhnchanneltrust" + Long cid = c.getId(); + Org org = c.getOrg(); + // now remove all of the orgs to the "rhnchanneltrust" and unsubscribe systems + Set<Org> trustedOrgs = org.getTrustedOrgs(); + for (Org o : trustedOrgs) { + DataResult<Map> dr = + SystemManager.subscribedInOrgTrust(org.getId(), o.getId()); + for (Map item : dr) { + Long sid = (Long)item.get("id"); + User user = ctx.getLoggedInUser(); + SystemManager.unsubscribeServerFromChannel(user, sid, cid); + } + } c.getTrustedOrgs().clear(); ChannelFactory.save(c); return c;
spacewalk-commits@lists.fedorahosted.org