Welcome Guest, Not a member yet? Register   Sign In
Two issues: Checking login status and mail CR/LF
#1

[eluser]Uto[/eluser]
Hi,

I have found two problems while starting to use CI, well, the first one is not actually a problem but a doubt, cause I'm not sure how to do it better:

I have a site requiring login, so default controller is login.php and it takes care of everything. When the login is correct the method _loginok() is called, and that method starts a session, and adds the "userid" to that session.

The rest of the controllers require the "userid" on the session, or they cannot work (shoudl be redirected to login page if someone tries to load those pages).

I have thought about doing a "check" function on every controller, so I can check if the session var exists and if not, do something like
Code:
header('Location: /index.php')
or similar. But of course that means that I have to remember to do it at the beginning of every method (and that's dangerous as I can forget it).

Also I have thought about doint it on the _remap() method, but I cannot find how telling the remap method to call the default method except if I find there is no session.

Maybe there is another better way o do this, but I cannot find something suiting on docs or FAQ.

The second problem is about CR/LF on mails, I have tried everything, even I've created the email.php on the config folder, and tried all the combinations, but I still can find no way for it to work, I allways get "rn" wherever I write "\r\n", "r" when I write "\r", etc.
Any tips?


Messages In This Thread
Two issues: Checking login status and mail CR/LF - by El Forum - 01-30-2009, 12:55 PM
Two issues: Checking login status and mail CR/LF - by El Forum - 01-30-2009, 01:06 PM
Two issues: Checking login status and mail CR/LF - by El Forum - 01-30-2009, 01:43 PM
Two issues: Checking login status and mail CR/LF - by El Forum - 01-30-2009, 01:56 PM
Two issues: Checking login status and mail CR/LF - by El Forum - 01-30-2009, 02:05 PM
Two issues: Checking login status and mail CR/LF - by El Forum - 01-30-2009, 02:27 PM
Two issues: Checking login status and mail CR/LF - by El Forum - 01-30-2009, 02:33 PM
Two issues: Checking login status and mail CR/LF - by El Forum - 01-30-2009, 03:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB