Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/plugin/bbb/uninstall.php

36 lines
1.8 KiB

<?php
/**
* This script is included by main/admin/settings.lib.php when unselecting a plugin
* and is meant to remove things installed by the install.php script in both
* the global database and the courses tables
*/
$t_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin'";
Database::query($sql);
$sql = "DELETE FROM $t_options WHERE variable = 'bbb_plugin'";
Database::query($sql);
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin_host'";
Database::query($sql);
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin_salt'";
Database::query($sql);
$sql = "DROP TABLE plugin_bbb";
Database::query($sql);
// update existing courses to add conference settings
$t_courses = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT id, code, db_name FROM $t_courses ORDER BY id";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
$t_course = Database::get_course_table(TABLE_COURSE_SETTING,$row['db_name']);
$sql_course = "DELETE FROM $t_course WHERE variable = 'big_blue_button_meeting_name'";
$r = Database::query($sql_course);
$sql_course = "DELETE FROM $t_course WHERE variable = 'big_blue_button_attendee_password'";
$r = Database::query($sql_course);
$sql_course = "DELETE FROM $t_course WHERE variable = 'big_blue_button_moderator_password'";
$r = Database::query($sql_course);
$sql_course = "DELETE FROM $t_course WHERE variable = 'big_blue_button_welcome_message'";
$r = Database::query($sql_course);
$t_tool = Database::get_course_table(TABLE_TOOL_LIST,$row['db_name']);
$sql_course = "DELETE FROM $t_tool WHERE link = '../../plugin/bbb/start.php'";
$r = Database::query($sql_course);
}