コード例 #1
0
ファイル: proxy.class.php プロジェクト: Burick/modx-WebDAV
 public function process()
 {
     @session_write_close();
     $src = $this->getProperty('src');
     if (empty($src)) {
         return $this->failure();
     }
     $this->getSource($this->getProperty('source'));
     if (empty($this->source)) {
         $this->failure($this->modx->lexicon('source_err_nf'));
     }
     // Prevent another media sources requests for security reasons
     if ($this->source->getTypeName() != 'WebDAV') {
         $this->failure($this->modx->lexicon('source_err_nfs'));
     }
     $body = $this->source->getObjectContents($src);
     if (empty($body)) {
         $this->failure($this->modx->lexicon('file_err_nf'));
     }
     header('Content-Type: ' . $body['mime']);
     echo $body['content'];
 }