protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            Visible = (!PortalSettings.HideLoginControl || Request.IsAuthenticated) &&
                      (!PortalSettings.InErrorPageRequest() || ShowInErrorPage);
        }
        private Entities.LoginLink GetModel()
        {
            Entities.LoginLink LoginLink = new Entities.LoginLink();
            string             returnUrl = HttpContext.Current?.Request.QueryString["returnurl"] != null ? HttpContext.Current?.Request.QueryString["returnurl"] : HttpContext.Current?.Request.RawUrl;

            PortalSettings PortalSettings = PortalController.Instance.GetCurrentSettings() as PortalSettings;
            bool           Visible        = (!PortalSettings.HideLoginControl || HttpContext.Current.Request.IsAuthenticated) &&
                                            (!PortalSettings.InErrorPageRequest());

            LoginLink.Url = Managers.LoginLinkManager.LoginURL(returnUrl, false);

            if (Visible)
            {
                LoginLink.IsAuthenticated = HttpContext.Current.Request.IsAuthenticated;
                if (LoginLink.IsAuthenticated)
                {
                    LoginLink.Url = Core.Managers.LoginManager.Logoff();
                }
            }
            return(LoginLink);
        }
示例#3
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            Visible = !PortalSettings.InErrorPageRequest() || ShowInErrorPage;
        }