Community Auth - problem |
(10-25-2015, 01:33 AM)Martin7483 Wrote: @skunkbad Sorry, I wasn't trying to insult you. I'll explain LOGIN_PAGE, so you can understand why it must be a constant, and what a constant is appropriate in this case. If you dig around in Community Auth you would find that the routes.php file sets a special route to the main login page, and yes the key is the LOGIN_PAGE constant, which is declared in a pre-system hook. This is necessary because no CI config is available at that point. The idea here is that LOGIN_PAGE can be anything you want. On your site, if you want everyone to login at /rainbows/unicorns, then you just set the value of LOGIN_PAGE to /rainbows/unicorns. If you try to access /examples/login directly, you get a 404, which is intended, because I want to force people to use /rainbows/unicorns. Why this? Well, sometimes bots will hammer away on certain login pages; most people are familiar with wp-login.php getting hammered (if they are WordPress users). So now if /rainbows/unicorns is getting hammered on, just switch it to something else, like /stooges/3, or anything new. I got the idea to make this part of Community Auth because of WordPress, and attacks on the login, which were a problem for me and many of my clients. This doesn't really help when the login is visible to anybody, but for many sites where the login is an unknown URL (except to staff members or admin users), then this can be quite handy. I'm sure you can think of other reasons why changing the login page URL would be handy. So yes, LOGIN_PAGE is a constant, and must be a constant because it is declared in a pre-system hook and used in routing config, where CI config is not yet available. |
Messages In This Thread |
Community Auth - problem - by MartinMIB - 10-22-2015, 01:52 PM
RE: Community Auth - problem - by Martin7483 - 10-23-2015, 01:40 AM
RE: Community Auth - problem - by skunkbad - 10-23-2015, 05:48 PM
RE: Community Auth - problem - by Martin7483 - 10-24-2015, 10:02 AM
RE: Community Auth - problem - by skunkbad - 10-24-2015, 11:56 PM
RE: Community Auth - problem - by Martin7483 - 10-25-2015, 01:33 AM
RE: Community Auth - problem - by skunkbad - 10-25-2015, 04:48 PM
RE: Community Auth - problem - by syerwin - 02-27-2016, 11:12 AM
RE: Community Auth - problem - by syerwin - 02-27-2016, 11:14 AM
|