Magic auth model for codeigniter php framework