Example usage for com.liferay.portal.kernel.util CookieKeys getCookie

List of usage examples for com.liferay.portal.kernel.util CookieKeys getCookie

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util CookieKeys getCookie.

Prototype

public static String getCookie(HttpServletRequest httpServletRequest, String name, boolean toUpperCase) 

Source Link

Usage

From source file:com.liferay.login.web.internal.portlet.util.LoginUtil.java

License:Open Source License

public static String getLogin(HttpServletRequest request, String paramName, Company company) {

    String login = request.getParameter(paramName);

    if ((login == null) || login.equals(StringPool.NULL)) {
        login = CookieKeys.getCookie(request, CookieKeys.LOGIN, false);

        String authType = company.getAuthType();

        if (PropsValues.COMPANY_LOGIN_PREPOPULATE_DOMAIN && Validator.isNull(login)
                && authType.equals(CompanyConstants.AUTH_TYPE_EA)) {

            login = "@".concat(company.getMx());
        }//from  w w  w  . java  2s. c  o  m
    }

    return login;
}

From source file:com.liferay.portlet.login.util.LoginUtil.java

License:Open Source License

public static String getLogin(HttpServletRequest request, String paramName, Company company)
        throws SystemException {

    String login = request.getParameter(paramName);

    if ((login == null) || login.equals(StringPool.NULL)) {
        login = GetterUtil.getString(CookieKeys.getCookie(request, CookieKeys.LOGIN, false));

        if (PropsValues.COMPANY_LOGIN_PREPOPULATE_DOMAIN && Validator.isNull(login)
                && company.getAuthType().equals(CompanyConstants.AUTH_TYPE_EA)) {

            login = "@" + company.getMx();
        }//www . j  a  va 2s. c om
    }

    return login;
}