ticket.class.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This class defines the basis of the ticket management system plugin
  5. * @package chamilo.plugin.ticket
  6. */
  7. /**
  8. * Ticket class
  9. */
  10. class Ticket {
  11. var $url;
  12. var $salt;
  13. var $api;
  14. var $user_complete_name = null;
  15. var $protocol = 'http://';
  16. var $debug = false;
  17. var $logout_url = null;
  18. var $plugin_enabled = false;
  19. /**
  20. * Constructor (generates a connection to the API and the Chamilo settings
  21. * required for the connection to the videoconference server)
  22. */
  23. function __construct() {
  24. // initialize video server settings from global settings
  25. $plugin = TicketPlugin::create();
  26. /*
  27. $bbb_plugin = $plugin->get('tool_enable');
  28. $bbb_host = $plugin->get('host');
  29. $bbb_salt = $plugin->get('salt');
  30. //$course_code = api_get_course_id();
  31. $this->logout_url = api_get_path(WEB_PLUGIN_PATH).'bbb/listing.php';
  32. $this->table = Database::get_main_table('plugin_bbb_meeting');
  33. if ($bbb_plugin == true) {
  34. $user_info = api_get_user_info();
  35. $this->user_complete_name = $user_info['complete_name'];
  36. $this->salt = $bbb_salt;
  37. $info = parse_url($bbb_host);
  38. $this->url = $bbb_host.'/bigbluebutton/';
  39. if (isset($info['scheme'])) {
  40. $this->protocol = $info['scheme'].'://';
  41. $this->url = str_replace($this->protocol, '', $this->url);
  42. }
  43. // Setting BBB api
  44. define('CONFIG_SECURITY_SALT', $this->salt);
  45. define('CONFIG_SERVER_BASE_URL', $this->url);
  46. $this->api = new TckBlueButtonBN();
  47. $this->plugin_enabled = true;
  48. }*/
  49. }
  50. /**
  51. * Checks whether a user is teacher in the current course
  52. * @return bool True if the user can be considered a teacher in this course, false otherwise
  53. */
  54. function is_teacher() {
  55. return api_is_course_admin() || api_is_coach() || api_is_platform_admin();
  56. }
  57. }