admin/controllers/AdminRouter.php
public function index()
    {
        //  When executing on the CLI we don't need to perform a few bit's of sense checking
        $oInput = Factory::service('Input');
        if (!$oInput::isCli()) {

            //  Is there an AdminIP whitelist?
            $whitelistIp = (array) appSetting('whitelist', 'admin');

            if ($whitelistIp) {
                if (!isIpInRange($oInput->ipAddress(), $whitelistIp)) {
                    show404();
                }
            }

            //  Before we do anything, is the user an admin?
            if (!isAdmin()) {
                unauthorised();
            }
        }

        //  Determine which admin controllers are available to the system
        $this->findAdminControllers();

        // --------------------------------------------------------------------------

        /**
         * Sort the controllers into a view friendly array, taking into
         * consideration the user's order and state preferences.
         */

        $this->prepAdminControllersNav();

        //  Save adminControllers to controller data so everyone can use it
        $this->data['adminControllers']    = $this->adminControllers;
        $this->data['adminControllersNav'] = $this->adminControllersNav;

        // --------------------------------------------------------------------------

        //  Route the user's request
        $this->routeRequest();
    }
public function index()
    {
        //  When executing on the CLI we don't need to perform a few bit's of sense checking
        $oInput = Factory::service('Input');
        if (!$oInput::isCli()) {

            //  Is there an AdminIP whitelist?
            $whitelistIp = (array) appSetting('whitelist', 'admin');

            if ($whitelistIp) {
                if (!isIpInRange($oInput->ipAddress(), $whitelistIp)) {
                    show404();
                }
            }

            //  Before we do anything, is the user an admin?
            if (!isAdmin()) {
                unauthorised();
            }
        }

        //  Determine which admin controllers are available to the system
        $this->findAdminControllers();

        // --------------------------------------------------------------------------

        /**
         * Sort the controllers into a view friendly array, taking into
         * consideration the user's order and state preferences.
         */

        $this->prepAdminControllersNav();

        //  Save adminControllers to controller data so everyone can use it
        $this->data['adminControllers']    = $this->adminControllers;
        $this->data['adminControllersNav'] = $this->adminControllersNav;

        // --------------------------------------------------------------------------

        //  Route the user's request
        $this->routeRequest();
    }
Initial touch point for admin, all requests are routed through here.

@return void