Exemple #1
0
        // If we're using the combo, put combo value into the original username textbox so normal processing can occur
        private void Login1_LoggingIn(object sender, LoginCancelEventArgs e)
        {
            Login1.UserName = _userNameCombo.AllowCustomText && _userNameCombo.Value == string.Empty ? _userNameCombo.Text : _userNameCombo.Value;
            MembershipUser userInfo = Membership.GetUser(Login1.UserName);

            if (userInfo != null)
            {
                OrganisationSettings settings    = new OrganisationSettings();
                List <AspUser>       aspUserList = ApartmentMethods.ListAspUser(null, (Guid)userInfo.ProviderUserKey, null);
                if (aspUserList == null || aspUserList.Count == 0 ||
                    (aspUserList[0].OrganisationId.HasValue && aspUserList[0].OrganisationId != Convert.ToInt32(settings.OrganisationId)))
                {
                    this.ExtraErrorInformation.Text = Properties.Resources.UserLoginWrongOrg;
                    e.Cancel = true;
                }
            }
            Response.Cookies["ActiveModule"].Value = string.Empty;
        }
 public List <AspUser> ListAspUser(int?orgId, Guid?userId, bool?isLegacy)
 {
     return(ApartmentMethods.ListAspUser(orgId, userId, isLegacy));
 }