Пример #1
0
    /// <summary>
    /// Updates OpenID for given user.
    /// </summary>
    private void UpdateOpenID(UserInfo ui)
    {
        if (ui != null)
        {
            string oldOpenID = OpenIDUserInfoProvider.GetOpenIDByUserID(ui.UserID) ?? "";
            string newOpenID = txtOpenID.Text.Trim();

            // Only update if Open ID has changed
            if (newOpenID != oldOpenID)
            {
                UserInfo uiUpdated = OpenIDUserInfoProvider.GetUserInfoByOpenID(newOpenID);

                // Make sure that only non-existing OpenID identifier can be saved
                if ((uiUpdated == null) || (uiUpdated.UserID == ui.UserID))
                {
                    // Update or delete given OpenID related to user
                    OpenIDUserInfoProvider.UpdateOpenIDUserInfo(oldOpenID, newOpenID, ui.UserID);
                }
                else
                {
                    ShowError(GetString("mem.openid.idassignedto") + uiUpdated.UserName);
                }
            }
        }
    }
Пример #2
0
    /// <summary>
    /// Updates OpenID for given user.
    /// </summary>
    private void UpdateOpenID(UserInfo ui)
    {
        if (ui != null)
        {
            string   oldOpenID = OpenIDUserInfoProvider.GetOpenIDByUserID(ui.UserID);
            string   newOpenID = txtOpenID.Text.Trim();
            UserInfo uiUpdated = OpenIDUserInfoProvider.GetUserInfoByOpenID(newOpenID);

            // Make sure that only non-existing OpenID identificator can be saved
            if ((uiUpdated == null) || (uiUpdated.UserID == ui.UserID))
            {
                // Update or delete given OpenID related to user
                OpenIDUserInfoProvider.UpdateOpenIDUserInfo(oldOpenID, newOpenID, ui.UserID);
            }
            else
            {
                lblError.Text    = GetString("mem.openid.idassignedto") + uiUpdated.UserName;
                lblError.Visible = true;
            }
        }
    }
