Welcome Guest, Not a member yet? Register   Sign In
Saving password - IonAuth
#1

[eluser]solid9[/eluser]
Hi guys

How to properly save a password on IonAuth Database?

I also noticed it has a SALT column field.

How to properly use the SALT?

Thanks in advanced.
#2

[eluser]solid9[/eluser]
controller:
Code:
public function process_new_user()
{
  //ip_address, username, password, salk, activation_code, forgotten_password_code
  //remember_code, created_on, last_login, active, firstname, lastname, company, phone
  //Capture all data first
  //check username existence
  //check email existence
  //If username and email don't exist then store data into db.
  //send email activation message, display message
  
  //validate
  $this->form_validation->set_rules('fname', 'First Name', 'required');
  $this->form_validation->set_rules('lname', 'Last Name', 'required');
  $this->form_validation->set_rules('username', 'Username', 'required|is_unique[users.username]');
  $this->form_validation->set_rules('password', 'Password', 'required');
  $this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]');

  if ($this->form_validation->run() == FALSE)
   {
    //$data_midnav['rows'] = $this->data_model->getAll();
    $this->data['midnav'] = $this->load->view('create_user_form', '', TRUE);
    
    $this->load->view('create_user_form', $this->data);
   }
   else
   {
    //save to DB
    $userinfo = array(
     'ip_address' => $_SERVER['REMOTE_ADDR'],
     'first_name' => $this->input->post('fname', TRUE),
     'last_name' => $this->input->post('lname', TRUE),
     'username' => $this->input->post('username', TRUE),
     'password' => $this->input->post('password', TRUE),
     'email' => $this->input->post('email', TRUE),
    );
    
    $this->data_model->register_user($userinfo);
    
    //email userinfo to user
    
    
    $this->load->view('create_user_success');
   }  
}


model
Code:
function register_user($userinfo)
{
  $this->db->insert('users', $userinfo);
  return;
}



Thanks in advanced.





Theme © iAndrew 2016 - Forum software by © MyBB