Пример #1
0
        public string SendNotificationToChange(string userId)
        {
            var user = CoreContext.UserManager.GetUsers(
                string.IsNullOrEmpty(userId)
                    ? SecurityContext.CurrentAccount.ID
                    : new Guid(userId));

            var canChange =
                user.IsMe() ||
                SecurityContext.CheckPermissions(new UserSecurityProvider(user.ID), ASC.Core.Users.Constants.Action_EditUser);

            if (!canChange)
            {
                throw new SecurityAccessDeniedException(Resource.ErrorAccessDenied);
            }

            user.MobilePhoneActivationStatus = MobilePhoneActivationStatus.NotActivated;
            CoreContext.UserManager.SaveUserInfo(user);

            if (user.IsMe())
            {
                return(CommonLinkUtility.GetConfirmationUrl(user.Email, ConfirmType.PhoneActivation));
            }

            StudioNotifyService.Instance.SendMsgMobilePhoneChange(user);
            return(string.Empty);
        }
        public void SendInvitePersonal(string email, string additionalMember = "")
        {
            var newUserInfo = CoreContext.UserManager.GetUserByEmail(email);

            if (CoreContext.UserManager.UserExists(newUserInfo.ID))
            {
                return;
            }

            var lang = CoreContext.Configuration.CustomMode
                           ? "ru-RU"
                           : Thread.CurrentThread.CurrentUICulture.Name;

            var culture = SetupInfo.GetPersonalCulture(lang);

            var confirmUrl = CommonLinkUtility.GetConfirmationUrl(email, ConfirmType.EmpInvite, (int)EmployeeType.User)
                             + "&emplType=" + (int)EmployeeType.User
                             + "&lang=" + culture.Key
                             + additionalMember;

            client.SendNoticeToAsync(
                CoreContext.Configuration.CustomMode ? Actions.PersonalCustomModeConfirmation : Actions.PersonalConfirmation,
                null,
                StudioNotifyHelper.RecipientFromEmail(email, false),
                new[] { EMailSenderName },
                null,
                new TagValue(Tags.InviteLink, confirmUrl),
                new TagValue(CommonTags.Footer, CoreContext.Configuration.CustomMode ? "personalCustomMode" : "personal"),
                new TagValue(CommonTags.Culture, Thread.CurrentThread.CurrentUICulture.Name));
        }
