|
|
|
@ -1,10 +1,7 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
|
|
|
|
|
using Volo.Abp.Identity.Settings;
|
|
|
|
|
using Volo.Abp.Settings;
|
|
|
|
|
|
|
|
|
|
namespace Volo.Abp.Identity.Web.Pages.Identity.Shared
|
|
|
|
|
{
|
|
|
|
@ -12,19 +9,7 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Shared
|
|
|
|
|
{
|
|
|
|
|
[BindProperty]
|
|
|
|
|
public PersonalSettingsInfoModel PersonalSettingsInfoModel { get; set; }
|
|
|
|
|
|
|
|
|
|
[BindProperty]
|
|
|
|
|
public PersonalSettingsInfoModel PersonalSettingsInfoModel2 { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool IsUsernameUpdateDisabled => !string.Equals(
|
|
|
|
|
SettingManager.GetOrNull(IdentitySettingNames.User.IsUserNameUpdateEnabled), "true",
|
|
|
|
|
StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
|
|
|
|
|
public bool IsEmailUpdateDisabled => !string.Equals(
|
|
|
|
|
SettingManager.GetOrNull(IdentitySettingNames.User.IsEmailUpdateEnabled), "true",
|
|
|
|
|
StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private readonly IProfileAppService _profileAppService;
|
|
|
|
|
|
|
|
|
|
public PersonalSettingsModal(IProfileAppService profileAppService)
|
|
|
|
@ -45,24 +30,6 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Shared
|
|
|
|
|
|
|
|
|
|
var updateDto = ObjectMapper.Map<PersonalSettingsInfoModel, UpdateProfileDto>(PersonalSettingsInfoModel);
|
|
|
|
|
|
|
|
|
|
ProfileDto user = null;
|
|
|
|
|
|
|
|
|
|
if (IsUsernameUpdateDisabled )
|
|
|
|
|
{
|
|
|
|
|
user = await _profileAppService.GetAsync();
|
|
|
|
|
updateDto.UserName = user.UserName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (IsEmailUpdateDisabled)
|
|
|
|
|
{
|
|
|
|
|
if (user == null)
|
|
|
|
|
{
|
|
|
|
|
user = await _profileAppService.GetAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updateDto.Email = user.Email;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await _profileAppService.UpdateAsync(updateDto);
|
|
|
|
|
|
|
|
|
|
return NoContent();
|
|
|
|
|