original_string: protected function get_area_user_private($itemid, $filepath, $filename) {
          global $USER, $CFG;
  
          // access control: only my files, nobody else
          if ($this->user->id != $USER->id) {
              return null;
          }
  
          if (is_null($itemid)) {
              // go to parent, we do not use itemids here in private area
              return $this;
          }
  
          $fs = get_file_storage();
  
          $filepath = is_null($filepath) ? '/' : $filepath;
          $filename = is_null($filename) ? '.' : $filename;
  
          if (!$storedfile = $fs->get_file($this->context->id, 'user', 'private', 0, $filepath, $filename)) {
              if ($filepath === '/' and $filename === '.') {
                  // root dir does not exist yet
                  $storedfile = new virtual_root_file($this->context->id, 'user', 'private', 0);
              } else {
                  // not found
                  return null;
              }
          }
          $urlbase = $CFG->wwwroot.'/pluginfile.php';
  
          //TODO: user quota from $CFG->userquota
  
          return new file_info_stored($this->browser, $this->context, $storedfile, $urlbase, get_string('areauserpersonal', 'repository'), false, true, true, false);
      }
code: protected function get_area_user_private($itemid, $filepath, $filename) {
          global $USER, $CFG;
  
          // access control: only my files, nobody else
          if ($this->user->id != $USER->id) {
              return null;
          }
  
          if (is_null($itemid)) {
              // go to parent, we do not use itemids here in private area
              return $this;
          }
  
          $fs = get_file_storage();
  
          $filepath = is_null($filepath) ? '/' : $filepath;
          $filename = is_null($filename) ? '.' : $filename;
  
          if (!$storedfile = $fs->get_file($this->context->id, 'user', 'private', 0, $filepath, $filename)) {
              if ($filepath === '/' and $filename === '.') {
                  // root dir does not exist yet
                  $storedfile = new virtual_root_file($this->context->id, 'user', 'private', 0);
              } else {
                  // not found
                  return null;
              }
          }
          $urlbase = $CFG->wwwroot.'/pluginfile.php';
  
          //TODO: user quota from $CFG->userquota
  
          return new file_info_stored($this->browser, $this->context, $storedfile, $urlbase, get_string('areauserpersonal', 'repository'), false, true, true, false);
      }
code_tokens: protected function get_area_user_private ( $ itemid , $ filepath , $ filename ) { global $ USER , $ CFG ; // access control: only my files, nobody else if ( $ this -> user -> id != $ USER -> id ) { return null ; } if ( is_null ( $ itemid ) ) { // go to parent, we do not use itemids here in private area return $ this ; } $ fs = get_file_storage ( ) ; $ filepath = is_null ( $ filepath ) ? '/' : $ filepath ; $ filename = is_null ( $ filename ) ? '.' : $ filename ; if ( ! $ storedfile = $ fs -> get_file ( $ this -> context -> id , 'user' , 'private' , 0 , $ filepath , $ filename ) ) { if ( $ filepath === '/' and $ filename === '.' ) { // root dir does not exist yet $ storedfile = new virtual_root_file ( $ this -> context -> id , 'user' , 'private' , 0 ) ; } else { // not found return null ; } } $ urlbase = $ CFG -> wwwroot . '/pluginfile.php' ; //TODO: user quota from $CFG->userquota return new file_info_stored ( $ this -> browser , $ this -> context , $ storedfile , $ urlbase , get_string ( 'areauserpersonal' , 'repository' ) , false , true , true , false ) ; }
docstring: Get a file from user private area
  
  @todo MDL-31070 this method should respect $CFG->userquota
  @param int $itemid item ID
  @param string $filepath file path
  @param string $filename file name
  @return file_info|null
docstring_tokens: Get a file from user private area