[eluser]Alhazred[/eluser]
I add some code because it looks the problem is not sure to be inside the model, I've left only the constructor inside it and the problem persists.
Controller
Code:
class Authentication extends CI_Controller
{
/**
* Funzione di login
* @return boolean true in caso di successo, false altrimenti
*/
public function login()
{
//form validation
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'lang:form_username', 'required|alpha_dash');
$this->form_validation->set_rules('password', 'lang:form_password', 'required');
//caricamento file messaggi autenticazione
$this->lang->load('authentication_messages');
if ($this->form_validation->run() == FALSE) //field validation failed
{
$data['message'] = lang('auth_login_validation_error');
$this->load->view('authentication/login_form',$data);
}
else //fields ok
{
$username = $this->input->post('username',TRUE);
$password = $this->input->post('password',TRUE);
//load model, it is inside a subfolder, models/authentication/authentication.php
//THE EXECUTION STOPS AT THIS LINE IF I REMOVE IT THE CONTROLLER GOES ON
$this->load->model('authentication/Authentication');
//$this->Authentication->init($username,$password); //inizializza l'oggetto
$result = FALSE; // was $this->Autentication->login(); changed to debug
if ( ! $result) //login failed
{
$data = array(); //reset dell'array $data
$data['message'] = lang('auth_login_error');
$this->load->view('authentication/login_form',$data);
}
else //login successful
{
$this->load->view('authentication/login_success');
}
}
}
}
Model
[code]
class Authentication extends CI_Model
{
function __construct()
{
parent::__construct();
}
}