<commit_before><?php 

class UsuariosController extends \HXPHP\System\Controller
{
	public function __construct($configs)
	{
		parent::__construct($configs);

		$this->load(
			'Services\Auth',
			$configs->auth->after_login,
			$configs->auth->after_logout,
			true
		);

		$this->auth->redirectCheck();

		$user_id = $this->auth->getUserId();
		$user = User::find($user_id);
		$role = Role::find($user->role_id);

		$this->auth->roleCheck(array(
			'administrator'// somente o administrador tem acesso a esse link
		));

		$this->load(
			'Helpers\Menu',
			$this->request,
			$this->configs,
			$role->role

			);

		

		$this->view->setTitle('HXPHP - Administrativo')
					->setVars([
						'user'=>$user,
						'users'=> User::all()
						]);
	}

	
}<commit_msg> Bloquear/desbloquear/excluir usuarios<commit_after><?php 

class UsuariosController extends \HXPHP\System\Controller
{
	public function __construct($configs)
	{
		parent::__construct($configs);

		$this->load(
			'Services\Auth',
			$configs->auth->after_login,
			$configs->auth->after_logout,
			true
		);

		$this->auth->redirectCheck();

		$user_id = $this->auth->getUserId();
		$user = User::find($user_id);
		$role = Role::find($user->role_id);

		$this->auth->roleCheck(array(
			'administrator'// somente o administrador tem acesso a esse link
		));

		$this->load(
			'Helpers\Menu',
			$this->request,
			$this->configs,
			$role->role

			);

		

		$this->view->setTitle('HXPHP - Administrativo')
					->setFile('index')
					->setVars([
						'user'=>$user,
						'users'=> User::all()
						]);
	}
	public function bloquearAction($user_id= null)
	{
		if (is_numeric($user_id)) {
			$user=User::find_by_id($user_id);

			if (!is_null($user)) {
			$user ->status= 0;
			$user ->save(false);
			$this->view->setVar('user',User::all());
			}
		}
	}
	public function desbloquearAction($user_id= null)
	{
		if (is_numeric($user_id)) {
			$user=User::find_by_id($user_id);

			if (!is_null($user)) {
			$user ->status= 1;
			$user ->save(false);
			$this->view->setVar('user',User::all());
			}
		}
	}
	public function excluirAction($user_id= null)
	{
		if (is_numeric($user_id)) {
			$user=User::find_by_id($user_id);

			if (!is_null($user)) {
			$user ->delete();
			$this->view->setVar('user',User::all());
			}
		}
	}

}
{'fraction_non_alphanumeric': 0.19921705089169203, 'fraction_numerical': 0.0008699434536755111, 'mean_word_length': 3.5634920634920637, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 57, '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': '395485', 'n_tokens_mistral': 1035, 'n_tokens_neox': 871, 'n_words': 129}