private function get_file_info_context_user($context, $component, $filearea, $itemid, $filepath, $filename) {
        global $DB, $USER;
        if ($context->instanceid == $USER->id) {
            $user = $USER;
        } else {
            $user = $DB->get_record('user', array('id'=>$context->instanceid));
        }

        if (isguestuser($user)) {
            // guests do not have any files
            return null;
        }

        if ($user->deleted) {
            return null;
        }

        $level = new file_info_context_user($this, $context, $user);
        return $level->get_file_info($component, $filearea, $itemid, $filepath, $filename);
    }
private function get_file_info_context_user($context, $component, $filearea, $itemid, $filepath, $filename) {
        global $DB, $USER;
        if ($context->instanceid == $USER->id) {
            $user = $USER;
        } else {
            $user = $DB->get_record('user', array('id'=>$context->instanceid));
        }

        if (isguestuser($user)) {
            // guests do not have any files
            return null;
        }

        if ($user->deleted) {
            return null;
        }

        $level = new file_info_context_user($this, $context, $user);
        return $level->get_file_info($component, $filearea, $itemid, $filepath, $filename);
    }
private function get_file_info_context_user ( $ context , $ component , $ filearea , $ itemid , $ filepath , $ filename ) { global $ DB , $ USER ; if ( $ context -> instanceid == $ USER -> id ) { $ user = $ USER ; } else { $ user = $ DB -> get_record ( 'user' , array ( 'id' => $ context -> instanceid ) ) ; } if ( isguestuser ( $ user ) ) { // guests do not have any files return null ; } if ( $ user -> deleted ) { return null ; } $ level = new file_info_context_user ( $ this , $ context , $ user ) ; return $ level -> get_file_info ( $ component , $ filearea , $ itemid , $ filepath , $ filename ) ; }
Returns info about the files at User context

@param stdClass $context context object
@param string $component component
@param string $filearea file area
@param int $itemid item ID
@param string $filepath file path
@param string $filename file name
@return file_info|null file_info instance or null if not found or access not allowed
Returns info about the files at User context