<commit_before><?php

class Register extends CI_Controller
{

	var $mac;
	var $key;

	function index()
	{
		$data['error_msg'] = "Registration Error";
		$this->load->view('error_view', $data);
	}

	function auth($mac = '', $key = '', $version = '')
	{
		if ($mac && $key) //Both $mac and $key are required if not show error message
		{
			//Get AP Credentials from database
			$this->load->model('ap_model');
			$validMAC = $this->ap_model->validateMAC($mac);

			if($validMAC) //Check to make sure something is returned
			{
				//Test to see if a valid user name and password were passed
				$this->load->library('Validate');
				$validUser = $this->validate->validateUser($mac, $key);

				if($validUser)
				{
					$time_stamp = date("Y-m-d H:i:s");
					if (isset($_POST['uptime']))
					{
						//Get Heartbeat Data
						$data = array(
							'mac' => $mac,
							'uptime' => $this->input->post('uptime'),
							'ap_version' => $this->input->post('ap_version'),
							'time_stamp' => $time_stamp
						);
					}
					else
					{
						$data = array(
							'mac' => $mac,
							'time_stamp' => $time_stamp
						);
					}<commit_msg>Changed time format to linux epoch<commit_after><?php

class Register extends CI_Controller
{

	var $mac;
	var $key;

	function index()
	{
		$data['error_msg'] = "Registration Error";
		$this->load->view('error_view', $data);
	}

	function auth($mac = '', $key = '', $version = '')
	{
		if ($mac && $key) //Both $mac and $key are required if not show error message
		{
			//Get AP Credentials from database
			$this->load->model('ap_model');
			$validMAC = $this->ap_model->validateMAC($mac);

			if($validMAC) //Check to make sure something is returned
			{
				//Test to see if a valid user name and password were passed
				$this->load->library('Validate');
				$validUser = $this->validate->validateUser($mac, $key);

				if($validUser)
				{
					$time_stamp = time();
					if (isset($_POST['uptime']))
					{
						//Get Heartbeat Data
						$data = array(
							'mac' => $mac,
							'uptime' => $this->input->post('uptime'),
							'ap_version' => $this->input->post('ap_version'),
							'time_stamp' => $time_stamp
						);
					}
					else
					{
						$data = array(
							'mac' => $mac,
							'time_stamp' => $time_stamp
						);
					}
{'fraction_non_alphanumeric': 0.17770034843205576, 'fraction_numerical': 0.0, 'mean_word_length': 2.66347687400319, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '4874585', 'n_tokens_mistral': 1020, 'n_tokens_neox': 769, 'n_words': 188}