<commit_before><?php

App::uses('AppController', 'Controller');
App::uses('CakeEmail', 'Network/Email');

/**
 * Comments Controller
 *
 * @property Comment $Comment
 */
class CommentsController extends AppController {

    public $helpers = array('AdminLayout', 'Gravatar', 'Js' => array('Jquery'));
    public $components = array('RequestHandler');
    public $paginate = array(
        'conditions' => array(
            'Comment.approved' => array(0, 1),
        ),
        'limit' => 15,
        'order' => array(
            'Comment.created' => 'desc'
        )
    );

    public function beforeFilter() {
        parent::beforeFilter();
        $this->Auth->allow();
        //$this->isAuthorized();
    }

    public function isAuthorized() {
        switch ($this->Auth->user('role')) {
            case 'admin':
                $this->Auth->allow('*');
                break;<commit_msg>Allow access to "index" and "reply" action for not login users.<commit_after><?php

App::uses('AppController', 'Controller');
App::uses('CakeEmail', 'Network/Email');

/**
 * Comments Controller
 *
 * @property Comment $Comment
 */
class CommentsController extends AppController {

    public $helpers = array('AdminLayout', 'Gravatar', 'Js' => array('Jquery'));
    public $components = array('RequestHandler');
    public $paginate = array(
        'conditions' => array(
            'Comment.approved' => array(0, 1),
        ),
        'limit' => 15,
        'order' => array(
            'Comment.created' => 'desc'
        )
    );

    public function beforeFilter() {
        parent::beforeFilter();
        $this->Auth->allow('index', 'reply');
    }

    public function isAuthorized() {
        switch ($this->Auth->user('role')) {
            case 'admin':
                $this->Auth->allow('*');
                break;
{'fraction_non_alphanumeric': 0.1725832878208629, 'fraction_numerical': 0.004369197160021846, 'mean_word_length': 2.463137996219282, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, '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': '647705', 'n_tokens_mistral': 516, 'n_tokens_neox': 498, 'n_words': 113}