Example usage for com.liferay.portal.util PrefsPropsUtil getString

List of usage examples for com.liferay.portal.util PrefsPropsUtil getString

Introduction

In this page you can find the example usage for com.liferay.portal.util PrefsPropsUtil getString.

Prototype

public static String getString(String name, String defaultValue) 

Source Link

Usage

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

License:Open Source License

protected void processFilter(HttpServletRequest request, HttpServletResponse response,
        FilterChain filterChain) {//w ww  .  j a 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.openinfinity.sso.springsecurity.liferay.LiferayRequest.java

License:Apache License

private String liferayProperty(String key) {
    try {/*from w  w  w .j a v a 2 s. c  om*/
        return PrefsPropsUtil.getString(companyID(), key);
    } catch (Exception e) {
        LOG.error(e);
        return null;
    }
}

From source file:org.openinfinity.sso.springsecurity.liferay.PreAuthenticatedAutoLogin.java

License:Apache License

private boolean isProvisioned(LiferayRequest request) {
    try {//from   www  .jav a 2  s . c o m
        String stringValue = PrefsPropsUtil.getString(request.companyID(), PROVISIONING_KEY_NAME);
        return Boolean.valueOf(stringValue);
    } catch (Exception e) {
        LOG.error(e);
        return true;
    }
}