Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Admin_Controller extends MY_Controller {
- public function __construct() {
- parent::__construct();
- if (!$this->isLoggedIn()) {
- redirect('/home');
- }
- $this->template->set_master_template('desktop/templates/admin');
- $this->data['page'] = new stdClass();
- $this->data['page']->title = "Administration Control Panel";
- $this->data['allusers'] = $this->user_model->get_all();
- $this->data['allgroups'] = $this->group_model->get_all();
- $this->data['allpages'] = $this->page_model->get_all();
- $this->template->set_breadcrumb($this->data['page']->title, site_url('admin'));
- $this->template->write_view('adminnav', 'desktop/views/admin/partials/navmenu');
- }
- protected function isLoggedIn() {
- if (($this->session->userdata('id')) == '') {
- return False;
- }
- else {
- return True;
- }
- }
- protected function isAdmin() {
- if ($this->isLoggedIn() && $this->user_model->get($this->session->userdata('id'))->group == 1) {
- return True;
- }
- else {
- return False;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement