Ejemplo n.º 1
0
        /// ****************************************************************
        ///   protected Render
        /// ----------------------------------------------------------------
        ///   <summary>
        ///     Renders the control.
        ///   </summary>
        /// ****************************************************************
        ///
        protected override void Render(HtmlTextWriter output)
        {
            if ((Config.GetInt("Security.AuthenticationMode", (int)AuthenticationMode.Windows) & (int)AuthenticationMode.Passport) != 0)
            {
                PassportIdentity passport = (PassportIdentity)Context.User.Identity;

                //
                // Display the Passport login image.
                //
                int  timeWindow = Config.GetInt("Passport.TimeWindow", 14400);
                bool secure     = Request.IsSecureConnection;

                string thisUrl = (Request.IsSecureConnection ? "https://" : "http://") +
                                 Request.ServerVariables["SERVER_NAME"] +
                                 Request.ServerVariables["SCRIPT_NAME"];

                if (Utility.StringEmpty(ReturnUrl))
                {
                    ReturnUrl = thisUrl;
                }

                //
                // Update this to LogoTag2 when Passport .NET support is updated.
                //
                string html = passport.LogoTag(ReturnUrl, timeWindow, forceLogin, "", 0, secure, "", 0, false);

                output.WriteLine(
                    "&nbsp;&nbsp;" +
                    html.Replace("<A ", "<A TARGET='_top' ") +
                    "&nbsp;&nbsp;");
            }
        }