Пример #3
0
        public object ChangeOwner(Guid ownerId)
        {
            try
            {
                SecurityContext.DemandPermissions(SecutiryConstants.EditPortalSettings);

                var curTenant = CoreContext.TenantManager.GetCurrentTenant();
                var owner     = CoreContext.UserManager.GetUsers(curTenant.OwnerId);

                if (owner.IsVisitor())
                {
                    throw new System.Security.SecurityException("Collaborator can not be an owner");
                }

                if (curTenant.OwnerId.Equals(SecurityContext.CurrentAccount.ID) && !Guid.Empty.Equals(ownerId))
                {
                    var confirmLink = CommonLinkUtility.GetConfirmationUrl(owner.Email, ConfirmType.PortalOwnerChange, ownerId, ownerId);
                    StudioNotifyService.Instance.SendMsgConfirmChangeOwner(curTenant, CoreContext.UserManager.GetUsers(ownerId).DisplayUserName(), confirmLink);

                    MessageService.Send(HttpContext.Current.Request, MessageAction.OwnerSentChangeOwnerInstructions, MessageTarget.Create(owner.ID), owner.DisplayUserName(false));

                    var emailLink = string.Format("<a href=\"mailto:{0}\">{0}</a>", owner.Email);
                    return(new { Status = 1, Message = Resource.ChangePortalOwnerMsg.Replace(":email", emailLink) });
                }

                return(new { Status = 0, Message = Resource.ErrorAccessDenied });
            }
            catch (Exception e)
            {
                return(new { Status = 0, Message = e.Message.HtmlEncode() });
            }
        }
        private void SendInvite(UserInfo user, string inviteMessage, bool join, EmployeeType emplType)
        {
            var inviteUrl = CommonLinkUtility.GetConfirmationUrl(user.Email, ConfirmType.EmpInvite, (int)emplType, SecurityContext.CurrentAccount.ID)
                            + String.Format("&firstname={0}&lastname={1}&emplType={2}",
                                            HttpUtility.UrlEncode(user.FirstName),
                                            HttpUtility.UrlEncode(user.LastName),
                                            (int)emplType);

            client.SendNoticeToAsync(
                join ? Constants.ActionJoinUsers : Constants.ActionInviteUsers,
                null,
                RecipientFromEmail(new string[] { user.Email }, join),        /*if it's invite - don't check activation status*/
                new[] { EMailSenderName },
                null,
                new TagValue(Constants.TagUserName, SecurityContext.IsAuthenticated ? DisplayUserSettings.GetFullUserName(SecurityContext.CurrentAccount.ID) : ((HttpContext.Current != null) ? HttpContext.Current.Request.UserHostAddress : null)),
                new TagValue(Constants.TagInviteLink, inviteUrl),
                new TagValue(Constants.TagBody, inviteMessage ?? string.Empty),
                Constants.TagTableTop(),
                Constants.TagTableItem(1),
                Constants.TagTableItem(2),
                Constants.TagTableItem(3),
                Constants.TagTableBottom(),
                new TagValue("WithPhoto", "photo"),
                new TagValue("UserDisplayName", (user.DisplayUserName() ?? "").Trim()),
                CreateSendFromTag());
        }
        public string TfaAppNewApp(TfaModel model)
        {
            var isMe = model.Id.Equals(Guid.Empty);
            var user = CoreContext.UserManager.GetUsers(isMe ? SecurityContext.CurrentAccount.ID : model.Id);

            if (!isMe && !SecurityContext.CheckPermissions(Tenant, new UserSecurityProvider(user.ID), Constants.Action_EditUser))
            {
                throw new SecurityAccessDeniedException(Resource.ErrorAccessDenied);
            }

            if (!TfaAppAuthSettings.IsVisibleSettings || !TfaAppUserSettings.EnableForUser(user.ID))
            {
                throw new Exception(Resource.TfaAppNotAvailable);
            }

            if (user.IsVisitor(Tenant) || user.IsOutsider(Tenant))
            {
                throw new NotSupportedException("Not available.");
            }

            TfaAppUserSettings.DisableForUser(user.ID);
            MessageService.Send(MessageAction.UserDisconnectedTfaApp, MessageTarget.Create(user.ID), user.DisplayUserName(false));

            if (isMe)
            {
                return(CommonLinkUtility.GetConfirmationUrl(Tenant.TenantId, user.Email, ConfirmType.TfaActivation));
            }

            StudioNotifyService.SendMsgTfaReset(Tenant.TenantId, user);
            return(string.Empty);
        }
        private static string GenerateActivationConfirmUrl(UserInfo user)
        {
            var confirmUrl = CommonLinkUtility.GetConfirmationUrl(user.Email, ConfirmType.Activation);

            return(confirmUrl + String.Format("&uid={0}&firstname={1}&lastname={2}",
                                              SecurityContext.CurrentAccount.ID,
                                              HttpUtility.UrlEncode(user.FirstName),
                                              HttpUtility.UrlEncode(user.LastName)));
        }
 public void SendMsgProfileDeletion(string email)
 {
     client.SendNoticeToAsync(
         Constants.ActionProfileDelete,
         null,
         RecipientFromEmail(new[] { email }, false),
         new[] { EMailSenderName },
         null,
         new TagValue(Constants.TagInviteLink, CommonLinkUtility.GetConfirmationUrl(email, ConfirmType.ProfileRemove)));
 }
Пример #8
0
 public static string GenerateLink(EmployeeType employeeType)
 {
     if (CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID).IsAdmin() ||
         WebItemSecurity.IsProductAdministrator(WebItemManager.PeopleProductID, SecurityContext.CurrentAccount.ID))
     {
         return(CommonLinkUtility.GetConfirmationUrl(string.Empty, ConfirmType.LinkInvite, (int)employeeType, SecurityContext.CurrentAccount.ID)
                + String.Format("&emplType={0}", (int)employeeType));
     }
     return(null);
 }
Пример #9
0
        public object GeInviteLink(EmployeeType employeeType)
        {
            if (!WebItemSecurity.IsProductAdministrator(WebItemManager.PeopleProductID, AuthContext.CurrentAccount.ID))
            {
                throw new SecurityException("Method not available");
            }

            return(CommonLinkUtility.GetConfirmationUrl(string.Empty, ConfirmType.LinkInvite, (int)employeeType)
                   + $"&emplType={employeeType:d}");
        }
 public void SendMsgMobilePhoneChange(UserInfo userInfo)
 {
     client.SendNoticeToAsync(
         Constants.ActionPhoneChange,
         null,
         RecipientFromEmail(new[] { userInfo.Email.ToLower() }, false),
         new[] { EMailSenderName },
         null,
         new TagValue(Constants.TagInviteLink, CommonLinkUtility.GetConfirmationUrl(userInfo.Email.ToLower(), ConfirmType.PhoneActivation)),
         new TagValue("UserDisplayName", userInfo.DisplayUserName()));
 }
        public string GeInviteLink(EmployeeType employeeType)
        {
            if (!CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID).IsAdmin() &&
                !WebItemSecurity.IsProductAdministrator(WebItemManager.PeopleProductID, SecurityContext.CurrentAccount.ID))
            {
                throw new SecurityException("Method not available");
            }

            return(CommonLinkUtility.GetConfirmationUrl(string.Empty, ConfirmType.LinkInvite, (int)employeeType, SecurityContext.CurrentAccount.ID)
                   + String.Format("&emplType={0}", (int)employeeType));
        }
Пример #12
0
        public static string TfaConfirmUrl(UserInfo user)
        {
            if (user == null)
            {
                return(string.Empty);
            }
            var confirmType = TfaAppUserSettings.EnableForUser(user.ID)
                ? ConfirmType.TfaAuth
                : ConfirmType.TfaActivation;

            return(CommonLinkUtility.GetConfirmationUrl(user.Email, confirmType));
        }
 public void SendEmailChangeInstructions(UserInfo user, string email)
 {
     client.SendNoticeToAsync(
         Constants.ActionEmailChange,
         null,
         RecipientFromEmail(new[] { email }, false),
         new[] { EMailSenderName },
         null,
         new TagValue(Constants.TagUserName, SecurityContext.IsAuthenticated ? DisplayUserSettings.GetFullUserName(SecurityContext.CurrentAccount.ID) : ((HttpContext.Current != null) ? HttpContext.Current.Request.UserHostAddress : null)),
         new TagValue(Constants.TagInviteLink, CommonLinkUtility.GetConfirmationUrl(email, ConfirmType.EmailChange)),
         new TagValue(Constants.TagBody, string.Empty),
         new TagValue("UserDisplayName", string.Empty));
 }
        public void SendMsgTfaReset(UserInfo userInfo)
        {
            var confirmationUrl = CommonLinkUtility.GetConfirmationUrl(userInfo.Email.ToLower(), ConfirmType.TfaActivation);

            Func <string> greenButtonText = () => WebstudioNotifyPatternResource.ButtonChangeTfa;

            client.SendNoticeToAsync(
                Actions.TfaChange,
                null,
                StudioNotifyHelper.RecipientFromEmail(userInfo.Email, false),
                new[] { EMailSenderName },
                null,
                TagValues.GreenButton(greenButtonText, confirmationUrl));
        }
        public string SendDeleteInstructions()
        {
            SecurityContext.DemandPermissions(SecutiryConstants.EditPortalSettings);

            var tenant = CoreContext.TenantManager.GetCurrentTenant();
            var owner = CoreContext.UserManager.GetUsers(tenant.OwnerId);

            StudioNotifyService.Instance.SendMsgPortalDeletion(tenant, CommonLinkUtility.GetConfirmationUrl(owner.Email, ConfirmType.PortalRemove));

            MessageService.Send(HttpContext.Current.Request, MessageAction.OwnerSentPortalDeleteInstructions, owner.DisplayUserName(false));

            var emailLink = string.Format("<a href=\"mailto:{0}\">{0}</a>", owner.Email);
            return Resource.AccountDeletionMsg.Replace(":email", emailLink);
        }
        public void UserPasswordChange(UserInfo userInfo)
        {
            var hash = Hasher.Base64Hash(CoreContext.Authentication.GetUserPasswordHash(userInfo.ID));

            client.SendNoticeToAsync(
                Constants.ActionPasswordChange,
                null,
                RecipientFromEmail(new[] { userInfo.Email }, false),
                new[] { EMailSenderName },
                null,
                new TagValue(Constants.TagUserName, SecurityContext.IsAuthenticated ? DisplayUserSettings.GetFullUserName(SecurityContext.CurrentAccount.ID) : ((HttpContext.Current != null) ? HttpContext.Current.Request.UserHostAddress : null)),
                new TagValue(Constants.TagInviteLink, CommonLinkUtility.GetConfirmationUrl(userInfo.Email, ConfirmType.PasswordChange, hash)),
                new TagValue(Constants.TagBody, string.Empty),
                new TagValue("UserDisplayName", userInfo.DisplayUserName()));
        }
