Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Validates the current user model's data.
- *
- * [!!] Removes password checks if not changed, and then puts them back in afterwards
- *
- * @return boolean
- */
- public function check()
- {
- if ( ! array_key_exists('password', $this->_changed))
- {
- // Tmp store password rules
- $annoying = Arr::extract($this->_rules, array('password', 'password_confirm'));
- // Unset
- unset($this->_rules['password'], $this->_rules['password_confirm']);
- // Check
- $result = parent::check();
- // Put back in
- $this->_rules += $annoying;
- // Return result
- return $result;
- }
- return parent::check();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement