<commit_before><?php
Controller::$defaultLayout='admin/users';
/** @Check('ACSecureAdmin') @Acl('Users') */
class UsersController extends Controller{
	/** */
	function index(){
		User::Table()->fields('id,email,pseudo,first_name,last_name,gender/*#if users.pseudo*/,pseudo/*#/if*/,type,status,created,updated')
			->allowFilters()->paginate()->actionClick('view')->render('Utilisateurs');
	}
	
	/** @ValidParams @Id('id') */
	function view(int $id){
		$user=User::ById($id)->notFoundIfFalse();
		mset($user);
		$paginate=$user->findWithPaginate('UserHistory',array('with'=>array('type'),'orderBy'=>array('created'=>'DESC')));
		$paginate->pageSize(25)->execute();
		render();
	}
	/** @ValidParams @Id('id') */
	function disable(int $id){
		User::QUpdateOneField('status',User::DISABLED)->byIdAndStatus($id,User::VALID);
		UserHistory::add(UserHistory::DISABLE_USER,CSecure::connected(),$id);
		redirect('/users/view/'.$id);
	}
	
	
	/** */
	function connections(){
		UserConnection::Table()->orderByCreated()
			->allowFilters()
			->paginate()->fields(array('created','type','succeed','login',
					'connected'=>array('align'=>'center','escape'=>false,<commit_msg>Update UsersController.php<commit_after><?php
Controller::$defaultLayout='admin/users';
/** @Check('ACSecureAdmin') @Acl('Users') */
class UsersController extends Controller{
	/** */
	function index(){
		User::Table()->fields('id,email,first_name,last_name,gender/*#if users.pseudo*/,pseudo/*#/if*/,type,status,created,updated')
			->allowFilters()->paginate()->actionClick('view')->render('Utilisateurs');
	}
	
	/** @ValidParams @Id('id') */
	function view(int $id){
		$user=User::ById($id)->notFoundIfFalse();
		mset($user);
		$paginate=$user->findWithPaginate('UserHistory',array('with'=>array('type'),'orderBy'=>array('created'=>'DESC')));
		$paginate->pageSize(25)->execute();
		render();
	}
	/** @ValidParams @Id('id') */
	function disable(int $id){
		User::QUpdateOneField('status',User::DISABLED)->byIdAndStatus($id,User::VALID);
		UserHistory::add(UserHistory::DISABLE_USER,CSecure::connected(),$id);
		redirect('/users/view/'.$id);
	}
	
	
	/** */
	function connections(){
		UserConnection::Table()->orderByCreated()
			->allowFilters()
			->paginate()->fields(array('created','type','succeed','login',
					'connected'=>array('align'=>'center','escape'=>false,
{'fraction_non_alphanumeric': 0.2442159383033419, 'fraction_numerical': 0.001713796058269066, 'mean_word_length': 7.553113553113553, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '403236', 'n_tokens_mistral': 794, 'n_tokens_neox': 759, 'n_words': 74}