enabling user login

fixed save parameter from 'userid' to 'user_id' and use $user['id'];