Accessing controller in advanced module

edited October 2011 in Modules
Hi,

I am just trying to set up tank_auth as an advanced module to set up user authentication, at the moment I have just directly ported over the tank_auth folder into a module folder.

All appears to be working so far but if I try and access the welcome.php controller which comes with the download to show when logged in I get a 404 error.

I know the main controller must be named after the module like so : fuel/modules/my_module/controllers/my_module.php

In my case I have : fuel/modules/auth/controllers/auth.php

However accessing fuel/modules/auth/controllers/welcome.php does not work.

Any suggestions?

Thanks

Comments

  • edited 4:11AM
    What is the URI that you are using to try and access? Is it "auth/welcome"?
  • edited October 2011
    Hi,

    Yes it is. It is supposed to re-direct to that page when successfully logged in.

    It is worth adding that I had to amend the auth.php so that each view was loading properly.. where a line reads :$this->load->view('auth/....) I have amended it to $this->load->view('auth/auth/...)

    Thanks.
  • edited October 2011
    Hmm... I just installed tank_auth with these steps and was able to browse to the welcome page where it says "Hi, admin! You are logged in now. Logout"

    1. moved everything from the "tank_auth/application" directory into the folder "fuel/modules/auth"
    2. renamed all thew view file paths like you did above
    3. registered at auth/register and confirmed my registration with the email
    4. logged in, in which case it redirected me back to the homepage.
    5. browsed to auth/welcome

    Is there something in those steps that may help with your troubles?
  • edited 4:11AM
    Well I thought I had done exactly as you...I will try a fresh install of fuel and see if the issues persists.

    standby...
  • edited 4:11AM
    Ok, well I have now re-installed fuel and tank auth and now it works. I must have changed some thing inadvertently.

    Thanks for your help.

    Boosh
  • edited 4:11AM
    sure... glad you got it working.
  • edited 4:11AM
    Ok right the next brick I face is I can't access the module from another module or controller. If I have say have this : $this->load->module_library('auth','tank_auth');

    I get the error: "An Error Was Encountered
    The configuration file development/tank_auth.php and tank_auth.php do not exist."

    Thanks
  • edited 4:11AM
    Take a look at line 27 of the Tank_auth library class. You may need to change that to load from the auth module like so:
    $this->ci->load->module_config('auth', 'tank_auth', TRUE);
  • edited 4:11AM
    Yep that was it. Thanks once again

    Regards

    boosh
Sign In or Register to comment.