Пример #3
0
    /// <summary>
    /// Initializes the control properties.
    /// </summary>
    protected void SetupControl()
    {
        if (!StopProcessing)
        {
            plcError.Visible = false;

            // Check renamed DLL library
            if (!CMSOpenIDHelper.CheckOpenIdDLL())
            {
                // Error label is displayed when OpenID library is not enabled
                lblError.Text      = ResHelper.GetString("mem.openid.library");
                plcError.Visible   = true;
                plcContent.Visible = false;
            }

            // Check if OpenID module is enabled
            if (!SettingsKeyProvider.GetBoolValue(CMSContext.CurrentSiteName + ".CMSEnableOpenID") && !plcError.Visible)
            {
                // Error label is displayed only in Design mode
                if (CMSContext.ViewMode == ViewModeEnum.Design)
                {
                    StringBuilder parameter = new StringBuilder();
                    parameter.Append(GetString("header.sitemanager") + " -> ");
                    parameter.Append(GetString("settingscategory.cmssettings") + " -> ");
                    parameter.Append(GetString("settingscategory.cmsmembership") + " -> ");
                    parameter.Append(GetString("settingscategory.cmsmembershipauthentication") + " -> ");
                    parameter.Append(GetString("settingscategory.cmsopenid"));
                    if (CMSContext.CurrentUser.UserSiteManagerAdmin)
                    {
                        // Make it link for SiteManager Admin
                        parameter.Insert(0, "<a href=\"" + URLHelper.GetAbsoluteUrl("~/CMSSiteManager/default.aspx?section=settings") + "\" target=\"_top\">");
                        parameter.Append("</a>");
                    }

                    lblError.Text      = String.Format(GetString("mem.openid.disabled"), parameter.ToString());
                    plcError.Visible   = true;
                    plcContent.Visible = false;
                }
                // In other modes is webpart hidden
                else
                {
                    Visible = false;
                }
            }

            // Display webpart when no error occured
            if (!plcError.Visible && Visible)
            {
                if (!CMSContext.CurrentUser.IsAuthenticated())
                {
                    plcPasswordNew.Visible  = AllowFormsAuthentication;
                    pnlExistingUser.Visible = AllowExistingUser;

                    // Initialize OpenID session
                    response = (Dictionary <string, object>)SessionHelper.GetValue(SESSION_NAME_USERDATA);

                    userProviderUrl = ValidationHelper.GetString(SessionHelper.GetValue(SESSION_NAME_URL), null);

                    // Check that OpenID is not already registered
                    if (response != null)
                    {
                        UserInfo ui = OpenIDUserInfoProvider.GetUserInfoByOpenID((string)response["ClaimedIdentifier"]);

                        // OpenID is already registered to some user
                        if (ui != null)
                        {
                            plcContent.Visible = false;
                            plcError.Visible   = true;
                            lblError.Text      = GetString("mem.openid.openidregistered");
                        }
                    }

                    // There is no OpenID response object stored in session - hide all
                    if ((response == null) && HideForNoOpenID)
                    {
                        Visible = false;
                    }
                    else if (!RequestHelper.IsPostBack())
                    {
                        LoadData();
                    }
                }
                // Hide webpart for authenticated users
                else
                {
                    Visible = false;
                }
            }
        }
        // Hide control when StopProcessing = TRUE
        else
        {
            Visible = false;
        }
    }
    /// <summary>
    /// Checks status of current user.
    /// </summary>
    protected void CheckStatus()
    {
        // Get current site name
        string siteName = SiteContext.CurrentSiteName;
        string error    = null;

        // Check return URL
        string returnUrl = QueryHelper.GetString("returnurl", null);

        returnUrl = HttpUtility.UrlDecode(returnUrl);

        // Get current URL
        string currentUrl = RequestContext.CurrentURL;

        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "token");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.ns");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.mode");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.return_to");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.claimed_id");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.identity");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.assoc_handle");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.realm");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.response_nonce");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.signed");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.op_endpoint");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.pape.auth_level.nist");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.sig");

        // Get OpenID response status
        switch (openIDhelper.CheckStatus())
        {
        // User is authenticated
        case CMSOpenIDHelper.RESPONSE_AUTHENTICATED:
            // Claimed ID not found  = save new user
            if (OpenIDUserInfoProvider.GetUserInfoByOpenID(openIDhelper.ClaimedIdentifier) == null)
            {
                // Check whether additional user info page is set
                string additionalInfoPage = SettingsKeyInfoProvider.GetValue(siteName + ".CMSRequiredOpenIDPage").Trim();

                // No page set, user can be created
                if (String.IsNullOrEmpty(additionalInfoPage))
                {
                    // Register new user
                    UserInfo ui = AuthenticationHelper.AuthenticateOpenIDUser(openIDhelper.ClaimedIdentifier, ValidationHelper.GetString(SessionHelper.GetValue(SESSION_NAME_URL), null), siteName, false, true, ref error);

                    // If user was found or successfuly created
                    if (ui != null)
                    {
                        // Load values submited by OpenID provider
                        // Load date of birth
                        if (openIDhelper.BirthDate != DateTime.MinValue)
                        {
                            ui.UserSettings.UserDateOfBirth = openIDhelper.BirthDate;
                        }
                        // Load default country
                        if (openIDhelper.Culture != null)
                        {
                            ui.PreferredCultureCode = openIDhelper.Culture.Name;
                        }
                        // Load e-mail
                        if (!String.IsNullOrEmpty(openIDhelper.Email))
                        {
                            ui.Email = openIDhelper.Email;
                        }
                        // Nick name
                        if (!String.IsNullOrEmpty(openIDhelper.Nickname))
                        {
                            ui.UserSettings.UserNickName = openIDhelper.Nickname;
                        }
                        // User gender
                        if (openIDhelper.UserGender != null)
                        {
                            ui.UserSettings.UserGender = (int)openIDhelper.UserGender;
                        }

                        UserInfoProvider.SetUserInfo(ui);

                        // If user is enabled
                        if (ui.Enabled)
                        {
                            // Create autentification cookie
                            AuthenticationHelper.SetAuthCookieWithUserData(ui.UserName, true, Session.Timeout, new[] { "openidlogin" });
                            // Log activity
                            MembershipActivityLogger.LogLogin(ui.UserName, DocumentContext.CurrentDocument);
                        }

                        // Notify administrator
                        if (NotifyAdministrator && !String.IsNullOrEmpty(FromAddress) && !String.IsNullOrEmpty(ToAddress))
                        {
                            AuthenticationHelper.NotifyAdministrator(ui, FromAddress, ToAddress);
                        }

                        // Log user registration into the web analytics and track conversion if set
                        AnalyticsHelper.TrackUserRegistration(siteName, ui, TrackConversionName, ConversionValue);

                        MembershipActivityLogger.LogRegistration(ui.UserName, DocumentContext.CurrentDocument);
                    }

                    // Redirect when authentication was succesfull
                    if (String.IsNullOrEmpty(error))
                    {
                        if (URLHelper.IsLocalUrl(returnUrl))
                        {
                            URLHelper.Redirect(returnUrl);
                        }
                        else
                        {
                            URLHelper.Redirect(currentUrl);
                        }
                    }
                    // Display error otherwise
                    else
                    {
                        lblError.Text    = error;
                        lblError.Visible = true;
                    }
                }
                // Additional information page is set
                else
                {
                    // Store user object in session for additional use
                    StoreResponseInSession();

                    // Redirect to additional info page
                    string targetURL = URLHelper.GetAbsoluteUrl(additionalInfoPage);

                    if (URLHelper.IsLocalUrl(returnUrl))
                    {
                        // Add return URL to parameter
                        targetURL = URLHelper.AddParameterToUrl(targetURL, "returnurl", HttpUtility.UrlEncode(returnUrl));
                    }

                    URLHelper.Redirect(UrlResolver.ResolveUrl(targetURL));
                }
            }
            // Claimed OpenID is in DB
            else
            {
                // Login existing user
                UserInfo ui = AuthenticationHelper.AuthenticateOpenIDUser(openIDhelper.ClaimedIdentifier, ValidationHelper.GetString(SessionHelper.GetValue(SESSION_NAME_URL), null), siteName, false, true, ref error);

                if ((ui != null) && (ui.Enabled))
                {
                    // Create autentification cookie
                    AuthenticationHelper.SetAuthCookieWithUserData(ui.UserName, true, Session.Timeout, new[] { "openilogin" });

                    // Log activity
                    MembershipActivityLogger.LogLogin(ui.UserName, DocumentContext.CurrentDocument);

                    // Redirect user
                    if (URLHelper.IsLocalUrl(returnUrl))
                    {
                        URLHelper.Redirect(UrlResolver.ResolveUrl(URLHelper.GetAbsoluteUrl(returnUrl)));
                    }
                    else
                    {
                        URLHelper.Redirect(currentUrl);
                    }
                }
                // Display error which occured during authentication process
                else if (!String.IsNullOrEmpty(error))
                {
                    lblError.Text    = error;
                    lblError.Visible = true;
                }
                // Otherwise is user disabled
                else
                {
                    lblError.Text    = GetString("membership.userdisabled");
                    lblError.Visible = true;
                }
            }
            break;

        // Authentication was canceled
        case CMSOpenIDHelper.RESPONSE_CANCELED:
            lblError.Text    = GetString("openid.logincanceled");
            lblError.Visible = true;
            break;

        // Authentication failed
        case CMSOpenIDHelper.RESPONSE_FAILED:
            lblError.Text    = GetString("openid.loginfailed");
            lblError.Visible = true;
            break;
        }
    }
