Exemplo n.º 1
0
        public async Task <RegisterOutput> Register(RegisterInput input)
        {
            var user = await _userRegistrationManager.RegisterAsync(
                input.Name,
                input.Surname,
                input.EmailAddress,
                input.UserName,
                input.Password,
                true // Assumed email address is always confirmed. Change this if you want to implement email confirmation.
                );

            _notificationSubscriptionManager.SubscribeToAllAvailableNotifications(user.ToUserIdentifier());
            await _appNotifier.WelcomeToTheApplicationAsync(user);


            var notification = _userNotificationManager.GetUserNotifications(user.ToUserIdentifier());

            await _realTimeNotifier.SendNotificationsAsync(notification.ToArray());

            var isEmailConfirmationRequiredForLogin = await SettingManager.GetSettingValueAsync <bool>(AbpZeroSettingNames.UserManagement.IsEmailConfirmationRequiredForLogin);

            return(new RegisterOutput
            {
                CanLogin = user.IsActive && (user.IsEmailConfirmed || !isEmailConfirmationRequiredForLogin)
            });
        }
Exemplo n.º 2
0
        public async Task <ListResultDto <UserNotification> > GetUserNotifications(long userId)
        {
            var user = await _userManager.GetUserByIdAsync(userId);

            var userNotifications = _userNotificationManager.GetUserNotifications(user.ToUserIdentifier());


            return(new ListResultDto <UserNotification>(ObjectMapper.Map <List <UserNotification> >(userNotifications)));
        }
Exemplo n.º 3
0
        public ActionResult Notice()
        {
            var notices = _notificationManager.GetUserNotifications(new Abp.UserIdentifier(null, AbpSession.UserId.Value), UserNotificationState.Unread);

            return(PartialView(notices));
        }