Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function create_account()
- {
- $this->values($_POST, array(
- 'first_name',
- 'last_name',
- 'mobile'
- ));
- $this->user->values($_POST, array(
- 'email',
- 'username',
- 'password'
- ));
- $extra_validation = Model_User::get_password_validation($_POST)
- ->rule('password', 'not_empty');
- $landlord_validation = $this->validation();
- $user_validation = $this->user->validation();
- $user_check = $user_validation->check($extra_validation);
- $landlord_check = $landlord_validation->check();
- if ( ! $user_check OR ! $landlord_check)
- {
- $e = new ORM_Validation_Exception($this->_object_name, $landlord_validation);
- $e->add_object($this->user->_object_name, $user_validation);
- throw $e;
- }
- // Avoid validating twice
- $this->_valid = $this->user->_valid = TRUE;
- $this->user->save();
- $this->user_id = $this->user->id;
- $this->save();
- return $this;
- }
Add Comment
Please, Sign In to add comment