Created
January 28, 2012 21:35
-
-
Save wrightlabs/1695824 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
$this->load->library('tank_auth'); | |
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
ALTER TABLE users ADD group_id INT NOT NULL DEFAULT '300' |
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
$this->load->library('tank_auth_groups','','tank_auth'); |
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 | |
// application/controllers/admin.php | |
require 'admin_base.php'; | |
class Admin extends Admin_Base { | |
function index() | |
{ | |
redirect('admin/dashboard'); | |
} | |
function dashboard() | |
{ | |
// display admin dashboard | |
} | |
} | |
?> |
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 | |
// application/controllers/admin_base.php | |
class Admin_Base extends CI_Controller { | |
function __construct() | |
{ | |
parent::__construct(); | |
$this->load->library( | |
'tank_auth_groups', '', 'tank_auth' | |
); | |
if(!$this->tank_auth->is_admin()) | |
{ | |
redirect('auth/login'); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment