<commit_before><?php

namespace Lorry\Presenter\User;

use Lorry\Presenter;
use Lorry\ModelFactory;
use Lorry\Exception\FileNotFoundException;

class Table extends Presenter {

	public function get() {
		$this->security->requireModerator(); //@TODO rate limiting
		$this->offerIdentification();
		$this->security->requireIdentification();
		
		$users = ModelFactory::build('User');

		$filter = filter_input(INPUT_GET, 'filter');
		if($filter) {
			switch($filter) {
				case 'bans':
					$this->security->requireModerator();
					//@TODO filter bans
					break;
				case 'moderators':
					$this->security->requireAdministrator();
					//@TODO filter privileges
					break;
				default:
					throw new FileNotFoundException();
					break;
			}
		} else {
			$users = $users->limit(1)->byAnything();
		}
		foreach($users as $user) {
			$this->context['users'][] = array(
				'name' => $user->getUsername(),
				'administrator' => $user->isAdministrator(),
				'moderator' => $user->isModerator()<commit_msg>fix user table only returning one user<commit_after><?php

namespace Lorry\Presenter\User;

use Lorry\Presenter;
use Lorry\ModelFactory;
use Lorry\Exception\FileNotFoundException;

class Table extends Presenter {

	public function get() {
		$this->security->requireModerator(); //@TODO rate limiting
		$this->offerIdentification();
		$this->security->requireIdentification();
		
		$users = ModelFactory::build('User');

		$filter = filter_input(INPUT_GET, 'filter');
		if($filter) {
			switch($filter) {
				case 'bans':
					$this->security->requireModerator();
					//@TODO filter bans
					break;
				case 'moderators':
					$this->security->requireAdministrator();
					//@TODO filter privileges
					break;
				default:
					throw new FileNotFoundException();
					break;
			}
		} else {
			$users = $users->all()->byAnything();
		}
		foreach($users as $user) {
			$this->context['users'][] = array(
				'name' => $user->getUsername(),
				'administrator' => $user->isAdministrator(),
				'moderator' => $user->isModerator()
{'fraction_non_alphanumeric': 0.16208251473477406, 'fraction_numerical': 0.0004911591355599214, 'mean_word_length': 3.838479809976247, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '6247375', 'n_tokens_mistral': 785, 'n_tokens_neox': 628, 'n_words': 129}