<commit_before><?php namespace App\Http\Controllers\Panel;

use App\Board;
use App\Post;
use App\Support\IP;
use Carbon\Carbon;
use Illuminate\Pagination\LengthAwarePaginator;

use Cache;
use Input;
use Request;
use Validator;

class HistoryController extends PanelController {
	
	/*
	|--------------------------------------------------------------------------
	| History Controller
	|--------------------------------------------------------------------------
	|
	| Pulls history for an address.
	|
	*/
	
	const VIEW_HISTORY = "history";
	
	public function getHistory($ip = null)
	{
		if (!$this->user->canViewGlobalHistory())
		{
			return abort(403);
		}
		
		if (is_null($ip))
		{
			return abort(404);
		}
		
		try
		{
			$ip = new IP($ip);
		}
		catch (\InvalidArgumentException $e)
		{
			return abort(404);
		}
		catch (\Exception $e)
		{
			throw $e;
		}
		
		$posts = Post::with('op', 'board', 'board.assets')
			->withEverything()
			->where('author_ip', $ip)
			->orderBy('post_id', 'desc')
			->paginate(15);
		
		return $this->view(static::VIEW_HISTORY, [
			'posts' => $posts,
			'ip'    => $ip->toText(),
		]);
	}
	
	public function getBoardHistory(Board $board, Post $post)
	{
		$posts = $board->posts()
			->with('op')
			->withEverything()
			->where('author_ip', $post->author_ip)
			->orderBy('post_id', 'desc')
			->paginate(15);
		
		foreach ($posts as $item)
		{
			$item->setRelation('board', $board);
		}
		
		return $this->view(static::VIEW_HISTORY, [
			'posts'      => $posts,
			'multiboard' => false,
			'ip'         => ip_less($post->author_ip->toText()),
		]);
	}
	
}
<commit_msg>Missing permission added.<commit_after><?php namespace App\Http\Controllers\Panel;

use App\Board;
use App\Post;
use App\Support\IP;
use Carbon\Carbon;
use Illuminate\Pagination\LengthAwarePaginator;

use Cache;
use Input;
use Request;
use Validator;

class HistoryController extends PanelController {
	
	/*
	|--------------------------------------------------------------------------
	| History Controller
	|--------------------------------------------------------------------------
	|
	| Pulls history for an address.
	|
	*/
	
	const VIEW_HISTORY = "history";
	
	public function getHistory($ip = null)
	{
		if (!$this->user->canViewGlobalHistory())
		{
			return abort(403);
		}
		
		if (is_null($ip))
		{
			return abort(404);
		}
		
		try
		{
			$ip = new IP($ip);
		}
		catch (\InvalidArgumentException $e)
		{
			return abort(404);
		}
		catch (\Exception $e)
		{
			throw $e;
		}
		
		$posts = Post::with('op', 'board', 'board.assets')
			->withEverything()
			->where('author_ip', $ip)
			->orderBy('post_id', 'desc')
			->paginate(15);
		
		return $this->view(static::VIEW_HISTORY, [
			'posts' => $posts,
			'ip'    => $ip->toText(),
		]);
	}
	
	public function getBoardHistory(Board $board, Post $post)
	{
		if (!$this->user->canViewHistory())
		{
			return abort(403);
		}
		
		$posts = $board->posts()
			->with('op')
			->withEverything()
			->where('author_ip', $post->author_ip)
			->orderBy('post_id', 'desc')
			->paginate(15);
		
		foreach ($posts as $item)
		{
			$item->setRelation('board', $board);
		}
		
		return $this->view(static::VIEW_HISTORY, [
			'posts'      => $posts,
			'multiboard' => false,
			'ip'         => ip_less($post->author_ip->toText()),
		]);
	}
	
}

{'fraction_non_alphanumeric': 0.255216208043544, 'fraction_numerical': 0.008769277290595706, 'mean_word_length': 2.2367906066536203, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, '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': '3863425', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1112, 'n_words': 218}