| @@ 69-76 (lines=8) @@ | ||
| 66 | } |
|
| 67 | ||
| 68 | $cnConfigArray = []; |
|
| 69 | foreach ($this->io->readFolder($this->configDir, $fileFilter) as $configFile) { |
|
| 70 | $cnConfig = new CnConfig( |
|
| 71 | Json::decode( |
|
| 72 | $this->io->readFile($configFile) |
|
| 73 | ) |
|
| 74 | ); |
|
| 75 | $cnConfigArray[basename($configFile)] = $cnConfig->toArray(); |
|
| 76 | } |
|
| 77 | ||
| 78 | $response = new JsonResponse(); |
|
| 79 | $response->setBody($cnConfigArray); |
|
| @@ 58-67 (lines=10) @@ | ||
| 55 | Utils::requireScope($tokenInfo, ['admin']); |
|
| 56 | ||
| 57 | $userConfigArray = []; |
|
| 58 | foreach ($this->io->readFolder($this->configDir) as $configFile) { |
|
| 59 | $userConfig = new UserConfig( |
|
| 60 | Json::decode( |
|
| 61 | $this->io->readFile($configFile) |
|
| 62 | ) |
|
| 63 | ); |
|
| 64 | // never expose the OTP secret |
|
| 65 | $userConfig->hideOtpSecret(); |
|
| 66 | $userConfigArray[basename($configFile)] = $userConfig->toArray(); |
|
| 67 | } |
|
| 68 | ||
| 69 | $response = new JsonResponse(); |
|
| 70 | $response->setBody($userConfigArray); |
|