| @@ 56-62 (lines=7) @@ | ||
| 53 | ||
| 54 | $service->get( |
|
| 55 | '/server_pool', |
|
| 56 | function (Request $request, array $hookData) { |
|
| 57 | Utils::requireUser($hookData, ['vpn-admin-portal', 'vpn-user-portal']); |
|
| 58 | $poolId = $request->getQueryParameter('pool_id'); |
|
| 59 | InputValidation::poolId($poolId); |
|
| 60 | ||
| 61 | return new ApiResponse('server_pool', $this->instanceConfig->v('vpnPools', $poolId)); |
|
| 62 | } |
|
| 63 | ); |
|
| 64 | } |
|
| 65 | } |
|
| @@ 59-65 (lines=7) @@ | ||
| 56 | ||
| 57 | $service->get( |
|
| 58 | '/is_disabled_user', |
|
| 59 | function (Request $request, array $hookData) { |
|
| 60 | Utils::requireUser($hookData, ['vpn-admin-portal']); |
|
| 61 | $userId = $request->getQueryParameter('user_id'); |
|
| 62 | InputValidation::userId($userId); |
|
| 63 | ||
| 64 | return new ApiResponse('is_disabled_user', $this->users->isDisabled($userId)); |
|
| 65 | } |
|
| 66 | ); |
|
| 67 | ||
| 68 | $service->post( |
|
| @@ 95-101 (lines=7) @@ | ||
| 92 | // OTP_SECRETS |
|
| 93 | $service->get( |
|
| 94 | '/has_otp_secret', |
|
| 95 | function (Request $request, array $hookData) { |
|
| 96 | Utils::requireUser($hookData, ['vpn-admin-portal', 'vpn-user-portal']); |
|
| 97 | $userId = $request->getQueryParameter('user_id'); |
|
| 98 | InputValidation::userId($userId); |
|
| 99 | ||
| 100 | return new ApiResponse('has_otp_secret', $this->users->hasOtpSecret($userId)); |
|
| 101 | } |
|
| 102 | ); |
|
| 103 | ||
| 104 | $service->post( |
|
| @@ 131-137 (lines=7) @@ | ||
| 128 | // VOOT_TOKENS |
|
| 129 | $service->get( |
|
| 130 | '/has_voot_token', |
|
| 131 | function (Request $request, array $hookData) { |
|
| 132 | Utils::requireUser($hookData, ['vpn-user-portal']); |
|
| 133 | $userId = $request->getQueryParameter('user_id'); |
|
| 134 | InputValidation::userId($userId); |
|
| 135 | ||
| 136 | return new ApiResponse('has_voot_token', $this->users->hasVootToken($userId)); |
|
| 137 | } |
|
| 138 | ); |
|
| 139 | ||
| 140 | $service->post( |
|