Пример #5
0
    /// <summary>
    /// Initializes the control properties.
    /// </summary>
    protected void SetupControl()
    {
        if (!StopProcessing)
        {
            plcError.Visible = false;

            // Check if OpenID module is enabled
            if (!SettingsKeyInfoProvider.GetBoolValue(SiteContext.CurrentSiteName + ".CMSEnableOpenID") && !plcError.Visible)
            {
                // Error label is displayed only in Design mode
                if (PortalContext.IsDesignMode(PortalContext.ViewMode))
                {
                    StringBuilder parameter = new StringBuilder();
                    parameter.Append(UIElementInfoProvider.GetApplicationNavigationString("cms", "Settings") + " -> ");
                    parameter.Append(GetString("settingscategory.cmsmembership") + " -> ");
                    parameter.Append(GetString("settingscategory.cmsmembershipauthentication") + " -> ");
                    parameter.Append(GetString("settingscategory.cmsopenid"));
                    if (MembershipContext.AuthenticatedUser.CheckPrivilegeLevel(UserPrivilegeLevelEnum.GlobalAdmin))
                    {
                        // Make it link for Admin
                        parameter.Insert(0, "<a href=\"" + URLHelper.GetAbsoluteUrl(ApplicationUrlHelper.GetApplicationUrl("cms", "settings")) + "\" target=\"_top\">");
                        parameter.Append("</a>");
                    }

                    lblError.Text      = String.Format(GetString("mem.openid.disabled"), parameter.ToString());
                    plcError.Visible   = true;
                    plcContent.Visible = false;
                }
                // In other modes is webpart hidden
                else
                {
                    Visible = false;
                }
            }

            // Display webpart when no error occured
            if (!plcError.Visible && Visible)
            {
                if (!AuthenticationHelper.IsAuthenticated())
                {
                    plcPasswordNew.Visible  = AllowFormsAuthentication;
                    pnlExistingUser.Visible = AllowExistingUser;

                    // Initialize OpenID session
                    response = (Dictionary <string, object>)SessionHelper.GetValue(SESSION_NAME_USERDATA);

                    userProviderUrl = ValidationHelper.GetString(SessionHelper.GetValue(SESSION_NAME_URL), null);

                    // Check that OpenID is not already registered
                    if (response != null)
                    {
                        UserInfo ui = OpenIDUserInfoProvider.GetUserInfoByOpenID((string)response["ClaimedIdentifier"]);

                        // OpenID is already registered to some user
                        if (ui != null)
                        {
                            plcContent.Visible = false;
                            plcError.Visible   = true;
                            lblError.Text      = GetString("mem.openid.openidregistered");
                        }
                    }

                    // There is no OpenID response object stored in session - hide all
                    if (response == null)
                    {
                        if (HideForNoOpenID)
                        {
                            Visible = false;
                        }
                    }
                    else if (!RequestHelper.IsPostBack())
                    {
                        LoadData();
                    }
                }
                // Hide webpart for authenticated users
                else
                {
                    Visible = false;
                }
            }
        }
        // Hide control when StopProcessing = TRUE
        else
        {
            Visible = false;
        }
    }
