install.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * This script is included by main/admin/settings.lib.php and generally
  4. * includes things to execute in the main database (settings_current table)
  5. */
  6. $t_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
  7. $t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
  8. $sql = "INSERT INTO $t_settings
  9. (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable)
  10. VALUES
  11. ('bbb_plugin', '', 'radio', 'Extra', 'false', 'BigBlueButtonEnableTitle','BigBlueButtonEnableComment',NULL,NULL, 1)";
  12. Database::query($sql);
  13. $sql = "INSERT INTO $t_options (variable, value, display_text) VALUES ('bbb_plugin', 'true', 'Yes')";
  14. Database::query($sql);
  15. $sql = "INSERT INTO $t_options (variable, value, display_text) VALUES ('bbb_plugin', 'false', 'No')";
  16. Database::query($sql);
  17. $sql = "INSERT INTO $t_settings
  18. (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable)
  19. VALUES
  20. ('bbb_plugin_host', '', 'textfield', 'Extra', '192.168.0.100', 'BigBlueButtonHostTitle','BigBlueButtonHostComment',NULL,NULL, 1)";
  21. Database::query($sql);
  22. $sql = "INSERT INTO $t_settings
  23. (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable)
  24. VALUES
  25. ('bbb_plugin_salt', '', 'textfield', 'Extra', '', 'BigBlueButtonSecuritySaltTitle','BigBlueButtonSecuritySaltComment',NULL,NULL, 1)";
  26. Database::query($sql);
  27. $table = Database::get_main_table('plugin_bbb');
  28. $sql = "CREATE TABLE $table ( " .
  29. "id BIGINT unsigned NOT NULL auto_increment PRIMARY KEY, " .
  30. "course_id INT unsigned NOT NULL DEFAULT 0, " .
  31. "name VARCHAR(255) NOT NULL DEFAULT '', " .
  32. "meeting_name VARCHAR(255) NOT NULL DEFAULT '', " .
  33. "meeting_id VARCHAR(255) NOT NULL DEFAULT '', " .
  34. "attendee_pw VARCHAR(255) NOT NULL DEFAULT '', " .
  35. "moderator_pw VARCHAR(255) NOT NULL DEFAULT '', " .
  36. "auto_login VARCHAR(255) NOT NULL DEFAULT '', " .
  37. "new_window VARCHAR(255) NOT NULL DEFAULT '', " .
  38. "welcome_msg VARCHAR(255) NOT NULL DEFAULT '')";
  39. Database::query($sql);
  40. // update existing courses to add conference settings
  41. $t_courses = Database::get_main_table(TABLE_MAIN_COURSE);
  42. $sql = "SELECT id, code, db_name FROM $t_courses ORDER BY id";
  43. $res = Database::query($sql);
  44. while ($row = Database::fetch_assoc($res)) {
  45. $t_course = Database::get_course_table(TABLE_COURSE_SETTING,$row['db_name']);
  46. $sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_meeting_name','','plugins')";
  47. $r = Database::query($sql_course);
  48. $sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_attendee_password','','plugins')";
  49. $r = Database::query($sql_course);
  50. $sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_moderator_password','','plugins')";
  51. $r = Database::query($sql_course);
  52. $sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_welcome_message','','plugins')";
  53. $r = Database::query($sql_course);
  54. $t_tool = Database::get_course_table(TABLE_TOOL_LIST,$row['db_name']);
  55. $sql_course = "INSERT INTO $t_tool VALUES (NULL, 'videoconference','../plugin/bbb/start.php','visio.gif','".string2binary(api_get_setting('course_create_active_tools', 'videoconference'))."','0','squaregrey.gif','NO','_blank','plugin','0')";
  56. $r = Database::query($sql_course);
  57. }