wisskiCloudAccountManagerDaemonApiActions = $wisskiCloudAccountManagerDaemonApiActions; } /** * Populate the reachable variables from services. * * @param \Symfony\Component\DependencyInjection\ContainerInterface $container * The class container. */ public static function create(ContainerInterface $container) { return new static( $container->get('wisski_cloud_account_manager.daemon_api.actions'), ); } /** * Info page for terms and conditions. * * @return array * The page build array. */ public function termsAndConditionsPage(): array { $build = [ '#theme' => 'terms_and_conditions_page', '#date' => date('Y'), ]; return $build; } /** * Page to check the validation and provision status. * * @param string $validationCode * The token to check the status for. * * @return array * The page build array. */ public function validationPage(string $validationCode): array { $validationResponse = $this->wisskiCloudAccountManagerDaemonApiActions->validateAccount($validationCode); $account = json_decode($validationResponse->getBody() ->getContents(), TRUE); return [ '#theme' => 'wisski_cloud_account_manager_validation_page', '#account' => $account, '#attached' => [ 'library' => [ 'wisski_cloud_account_manager/wisski_cloud_account_manager', ], ], '#cache' => [ 'max-age' => 0, ], ]; } /** * Page list the account statuses. * * @return array * The page build array. */ public function accountManagingPage(): array { $accounts = $this->wisskiCloudAccountManagerDaemonApiActions->getAccounts(); return [ '#theme' => 'wisski_cloud_account_manager_account_managing_page', '#accounts' => $accounts, '#attached' => [ 'library' => [ 'wisski_cloud_account_manager/wisski_cloud_account_manager', ], ], '#cache' => [ 'max-age' => 0, ], ]; } }