I create a menu login and register with email verification . but none the less I want if the email has not been verified will display the message " Your email has not been verified " what should I add to my script ... ?
ex :
active = 1 ( already verified )
active = 0 ( not verified )
controllers:
public function index($param='')
{
if($param == 'error')
$param = 'Incorrect username or password';
$data = array('title'=>'Login',
'message'=>$param,
'isi' => 'login/vlogin',
'base_url'=>base_url());
$this->load->view('layout/wrapper', $data);
}
public function do_login(){
$data = $this->input->post(null,true);
$is_login = $this->db->get_where('user',array(
'email'=>$data['email'],
'password'=>$data['password'],
'active'=> 1
))->row();
if($is_login){
$session_set = array(
'is_login' => true,
'firstname' => $is_login->firstname,
'lastname' => $is_login->lastname,
'jkl' => $is_login->jkl,
'id' => $is_login->id,
'lastlogin' => $is_login->lastlogin
);
$this->db->update('user',array('lastlogin'=>date('Y-m-d H:i:s')),array('id'=>$is_login->id));
$this->session->set_userdata($session_set);
redirect('homepage/homepage/menu');
}else{
redirect('login/login/index/error');
}
}