Use the "alnum" method when generating random strings via the codeigniter helper function (generates shorter strings)

This commit is contained in:
Alex Tselegidis 2020-09-23 14:37:09 +03:00
parent 8dce5bf17a
commit cfc6167d4f
2 changed files with 2 additions and 2 deletions

View file

@ -143,7 +143,7 @@ class Installation extends CI_Controller {
$services['id'] = $this->services_model->add($services); $services['id'] = $this->services_model->add($services);
$salt = generate_salt(); $salt = generate_salt();
$password = random_string('sha1', 12); $password = random_string('alnum', 12);
$sample_provider = [ $sample_provider = [
'first_name' => 'John', 'first_name' => 'John',

View file

@ -186,7 +186,7 @@ class User_Model extends CI_Model {
$user_id = $result->row()->id; $user_id = $result->row()->id;
// Create a new password and send it with an email to the given email address. // Create a new password and send it with an email to the given email address.
$new_password = random_string('sha1', 12); $new_password = random_string('alnum', 12);
$salt = $this->db->get_where('user_settings', ['id_users' => $user_id])->row()->salt; $salt = $this->db->get_where('user_settings', ['id_users' => $user_id])->row()->salt;
$hash_password = hash_password($salt, $new_password); $hash_password = hash_password($salt, $new_password);
$this->db->update('user_settings', ['password' => $hash_password], ['id_users' => $user_id]); $this->db->update('user_settings', ['password' => $hash_password], ['id_users' => $user_id]);