Completed
Branch master (16e61c)
by Alessandro
02:02
created
src/Controller/Component/UserPermissionsComponent.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
141 141
 		}
142 142
 
143 143
 		return $bool;
144
-    }
144
+	}
145 145
 }
146 146
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -110,8 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 								header("Location: " . $redirect);
112 112
 								exit;
113
-							}
114
-							else{
113
+							} else{
115 114
 								$bool = '0';
116 115
 							}
117 116
 						}
@@ -131,8 +130,7 @@  discard block
 block discarded – undo
131 130
 							
132 131
 							header("Location: " . $redirect);
133 132
 							exit;
134
-						}
135
-						else{
133
+						} else{
136 134
 							$bool = '0';
137 135
 						}
138 136
 					}
Please login to merge, or discard this patch.