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

class Login extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		//Datos HTML para vistas
		$data['title'] = 'Login';
		$data['config_title'] = $this->Configapp->get_config()->name;
		$data['show_menu'] = false;
		$data['system_message'] = '';
		$this->load->vars($data);
	}

	public function index()
	{
		$this->load->model('Employee');
		if ($this->input->post('submit')) {
			$username = $this->input->post('username');
			$password = $this->input->post('password');

			if ($employee = $this->Employee->login($username, $password)) {
				redirect('home');
			}else{
				$data['system_message'] = 'Nombre de usuario o contraseña Invalido!';
				$this->load->view('login', $data);
			}
		}else{
			if ($this->Employee->is_logged_in()) {
				redirect('home');
			}else{
				$this->load->view('login');
			}
			
		}
	}

}

/* End of file login.php */
/* Location: ./application/controllers/login.php */<commit_msg>Clase en body para login<commit_after><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		//Datos HTML para vistas
		$data['title'] = 'Login';
		$data['config_title'] = $this->Configapp->get_config()->name;
		$data['show_menu'] = false;
		$data['system_message'] = '';
		$data['class'] = 'login';
		$this->load->vars($data);
	}

	public function index()
	{
		$this->load->model('Employee');
		if ($this->input->post('submit')) {
			$username = $this->input->post('username');
			$password = $this->input->post('password');

			if ($employee = $this->Employee->login($username, $password)) {
				redirect('home');
			}else{
				$data['system_message'] = 'Nombre de usuario o contraseña Invalido!';
				$this->load->view('login', $data);
			}
		}else{
			if ($this->Employee->is_logged_in()) {
				redirect('home');
			}else{
				$this->load->view('login');
			}
			
		}
	}

}

/* End of file login.php */
/* Location: ./application/controllers/login.php */
{'fraction_non_alphanumeric': 0.2132387706855792, 'fraction_numerical': 0.0, 'mean_word_length': 4.014218009478673, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '7227747', 'n_tokens_mistral': 810, 'n_tokens_neox': 706, 'n_words': 136}