Commit cc4d4933 by Carsten Brandt

fixed undefined variable problem in AccessControl

parent 0b2aafc7
...@@ -64,6 +64,7 @@ class AccessControl extends ActionFilter ...@@ -64,6 +64,7 @@ class AccessControl extends ActionFilter
* ~~~ * ~~~
* *
* where `$rule` is this rule, and `$action` is the current [[Action|action]] object. * where `$rule` is this rule, and `$action` is the current [[Action|action]] object.
* `$rule` will be `null` if access is denied because none of the rules matched.
*/ */
public $denyCallback; public $denyCallback;
/** /**
...@@ -79,6 +80,7 @@ class AccessControl extends ActionFilter ...@@ -79,6 +80,7 @@ class AccessControl extends ActionFilter
*/ */
public $rules = []; public $rules = [];
/** /**
* Initializes the [[rules]] array by instantiating rule objects from configurations. * Initializes the [[rules]] array by instantiating rule objects from configurations.
*/ */
...@@ -114,16 +116,14 @@ class AccessControl extends ActionFilter ...@@ -114,16 +116,14 @@ class AccessControl extends ActionFilter
} else { } else {
$this->denyAccess($user); $this->denyAccess($user);
} }
return false; return false;
} }
} }
if (isset($this->denyCallback)) { if (isset($this->denyCallback)) {
call_user_func($this->denyCallback, $rule, $action); call_user_func($this->denyCallback, null, $action);
} else { } else {
$this->denyAccess($user); $this->denyAccess($user);
} }
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment