I am developing a site with a customer logged in area. I don't want anyone to access the section if they are logged out and instead redirect them to the login form.
I could just add {% requireLogin %} to the top of all the member templates, but its open to error, especially if we have loads. I am concerned we may forget to add it, accidentally delete the line one day. Then private pages are public, not good.
So I thought I would add the function to a plugin I have created for this site, to remove it from the template, and I can also target the whole /account/ segment where member templates are located.
BUT, the plugin can be uninstalled or disabled. Various people will be Admins, and there is always the possibility someone could disable this for some reason, and then all private pages become public!
So can we disable the ability to disable and uninstall plugins in the CP? The plugin will contain this and other site essential functions that we cant just have someone delete. They need to be fixed into the system to prevent accidental disabling.
If not, is there an alternative way to add functions without using a plugin or controller, so we can override core actions like this without any CP control.
Thanks!