| Conditions | 3 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | public function create() |
||
| 34 | { |
||
| 35 | $userService = $this->getUserService(); |
||
| 36 | |||
| 37 | if (!$userService->isUserLoggedIn() || |
||
| 38 | $userService->getSessionUserRole() < $userService::MODERATOR_ROLE_PRIORITY |
||
| 39 | ) { |
||
| 40 | $this->httpResponse->response( |
||
| 41 | new Response( |
||
| 42 | Locale::getLocale('User must be logged in and have the correct rights'), |
||
| 43 | Response::CONTENT_TYPE_PLAIN_TEXT, |
||
| 44 | Response::HTTP_RESPONSE_UNAUTHORIZED |
||
| 45 | ) |
||
| 46 | ); |
||
| 47 | return; |
||
| 48 | } |
||
| 49 | |||
| 50 | $newUserStatusCommand = new CreateUserStatusCommand( |
||
| 51 | $this->httpRequest->getParameter('name'), |
||
| 52 | $this->diContainer->get("entityManager") |
||
| 53 | ); |
||
| 54 | $newUserStatusCommand->execute(); |
||
| 55 | } |
||
| 57 |