<commit_before><?php
	/**
	 * Controller.php 
	 * Contains the Thinker\Framework\Controller class
	 *
	 * @author <NAME>
	 */
	 
namespace Thinker\Framework;

use \ReflectionClass;

abstract class Controller
{
	protected $reflectionClass; // Contains information about the class (ReflectionClass)
	protected $data;            // Contains the data being passed back from the Section
	public $session;       		// Contains session object
	public $view;     			// Contains the view being loaded for the section
	
	/**
	 * __construct()
	 * Constructor for the Thinker\Framework\Controller Class
	 *
	 * @author <NAME>
	 * @access public
	 */
	public function __construct()
	{
		// Initialize classInfo with information about the target class
		$this->reflectionClass = new ReflectionClass($this);
		$this->data = array();

		// Override view if necessary
		if(isset($_GET['view']))
		{
			// ucwords() allows users to use views as lowercase in URLs
			$this->view = ucwords(\Thinker\Http\Request::get('view', true));
		}
		else
		{
			$this->view = DEFAULT_VIEW;
		}

		// Get the session information
		if(SESSION_CLASS)
		{
			$sessionClass = SESSION_CLASS;
		}
		else
		{
			// No session specified, assume open site
			$sessionClass = 'Open';
		}
			
		$this->session = $sessionClass::singleton();

		if(!$this->session->auth('section', array('section' => $_SECTION, 'subsection' => $_SUBSECTION)))
		{
			// Redirect to error
			\Thinker\Http\Redirect::error(403);
		}
	}

	/**
	 * defaultSubsection()
	 * Gets the default subsection for this section
	 *
	 * @abstract
	 * @access public
	 * @return string Default Subsection Name
	 */
	abstract public static function defaultSubsection();
<commit_msg>Add 'allowOpenAccess' Flag to Controller<commit_after><?php
	/**
	 * Controller.php 
	 * Contains the Thinker\Framework\Controller class
	 *
	 * @author <NAME>
	 */
	 
namespace Thinker\Framework;

use \ReflectionClass;

abstract class Controller
{
	protected $reflectionClass;         // Contains information about the class (ReflectionClass)
	protected $data;                    // Contains the data being passed back from the Section
	protected $allowOpenAccess = false; // Flag to always allow access, if necessary
	public $session;       		        // Contains session object
	public $view;     			        // Contains the view being loaded for the section
	
	/**
	 * __construct()
	 * Constructor for the Thinker\Framework\Controller Class
	 *
	 * @author <NAME>
	 * @access public
	 */
	public function __construct()
	{
		// Initialize classInfo with information about the target class
		$this->reflectionClass = new ReflectionClass($this);
		$this->data = array();

		// Override view if necessary
		if(isset($_GET['view']))
		{
			// ucwords() allows users to use views as lowercase in URLs
			$this->view = ucwords(\Thinker\Http\Request::get('view', true));
		}
		else
		{
			$this->view = DEFAULT_VIEW;
		}

		// Get the session information
		if(SESSION_CLASS)
		{
			$sessionClass = SESSION_CLASS;
		}
		else
		{
			// No session specified, assume open site
			$sessionClass = 'Open';
		}
		
		$this->session = $sessionClass::singleton();

		if(!$this->session->auth('section', array('section' => $_SECTION, 'subsection' => $_SUBSECTION)) && !$this->allowOpenAccess)
		{
			// Redirect to error
			\Thinker\Http\Redirect::error(403);
		}
	}

	/**
	 * defaultSubsection()
	 * Gets the default subsection for this section
	 *
	 * @abstract
	 * @access public
	 * @return string Default Subsection Name
	 */
	abstract public static function defaultSubsection();

{'fraction_non_alphanumeric': 0.12097451694203304, 'fraction_numerical': 0.0016802016241949033, 'mean_word_length': 3.2023529411764704, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 26, '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': '6618595', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1012, 'n_words': 303}