Reusable code for CodeIgniter user management