<commit_before><?php
/**
 * Users - A Controller for managing the Users Authentication.
 *
 * @author <NAME> - <EMAIL>
 * @version 3.0
 */

namespace App\Modules\Users\Controllers\Admin;

use Core\View;
use Helpers\Url;
use Helpers\ReCaptcha;

use App\Core\Controller;
use App\Models\Role;
use App\Models\User;
use App\Modules\Users\Helpers\RoleVerifier as Authorize;

use Carbon\Carbon;

use Auth;
use Hash;
use Input;
use Redirect;
use Session;
use Validator;


class Users extends Controller
{
    public function __construct()
    {
        parent::__construct();

        // Prepare the Users Model instance - while using the Database Auth Driver.
        //$this->model = new \App\Modules\Users\Models\Users();
    }

    protected function before()
    {
        // Check the User Authorization - while using the Extended Auth Driver.
        $method = $this->getMethod();

        switch ($this->getMethod()) {
            case 'profile':
            case 'postProfile':
                break;

            default:
                if (! Auth::user()->hasRole('administrator')) {
                    $status = __('You are not authorized to access this resource.');

                    return Redirect::to('admin/dashboard')->withStatus($status, 'warning');
                }
        }

        // Check the User Authorization - while using the Database Auth Driver.
        /*
        switch ($this->getMethod()) {
            case 'profile':
            case 'postProfile':
                break;

            default:
                if (!  Authorize::userHasRole('administrator')) {
                    $status = __('You are not authorized to access this resource.');

                    return Redirect::to('admin/dashboard')->withStatus($status, 'warning');<commit_msg>Remove unused code on App\Modules\Users\Controllers\Admin\Users@before<commit_after><?php
/**
 * Users - A Controller for managing the Users Authentication.
 *
 * @author <NAME> - <EMAIL>
 * @version 3.0
 */

namespace App\Modules\Users\Controllers\Admin;

use Core\View;
use Helpers\Url;
use Helpers\ReCaptcha;

use App\Core\Controller;
use App\Models\Role;
use App\Models\User;
use App\Modules\Users\Helpers\RoleVerifier as Authorize;

use Carbon\Carbon;

use Auth;
use Hash;
use Input;
use Redirect;
use Session;
use Validator;


class Users extends Controller
{
    public function __construct()
    {
        parent::__construct();

        // Prepare the Users Model instance - while using the Database Auth Driver.
        //$this->model = new \App\Modules\Users\Models\Users();
    }

    protected function before()
    {
        // Check the User Authorization - while using the Extended Auth Driver.
        switch ($this->getMethod()) {
            case 'profile':
            case 'postProfile':
                break;

            default:
                if (! Auth::user()->hasRole('administrator')) {
                    $status = __('You are not authorized to access this resource.');

                    return Redirect::to('admin/dashboard')->withStatus($status, 'warning');
                }
        }

        // Check the User Authorization - while using the Database Auth Driver.
        /*
        switch ($this->getMethod()) {
            case 'profile':
            case 'postProfile':
                break;

            default:
                if (!  Authorize::userHasRole('administrator')) {
                    $status = __('You are not authorized to access this resource.');

                    return Redirect::to('admin/dashboard')->withStatus($status, 'warning');
{'fraction_non_alphanumeric': 0.11767986614612382, 'fraction_numerical': 0.0011154489682097045, 'mean_word_length': 2.127288578901482, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 20, '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': '2880774', 'n_tokens_mistral': 952, 'n_tokens_neox': 932, 'n_words': 275}