It's a common problem, solved many times, but for some reason i cannot find the right information.
Some constraints and requirements:
- Technique for LAMP stack.
 - Fine-grained control of which files are accessible.
 - No basic authentication with htpasswd files, i want to provide a custom login frontend.
 - Should be able to securely protect and serve big video files
 
How do all those sites protect their files from public without using basic authentication?
Thanks!
A similar question: http://stackoverflow.com/questions/1688568/performance-oriented-way-to-protect-files-on-php-level