title: How to call Module function in Codeigniter HMVC? Tank auth
body: <p>I have installed tank auth to save me time creating a authentication script.</p>
  
  <p>As I am using HMVC, tank auth has it's own module (modules/auth).</p>
  
  <p>How can I protect my other modules (/admin, /members etc) with the login script??</p>
  
  <p>From what I have read I need to do something like:</p>
  
  <pre><code>modules::run('auth/is_logged_in'); 
  </code></pre>
  
  <p>My auth controller looks like:</p>
  
  <pre><code>&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');
  
  class Auth extends MX_Controller
  {
      function __construct()
      {
          parent::__construct();
  
          $this-&gt;load-&gt;helper(array('form', 'url'));
          $this-&gt;load-&gt;library('form_validation');
          //$this-&gt;load-&gt;library('security');
          $this-&gt;load-&gt;library('tank_auth');
          $this-&gt;lang-&gt;load('tank_auth');
  
      }
  
      function index()
      {
          if ($message = $this-&gt;session-&gt;flashdata('message')) {
              //$this-&gt;load-&gt;view('auth/auth/general_message', array('message' =&gt; $message));
  
              $main_content = 'auth/auth/general_message';
              $this-&gt;load-&gt;view('includes/template', array('message' =&gt; $message, 'main_content' =&gt;$main_content));
          } else {
              redirect('auth/login/');
          }
      }
  
      /**
       * Login user on the site
       *
       * @return void
       */
      function login()
      {
          if ($this-&gt;tank_auth-&gt;is_logged_in()) {                                 // logged in
              redirect('admin');
  
          } elseif ($this-&gt;tank_auth-&gt;is_logged_in(FALSE)) {                      // logged in, not activated
              redirect('auth/send_again/');........
  </code></pre>
  
  <p>an the controller/module I want to protect with the login script:</p>
  
  <pre><code>&lt;?php
  
  if (!defined('BASEPATH'))
      exit('No direct script access allowed');
  
      class Admin extends MX_Controller {
  
          public function __construct(){
              parent::__construct();  
  
  
  
              modules::run('auth/auth/login'); 
  
          }   
  </code></pre>
  
  <p>The above does not seem to work? What am I missing?</p>