<commit_before><?php
/**
 * A11yc\Route
 *
 * @package    part of A11yc
 * @author     Jidaikobo Inc.
 * @license    The MIT License (MIT)
 * @copyright  Jidaikobo Inc.
 * @link       http://www.jidaikobo.com
 */
namespace A11yc;
class Route extends \Kontiki\Route
{
	protected static $controller;
	protected static $action;

	/**
	 * forge
	 *
	 * @return  void
	 */
	public static function forge()
	{
		// vals
		$controller = '';
		$action = '';
		$c = Input::get('c', '');
		$a = Input::get('a', '');
		$is_index = empty(join($_GET));

		// auth
		if ($is_index && ! \Kontiki\Auth::auth())
		{
			$controller = '\A11yc\Controller_Auth';
			$action = 'Action_Login';
		}
		// default controller
		else if ($is_index)
		{
			$controller = '\A11yc\Controller_Center';
			$action = 'Action_Index';
		}
		// safe access?
		else if (ctype_alnum($c) && ctype_alnum($a))
		{
			$controller = '\A11yc\Controller_'.ucfirst($c);
			$action = 'Action_'.ucfirst($a);
		}

		// performed IPs
		if (defined('A11YC_APPROVED_IPS'))
		{
			if ( ! in_array(Arr::get($_SERVER, 'REMOTE_ADDR'), unserialize(A11YC_APPROVED_IPS)))
			{
				$controller = '';
			}<commit_msg>fix auth and routing<commit_after><?php
/**
 * A11yc\Route
 *
 * @package    part of A11yc
 * @author     Jidaikobo Inc.
 * @license    The MIT License (MIT)
 * @copyright  Jidaikobo Inc.
 * @link       http://www.jidaikobo.com
 */
namespace A11yc;
class Route extends \Kontiki\Route
{
	protected static $controller;
	protected static $action;

	/**
	 * forge
	 *
	 * @return  void
	 */
	public static function forge()
	{
		// vals
		$controller = '';
		$action = '';
		$c = Input::get('c', '');
		$a = Input::get('a', '');
		$is_index = empty(join($_GET));

		// auth
		if ($is_index && ! \Kontiki\Auth::auth())
		{
			$controller = '\A11yc\Controller_Auth';
			$action = 'Action_Login';
		}

		// for loged in users
		if (\Kontiki\Auth::auth())
		{
			// default controller
			if ($is_index)
			{
				$controller = '\A11yc\Controller_Center';
				$action = 'Action_Index';
			}
			// safe access?
			else if (ctype_alnum($c) && ctype_alnum($a))
			{
				$controller = '\A11yc\Controller_'.ucfirst($c);
				$action = 'Action_'.ucfirst($a);
			}
		}

		// performed IPs
		if (defined('A11YC_APPROVED_IPS'))
		{
			if ( ! in_array(Arr::get($_SERVER, 'REMOTE_ADDR'), unserialize(A11YC_APPROVED_IPS)))
			{
				$controller = '';
			}
{'fraction_non_alphanumeric': 0.18120805369127516, 'fraction_numerical': 0.013422818791946308, 'mean_word_length': 2.968386023294509, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2201630', 'n_tokens_mistral': 1033, 'n_tokens_neox': 893, 'n_words': 174}