Remove psuedo-property SetPassword from Member

This commit is contained in:
Robbie Averill 2017-10-05 16:34:20 +13:00
parent cdf6ae45a3
commit 413034f684
2 changed files with 3 additions and 13 deletions

View File

@ -2507,6 +2507,7 @@ New `TimeField` methods replace `getConfig()` / `setConfig()`
* `LoginForm` now has an abstract method `getAuthenticatorName()`. If you have made subclasses of this,
you will need to define this method and return a short name describing the login method.
* `MemberLoginForm` has a new constructor argument for the authenticator class, athough tis is usually
* `MemberLoginForm` has a new constructor argument for the authenticator class, although this is usually
constructed by `MemberAuthenticator` and won't affect normal use.
* `Authenticator` methods `register` and `unregister` are deprecated in favor of using `Config`
* `Authenticator` methods `register` and `unregister` are deprecated in favour of using `Config`
* Unused `SetPassword` property removed from `Member`. Use `Member::changePassword` or set `Password` directly.

View File

@ -56,7 +56,6 @@ use SilverStripe\ORM\ValidationResult;
* @property int $FailedLoginCount
* @property string $DateFormat
* @property string $TimeFormat
* @property string $SetPassword Pseudo-DB field for temp storage. Not emitted to DB
*/
class Member extends DataObject
{
@ -858,10 +857,6 @@ class Member extends DataObject
*/
public function onBeforeWrite()
{
if ($this->SetPassword && !$this->passwordChangesToWrite) {
$this->Password = $this->SetPassword;
}
// If a member with the same "unique identifier" already exists with a different ID, don't allow merging.
// Note: This does not a full replacement for safeguards in the controller layer (e.g. in a registration form),
// but rather a last line of defense against data inconsistencies.
@ -1653,12 +1648,6 @@ class Member extends DataObject
}
}
if ((!$this->ID && $this->SetPassword) || $this->isChanged('SetPassword')) {
if ($this->SetPassword && $validator) {
$valid->combineAnd($validator->validate($this->SetPassword, $this));
}
}
return $valid;
}