<commit_before><?php
/**
* Authentication Library
*
* @package Authentication
* @category Libraries
* @author <NAME>
* @link http://adamgriffiths.co.uk
* @version 2.0.3
* @copyright <NAME> 2011
*
* Auth provides a powerful, lightweight and simple interface for user authentication .
*/

class AG_Auth_model extends CI_Model
{
	var $user_table; // The user table (prefix + config)
	var $group_table; // The group table (prefix + config)
	
	public function __construct()
	{
		parent::__construct();

		log_message('debug', 'Auth Model Loaded');
		
		$this->config->load('ag_auth');
		$this->load->database();

		$this->user_table = $this->config->item('auth_user_table');
		$this->group_table = $this->config->item('auth_group_table');
	}
	
	public function login_check($username, $field_type)
	{
		$query = $this->db->get_where($this->user_table, array($field_type => $username));
		$result = $query->row_array();
		
		return $result;
	}
	
	public function register($username, $password, $email)
	{
		if($this->db->set('username', $username)->set('password', $password)->set('email', $email)->set('group', '100')->insert($this->user_table))
		{<commit_msg>there is no column name in table "users". change  ->set('group', '100')   to ->set('group_id', '100')<commit_after><?php
/**
* Authentication Library
*
* @package Authentication
* @category Libraries
* @author <NAME>
* @link http://adamgriffiths.co.uk
* @version 2.0.3
* @copyright <NAME> 2011
*
* Auth provides a powerful, lightweight and simple interface for user authentication .
*/

class AG_Auth_model extends CI_Model
{
	var $user_table; // The user table (prefix + config)
	var $group_table; // The group table (prefix + config)
	
	public function __construct()
	{
		parent::__construct();

		log_message('debug', 'Auth Model Loaded');
		
		$this->config->load('ag_auth');
		$this->load->database();

		$this->user_table = $this->config->item('auth_user_table');
		$this->group_table = $this->config->item('auth_group_table');
	}
	
	public function login_check($username, $field_type)
	{
		$query = $this->db->get_where($this->user_table, array($field_type => $username));
		$result = $query->row_array();
		
		return $result;
	}
	
	public function register($username, $password, $email)
	{
		if($this->db->set('username', $username)->set('password', $password)->set('email', $email)->set('group_id', '100')->insert($this->user_table))
		{
{'fraction_non_alphanumeric': 0.18200749687630155, 'fraction_numerical': 0.010828821324448146, 'mean_word_length': 5.005, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 53, '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': '4858783', 'n_tokens_mistral': 844, 'n_tokens_neox': 771, 'n_words': 175}