Skip to content

Commit 5c22eb3

Browse files
committed
Fix issue deleting users - refs #8140
1 parent ffa1de8 commit 5c22eb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main/inc/lib/usermanager.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ public static function can_delete_user($user_id)
489489
return false;
490490
}
491491
$sql = "SELECT * FROM $table_course_user
492-
WHERE status = '1' AND id = '".$user_id."'";
492+
WHERE status = 1 AND user_id = ".$user_id;
493493
$res = Database::query($sql);
494494
while ($course = Database::fetch_object($res)) {
495495
$sql = "SELECT id FROM $table_course_user
496-
WHERE status='1' AND c_id ='".Database::escape_string($course->c_id)."'";
496+
WHERE status=1 AND c_id = " . Database::escape_string($course->c_id);
497497
$res2 = Database::query($sql);
498498
if (Database::num_rows($res2) == 1) {
499499
return false;

0 commit comments

Comments
 (0)