Commit 3c24068b by tetiana yaremko

ready to deploy

parent 773af4bf
...@@ -131,7 +131,7 @@ class Auth extends CI_Controller ...@@ -131,7 +131,7 @@ class Auth extends CI_Controller
$email = $this->input->post('email'); $email = $this->input->post('email');
$user=$this->db->get_where('users', array('email'=>$email, 'is_active'=>1))->row_array(); $user=$this->db->get_where('users', array('email'=>$email, 'is_active'=>1))->row_array();
if($user) { if($user) {
$token = base64_encode(random_bytes(32)); $token = bin2hex(openssl_random_pseudo_bytes(32, $cstrong));
$user_token=array( $user_token=array(
'email'=>$email, 'email'=>$email,
'token'=>$token, 'token'=>$token,
...@@ -154,7 +154,7 @@ class Auth extends CI_Controller ...@@ -154,7 +154,7 @@ class Auth extends CI_Controller
public function resetPassword() { public function resetPassword() {
require_once(APPPATH.'libraries/random.php'); //require_once(APPPATH.'libraries/random.php');
$email =$this->input->get('email'); $email =$this->input->get('email');
$token =$this->input->get('token'); $token =$this->input->get('token');
$user = $this->db->get_where('users', array('email'=>$email))->row_array(); $user = $this->db->get_where('users', array('email'=>$email))->row_array();
......
...@@ -20,7 +20,7 @@ class Register_model extends CI_Model { ...@@ -20,7 +20,7 @@ class Register_model extends CI_Model {
'role_id'=>2 'role_id'=>2
); );
$this->db->insert('users', $data); $this->db->insert('users', $data);
$token =base64_encode(random_bytes(32)); $token =bin2hex(openssl_random_pseudo_bytes(32, $cstrong));
$user_token =array( $user_token =array(
'email' => $this->input->post('email'), 'email' => $this->input->post('email'),
'token'=>$token, 'token'=>$token,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment