start.php 982 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * This script initiates a notebookteacher plugin.
  4. *
  5. * @package chamilo.plugin.notebookteacher
  6. */
  7. $course_plugin = 'notebookteacher';
  8. require_once __DIR__.'/config.php';
  9. $plugin = NotebookTeacherPlugin::create();
  10. $enable = $plugin->get('enable_plugin_notebookteacher') == 'true';
  11. if ($enable) {
  12. if (api_is_teacher() || api_is_drh()) {
  13. $url = 'src/index.php?'.api_get_cidreq();
  14. header('Location: '.$url);
  15. exit;
  16. } else {
  17. $session = api_get_session_entity(api_get_session_id());
  18. $_course = api_get_course_info();
  19. $webCoursePath = api_get_path(WEB_COURSE_PATH);
  20. $url = $webCoursePath.$_course['path'].'/index.php'.($session ? '?id_session='.$session->getId() : '');
  21. Display::addFlash(
  22. Display::return_message($plugin->get_lang('ToolForTeacher'))
  23. );
  24. header('Location: '.$url);
  25. exit;
  26. }
  27. } else {
  28. api_not_allowed(true, $plugin->get_lang('ToolDisabled'));
  29. }