CodeIgniter Forums
Clever login structure - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Clever login structure (/showthread.php?tid=5319)



Clever login structure - El Forum - 01-17-2008

[eluser]Kurai[/eluser]
Hi there.
I'm trying to build a message system. It will be something like twitter in my mind, but without the character limitation. I'm trying to stick to a very simple build, and then expand it later.

Basically what the system should do is:

- You enter and you see the login page, where you put your username and password.
- then you're redirected to your personal page, which shows all the messages you have received.
- you can send messages to other users

Now, I'm a bit stuck with the login form. I tried simplelogin, but I really don't get how to deal with session. Basically, what I want is to bypass the login session if I'm already logged in. But since currently my main page is expecting to get the Post data from the login, it obviously throw an error.
Do you have any advice on how it's best to operate?

Should I trash Simplelogin and build up a database method instead?

Thank you!


Clever login structure - El Forum - 01-17-2008

[eluser]leon_dewey[/eluser]
Check session data then check post data... if both are null then redirect to login if eather are good then show page. Check the session first.


Clever login structure - El Forum - 01-18-2008

[eluser]obiron2[/eluser]
look at freakauthlight (youll fidn it in wiki)

To add it your pages you just need to add a couple of lines to each function (or to the index of the controller)

It automatically checks for login and login level and redirects to the login page if necessary then returns to the calling function. nice.

Obiron


Clever login structure - El Forum - 01-18-2008

[eluser]Nick Husher[/eluser]
I've had a lot of success with Erkanaauth; I like that I can use whatever fields I want as a login key.