index.php 954 B

123456789101112131415161718192021222324
  1. <?php
  2. // Show the CAS button to logout to your CAS session
  3. global $_user;
  4. $_template['show_message'] = false;
  5. if (!api_is_anonymous() &&
  6. api_get_setting('cas_activate') == 'true' &&
  7. $_user['auth_source'] == CAS_AUTH_SOURCE
  8. ) {
  9. $_template['show_message'] = true;
  10. // the default title
  11. $logout_label = "Deconnexion de CAS";
  12. if (!empty($plugin_info['settings']['add_cas_logout_button_cas_logout_label'])) {
  13. $logout_label = api_htmlentities($plugin_info['settings']['add_cas_logout_button_cas_logout_label']);
  14. }
  15. // the comm
  16. $logout_comment = api_htmlentities($plugin_info['settings']['add_cas_logout_button_cas_logout_comment']);;
  17. // URL of the image
  18. $logout_image_url = $plugin_info['settings']['add_cas_logout_button_cas_logout_image_url'];
  19. $_template['logout_label'] = $logout_label;
  20. $_template['logout_comment'] = $logout_comment;
  21. $_template['logout_image_url'] = $logout_image_url;
  22. }