本文整理汇总了Java中com.liferay.portal.util.PrefsPropsUtil.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java PrefsPropsUtil.getBoolean方法的具体用法?Java PrefsPropsUtil.getBoolean怎么用?Java PrefsPropsUtil.getBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.util.PrefsPropsUtil
的用法示例。
在下文中一共展示了PrefsPropsUtil.getBoolean方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isFilterEnabled
import com.liferay.portal.util.PrefsPropsUtil; //导入方法依赖的package包/类
@Override
public boolean isFilterEnabled(HttpServletRequest request, HttpServletResponse response) {
long companyId = PortalUtil.getCompanyId(request);
boolean enabled = false;
try {
enabled = PrefsPropsUtil.getBoolean(
companyId, FedPropsKeys.SAML_AUTH_ENABLED,
FedPropsValues.SAML_AUTH_ENABLED);
} catch (SystemException ex) {
_log.error(ex);
}
_log.debug("SAML Filter enabled: "+enabled);
return enabled;
}
示例2: login
import com.liferay.portal.util.PrefsPropsUtil; //导入方法依赖的package包/类
public String[] login(HttpServletRequest req, HttpServletResponse res)
throws AutoLoginException {
try {
String[] credentials = null;
long companyId = PortalUtil.getCompanyId(req);
if (!PrefsPropsUtil.getBoolean(companyId,PropsUtil.CAS_AUTH_ENABLED)) {
return credentials;
}
WebSSOUser webssoUser = (WebSSOUser) SecurityContextHolder
.getContext().getAuthentication().getPrincipal();
User user = null;
try {
_log.debug("Users Company Id "+companyId+" GridId "+webssoUser.getGridId());
UserIdMapper userIdMapper = UserIdMapperLocalServiceUtil
.getUserIdMapperByExternalUserId("", webssoUser.getGridId());
user = UserLocalServiceUtil.getUserById(userIdMapper.getUserId());
} catch (NoSuchUserIdMapperException nusime) {
_log.debug(nusime.getMessage());
user = addUser(companyId, webssoUser);
UserIdMapperLocalServiceUtil.updateUserIdMapper(user
.getUserId(), null, null, webssoUser.getGridId());
}
credentials = new String[3];
credentials[0] = String.valueOf(user.getUserId());
credentials[1] = user.getPassword();
credentials[2] = Boolean.TRUE.toString();
return credentials;
} catch (Exception e) {
throw new AutoLoginException(e);
}
}