I'm creating a new user (v3.x) via a module helper function.
the helper function is called via AJAX. this all works fine.
I'm having trouble getting the user registration to work.
I've previously written this for a back end component and thought the code would just move across but it doesn't any help would be great:
$data['name'] = $userName; $data['username'] = $userName; $data['email1'] = $email; $data['email2'] = $email1; $pwd = md5($password1); $data['password1'] = $pwd; $data['password2'] = $pwd; $language = JFactory::getLanguage(); $language->load('com_users', JPATH_SITE, 'en-GB', true); JModelLegacy::addIncludePath(JPATH_ROOT . '/components/com_users/models'); $model = JModelLegacy::getInstance('Registration', 'UsersModel'); $return = $model->register($data);