Пример #6
0
    /// <summary>
    /// Checks status of current user.
    /// </summary>
    protected void CheckStatus()
    {
        // Get current site name
        string siteName = CMSContext.CurrentSiteName;
        string error    = null;

        // Check return URL
        string returnUrl = QueryHelper.GetString("returnurl", null);

        returnUrl = HttpUtility.UrlDecode(returnUrl);

        // Get current URL
        string currentUrl = URLHelper.CurrentURL;

        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "token");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.ns");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.mode");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.return_to");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.claimed_id");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.identity");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.assoc_handle");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.realm");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.response_nonce");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.signed");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.op_endpoint");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.pape.auth_level.nist");
        currentUrl = URLHelper.RemoveParameterFromUrl(currentUrl, "openid.sig");

        // Get OpenID response status
        switch (openIDhelper.CheckStatus())
        {
        // User is authenticated
        case CMSOpenIDHelper.RESPONSE_AUTHENTICATED:
            // Claimed ID not found  = save new user
            if (OpenIDUserInfoProvider.GetUserInfoByOpenID(openIDhelper.ClaimedIdentifier) == null)
            {
                // Check whether additional user info page is set
                string additionalInfoPage = SettingsKeyProvider.GetStringValue(siteName + ".CMSRequiredOpenIDPage").Trim();

                // No page set, user can be created
                if (String.IsNullOrEmpty(additionalInfoPage))
                {
                    // Register new user
                    UserInfo ui = UserInfoProvider.AuthenticateOpenIDUser(openIDhelper.ClaimedIdentifier, ValidationHelper.GetString(SessionHelper.GetValue(SESSION_NAME_URL), null), siteName, false, true, ref error);

                    // If user was found or successfuly created
                    if (ui != null)
                    {
                        // Load values submited by OpenID provider
                        // Load date of birth
                        if (openIDhelper.BirthDate != DateTime.MinValue)
                        {
                            ui.UserSettings.UserDateOfBirth = openIDhelper.BirthDate;
                        }
                        // Load default country
                        if (openIDhelper.Culture != null)
                        {
                            ui.PreferredCultureCode = openIDhelper.Culture.Name;
                        }
                        // Load e-mail
                        if (!String.IsNullOrEmpty(openIDhelper.Email))
                        {
                            ui.Email = openIDhelper.Email;
                        }
                        // Nick name
                        if (!String.IsNullOrEmpty(openIDhelper.Nickname))
                        {
                            ui.UserSettings.UserNickName = openIDhelper.Nickname;
                        }
                        // User gender
                        if (openIDhelper.UserGender != null)
                        {
                            ui.UserSettings.UserGender = (int)openIDhelper.UserGender;
                        }

                        UserInfoProvider.SetUserInfo(ui);

                        // If user is enabled
                        if (ui.Enabled)
                        {
                            // Create autentification cookie
                            UserInfoProvider.SetAuthCookieWithUserData(ui.UserName, true, Session.Timeout, new string[] { "openidlogin" });
                            // Log activity
                            if ((CMSContext.ViewMode == ViewModeEnum.LiveSite) && ActivitySettingsHelper.ActivitiesEnabledAndModuleLoaded(siteName) && ActivitySettingsHelper.UserLoginEnabled(siteName))
                            {
                                int contactId = ModuleCommands.OnlineMarketingGetUserLoginContactID(ui);
                                ActivityLogHelper.UpdateContactLastLogon(contactId);
                                if (ActivitySettingsHelper.ActivitiesEnabledForThisUser(ui))
                                {
                                    TreeNode currentDoc = CMSContext.CurrentDocument;
                                    ActivityLogProvider.LogLoginActivity(contactId,
                                                                         ui, URLHelper.CurrentRelativePath, currentDoc.NodeID, siteName, CMSContext.Campaign, currentDoc.DocumentCulture);
                                }
                            }
                        }

                        // Send registration e-mails
                        // E-mail confirmation is not required as user already provided confirmation by successful login using OpenID
                        UserInfoProvider.SendRegistrationEmails(ui, null, null, false, false);

                        // Notify administrator
                        if (this.NotifyAdministrator && !String.IsNullOrEmpty(this.FromAddress) && !String.IsNullOrEmpty(this.ToAddress))
                        {
                            UserInfoProvider.NotifyAdministrator(ui, this.FromAddress, this.ToAddress);
                        }

                        // Track user registration
                        UserInfoProvider.TrackUserRegistration(this.TrackConversionName, this.ConversionValue, siteName, ui);

                        // Log activity
                        if ((CMSContext.ViewMode == ViewModeEnum.LiveSite) && ActivitySettingsHelper.ActivitiesEnabledAndModuleLoaded(siteName) && ActivitySettingsHelper.ActivitiesEnabledForThisUser(CMSContext.CurrentUser) &&
                            ActivitySettingsHelper.UserLoginEnabled(siteName))
                        {
                            int contactId = ModuleCommands.OnlineMarketingGetUserLoginContactID(ui);
                            ModuleCommands.OnlineMarketingUpdateContactFromExternalData(ui, contactId);
                            TreeNode currentDoc = CMSContext.CurrentDocument;
                            ActivityLogProvider.LogRegistrationActivity(contactId,
                                                                        ui, URLHelper.CurrentRelativePath, currentDoc.NodeID, siteName, CMSContext.Campaign, currentDoc.DocumentCulture);
                        }
                    }

                    // Redirect when authentication was succesfull
                    if (String.IsNullOrEmpty(error))
                    {
                        if (!String.IsNullOrEmpty(returnUrl))
                        {
                            URLHelper.Redirect(URLHelper.GetAbsoluteUrl(returnUrl));
                        }
                        else
                        {
                            URLHelper.Redirect(currentUrl);
                        }
                    }
                    // Display error otherwise
                    else
                    {
                        lblError.Text    = error;
                        lblError.Visible = true;
                    }
                }
                // Additional information page is set
                else
                {
                    // Store user object in session for additional use
                    SessionHelper.SetValue(SESSION_NAME_USERDATA, openIDhelper.GetResponseObject());

                    // Redirect to additional info page
                    string targetURL = URLHelper.GetAbsoluteUrl(additionalInfoPage);

                    if (!String.IsNullOrEmpty(returnUrl))
                    {
                        // Add return URL to parameter
                        targetURL = URLHelper.AddParameterToUrl(targetURL, "returnurl", HttpUtility.UrlEncode(returnUrl));
                    }
                    URLHelper.Redirect(targetURL);
                }
            }
            // Claimed OpenID is in DB
            else
            {
                // Login existing user
                UserInfo ui = UserInfoProvider.AuthenticateOpenIDUser(openIDhelper.ClaimedIdentifier, ValidationHelper.GetString(SessionHelper.GetValue(SESSION_NAME_URL), null), siteName, false, true, ref error);

                if ((ui != null) && (ui.Enabled))
                {
                    // Create autentification cookie
                    UserInfoProvider.SetAuthCookieWithUserData(ui.UserName, true, Session.Timeout, new string[] { "openilogin" });

                    // Log activity
                    if ((CMSContext.ViewMode == ViewModeEnum.LiveSite) && ActivitySettingsHelper.ActivitiesEnabledAndModuleLoaded(siteName) && ActivitySettingsHelper.UserLoginEnabled(siteName))
                    {
                        int contactId = ModuleCommands.OnlineMarketingGetUserLoginContactID(ui);
                        ActivityLogHelper.UpdateContactLastLogon(contactId);
                        if (ActivitySettingsHelper.ActivitiesEnabledForThisUser(ui))
                        {
                            TreeNode currentDoc = CMSContext.CurrentDocument;
                            ActivityLogProvider.LogLoginActivity(contactId,
                                                                 ui, URLHelper.CurrentRelativePath, currentDoc.NodeID, siteName, CMSContext.Campaign, currentDoc.DocumentCulture);
                        }
                    }

                    // Redirect user
                    if (!String.IsNullOrEmpty(returnUrl))
                    {
                        URLHelper.Redirect(URLHelper.GetAbsoluteUrl(returnUrl));
                    }
                    else
                    {
                        URLHelper.Redirect(currentUrl);
                    }
                }
                // Display error which occured during authentication process
                else if (!String.IsNullOrEmpty(error))
                {
                    lblError.Text    = error;
                    lblError.Visible = true;
                }
                // Otherwise is user disabled
                else
                {
                    lblError.Text    = GetString("membership.userdisabled");
                    lblError.Visible = true;
                }
            }
            break;

        // Authentication was canceled
        case CMSOpenIDHelper.RESPONSE_CANCELED:
            lblError.Text    = GetString("openid.logincanceled");
            lblError.Visible = true;
            break;

        // Authentication failed
        case CMSOpenIDHelper.RESPONSE_FAILED:
            lblError.Text    = GetString("openid.loginfailed");
            lblError.Visible = true;
            break;
        }
    }