<commit_before><?php

class DashboardController extends Controller
{
	public $layout = '//layouts/column2';
	/**
	 * @return array action filters
	 */
	public function filters()
	{
		return array(
			'accessControl', // perform access control for dashboard operations
		);
	}

	/**
	 * Specifies the access control rules.
	 * This method is used by the 'accessControl' filter.
	 * @return array access control rules
	 */
	public function accessRules()
	{
		return array(
			array('allow', // allow authenticated user
				'actions'=>array('index', 'uploadPhoto'),
				'users'=>array('@'),
			),
			array('deny',  // deny all users
				'users'=>array('*'),
			),
		);
	}

	/**
	 * Redirects to actionProfile()
	 */
	public function actionIndex()
	{
		$student = Student::model()->findByPk(Yii::app()->user->id);
		$downloadsDataProvider = $student->getDownloadHistory();
		$uploadsDataProvider = $student->getUploadList();

		$downloadsDataProvider->setPagination(array(
			'pageSize' => 5,
		));
		$uploadsDataProvider->setPagination(array(
			'pageSize' => 5,
		));

		$this->render('index', array(
			'downloadsDataProvider' => $downloadsDataProvider,
			'uploadsDataProvider' => $uploadsDataProvider,
		));
	}

	/**
	 * Uploads a new profile photo.
	 */
	public function actionUploadPhoto()
	{
		$model = new PhotoUploadForm();

		if (isset($_POST['PhotoUploadForm']))
		{
			$model->photo = CUploadedFile::getInstance($model, 'photo');
			if ($model->validate())
			{
				$model->savePhoto();
				Yii::app()->user->setFlash('message', 'Foto berhasil diunggah.');
			}
		}

		$this->render('uploadPhoto', array(
			'model' => $model,
		));
	}
};<commit_msg>Memperbaiki komentar<commit_after><?php

class DashboardController extends Controller
{
	public $layout = '//layouts/column2';
	/**
	 * @return array action filters
	 */
	public function filters()
	{
		return array(
			'accessControl', // perform access control for dashboard operations
		);
	}

	/**
	 * Specifies the access control rules.
	 * This method is used by the 'accessControl' filter.
	 * @return array access control rules
	 */
	public function accessRules()
	{
		return array(
			array('allow', // allow authenticated user
				'actions'=>array('index', 'uploadPhoto'),
				'users'=>array('@'),
			),
			array('deny',  // deny all users
				'users'=>array('*'),
			),
		);
	}

	/**
	 * Displays this user's history.
	 */
	public function actionIndex()
	{
		$student = Student::model()->findByPk(Yii::app()->user->id);
		$downloadsDataProvider = $student->getDownloadHistory();
		$uploadsDataProvider = $student->getUploadList();

		$downloadsDataProvider->setPagination(array(
			'pageSize' => 5,
		));
		$uploadsDataProvider->setPagination(array(
			'pageSize' => 5,
		));

		$this->render('index', array(
			'downloadsDataProvider' => $downloadsDataProvider,
			'uploadsDataProvider' => $uploadsDataProvider,
		));
	}

	/**
	 * Uploads a new profile photo.
	 */
	public function actionUploadPhoto()
	{
		$model = new PhotoUploadForm();

		if (isset($_POST['PhotoUploadForm']))
		{
			$model->photo = CUploadedFile::getInstance($model, 'photo');
			if ($model->validate())
			{
				$model->savePhoto();
				Yii::app()->user->setFlash('message', 'Foto berhasil diunggah.');
			}
		}

		$this->render('uploadPhoto', array(
			'model' => $model,
		));
	}
};
{'fraction_non_alphanumeric': 0.17318099819603128, 'fraction_numerical': 0.0018039687312086591, 'mean_word_length': 3.8640350877192984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '124901', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1048, 'n_words': 222}