Welcome Guest, Not a member yet? Register   Sign In
Modular Separation and Tank Auth

Dear all,

Recently I finished my first project with CI. Now I'm looking at Modular Separation. And I want to use Tank Auth for logging in etc.

I made a module auth where I put all the Tank Auth files. Not sure if this is correct.

Plus I'm having troubles with the routing. The Tank Auth files direct without the module name. And so I get an error.

Does anyone know a good tutorial or tips for implementing Tank Auth (or any other) with Modular Separation? I can't find it.

Kind regards,


Decided to use Ion-Auth. Currently trying to implement this. Not sure if I'm doing this correct. Since it takes me a lot of time. I tought CI and modules should save time. So, I must be doing something wrong.

I haven't used Modular Separation, but with Matchbox it was a walk in the park. I've used Matchbox both with DX_auth and with Tank_Auth in their own /auth/ module.

If you give up on Modular Separation I could perhaps help if you use Matchbox.

Regarding actually placing all of the tank auth files into the module... in my system the DX_Auth and Tank_Auth were kept in the normal library/model/config folders, and in my auth module I added the controller that actually handled the login and logout, registration functions etc. I don't know if that would matter in the routing, but it made more sense in my brain as far as separating the contributed code from my own personal code.


Thanks. I did manage to get it working. I also put the library in the regular folder and not in a module. But I put my auth.php not in an own module. I just added it to the admin module.

So it does work, but I do have a problem. When I log out I get redirected to the login page. So far so good. But when I use the back-button I can see previous page. But as soon as I click on a link I get redirected again to the login. So I am logged out, but can see the last page before logout.

Any ideas?



The back button usually shows you a browser-cached page, so even if it doesn't exists or you do not have access to it, you will still be able to see it, but it's like an illusion Tongue
Try going back and then hit F5 (reload)

[quote author="Buso" date="1283538729"]The back button usually shows you a browser-cached page[/quote]

Agreed. You can try and play some games with the cache settings meta tags... if you want to be very specific then make sure that you are checking for the login in the constructor of the controller (or extend the controller to create something like ADMIN_Controller that will do all that for you).

Check the following:
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
Course you would use the output class in CI. Heres another, written for Java, but the headers are the same etc.: http://faq.javaranch.com/java/NoCacheHeaders
response.setHeader( "Pragma", "no-cache" );
   response.setHeader( "Cache-Control", "no-cache" );
   response.setDateHeader( "Expires", 0 );

<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT">

Good luck, you're kinda in the hands of whether the browser wants to listen to your suggestions.

Theme © iAndrew 2016 - Forum software by © MyBB