Fix issue deleting users - refs #8140

1.10.x
Yannick Warnier 9 years ago
parent ffa1de82f1
commit 5c22eb31da
  1. 4
      main/inc/lib/usermanager.lib.php

@ -489,11 +489,11 @@ class UserManager
return false; return false;
} }
$sql = "SELECT * FROM $table_course_user $sql = "SELECT * FROM $table_course_user
WHERE status = '1' AND id = '".$user_id."'"; WHERE status = 1 AND user_id = ".$user_id;
$res = Database::query($sql); $res = Database::query($sql);
while ($course = Database::fetch_object($res)) { while ($course = Database::fetch_object($res)) {
$sql = "SELECT id FROM $table_course_user $sql = "SELECT id FROM $table_course_user
WHERE status='1' AND c_id ='".Database::escape_string($course->c_id)."'"; WHERE status=1 AND c_id = " . Database::escape_string($course->c_id);
$res2 = Database::query($sql); $res2 = Database::query($sql);
if (Database::num_rows($res2) == 1) { if (Database::num_rows($res2) == 1) {
return false; return false;

Loading…
Cancel
Save