Animation on log-in & other problems

My idea:
Closed locker > user clicks locker door > pop-up window asks register/log-in/visitor > register takes to register page/log-in to log-in page/etc > user registers and if correct information locker door opens and then they can click on the things inside

Problem:
I’m not sure where to do the log-in pop-up window and have the locker swing open when correct information is entered.

Problem #2:
Can someone direct me to a tutorial for making a registration/password protected page? each person has their own name/password

I’m not sleeping until it’s done!