CodeIgniter Forums
Protect site based on config setting? - 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: Protect site based on config setting? (/showthread.php?tid=47680)



Protect site based on config setting? - El Forum - 12-18-2011

[eluser]Sven Delle[/eluser]
Hi,

I'd like to create a sort of site protection routine using a custom config file:

site_config.php:

Code:
$site_config['site_protected'] = true/false;

And based on that set the default controller (in the routes.php file) accordingly to either:

site or login (controller)

How do I go about doing this? Or should I have a totally different approach?

The idea is to be able to easily enable or disable site protection.

Any ideas?