01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/portal/tags/sakai_2-4-1/portal-impl/impl/src/java/org/sakaiproject/portal/charon/handlers/ReLoginHandler.java $
03: * $Id: ReLoginHandler.java 29143 2007-04-19 01:10:38Z ajpoland@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005, 2006, 2007 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.portal.charon.handlers;
21:
22: import javax.servlet.http.HttpServletRequest;
23: import javax.servlet.http.HttpServletResponse;
24:
25: import org.sakaiproject.portal.api.PortalHandlerException;
26: import org.sakaiproject.tool.api.Session;
27:
28: /**
29: *
30: * @author ieb
31: * @since Sakai 2.4
32: * @version $Rev: 29143 $
33: *
34: */
35: public class ReLoginHandler extends BasePortalHandler {
36: public ReLoginHandler() {
37: urlFragment = "relogin";
38: }
39:
40: @Override
41: public int doPost(String[] parts, HttpServletRequest req,
42: HttpServletResponse res, Session session)
43: throws PortalHandlerException {
44: return doGet(parts, req, res, session);
45: }
46:
47: @Override
48: public int doGet(String[] parts, HttpServletRequest req,
49: HttpServletResponse res, Session session)
50: throws PortalHandlerException {
51: if ((parts.length == 2) && (parts[1].equals("relogin"))) {
52: try {
53: // Note: here we send a null path, meaning we will NOT set it as
54: // a possible return path
55: // we expect we are in the middle of a login screen processing,
56: // and it's already set (user login button is "ulogin") -ggolden
57: portal.doLogin(req, res, session, null, false);
58: return END;
59: } catch (Exception ex) {
60: throw new PortalHandlerException(ex);
61: }
62: } else {
63: return NEXT;
64: }
65: }
66:
67: }
|