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

class Site extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->library('session');
		$this->load->model('Login_Model');
	}		
	
	public function index()
	{
		if ($this->identity->is_admin()){
			redirect('admin/admin');
		} else if ($this->identity->is_anggota()){
			redirect('anggota/profile');
		} else 
			redirect('site/login');

	}

	public function login()
	{
		if ($_SERVER['REQUEST_METHOD'] == 'GET') {
			$this->load->view('login');
		} else {
			$username = $this->input->post('username');
			$password = $<PASSWORD>('password');
			
			if ($this->identity->login($username,$password)){
				if ($this->identity->is_admin()){
					redirect('admin/dashboard');
				} else {
					redirect('anggota/profile');
				}
			} else {
				$data['error'] = $this->session->flashdata('error');
				$this->load->view('login',$data);
			}
		}
		
	}

	public function logout()
	{
		$this->identity->logout();
		redirect('site/login');
	}

	public function success()
	{
		$this->load->view('anggota/success');
	}


}



?><commit_msg>add success path<commit_after><?php 
defined('BASEPATH') OR exit('No direct script access allowed');

class Site extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->library('session');
		$this->load->model('Login_Model');
	}		
	
	public function index()
	{
		if ($this->identity->is_admin()){
			redirect('admin/admin');
		} else if ($this->identity->is_anggota()){
			redirect('anggota/profile');
		} else 
			redirect('site/login');

	}

	public function login()
	{
		if ($_SERVER['REQUEST_METHOD'] == 'GET') {
			$this->load->view('login');
		} else {
			$username = $this->input->post('username');
			$password = $this->input->post('password');
			
			if ($this->identity->login($username,$password)){
				if ($this->identity->is_admin()){
					redirect('admin/dashboard');
				} else {
					redirect('anggota/profile');
				}
			} else {
				$data['error'] = $this->session->flashdata('error');
				$this->load->view('login',$data);
			}
		}
		
	}

	public function logout()
	{
		$this->identity->logout();
		redirect('site/login');
	}

	public function success()
	{
		$data['path'] = $this->session->flashdata('success_path');
		$this->load->view('anggota/success',$data);
	}


}



?>
{'fraction_non_alphanumeric': 0.21175489787411422, 'fraction_numerical': 0.0, 'mean_word_length': 3.8582995951417005, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 58, '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': '5427402', 'n_tokens_mistral': 938, 'n_tokens_neox': 799, 'n_words': 128}