You could try here. It's a login system I did a while back, you're welcome to modify it.

I never did get around to actually using it, my brother did though, seemed to work for him. Others can comment on the code to make it a little more sufficient for you.

-Andy