added loginproccess() function

This makes logging into the system possible.