001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.security.auth;
016    
017    import com.liferay.portal.kernel.exception.SystemException;
018    import com.liferay.portal.kernel.util.PropsKeys;
019    import com.liferay.portal.util.PrefsPropsUtil;
020    import com.liferay.portal.util.PropsValues;
021    
022    /**
023     * @author Michael C. Han
024     */
025    public class AuthSettingsUtil {
026    
027            public static boolean isLDAPAuthEnabled(long companyId)
028                    throws SystemException {
029    
030                    if (PrefsPropsUtil.getBoolean(
031                                    companyId, PropsKeys.LDAP_AUTH_ENABLED,
032                                    PropsValues.LDAP_AUTH_ENABLED)) {
033    
034                            return true;
035                    }
036                    else {
037                            return false;
038                    }
039            }
040    
041            public static boolean isNtlmEnabled(long companyId) throws SystemException {
042                    if (PrefsPropsUtil.getBoolean(
043                                    companyId, PropsKeys.NTLM_AUTH_ENABLED,
044                                    PropsValues.NTLM_AUTH_ENABLED)) {
045    
046                            return true;
047                    }
048                    else {
049                            return false;
050                    }
051            }
052    
053            public static boolean isSiteMinderEnabled(long companyId)
054                    throws SystemException {
055    
056                    if (PrefsPropsUtil.getBoolean(
057                                    companyId, PropsKeys.SITEMINDER_AUTH_ENABLED,
058                                    PropsValues.SITEMINDER_AUTH_ENABLED)) {
059    
060                            return true;
061                    }
062                    else {
063                            return false;
064                    }
065            }
066    
067    }