internal static bool IsValidPassword(string pwd, string newPwd, UserChangePassword control) { if (String.IsNullOrEmpty(pwd) || String.IsNullOrEmpty(newPwd)) { control.Message = HttpContext.GetGlobalResourceObject("PublicRegistrationPortlet", "PasswordNotValid") as string; return false; } return true; }
protected virtual bool ChangeCurrentUserPassword(string pwd, string newPwd, UserChangePassword control) { if (pwd.Equals(newPwd)) { var u = User.LoadNode(User.Current.Id) as User; #region from changeset #16856 u.Password = pwd; #endregion u.PasswordHash = User.EncodePassword(pwd); this.ChangeToAdminAccount(); u.Save(); this.RestoreOriginalUser(); return true; } else control.Message = HttpContext.GetGlobalResourceObject("PublicRegistrationPortlet", "PasswordsDontMatch") as string; return false; }