libdir.'/filelib.php'); // disable moodle specific debug messages disable_debugging(); $relativepath = get_file_argument('pix.php'); $args = explode('/', trim($relativepath, '/')); 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); } } // picture was deleted - use default instead redirect($CFG->pixpath.'/u/f1.png'); ?>