/** * Set passed data into the user object and return errors if data doesn't fit * * @access private * @return boolean */ private function check_post_data() { $results = array(); $errors = array(); array_push($results, $this->_new_user->__set('_username', VPost::username())); array_push($results, $this->_new_user->__set('_nickname', VPost::username())); array_push($results, $this->_new_user->__set('_publicname', VPost::username())); array_push($results, $this->_new_user->__set('_email', VPost::email())); array_push($results, $this->_new_user->__set('_firstname', VPost::firstname())); array_push($results, $this->_new_user->__set('_lastname', VPost::lastname())); if (VPost::website()) { array_push($results, $this->_new_user->__set('_website', VPost::website())); } array_push($results, $this->_new_user->__set('_role', VPost::role())); if (VPost::pwd() == VPost::re_pwd()) { array_push($results, $this->_new_user->__set('_password', VPost::pwd())); } else { array_push($results, 'Passwords doesn\'t match'); } foreach ($results as $result) { if ($result !== true) { array_push($errors, '<li>- ' . $result . '</li>'); } } if (!empty($errors)) { $error_msg = 'Check your informations:<br/><ul>' . implode('', $errors) . '</ul>'; $this->_action_msg = ActionMessages::custom_wrong($error_msg); return false; } else { return true; } }