You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
540 B
PHTML
34 lines
540 B
PHTML
8 years ago
|
<?php
|
||
|
|
||
|
if (!defined('BASEPATH'))
|
||
|
exit('No direct script access allowed');
|
||
|
/*
|
||
|
* 访问权限管理
|
||
|
*/
|
||
|
|
||
|
class Permission
|
||
|
{
|
||
|
|
||
|
var $CI;
|
||
|
|
||
|
public function __construct()
|
||
|
{
|
||
|
$this->CI = & get_instance();
|
||
|
log_message('debug', "Access permission Class Initialized");
|
||
|
}
|
||
|
|
||
|
function is_admin($auto_redirect=true)
|
||
|
{
|
||
|
if ($this->CI->session->userdata('session_admin') === FALSE)
|
||
|
{
|
||
|
if ($auto_redirect){
|
||
|
redirect(site_url('login'));
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|