From 73c79d2d52a319ec7f944bbbe4999455fa952aaa Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Thu, 2 Feb 2017 09:46:50 +0100 Subject: [PATCH] Delete user from meeting see BT#12225 --- main/inc/lib/usermanager.lib.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/main/inc/lib/usermanager.lib.php b/main/inc/lib/usermanager.lib.php index 53ef069b65..ee700cd745 100755 --- a/main/inc/lib/usermanager.lib.php +++ b/main/inc/lib/usermanager.lib.php @@ -602,11 +602,14 @@ class UserManager $table_work = Database :: get_course_table(TABLE_STUDENT_PUBLICATION); // Unsubscribe the user from all groups in all his courses - $sql = "SELECT c.id FROM $table_course c, $table_course_user cu + $sql = "SELECT c.id + FROM $table_course c + INNER JOIN $table_course_user cu + ON (c.id = cu.c_id) WHERE cu.user_id = '".$user_id."' AND - relation_type<>".COURSE_RELATION_TYPE_RRHH." AND - c.id = cu.c_id"; + relation_type<>".COURSE_RELATION_TYPE_RRHH." + "; $res = Database::query($sql); while ($course = Database::fetch_object($res)) { @@ -716,6 +719,14 @@ class UserManager $sql = "DELETE FROM $table WHERE user_id = $user_id"; Database::query($sql); + $connection = Database::getManager()->getConnection(); + $tableExists = $connection->getSchemaManager()->tablesExist(['plugin_bbb_room']); + if ($tableExists) { + // Delete user from database + $sql = "DELETE FROM plugin_bbb_room WHERE participant_id = $user_id"; + Database::query($sql); + } + // Delete user from database $sql = "DELETE FROM $table_user WHERE id = '".$user_id."'"; Database::query($sql);