<commit_before><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Verificador_controller extends CI_Controller {

 function __construct()
 {
   parent::__construct();
   $this->load->model('Login','',TRUE);
 }

 function index()
 {
   //This method will have the credentials validation
   $this->load->library('form_validation');

   $this->form_validation->set_rules('correo', 'correo', 'trim|required');
   $this->form_validation->set_rules('password', 'password', 'trim|required|callback_check_database');

   if($this->form_validation->run() == FALSE)
   {
     //Field validation failed.  User redirected to login page
     $this->load->view('login');
   }
   else
   {
     //Go to private area
     redirect('menu_controller', 'refresh');
   }

 }

 function check_database($sPassword)
 {
   //Field validation succeeded.  Validate against database
   $sNick = $this->input->post('correo');

   //query the database
   $result = $this->Login->getUser($correo, $password);

   if($result)
   {
     $sess_array = array();
     foreach($result as $row)
     {
       $sess_array = array(
         'id_usuario' => $row->id_usuario,
         'correo' => $row->correo
       );
       $this->session->set_userdata('logged_in', $sess_array);
     }
     return TRUE;
   }
   else
   {
     $this->form_validation->set_message('check_database', 'Invalid username or password');<commit_msg>Update Verificador_controller.php<commit_after><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Verificador_controller extends CI_Controller {

 function __construct()
 {
   parent::__construct();
   $this->load->model('Login','',TRUE);
 }

 function index()
 {
   //This method will have the credentials validation
   $this->load->library('form_validation');

   $this->form_validation->set_rules('correo', 'correo', 'trim|required');
   $this->form_validation->set_rules('password', 'password', 'trim|required|callback_check_database');

   if($this->form_validation->run() == FALSE)
   {
     //Field validation failed.  User redirected to login page
     $this->load->view('login');
   }
   else
   {
     //Go to private area
     redirect('menu_controller', 'refresh');
   }

 }

 function check_database($password)
 {
   //Field validation succeeded.  Validate against database
   $sNick = $this->input->post('correo');

   //query the database
   $result = $this->Login->getUser($correo, $password);

   if($result)
   {
     $sess_array = array();
     foreach($result as $row)
     {
       $sess_array = array(
         'id_usuario' => $row->id_usuario,
         'correo' => $row->correo
       );
       $this->session->set_userdata('logged_in', $sess_array);
     }
     return TRUE;
   }
   else
   {
     $this->form_validation->set_message('check_database', 'Invalid username or password');
{'fraction_non_alphanumeric': 0.15914655473941938, 'fraction_numerical': 0.0, 'mean_word_length': 3.489795918367347, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3395130', 'n_tokens_mistral': 889, 'n_tokens_neox': 864, 'n_words': 176}