Created
January 15, 2012 12:04
-
-
Save phawk/1615627 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
| class MY_Controller extends Controller | |
| { | |
| function MY_Controller() | |
| { | |
| parent::Controller(); | |
| $this->auth_logged_in(); | |
| } | |
| function auth_logged_in() | |
| { | |
| if ( ! $this->session->userdata('user_id')) | |
| { | |
| // Remember what page the user was on | |
| redirect('/users/login'); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment