/** * Before we do anything, check to see if the user is an admin. If it's * an un-auth'd call, log the user info (if they are logged in as a non-admin), * and the IP address */ public function __construct() { parent::__construct(); if (!UserHelper::isAdmin()) { log_message('error', "Attempted unauthorized access to admin section: " . UserHelper::getEmail() . '-' . UserHelper::getId() . '-' . $this->input->ip_address()); show_error("You do not have permission to access this resource. This has been logged."); } }