Пример #17
0
        public static string SmsConfirmUrl(UserInfo user)
        {
            if (user == null)
            {
                return(string.Empty);
            }

            var confirmType =
                string.IsNullOrEmpty(user.MobilePhone) ||
                user.MobilePhoneActivationStatus == MobilePhoneActivationStatus.NotActivated
                    ? ConfirmType.PhoneActivation
                    : ConfirmType.PhoneAuth;

            return(CommonLinkUtility.GetConfirmationUrl(user.Email, confirmType));
        }
        public void SendCongratulations(UserInfo u)
        {
            try
            {
                INotifyAction notifyAction;
                var           footer    = "common";
                var           analytics = string.Empty;

                if (TenantExtra.Enterprise)
                {
                    var defaultRebranding = MailWhiteLabelSettings.Instance.IsDefault;
                    notifyAction = defaultRebranding ? Actions.EnterpriseAdminActivationV10 : Actions.EnterpriseWhitelabelAdminActivationV10;
                    footer       = null;
                }
                else if (TenantExtra.Opensource)
                {
                    notifyAction = Actions.OpensourceAdminActivation;
                    footer       = "opensource";
                }
                else
                {
                    notifyAction = Actions.SaasAdminActivationV10;
                    var tenant = CoreContext.TenantManager.GetCurrentTenant();
                    analytics = StudioNotifyHelper.GetNotifyAnalytics(tenant.TenantId, notifyAction, false, true, false, false);
                }

                var confirmationUrl = CommonLinkUtility.GetConfirmationUrl(u.Email, ConfirmType.EmailActivation);
                confirmationUrl += "&first=true";

                Func <string> greenButtonText = () => WebstudioNotifyPatternResource.ButtonConfirm;

                client.SendNoticeToAsync(
                    notifyAction,
                    null,
                    StudioNotifyHelper.RecipientFromEmail(u.Email, false),
                    new[] { EMailSenderName },
                    null,
                    new TagValue(Tags.UserName, u.FirstName.HtmlEncode()),
                    new TagValue(Tags.MyStaffLink, GetMyStaffLink()),
                    TagValues.GreenButton(greenButtonText, confirmationUrl),
                    new TagValue(CommonTags.Footer, footer),
                    new TagValue(CommonTags.Analytics, analytics));
            }
            catch (Exception error)
            {
                LogManager.GetLogger("ASC.Notify").Error(error);
            }
        }
        public void SendEmailActivationInstructions(UserInfo user, string email)
        {
            var confirmationUrl = CommonLinkUtility.GetConfirmationUrl(email, ConfirmType.EmailActivation);

            Func <string> greenButtonText = () => WebstudioNotifyPatternResource.ButtonActivateEmail;

            client.SendNoticeToAsync(
                Actions.ActivateEmail,
                null,
                StudioNotifyHelper.RecipientFromEmail(email, false),
                new[] { EMailSenderName },
                null,
                new TagValue(Tags.InviteLink, confirmationUrl),
                TagValues.GreenButton(greenButtonText, confirmationUrl),
                new TagValue(Tags.UserDisplayName, (user.DisplayUserName() ?? string.Empty).Trim()));
        }
        public void SendJoinMsg(string email, EmployeeType emplType)
        {
            var inviteUrl = CommonLinkUtility.GetConfirmationUrl(email, ConfirmType.EmpInvite, (int)emplType)
                            + String.Format("&emplType={0}", (int)emplType);

            Func <string> greenButtonText = () => WebstudioNotifyPatternResource.ButtonJoin;

            client.SendNoticeToAsync(
                Actions.JoinUsers,
                null,
                StudioNotifyHelper.RecipientFromEmail(email, true),
                new[] { EMailSenderName },
                null,
                new TagValue(Tags.InviteLink, inviteUrl),
                TagValues.GreenButton(greenButtonText, inviteUrl));
        }
        private static string GenerateDnsChangeConfirmUrl(string email, string dnsName, string tenantAlias, ConfirmType confirmType)
        {
            var postfix = string.Join(string.Empty, new[] { dnsName, tenantAlias });

            var sb = new StringBuilder();

            sb.Append(CommonLinkUtility.GetConfirmationUrl(email, confirmType, postfix));
            if (!string.IsNullOrEmpty(dnsName))
            {
                sb.AppendFormat("&dns={0}", dnsName);
            }
            if (!string.IsNullOrEmpty(tenantAlias))
            {
                sb.AppendFormat("&alias={0}", tenantAlias);
            }
            return(sb.ToString());
        }
        public object SendDeactivateInstructions()
        {
            SecurityContext.DemandPermissions(SecutiryConstants.EditPortalSettings);

            var tenant = CoreContext.TenantManager.GetCurrentTenant();
            var owner  = CoreContext.UserManager.GetUsers(tenant.OwnerId);

            var suspendUrl  = CommonLinkUtility.GetConfirmationUrl(owner.Email, ConfirmType.PortalSuspend);
            var continueUrl = CommonLinkUtility.GetConfirmationUrl(owner.Email, ConfirmType.PortalContinue);

            StudioNotifyService.Instance.SendMsgPortalDeactivation(tenant, suspendUrl, continueUrl);

            MessageService.Send(HttpContext.Current.Request, MessageAction.OwnerSentPortalDeactivationInstructions, MessageTarget.Create(owner.ID), owner.DisplayUserName(false));

            var emailLink = string.Format("<a href=\"mailto:{0}\">{0}</a>", owner.Email.HtmlEncode());

            return(Resource.AccountDeactivationMsg.Replace(":email", emailLink));
        }
        public void SendCongratulations(UserInfo u)
        {
            var tariff = CoreContext.TenantManager.GetTenantQuota(CoreContext.TenantManager.GetCurrentTenant().TenantId);

            client.SendNoticeToAsync(
                tariff != null && tariff.Trial ? Constants.ActionCongratulations : Constants.ActionCongratulationsNoTrial,
                null,
                RecipientFromEmail(new[] { u.Email.ToLower() }, false),
                new[] { EMailSenderName },
                null,
                new TagValue(Constants.TagUserName, u.DisplayUserName()),
                new TagValue(Constants.TagUserEmail, u.Email),
                new TagValue(Constants.TagMyStaffLink, GetMyStaffLink()),
                new TagValue(Constants.TagSettingsLink, CommonLinkUtility.GetAdministration(ManagementType.General)),
                new TagValue(Constants.TagInviteLink, CommonLinkUtility.GetConfirmationUrl(u.Email, ConfirmType.EmailActivation)),
                Constants.TagNoteStart,
                Constants.TagNoteEnd,
                new TagValue("WithPhoto", "photo"));
        }
