001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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)
042                    throws SystemException {
043    
044                    if (PrefsPropsUtil.getBoolean(
045                                    companyId, PropsKeys.NTLM_AUTH_ENABLED,
046                                    PropsValues.NTLM_AUTH_ENABLED)) {
047    
048                            return true;
049                    }
050                    else {
051                            return false;
052                    }
053            }
054    
055            public static boolean isSiteMinderEnabled(long companyId)
056                    throws SystemException {
057    
058                    if (PrefsPropsUtil.getBoolean(
059                                    companyId, PropsKeys.SITEMINDER_AUTH_ENABLED,
060                                    PropsValues.SITEMINDER_AUTH_ENABLED)) {
061    
062                            return true;
063                    }
064                    else {
065                            return false;
066                    }
067            }
068    
069    }