Hi everyone,
I am currently working on adding pre-validation to my website. So that pages that require a log-in or other criteria, will only display if your session matches that criteria. I've got most of the system working, but I have one major obstacle. I cannot figure out how to stop CodeIgniter from running the rest of the controller (and thereby showing the page anyways), when the validation fails.
Here is my configuration:
- All my pages are in the Content controller
- My security system is a model called security.php
- In the _head private function (which is called by every page), I load security.php and call it's main function: run()
$this->security->run() gets the specific validation criteria for the page, and checks them.
If the user passes, then run() does nothing, and the page execution continues
This is where I need help. If the user does not pass, then I need to display an error page, and stop the controller from calling any other views.
Does anyone know how to do this?
Thanks,
Lemiant