Hi all,
I’m new to EE and doing some research for a client who needs to integrate EE with a 3rd party system (NATS from Too Much Media).
Does EE offer an API – or some other mechanism – that allows the following?
Thanks so much in advance!
Owen
Take a look at the member model.
$this->EE->load->model('member_model');
$this->EE->load->helper('security');
$data['username'] = $this->input->post('username');
$data['password'] = do_hash($this->input->post('password'));
$data['email'] = $this->EE->input->post('email');
$data['ip_address'] = $this->EE->input->ip_address();
$data['unique_id'] = random_string('encrypt');
$data['join_date'] = $this->EE->localize->now;
$data['language'] = $this->EE->config->item('deft_lang');
$data['timezone'] = ($this->EE->config->item('default_site_timezone') && $this->EE->config->item('default_site_timezone') != '') ? $this->EE->config->item('default_site_timezone') : $this->EE->config->item('server_timezone');
$data['daylight_savings'] = ($this->EE->config->item('default_site_dst') && $this->EE->config->item('default_site_dst') != '') ? $this->EE->config->item('default_site_dst') : $this->EE->config->item('daylight_savings');
$data['time_format'] = ($this->EE->config->item('time_format') && $this->EE->config->item('time_format') != '') ? $this->EE->config->item('time_format') : 'us';
$data['group_id'] = 1;
if ($this->EE->member_model->get_members('', '', '', $data['username'], '', 'username')->num_rows() > 0)
{
$this->EE->output->show_user_error('submission', 'Username already exists!!!!');
}
$member_id = $this->EE->member_model->create_member($data);
$this->EE->member_model->delete_member($member_id);You’d, of course, have to do this in your own custom module/template.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.