<commit_before><?php
/**
 * display static pages
 */
class SiteController extends Controller
{
	/**
	 * Declares class-based actions.
	 *
	 * @return void
	 */
	public function actions()
	{
		$actions = parent::actions();
		return array_merge($actions, array(
			// page action renders "static" pages stored under 'protected/views/site/pages'
			// They can be accessed via: index.php?r=site/page&view=FileName
			'page' => array(
				'class' => 'CViewAction',
			),
		));
	}

	/**
	 * This is the default 'index' action that is invoked
	 * when an action is not explicitly requested by users.
	 *
	 * @return void
	 */
	public function actionIndex()
	{
		// renders the view file 'protected/views/site/index.php'
		// using the default layout 'protected/views/layouts/main.php'
		$this->render('index');
	}

	/**
	 * show admin interface
	 *
	 * @return void
	 */
	public function actionAdmin()
	{
		$this->layout = '//layouts/column1_admin';
		$this->render('admin');
	}

	/**
	 * This is the action to handle external exceptions.
	 *
	 * @return void
	 */
	public function actionError()
	{
		if (($error=Yii::app()->errorHandler->error) !== null)
		{
			if(Yii::app()->request->isAjaxRequest)
			{
				echo $error['message'];
			}
			else
			{
				$this->render('error', $error);<commit_msg>check permission<commit_after><?php
/**
 * display static pages
 */
class SiteController extends Controller
{
	/**
	 * Declares class-based actions.
	 *
	 * @return void
	 */
	public function actions()
	{
		$actions = parent::actions();
		return array_merge($actions, array(
			// page action renders "static" pages stored under 'protected/views/site/pages'
			// They can be accessed via: index.php?r=site/page&view=FileName
			'page' => array(
				'class' => 'CViewAction',
			),
		));
	}

	/**
	 * This is the default 'index' action that is invoked
	 * when an action is not explicitly requested by users.
	 *
	 * @return void
	 */
	public function actionIndex()
	{
		// renders the view file 'protected/views/site/index.php'
		// using the default layout 'protected/views/layouts/main.php'
		$this->render('index');
	}

	/**
	 * show admin interface
	 *
	 * @throws CHttpException if logged in user is not an admin
	 * @return void
	 */
	public function actionAdmin()
	{
		if (!Yii::app()->user->getState('isAdmin'))
		{
			throw new CHttpException(403, 'Not authorized');
		}

		$this->layout = '//layouts/column1_admin';
		$this->render('admin');
	}

	/**
	 * This is the action to handle external exceptions.
	 *
	 * @return void
	 */
	public function actionError()
	{
		if (($error=Yii::app()->errorHandler->error) !== null)
		{
			if(Yii::app()->request->isAjaxRequest)
			{
				echo $error['message'];
			}
			else
			{
				$this->render('error', $error);
{'fraction_non_alphanumeric': 0.15766582094961942, 'fraction_numerical': 0.001812250815512867, 'mean_word_length': 3.1945288753799392, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '3940718', 'n_tokens_mistral': 987, 'n_tokens_neox': 861, 'n_words': 229}