/**
  * Public class constructor
  * @access public
  * @throws Exception when user has already been registered
  */
 public function __construct()
 {
     if (isset($_SESSION['visitor']) && $_SESSION['visitor'] == "accessed") {
         throw new Exception("User already registered", 1);
     } else {
         $this->dateTime = Carbon::now();
         $this->browser = BrowserDetect::browserFamily();
         $this->OS = BrowserDetect::osName();
         if (BrowserDetect::isMobile()) {
             $this->deviceType = "mobile";
         } elseif (Browser::isTablet()) {
             $this->deviceType = "tablet";
         } elseif (Browser::isDesktop()) {
             $this->deviceType = "desktop";
         } elseif (Browser::isBot()) {
             $this->deviceType = "bot";
         } else {
             $this->deviceType = "unknown";
         }
         $this->deviceFamily = Broswer::deviceFamily();
         $this->deviceModel = Browser::deviceModel();
         $this->broadcastAddress = $_SERVER["REMOTE_ADDR"];
         $this->model = new AccessModel($this);
     }
 }
Ejemplo n.º 2
0
 public function index()
 {
     //Limpando a sessão independente do redirecionamento
     session_destroy();
     $this->session->sess_destroy();
     //
     $data = $this->getParametroVisao();
     $data['msg'] = $this->getMsg();
     $data['abaAtiva'] = '';
     $data['abaPage'] = 'login';
     if (BrowserDetect::isMobile()) {
         $data['tema'] = $this->load->setTheme('responsive');
         $data["shadowbox"] = 1;
         $data['page'] = 'login_w/responsive/' . __FUNCTION__;
         $data["css"] = array("js/bower/bootstrap/dist/css/bootstrap.min.css", "js/bower/metisMenu/dist/metisMenu.min.css");
         $data["js"] = array("js/bower/jquery/dist/jquery.min.js", "js/bower/bootstrap/dist/js/bootstrap.min.js", "js/bower/metisMenu/dist/metisMenu.min.js");
     } else {
         $data['page'] = 'default';
         $data['tema'] = $this->load->setTheme('default');
     }
     $data['largura_percent'] = 30;
     $data['margin_top'] = 'margin_top70';
     $data['bordasMain'] = false;
     // Se não for retornado erro de senha, reseta o item 'qtd'
     if (!isset($_SESSION['erroUsuarioSenha'])) {
         $_SESSION['erroUsuarioSenha']['qtd'] = 0;
     }
     // Se o número de erro de senha for maior ou igual a 3
     if ($_SESSION['erroUsuarioSenha']['qtd'] >= 3) {
         // gera um código randomico de quatro caracteres
         $_SESSION['erroUsuarioSenha']['codigo'] = Util::getRandomString(4);
         // chama o helper captcha, seta suas variáveis, cria a imagem e envia a view
         $this->load->helper('captcha');
         $vals = array('word' => $_SESSION['erroUsuarioSenha']['codigo'], 'img_path' => './captcha/', 'img_url' => base_url() . 'captcha/', 'font_path' => './system/fonts/texb.ttf', 'img_width' => '120', 'img_height' => 30, 'expiration' => 1);
         $cap = create_captcha($vals);
         $data['captcha'] = $cap['image'];
     }
     // Carrega a view
     $this->load->view($this->load->getUrlTema(), $data);
 }
Ejemplo n.º 3
0
    <link rel="stylesheet" href="/css/dist/css/bootstrap-select.css">            
    <?php 
// Build title css sheets.
$myCSS = 'css/main/';
$relRoute = 'css/main/';
$media;
foreach (File::allFiles($myCSS) as $file) {
    $media = false;
    $blockCSS = false;
    if (BrowserDetect::browserFamily() == 'Chrome' && (BrowserDetect::isMobile() || BrowserDetect::isTablet())) {
        switch (str_replace('.css', '', $file = $file->getFilename())) {
            case 'tablet':
                $blockCSS = false;
                break;
            case 'mobile':
                $blockCSS = !BrowserDetect::isMobile();
                break;
            case 'noDotNet':
            case 'small':
            case 'smallMedium':
            case 'medium':
            case 'large':
            case 'small':
                $blockCSS = BrowserDetect::browserFamily() != 'Internet Explorer';
                break;
        }
    } else {
        //default to desktop view.
        switch (str_replace('.css', '', $file = $file->getFilename())) {
            case 'noDotNet':
                $media = 'screen and (max-width: 350px)';
Ejemplo n.º 4
0
 protected function renderHomePage()
 {
     $view_data = array();
     // --------------------------------------
     $meta_data = $this->setMetaData();
     $view_data = array_merge($view_data, $meta_data);
     // navigation
     // --------------------------------------
     $view_data['navigation'] = $this->renderNavigation();
     // --------------------------------------
     $template_data = $this->setPageData();
     // page template (handlebars)
     $ie = \BrowserDetect::isIE();
     $isMobile = \BrowserDetect::isMobile();
     //$tmpl = ($ie || $isMobile) ? 'hbs::homeIE' : 'hbs::home';
     $tmpl = 'hbs::home';
     $content = View::make($tmpl, $template_data);
     $view_data['content'] = $content;
     return View::make('layouts.application', $view_data);
 }