Skip to content

Commit

Permalink
SAK-42677 - Problems with copy paste of URL's (sakaiproject#7478)
Browse files Browse the repository at this point in the history
Commit to add pages that require info in backing bean (reply, reply all and forward) to the checkUrlRequirements.
  • Loading branch information
adrianmticarum authored and Miguel Pellicer committed Oct 23, 2019
1 parent aaf8cf0 commit 315bbb0
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
Expand Down Expand Up @@ -183,8 +185,14 @@ protected void dispatch(HttpServletRequest req, HttpServletResponse res) throws
*/
private String checkUrlRequirements(HttpServletRequest req, String target) {
String newTarget = target;
if ("/privateMsg/pvtMsgDetail".equals(target) && (req.getSession().getAttribute("PrivateMessagesTool") == null ||
((PrivateMessagesTool) req.getSession().getAttribute("PrivateMessagesTool")).getDetailMsg() == null)) {
final List<String> pagesRequireMsgDetailInBean = new ArrayList<>();
pagesRequireMsgDetailInBean.add("/privateMsg/pvtMsgDetail");
pagesRequireMsgDetailInBean.add("/pvtMsgReply");
pagesRequireMsgDetailInBean.add("/pvtMsgReplyAll");
pagesRequireMsgDetailInBean.add("/pvtMsgForward");

final PrivateMessagesTool backingBean = (PrivateMessagesTool) req.getSession().getAttribute("PrivateMessagesTool");
if (pagesRequireMsgDetailInBean.contains(target) && (backingBean == null || backingBean.getDetailMsg() == null)) {
newTarget = "/privateMsg/pvtMsgHpView";
} else if ("/privateMsg/pvtMsgDirectAccess".equals(target)) {
final String[] currentMsgDetail = req.getParameterMap().get("current_msg_detail");
Expand Down

0 comments on commit 315bbb0

Please sign in to comment.