index.php 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
  5. *
  6. * @package chamilo.plugin.azure_active_directory
  7. */
  8. /** @var AzureActiveDirectory $activeDirectoryPlugin */
  9. $activeDirectoryPlugin = AzureActiveDirectory::create();
  10. if ($activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_ENABLE) === 'true') {
  11. $signUp = $activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_SIGNIN_POLICY);
  12. $signIn = $activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_SIGNUP_POLICY);
  13. $signUnified = $activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_SIGNUNIFIED_POLICY);
  14. $_template['block_title'] = $activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_BLOCK_NAME);
  15. if ($signUp) {
  16. $_template['signup_url'] = $activeDirectoryPlugin->getUrl(AzureActiveDirectory::URL_TYPE_SIGNUP);
  17. }
  18. if ($signIn) {
  19. $_template['signin_url'] = $activeDirectoryPlugin->getUrl(AzureActiveDirectory::URL_TYPE_SIGNIN);
  20. }
  21. if ($signUnified) {
  22. $_template['signunified_url'] = $activeDirectoryPlugin->getUrl(AzureActiveDirectory::URL_TYPE_SIGNUNIFIED);
  23. }
  24. $_template['signout_url'] = $activeDirectoryPlugin->getUrl(AzureActiveDirectory::URL_TYPE_SIGNOUT);
  25. }