MDL-17065 user: profile iamges of deleted users are not accessible anymore

This commit is contained in:
skodak
2008-11-01 19:35:46 +00:00
parent f00e699477
commit 9f29866371
+7 -4
View File
@@ -17,10 +17,13 @@
if (count($args) == 2) {
$userid = (integer)$args[0];
$image = $args[1];
$pathname = make_user_directory($userid, true) . "/$image";
if (file_exists($pathname) and !is_dir($pathname)) {
send_file($pathname, $image);
// do not serve images of deleted users
if ($user = get_record('user', 'id', $userid, 'deleted', 0, 'picture', 1)) {
$image = $args[1];
$pathname = make_user_directory($userid, true) . "/$image";
if (file_exists($pathname) and !is_dir($pathname)) {
send_file($pathname, $image);
}
}
}