Part of the EllisLab Network
   
 
Clever login structure
Posted: 17 January 2008 03:41 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  54
Joined  08-25-2007

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!

Profile
 
 
Posted: 17 January 2008 08:16 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  21
Joined  05-09-2007

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.

Profile
 
 
Posted: 18 January 2008 09:59 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  204
Joined  03-12-2007

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

 Signature 

There are 10 kind of people in this world, those who understand binary and those who don’t

Profile
 
 
Posted: 18 January 2008 10:32 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  378
Joined  09-11-2006

I’ve had a lot of success with Erkanaauth; I like that I can use whatever fields I want as a login key.

 Signature 

August 2011: I’m not an active codeigniter developer right now. Feel free to contact me, but I may not be able to solve your problem for you.

flickr | twitter | rockets

Profile