-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathResetpassword.php
130 lines (27 loc) · 1.3 KB
/
Resetpassword.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Resetpassword extends CI_Controller {
public function index($verify_reg_code)
{
$this->load->library('form_validation');
$this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]');
$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
$this->form_validation->set_error_delimiters('<div class="alert alert-danger" role="alert">', '</div>');
if($this->form_validation->run() == FALSE)
{
$data['content'] = 'resetpassword_view';
$this->load->view('layout/layout',$data);
}
else
{
$query=$this->gpi_model->get_user_by_verify_reg_code("users",$verify_reg_code);
$user_id=$query->user_id;
$data=array(
'password'=>$this->input->post('password'),
);
$this->gpi_model->update($data, "users",$user_id,"user_id");
//echo $this->db->last_query();
$this->session->set_flashdata("msg","Password Successfully Changed!");
redirect(base_url()."login");
}
}
}