<commit_before><?php

App::uses('AppController', 'Controller');

/**
 * UserLogs Controller
 *
 * @property UserLog $UserLog
 */
class UserLogsController extends AccountsAppController {

	public function beforeFilter() {
		parent::beforeFilter();
	}

// 	public function isAuthorized() {
// //		parent::isAuthorized();
// 		switch ($this->Auth->user('group_id')) {
// 			case 1:
// 			case 2:
// 				return true;
// 				break;
// 			case 3:
// 				return false;
// 				break;
// 			case 4:
// 				return false;
// 				break;
// 			default :
// 				return false;
// 				break;
// 		}
// 	}

	/**
	 * index method
	 *
	 * @return void
	 */
	public function admin_index() {
		$this->UserLog->recursive = 0;
		$this->set('userLogs', $this->paginate());
	}

	/**
	 * view method
	 *
	 * @throws NotFoundException
	 * @param string $id
	 * @return void
	 */
	public function admin_view($id = null) {
		if (!$this->UserLog->exists($id)) {
			throw new NotFoundException(__('Invalid user log'), 'flash/warning');
		}
		$options = array('conditions' => array('UserLog.' . $this->UserLog->primaryKey => $id));
		$this->set('userLog', $this->UserLog->find('first', $options));
	}

	/**
	 * add method
	 *
	 * @return void
	 */
	public function admin_add() {
		if ($this->request->is('post')) {
			$this->UserLog->create();
			if ($this->UserLog->save($this->request->data)) {
				$this->Session->setFlash(__('The user log has been saved'), 'flash/success');
				$this->redirect(array('action' => 'index'));
			} else {<commit_msg>Change order a Userslogs<commit_after><?php

App::uses('AppController', 'Controller');

/**
 * UserLogs Controller
 *
 * @property UserLog $UserLog
 */
class UserLogsController extends AccountsAppController {

	public function beforeFilter() {
		parent::beforeFilter();
		if (Configure::read('debug') > 1) {
			$this->Auth->allow();
		}
	}

	/**
	 * index method
	 *
	 * @return void
	 */
	public function admin_index() {
		$this->UserLog->recursive = 0;
		$this->paginate = array(
			'order' => array('UserLog.created' => 'desc')
		);
		$this->set('userLogs', $this->paginate());
	}

	/**
	 * view method
	 *
	 * @throws NotFoundException
	 * @param string $id
	 * @return void
	 */
	public function admin_view($id = null) {
		if (!$this->UserLog->exists($id)) {
			throw new NotFoundException(__('Invalid user log'), 'flash/warning');
		}
		$options = array('conditions' => array('UserLog.' . $this->UserLog->primaryKey => $id));
		$this->set('userLog', $this->UserLog->find('first', $options));
	}

	/**
	 * add method
	 *
	 * @return void
	 */
	public function admin_add() {
		if ($this->request->is('post')) {
			$this->UserLog->create();
			if ($this->UserLog->save($this->request->data)) {
				$this->Session->setFlash(__('The user log has been saved'), 'flash/success');
				$this->redirect(array('action' => 'index'));
			} else {
{'fraction_non_alphanumeric': 0.20363890832750176, 'fraction_numerical': 0.00244926522043387, 'mean_word_length': 3.331818181818182, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, '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': '951146', 'n_tokens_mistral': 1077, 'n_tokens_neox': 958, 'n_words': 195}