Пример #24
0
        public string SendDeleteInstructions()
        {
            SecurityContext.DemandPermissions(SecutiryConstants.EditPortalSettings);

            var tenant = CoreContext.TenantManager.GetCurrentTenant();
            var owner  = CoreContext.UserManager.GetUsers(tenant.OwnerId);

            var showAutoRenewText = !CoreContext.Configuration.Standalone &&
                                    CoreContext.PaymentManager.GetTariffPayments(TenantProvider.CurrentTenantID).Any() &&
                                    !TenantExtra.GetTenantQuota().Trial;

            StudioNotifyService.Instance.SendMsgPortalDeletion(tenant, CommonLinkUtility.GetConfirmationUrl(owner.Email, ConfirmType.PortalRemove), showAutoRenewText);

            MessageService.Send(HttpContext.Current.Request, MessageAction.OwnerSentPortalDeleteInstructions, owner.DisplayUserName(false));

            var emailLink = string.Format("<a href=\"mailto:{0}\">{0}</a>", owner.Email);

            return(Resource.AccountDeletionMsg.Replace(":email", emailLink));
        }
        public void UserPasswordChange(UserInfo userInfo)
        {
            var hash            = CoreContext.Authentication.GetUserPasswordStamp(userInfo.ID).ToString("s");
            var confirmationUrl = CommonLinkUtility.GetConfirmationUrl(userInfo.Email, ConfirmType.PasswordChange, hash);

            Func <string> greenButtonText = () => WebstudioNotifyPatternResource.ButtonChangePassword;

            var action = CoreContext.Configuration.Personal
                             ? (CoreContext.Configuration.CustomMode ? Actions.PersonalCustomModePasswordChange : Actions.PersonalPasswordChange)
                             : Actions.PasswordChange;

            client.SendNoticeToAsync(
                action,
                null,
                StudioNotifyHelper.RecipientFromEmail(userInfo.Email, false),
                new[] { EMailSenderName },
                null,
                TagValues.GreenButton(greenButtonText, confirmationUrl));
        }
        public void SendMsgProfileDeletion(UserInfo user)
        {
            var confirmationUrl = CommonLinkUtility.GetConfirmationUrl(user.Email, ConfirmType.ProfileRemove);

            Func <string> greenButtonText = () => CoreContext.Configuration.Personal ? WebstudioNotifyPatternResource.ButtonConfirmTermination : WebstudioNotifyPatternResource.ButtonRemoveProfile;

            var action = CoreContext.Configuration.Personal
                             ? (CoreContext.Configuration.CustomMode ? Actions.PersonalCustomModeProfileDelete : Actions.PersonalProfileDelete)
                             : Actions.ProfileDelete;

            client.SendNoticeToAsync(
                action,
                null,
                StudioNotifyHelper.RecipientFromEmail(user.Email, false),
                new[] { EMailSenderName },
                null,
                TagValues.GreenButton(greenButtonText, confirmationUrl),
                new TagValue(CommonTags.Culture, user.GetCulture().Name));
        }
        public void SendEmailChangeInstructions(UserInfo user, string email)
        {
            var confirmationUrl = CommonLinkUtility.GetConfirmationUrl(email, ConfirmType.EmailChange, SecurityContext.CurrentAccount.ID);

            Func <string> greenButtonText = () => WebstudioNotifyPatternResource.ButtonChangeEmail;

            var action = CoreContext.Configuration.Personal
                             ? (CoreContext.Configuration.CustomMode ? Actions.PersonalCustomModeEmailChangeV115 : Actions.PersonalEmailChangeV115)
                             : Actions.EmailChangeV115;

            client.SendNoticeToAsync(
                action,
                null,
                StudioNotifyHelper.RecipientFromEmail(email, false),
                new[] { EMailSenderName },
                null,
                TagValues.GreenButton(greenButtonText, confirmationUrl),
                new TagValue(CommonTags.Culture, user.GetCulture().Name));
        }
        public void SendMsgRestoreCompleted(bool notifyAllUsers)
        {
            var users = notifyAllUsers
                    ? CoreContext.UserManager.GetUsers(EmployeeStatus.Active)
                    : new[] { CoreContext.UserManager.GetUsers(CoreContext.TenantManager.GetCurrentTenant().OwnerId) };

            foreach (var user in users)
            {
                var hash            = CoreContext.Authentication.GetUserPasswordStamp(user.ID).ToString("s");
                var confirmationUrl = CommonLinkUtility.GetConfirmationUrl(user.Email, ConfirmType.PasswordChange, hash);

                Func <string> greenButtonText = () => WebstudioNotifyPatternResource.ButtonSetPassword;

                client.SendNoticeToAsync(
                    Actions.RestoreCompletedV115,
                    null,
                    new IRecipient[] { user },
                    new[] { EMailSenderName },
                    null,
                    TagValues.GreenButton(greenButtonText, confirmationUrl));
            }
        }
Пример #29
0
        public string LogOutAllActiveConnectionsChangePassword()
        {
            try
            {
                var user     = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID);
                var userName = user.DisplayUserName(false);

                LogOutAllActiveConnections(user.ID);

                Auth.ProcessLogout();

                var auditEventDate  = DateTime.UtcNow;
                var hash            = auditEventDate.ToString("s");
                var confirmationUrl = CommonLinkUtility.GetConfirmationUrl(user.Email, ConfirmType.PasswordChange, hash);
                MessageService.Send(Request, auditEventDate, MessageAction.UserSentPasswordChangeInstructions, MessageTarget.Create(user.ID), userName);

                return(confirmationUrl);
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                return(null);
            }
        }
 public void UserPasswordChange(int tenantId, UserInfo userInfo)
 {
     var hash            = Hasher.Base64Hash(CoreContext.Authentication.GetUserPasswordHash(tenantId, userInfo.ID));
     var confirmationUrl = CommonLinkUtility.GetConfirmationUrl(tenantId, userInfo.Email, ConfirmType.PasswordChange, hash + userInfo.ID, userInfo.ID);