CAFPE Docs
  • Class

Classes

  • Article_model
  • Articles
  • Auth
  • Auth_controller
  • Bcrypt
  • Hierarchical_controllers
  • Ion_auth
  • Ion_auth_model
  • MY_Controller
  • MY_Lang
  • MY_Model
  • Pages
  • Private_pages
  • Public_controller
  • Seeder
  • Slug
  • User_sessions
  • Users

Functions

  • action_result
  • actions_widget
  • admin_area_buttons
  • base64_current_url_encode
  • base64_url_decode
  • base64_url_encode
  • current_lang
  • jscript_tag
  • lang_switcher
  • logged_in
  • redirect_lang
  • site_url_lang
  • style_tag
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 
<?php defined('BASEPATH') or exit('No direct script access allowed');

/*
 * Controller extended by other controllers that load private access views
 */
class Auth_controller extends MY_Controller
{
    public function __construct()
    {
        parent::__construct('templates/auth');
        $this->_auth_logged_in();
        // add admin jscripts in auth area
        $this->data['jscripts'] = ['admin.vendors', 'admin'];
        $this->data['styles'] = ['admin'];
    }

    /**
    * Checks if user is authenticated
    */
    private function _auth_logged_in()
    {
        //Check if user is authenticated
        if ($this->ion_auth->logged_in() === false) {
            redirect_lang('admin/login');
        }
    }
}
CAFPE Docs API documentation generated by ApiGen