/** * Validates a user password & ensures an encrypted password is set * * @see \CMF\Model\User::_event_before_save() */ private function _ensure_and_validate_password() { if (!empty($this->password)) { $this->encrypted_password = Auth::encrypt_password($this->password); } if (empty($this->encrypted_password)) { throw new \Exception(\Lang::get('admin.validation.required', array('field' => 'Password'))); } }