File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -602,11 +602,14 @@ public static function delete_user($user_id)
602
602
$ table_work = Database :: get_course_table (TABLE_STUDENT_PUBLICATION );
603
603
604
604
// Unsubscribe the user from all groups in all his courses
605
- $ sql = "SELECT c.id FROM $ table_course c, $ table_course_user cu
605
+ $ sql = "SELECT c.id
606
+ FROM $ table_course c
607
+ INNER JOIN $ table_course_user cu
608
+ ON (c.id = cu.c_id)
606
609
WHERE
607
610
cu.user_id = ' " .$ user_id ."' AND
608
- relation_type<> " .COURSE_RELATION_TYPE_RRHH ." AND
609
- c.id = cu.c_id " ;
611
+ relation_type<> " .COURSE_RELATION_TYPE_RRHH ."
612
+ " ;
610
613
611
614
$ res = Database::query ($ sql );
612
615
while ($ course = Database::fetch_object ($ res )) {
@@ -716,6 +719,14 @@ public static function delete_user($user_id)
716
719
$ sql = "DELETE FROM $ table WHERE user_id = $ user_id " ;
717
720
Database::query ($ sql );
718
721
722
+ $ connection = Database::getManager ()->getConnection ();
723
+ $ tableExists = $ connection ->getSchemaManager ()->tablesExist (['plugin_bbb_room ' ]);
724
+ if ($ tableExists ) {
725
+ // Delete user from database
726
+ $ sql = "DELETE FROM plugin_bbb_room WHERE participant_id = $ user_id " ;
727
+ Database::query ($ sql );
728
+ }
729
+
719
730
// Delete user from database
720
731
$ sql = "DELETE FROM $ table_user WHERE id = ' " .$ user_id ."' " ;
721
732
Database::query ($ sql );
You can’t perform that action at this time.
0 commit comments