protected function beforeSave() { if ($this->isNew) { $holiday = Holiday::localeFromCountry($this->language); if ($holiday !== false) { $this->holidayset = $holiday; } } if (!$this->isNew && empty($this->holidayset) && ($contact = $this->createContact())) { $holiday = Holiday::localeFromCountry($contact->country); if ($holiday !== false) { $this->holidayset = $holiday; } } if ($this->isModified('password') && !empty($this->password)) { $this->_unencryptedPassword = $this->password; $this->password = $this->_encryptPassword($this->password); $this->password_type = 'crypt'; $this->digest = md5($this->username . ":" . GO::config()->product_name . ":" . $this->_unencryptedPassword); } return parent::beforeSave(); }