Im Moment mache ich es auf statische Weise:
Code: Select all
public function _check_admin_login($username, $pword)
{
$target_username = "firas";
$target_pass = "password";
if (($username == $target_username) && ($pword == $target_pass)) {
return TRUE;
} else {
return FALSE;
}
}
Code: Select all
public function username_check($str)
{
$this->load->module('store_accounts');
$this->load->module('site_security');
$error_msg = "Vous avez saisi un nom d'utilisateur ou un mot de passe incorrecte";
$pword = $this->input->post('pword', TRUE);
$result = $this->site_security->_check_admin_login($str, $pword);
if ($result==FALSE) {
$this->form_validation->set_message('username_check', $error_msg);
return FALSE;
} else {
return TRUE;
}
}
Code: Select all
function _check_admin_login($username, $pword)
{
$this->load->module('store_accounts');
$this->store_accounts->fetch_data_from_db();
$is_adminn = $data['is_adminn'];
if ($is_adminn==1) {
return TRUE;
} else {
return FALSE;
}
}
Mobile version