public function onAfterWrite()
    {
        parent::onAfterWrite();

        if ($this->owner->PasswordEncryption != Security::config()->get('password_encryption_algorithm')) {
            $this->resetPasswordEncryption();
        }
    }