Forum Moderators: phranque
I've tried allowing the IP ranges in .htaccess together with a .htpassword but they seem to conflict.
Has anyone here had any success with something similar?
Thanks
I would do this something like this, in a database table:
rec_id¦user_id¦access_level¦email...........¦pass
1.....¦123....¦0...........¦this@example.com¦testme
2.....¦124....¦1...........¦that@example.com¦
On registration, whatever mechanisms you have that assign access levels will set it at 1 or 0. You'd then set a non-expiring cookie for access level 1 users. For access level 0 users, you set an expiring cookie (say, 2 hours) to keep them logged in for the current session.
On return, all users are passed through a validation function. The level 1 users will be validated via the cookie and automatically let in (as you can see, no password is required in the database.) Level 0 users would be directed to a login form, unless their cookie hasn't expired.