Welcome Guest, Not a member yet? Register   Sign In
flexi auth - A user authentication library for CodeIgniter

[eluser]mautone[/eluser]
Hi.

I have a problem when i'm trying to create a user.
I'm doing it locally.

I already have a user in my db with the email [email protected]. I then try to create a new one with an email like this something [email protected].
It returns an error saying that there is already a user with that email address
Code:
//Create rules for the form
  $this->form_validation->set_rules(config_item('input_register_username'), 'Brugernavn', 'required');
  $this->form_validation->set_rules(config_item('input_register_email'), 'Email', 'required|valid_email');
  $this->form_validation->set_rules(config_item('input_register_password'), 'Adgangskode', 'required');
  $this->form_validation->set_rules(config_item('input_register_repeat_password'), 'Gentag adgangskode', 'required|matches[' . config_item('input_register_password') . ']');
  
  //Check if the validation returns true
  if($this->form_validation->run() === TRUE){
  
   //Convert to varialbles
   $email = $this->input->post(config_item('input_register_email'));
   $username = $this->input->post(config_item('input_register_username'));
   $password = $this->input->post(config_item('input_register_password'));
  
   //Check if email is available
   if($this->flexi_auth->email_available($email) === FALSE){
    
    //Check if username is available
    if($this->flexi_auth->username_available($username) === FALSE){
    
     //Check if the user is created
     if($this->flexi_auth->insert_user($email, $username, $password, '' , 1, TRUE)){
      //Create a message and send the user to the login form
      $this->session->set_flashdata('message', $this->flexi_auth->get_messages());
      redirect('admin/auth/login', 'refresh');
     } else {
      //Create a error and send the user back to the form
      $this->session->set_flashdata('error', $this->flexi_auth->get_messages());
      redirect('admin/auth/register', 'refresh');
     }

    } else {
     //Username is already taken. Set error and send user back
     $this->session->set_flashdata('error', 'Brugernavn findes allerede. Vælg venligst et andet');
     redirect('admin/auth/register', 'refresh');
    }

   } else {
    //Email is already taken. Set error and send user back
    $this->session->set_flashdata('error', 'En bruger anvender allerede denne emailadresse. Vælg venligst en anden');
    redirect('admin/auth/register', 'refresh');
   }
  
  
  }
  
  render_view(lang('login_register_title'), 'register', $this->data['view'], TRUE);
}

Can somebody tell me where i can make it possible so the domain of the email address can be the same but not the whole email address?


Messages In This Thread
flexi auth - A user authentication library for CodeIgniter - by El Forum - 12-26-2013, 01:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB