public function getIsAdmin(HTTPRequest $request)
    {
        $adminPaths = static::config()->get('admin_url_paths');
        $adminPaths[] = AdminRootController::admin_url();
        $currentPath = rtrim($request->getURL(), '/') . '/';
        foreach ($adminPaths as $adminPath) {
            if (substr($currentPath, 0, strlen($adminPath)) === $adminPath) {
                return true;
            }
        }
        return false;
    }
public function getIsAdmin(HTTPRequest $request)
    {
        $adminPaths = static::config()->get('admin_url_paths');
        $adminPaths[] = AdminRootController::admin_url();
        $currentPath = rtrim($request->getURL(), '/') . '/';
        foreach ($adminPaths as $adminPath) {
            if (substr($currentPath, 0, strlen($adminPath)) === $adminPath) {
                return true;
            }
        }
        return false;
    }
public function getIsAdmin ( HTTPRequest $ request ) { $ adminPaths = static :: config ( ) -> get ( 'admin_url_paths' ) ; $ adminPaths [ ] = AdminRootController :: admin_url ( ) ; $ currentPath = rtrim ( $ request -> getURL ( ) , '/' ) . '/' ; foreach ( $ adminPaths as $ adminPath ) { if ( substr ( $ currentPath , 0 , strlen ( $ adminPath ) ) === $ adminPath ) { return true ; } } return false ; }
Determine whether the website is being viewed from an admin protected area or not

@param  HTTPRequest $request
@return bool
Determine whether the website is being viewed from an admin protected area or not