Example #1
0
    protected void determineContextAndSendEmail(IConciergeAPIService serviceProxy)
    {
        targetPortalUser = serviceProxy.Get(ContextID).ResultValue.ConvertTo <msPortalUser>();

        //Send the forgotten password email
        serviceProxy.SendForgottenPortalPasswordEmail(targetPortalUser.Name, CompleteUrl);
    }
Example #2
0
    protected void gvDuplicates_RowCommand(Object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.ToLower() == "select")
        {
            if (MultiStepWizards.CreateAccount.InitiatedByLeader)
            {
                MultiStepWizards.CreateAccount.InitiatedByLeader = false;
                GoTo(string.Format("~/membership/Join.aspx?entityID={0}", e.CommandArgument));
                return;
            }

            msPortalUser portalUser = null;

            using (IConciergeAPIService proxy = GetConciegeAPIProxy())
            {
                portalUser = proxy.GetOrCreatePortalUserForEntity(e.CommandArgument.ToString()).ResultValue;
            }

            if (portalUser == null)
            {
                GoTo("~/profile/UnableToCreateAccount.aspx");
                return;
            }

            GoTo(string.Format("~/profile/EmailLoginInformation.aspx?contextID={0}", portalUser.ID));
            return;
        }
    }
Example #3
0
    /// <summary>
    /// Initializes the target object for the page
    /// </summary>
    /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing
    /// an event, the target object is an event. When looking up a directory, that's the target
    /// object. This method is intended to be overriden to initialize the target object for
    /// each page that needs it.</remarks>
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        user = LoadObjectFromAPI <msPortalUser>(ConciergeAPI.CurrentUser.ID);

        if (user == null)
        {
            GoToMissingRecordPage();
            return;
        }
    }
    protected void tryGetOrCreatePortalUser(IConciergeAPIService serviceProxy)
    {
        //The API GetOrCreatePortalUser will attempt to match the supplied credentials to a portal user, individual, or organization.
        //If a portal user is found it will be returned.  If not and an individual / organization uses the email address it will create and return a new Portal User
        ConciergeResult <msPortalUser> result = serviceProxy.SearchAndGetOrCreatePortalUser(tbLoginID.Text);

        //The portal user in the result will be null if the e-mail didn't match anywhere
        if (result.ResultValue == null)
        {
            return;
        }

        portalUser = result.ResultValue.ConvertTo <msPortalUser>();

        //Send the forgotten password email
        var sendEmailResult = serviceProxy.SendForgottenPortalPasswordEmail(portalUser.Name, null);
    }
Example #5
0
    public static void CheckToSeeIfMultipleIdentitiesAreAccessible()
    {
        // now - are there alternate accessible entities?
        var entities = ConciergeAPI.AccessibleEntities;

        if (entities == null || entities.Count == 0) // well, what entity do we login as?
        {
            return;
        }

        // automatically insert the current entity
        if (!entities.Exists(x => x.ID == ConciergeAPI.CurrentEntity.ID))
        {
            entities.Insert(0, new LoginResult.AccessibleEntity
            {
                ID   = ConciergeAPI.CurrentEntity.ID,
                Name = ConciergeAPI.CurrentEntity.Name,
                Type = ConciergeAPI.CurrentEntity.ClassType
            });

            ConciergeAPI.AccessibleEntities = entities;
            // remember, the session is out of proc, so we need to restore it
        }

        msPortalUser currentUser = ConciergeAPI.CurrentUser;

        if (currentUser.LastLoggedInAs != null && entities.Exists(x => x.ID == currentUser.LastLoggedInAs))
        {
            // use this one
            ConciergeAPI.CurrentEntity = APIExtensions.LoadObjectFromAPI <msEntity>(currentUser.LastLoggedInAs);
            return;
        }

        // we have multiple identiites
        HttpContext.Current.Response.Redirect("/MultipleEntitiesDetected.aspx?redirectURL=" + HttpContext.Current.Request.QueryString["redirectURL"]);
    }