@@ -21,8 +21,9 @@ |
||
| 21 | 21 | public function __invoke(Request $request, Response $response, callable $next) |
| 22 | 22 | { |
| 23 | 23 | if (isset($_SESSION['phpCAS']['user'])) { |
| 24 | - if (in_array($_SESSION['phpCAS']['user'], $this->container['parameters']['administrators'])) |
|
| 25 | - return $next($request, $response); |
|
| 24 | + if (in_array($_SESSION['phpCAS']['user'], $this->container['parameters']['administrators'])) { |
|
| 25 | + return $next($request, $response); |
|
| 26 | + } |
|
| 26 | 27 | } |
| 27 | 28 | |
| 28 | 29 | $this->flash->addMessage('error', '<i class="minus circle icon"></i> You are not allowed to access to this content.'); |
@@ -33,8 +33,9 @@ |
||
| 33 | 33 | |
| 34 | 34 | $res = []; |
| 35 | 35 | foreach($students as $student) { |
| 36 | - if ($student['uid'][0] != null) |
|
| 37 | - $res += [ $student['uid'][0] => $student['displayname'][0] ]; |
|
| 36 | + if ($student['uid'][0] != null) { |
|
| 37 | + $res += [ $student['uid'][0] => $student['displayname'][0] ]; |
|
| 38 | + } |
|
| 38 | 39 | } |
| 39 | 40 | |
| 40 | 41 | return $this->json($response, $res); |
@@ -27,8 +27,9 @@ |
||
| 27 | 27 | ]); |
| 28 | 28 | |
| 29 | 29 | foreach (json_decode($enrollments->getBody()->getContents()) as $enrollment) { |
| 30 | - if ($enrollment->class->title != null) |
|
| 31 | - array_push($classes, $enrollment->class); |
|
| 30 | + if ($enrollment->class->title != null) { |
|
| 31 | + array_push($classes, $enrollment->class); |
|
| 32 | + } |
|
| 32 | 33 | } |
| 33 | 34 | |
| 34 | 35 | return $this->view->render($response, 'App/user.twig',[ |
@@ -17,8 +17,9 @@ |
||
| 17 | 17 | $country_id = $request->getAttribute('routeInfo')[2]['country']; |
| 18 | 18 | |
| 19 | 19 | // Useful when a client edits the URL and types a language that does not exist. |
| 20 | - if (!$this->checkCountry($country_id)) |
|
| 21 | - return $response->withRedirect($this->router->pathFor('wrong-entry')); |
|
| 20 | + if (!$this->checkCountry($country_id)) { |
|
| 21 | + return $response->withRedirect($this->router->pathFor('wrong-entry')); |
|
| 22 | + } |
|
| 22 | 23 | |
| 23 | 24 | setcookie('country', $country_id, time() + (30 * 24 * 60 * 60)); // 30 days |
| 24 | 25 | |