index.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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. $_template['block_title'] = $activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_BLOCK_NAME);
  12. $_template['signin_url'] = $activeDirectoryPlugin->getUrl(AzureActiveDirectory::URL_TYPE_AUTHORIZE);
  13. if ('true' === $activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_FORCE_LOGOUT_BUTTON)) {
  14. $_template['signout_url'] = $activeDirectoryPlugin->getUrl(AzureActiveDirectory::URL_TYPE_LOGOUT);
  15. }
  16. $managementLoginEnabled = 'true' === $activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_MANAGEMENT_LOGIN_ENABLE);
  17. $_template['management_login_enabled'] = $managementLoginEnabled;
  18. if ($managementLoginEnabled) {
  19. $managementLoginName = $activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_MANAGEMENT_LOGIN_NAME);
  20. if (empty($managementLoginName)) {
  21. $managementLoginName = $activeDirectoryPlugin->get_lang('ManagementLogin');
  22. }
  23. $_template['management_login_name'] = $managementLoginName;
  24. }
  25. }