Exemplo n.º 1
0
        /// <summary>
        /// Fixed:
        /// </summary>
        public bool Authenticate()
        {
            var ret = false;

            switch (Parameters.Authentication.Provider)
            {
            case "LDAP":
                ret = Ldap.Authenticate(LoginId, Forms.Data("Users_Password"));
                if (ret)
                {
                    Get(SiteSettingsUtilities.UsersSiteSettings(),
                        where : Rds.UsersWhere().LoginId(LoginId));
                }
                break;

            case "Extension":
                var user = Extension.Authenticate(LoginId, Password);
                ret = user != null;
                if (ret)
                {
                    Get(SiteSettingsUtilities.UsersSiteSettings(),
                        where : Rds.UsersWhere()
                        .TenantId(user.TenantId)
                        .UserId(user.Id));
                }
                break;

            default:
                ret = GetByCredentials(LoginId, Password, Forms.Int("SelectedTenantId"));
                break;
            }
            return(ret);
        }