Example usage for com.liferay.portal.util PropsValues CAS_AUTH_ENABLED

List of usage examples for com.liferay.portal.util PropsValues CAS_AUTH_ENABLED

Introduction

In this page you can find the example usage for com.liferay.portal.util PropsValues CAS_AUTH_ENABLED.

Prototype

boolean CAS_AUTH_ENABLED

To view the source code for com.liferay.portal.util PropsValues CAS_AUTH_ENABLED.

Click Source Link

Usage

From source file:com.ext.portal.servlet.filters.sso.cas.CASFilterExt.java

License:Open Source License

@Override
public boolean isFilterEnabled(HttpServletRequest request, HttpServletResponse response) {

    try {//  ww  w. ja v a2s .c o m
        long companyId = PortalUtil.getCompanyId(request);

        if (PrefsPropsUtil.getBoolean(companyId, PropsKeys.CAS_AUTH_ENABLED, PropsValues.CAS_AUTH_ENABLED)) {

            return true;
        }
    } catch (Exception e) {
        _log.error(e, e);
    }

    return false;
}

From source file:org.intalio.tempo.web.CASFilter510.java

License:Open Source License

protected void processFilter(HttpServletRequest request, HttpServletResponse response,
        FilterChain filterChain) {//from www.  ja  va 2 s . c o  m

    try {
        long companyId = PortalUtil.getCompanyId(request);

        if (PrefsPropsUtil.getBoolean(companyId, PropsKeys.CAS_AUTH_ENABLED, PropsValues.CAS_AUTH_ENABLED)) {

            String pathInfo = request.getPathInfo();

            if (pathInfo.indexOf("/portal/logout") != -1) {
                HttpSession session = request.getSession();

                session.invalidate();

                String logoutUrl = PrefsPropsUtil.getString(companyId, PropsKeys.CAS_LOGOUT_URL);

                response.sendRedirect(logoutUrl);
            } else {
                Filter casFilter = getCASFilter(companyId);

                casFilter.doFilter(request, response, filterChain);
            }
        } else {
            processFilter(edu.yale.its.tp.cas.client.filter.CASFilter.class, request, response, filterChain);
        }
    } catch (Exception e) {
        _log.error(e, e);
    }
}

From source file:org.intalio.tempo.web.CASFilter520.java

License:Open Source License

protected void processFilter(HttpServletRequest request, HttpServletResponse response,
        FilterChain filterChain) {/*from w w  w.  j  a  v a2s.  c  o m*/

    try {
        long companyId = PortalUtil.getCompanyId(request);

        if (PrefsPropsUtil.getBoolean(companyId, PropsKeys.CAS_AUTH_ENABLED, PropsValues.CAS_AUTH_ENABLED)) {

            String pathInfo = request.getPathInfo();

            if (pathInfo.indexOf("/portal/logout") != -1) {
                HttpSession session = request.getSession();

                session.invalidate();

                String logoutUrl = PrefsPropsUtil.getString(companyId, PropsKeys.CAS_LOGOUT_URL,
                        PropsValues.CAS_LOGOUT_URL);

                response.sendRedirect(logoutUrl);
            } else {
                Filter casFilter = getCASFilter(companyId);

                casFilter.doFilter(request, response, filterChain);
            }
        } else {
            processFilter(CASFilter.class, request, response, filterChain);
        }
    } catch (Exception e) {
        _log.error(e, e);
    }
}