Ejemplo n.º 1
0
        public void InitView()
        {
            long idProvider = View.PreloadedIdProvider;

            View.IdProvider = idProvider;
            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout();
            }
            else
            {
                ModuleProviderManagement module = ModuleProviderManagement.CreatePortalmodule(UserContext.UserTypeID);
                View.AllowManagement = (module.Administration || module.ViewProviders);
                if (module.EditProvider || module.Administration)
                {
                    dtoProvider provider = Service.GetAuthenticationProvider(idProvider);
                    if (provider == null)
                    {
                        View.DisplayProviderUnknown();
                    }
                    else if (provider.Deleted != BaseStatusDeleted.None)
                    {
                        View.DisplayDeletedProvider((provider.Translation == null) ? provider.Name : provider.Translation.Name, provider.Type);
                    }
                    else
                    {
                        View.LoadProviderInfo(provider, (provider.Translation == null) ? provider.Name : provider.Translation.Name, provider.Type, (provider.Type != AuthenticationProviderType.Internal));
                        List <Language> languages = CurrentManager.GetAll <Language>().ToList();
                        View.LoadTranslations(provider.IdentifierFields, languages);
                        View.AllowEdit = true;
                    }
                }
                else
                {
                    View.DisplayNoPermission();
                }
            }
        }