@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | * @param string $event The event to use. |
| 38 | 38 | */ |
| 39 | 39 | |
| 40 | - public function initialize(array $config) |
|
| 41 | - { |
|
| 42 | - parent::initialize($config); |
|
| 40 | + public function initialize(array $config) |
|
| 41 | + { |
|
| 42 | + parent::initialize($config); |
|
| 43 | 43 | |
| 44 | - $this->controller = $this->_registry->getController(); |
|
| 45 | - $this->session = $this->controller->request->session(); |
|
| 46 | - } |
|
| 44 | + $this->controller = $this->_registry->getController(); |
|
| 45 | + $this->session = $this->controller->request->session(); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | 49 | * Initialization to get controller variable |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | * @param array $rules Array of rules for permissions. |
| 52 | 52 | * @return string '0' if user / group doesn't have permission, 1 if has permission |
| 53 | 53 | */ |
| 54 | - public function allow ($rules) { |
|
| 55 | - $user_id = $this->session->read('Auth.User.id'); |
|
| 54 | + public function allow ($rules) { |
|
| 55 | + $user_id = $this->session->read('Auth.User.id'); |
|
| 56 | 56 | |
| 57 | 57 | $actions = array(); |
| 58 | 58 | $bool = '1'; |
@@ -67,20 +67,20 @@ discard block |
||
| 67 | 67 | foreach($rules as $key => $value){ |
| 68 | 68 | switch($key){ |
| 69 | 69 | case "user_type": |
| 70 | - $userType = $value; |
|
| 71 | - break; |
|
| 72 | - case "redirect": |
|
| 73 | - $redirect = $value; |
|
| 74 | - break; |
|
| 75 | - case "action": |
|
| 76 | - $action = $value; |
|
| 77 | - break; |
|
| 78 | - case "controller": |
|
| 79 | - $controller = $value; |
|
| 80 | - break; |
|
| 81 | - case "message": |
|
| 82 | - $message = $value; |
|
| 83 | - break; |
|
| 70 | + $userType = $value; |
|
| 71 | + break; |
|
| 72 | + case "redirect": |
|
| 73 | + $redirect = $value; |
|
| 74 | + break; |
|
| 75 | + case "action": |
|
| 76 | + $action = $value; |
|
| 77 | + break; |
|
| 78 | + case "controller": |
|
| 79 | + $controller = $value; |
|
| 80 | + break; |
|
| 81 | + case "message": |
|
| 82 | + $message = $value; |
|
| 83 | + break; |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
@@ -141,5 +141,5 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | return $bool; |
| 144 | - } |
|
| 144 | + } |
|
| 145 | 145 | } |
| 146 | 146 | \ No newline at end of file |