index.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. // personalize the logout button behaviour
  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 link URL
  11. $link_url = "#";
  12. if (!empty($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url'])) {
  13. $link_url = api_htmlentities($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url']);
  14. }
  15. // the infobulle
  16. $link_infobulle = "Vous devez fermer votre navigateur pour clore votre session de travail.";
  17. if (!empty($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_infobulle'])) {
  18. $link_infobulle = api_htmlentities($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_infobulle']);
  19. }
  20. // $link_image=1 if we replace the logout button by a grey one 'exit_na'
  21. $link_image = "1";
  22. if (empty($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_image'])) {
  23. $link_image = "";
  24. }
  25. // checkbox to disaply an alert box when clicnkig on the logout button
  26. $alert_onoff = "1";
  27. if (empty($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_onoff'])) {
  28. $alert_onoff = "";
  29. }
  30. // alert text to display if check is on
  31. $alert_text = "\\\\nVous êtes connectés avec votre compte universitaire.\\\\n\\\\nVous devez *** fermer votre navigateur *** pour clore votre session de travail.";
  32. if (!empty($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_text'])) {
  33. $alert_text = $plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_text'];
  34. }
  35. $_template['link_url'] = $link_url;
  36. $_template['link_infobulle'] = $link_infobulle;
  37. $_template['link_image'] = $link_image;
  38. $_template['alert_onoff'] = $alert_onoff;
  39. $_template['alert_text'] = $alert_text;
  40. }