<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Description of browser
 *
 * @author Igor Ratsun
 */
class browser {

    function check_browser() {
        $CI = & get_instance();
        $allowed_browsers = $CI->config->item('min_allowed_browser_version');
        $CI->load->library('user_agent');
        $CI->lang->load('ciext/browsers');
        if ($CI->agent->is_browser() &&
                (isset($allowed_browsers[$CI->agent->browser()]) &&
                (integer) $CI->agent->version() < $allowed_browsers[$CI->agent->browser()])) {
            $_error = & load_class('Exceptions', 'core');
            echo $_error->show_error($CI->lang->line('browser_no_suport_head'), $CI->lang->line('browser_no_suport'), 'error_403', 403);
            exit;
        }
    }

}

