当前位置: 首页>>代码示例>>Java>>正文


Java PrefsPropsUtil类代码示例

本文整理汇总了Java中com.liferay.portal.util.PrefsPropsUtil的典型用法代码示例。如果您正苦于以下问题:Java PrefsPropsUtil类的具体用法?Java PrefsPropsUtil怎么用?Java PrefsPropsUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PrefsPropsUtil类属于com.liferay.portal.util包,在下文中一共展示了PrefsPropsUtil类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:csgf,项目名称:federated-login-ext,代码行数:17,代码来源:SAMLFilter.java

示例2: _initialize

import com.liferay.portal.util.PrefsPropsUtil; //导入依赖的package包/类
private void _initialize() {
	if (_captcha != null) {
		return;
	}

	synchronized (this) {
		if (_captcha != null) {
			return;
		}

		try {
			String captchaClassName = PrefsPropsUtil.getString(
				PropsKeys.CAPTCHA_ENGINE_IMPL,
				PropsValues.CAPTCHA_ENGINE_IMPL);

			if (_log.isInfoEnabled()) {
				_log.info("Initializing " + captchaClassName);
			}

			_captcha = (Captcha)InstanceFactory.newInstance(
				PACLClassLoaderUtil.getPortalClassLoader(),
				captchaClassName);

			_originalCaptcha = _captcha;
		}
		catch (Exception e) {
			_log.error(e, e);
		}
	}
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:31,代码来源:CaptchaImpl.java

示例3: 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);
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:32,代码来源:CaGridLiferayCASAutoLoginHook.java

示例4: validate

import com.liferay.portal.util.PrefsPropsUtil; //导入依赖的package包/类
protected void validate(long companyId, boolean autoPassword,
		String password1, String password2, boolean autoScreenName,
		String screenName, String emailAddress, String firstName,
		String lastName, long organizationId, long locationId)
		throws PortalException, SystemException {

	if (!autoScreenName) {
		validateScreenName(companyId, screenName);
	}

	if (!autoPassword) {
		PasswordPolicy passwordPolicy = PasswordPolicyLocalServiceUtil
				.getDefaultPasswordPolicy(companyId);

		PwdToolkitUtil.validate(companyId, 0, password1, password2,
				passwordPolicy);
	}

	if (!Validator.isEmailAddress(emailAddress)) {
		throw new UserEmailAddressException();
	} else {
		// As per caGrid requirements portal can have duplicate email address for a particular company Id.			
		/*try {
			User user = UserUtil.findByC_EA(companyId, emailAddress);

			if (user != null) {
				throw new DuplicateUserEmailAddressException();
			}
		} catch (NoSuchUserException nsue) {
		}*/

		String[] reservedEmailAddresses = PrefsPropsUtil.getStringArray(
				companyId, PropsUtil.ADMIN_RESERVED_EMAIL_ADDRESSES);

		for (int i = 0; i < reservedEmailAddresses.length; i++) {
			if (emailAddress.equalsIgnoreCase(reservedEmailAddresses[i])) {
				throw new ReservedUserEmailAddressException();
			}
		}
	}

	if (Validator.isNull(firstName)) {
		throw new ContactFirstNameException();
	} else if (Validator.isNull(lastName)) {
		throw new ContactLastNameException();
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:48,代码来源:CaGridUserLocalServiceImpl.java


注:本文中的com.liferay.portal.util.PrefsPropsUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。