Moved to PHP folder
This commit is contained in:
29
php/application/libraries/Userauth.php
Normal file
29
php/application/libraries/Userauth.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Userauth
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->CI =& get_instance();
|
||||
$this->CI->load->library('session');
|
||||
}
|
||||
public function logged_in(){
|
||||
|
||||
if ( ! $this->CI->session->userdata('user_id'))
|
||||
{
|
||||
redirect('admin');
|
||||
}
|
||||
}
|
||||
|
||||
public function logged_admin(){
|
||||
|
||||
if (! $this->CI->session->userdata('user_id') && $this->CI->session->userdata('user_type') != "admin")
|
||||
{
|
||||
redirect('admin');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user