I have an authorization library which looks like:
class Auth {
// properties
var $CI;
var $encrypt_pass;
var $redirect_to;
var $_login_var = 'email';
var $_password_var = 'password';
var $_permissions;
function Auth()
{
$this->CI =& get_instance();
$this->encrypt_pass = FALSE;
$this->redirect_to = 'login';
$this->hash_key = $this->CI->config->item('auth_hash');
}
function Authorize($permission_category = 1, $permission)
{
//here is a code to authorize users
}
When I will try to use
$this->auth->Authorize();
or
$this->auth->Authorize('userlist');
I’m getting error:
Message: Missing argument 2 for Auth::Authorize(), called in /controllers/admin.php on line 57 and defined
Filename: libraries/auth.php
Line Number: 31
Shouldn’t in a first case use argument 1: $permission_category = 1 and an empty $permission as argument 2? Then in a second case argument 1 be $permission_category = 1 and argument 2 $permission = ‘userlist’ ?
I’m little bit lost there.
Thanks
