Exemple #1
0
        public async Task <ActionResult> SaveUserAccess(UserAccessViewModel model, bool isUpdate = false)
        {
            string generatedPassword;
            var    _permissionAccess = model._userAccessPermission;

            _permissionAccess.Password = AppConfigurationHelper.PasswordGenerator();
            generatedPassword          = _permissionAccess.Password;


            _permissionAccess.Password = AppConfigurationHelper.AutoHashing(_permissionAccess.Password);
            var _SaveUserAccess = await UserAccessService.SaveUserAccess(_permissionAccess, isUpdate);

            if (_SaveUserAccess.flag == 0)
            {
                GenerateUserFolder(_permissionAccess.UserId);
            }
            if (_SaveUserAccess.flag == 0 && !string.IsNullOrEmpty(model._userAccessPermission.SelectedMapUserId))
            {
                var _SaveUserAccessMapping = await UserAccessService.SaveUserAccessMapping(model._userAccessPermission);

                if (isUpdate && !_permissionAccess.ChangePasswordInd)
                {
                    return(Json(new { resultCd = _SaveUserAccessMapping }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    _SaveUserAccessMapping.desp = _SaveUserAccessMapping.flag == 0 ? _SaveUserAccessMapping.desp + ", password: "******", password: " + generatedPassword : _SaveUserAccess.desp;
                return(Json(new { resultCd = _SaveUserAccess }, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #2
0
 public override string HashPassword(string password)
 {
     return(AppConfigurationHelper.AutoHashing(password));
 }