[eluser]rogierb[/eluser]
Just treat the User Guide as the CI bible. The questions you just asked are in the userguide.
And in the forums aswell.
Basically you want a callback that checks the database for a user.
The second part can be done via flashdata or a redirect to a logged_in method.
So print a copy of the userguide, an never go anywhere without, put it under your pillow as you go to sleep!
I'm not going to give you complete code or a complete solution, then you wouldn't learn from it;-)