From: dongsheng Date: Thu, 25 Jun 2009 04:58:58 +0000 (+0000) Subject: "MDL-16908, fixed webdav plugin hostname" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ecf4785cc4af568e5184e3edce9e8a705845c876;p=moodle.git "MDL-16908, fixed webdav plugin hostname" --- diff --git a/repository/webdav/repository.class.php b/repository/webdav/repository.class.php index 3c7448c7e4..7c39f58c25 100644 --- a/repository/webdav/repository.class.php +++ b/repository/webdav/repository.class.php @@ -14,32 +14,32 @@ class repository_webdav extends repository { parent::__construct($repositoryid, $context, $options); // set up webdav client $this->wd = new webdav_client(); - if (empty($this->webdav_server)) { + if (empty($this->options['webdav_server'])) { return; } - if (empty($this->webdav_type)) { - $this->webdav_type = ''; + if (empty($this->options['webdav_type'])) { + $this->options['webdav_type'] = ''; } else { - $this->webdav_type = 'ssl://'; + $this->options['webdav_type'] = 'ssl://'; } - $this->wd->set_server($this->webdav_server); - if (empty($this->webdav_port)) { - if (empty($this->webdav_type)) { + $this->wd->set_server($this->options['webdav_server']); + if (empty($this->options['webdav_port'])) { + if (empty($this->options['webdav_type'])) { $this->wd->set_port(80); } else { $this->wd->set_port(443); } $port = ''; } else { - $this->wd->set_port($this->webdav_port); - $port = ':'.$this->webdav_port; + $this->wd->set_port($this->options['webdav_port']); + $port = ':'.$this->options['webdav_port']; } - $this->webdav_host = $this->webdav_type.$this->webdav_server.$port; - if(!empty($this->webdav_user)){ - $this->wd->set_user($this->webdav_user); + $this->webdav_host = $this->options['webdav_type'].$this->options['webdav_server'].$port; + if(!empty($this->options['webdav_user'])){ + $this->wd->set_user($this->options['webdav_user']); } - if(!empty($this->webdav_password)) { - $this->wd->set_pass($this->webdav_password); + if(!empty($this->options['webdav_password'])) { + $this->wd->set_pass($this->options['webdav_password']); } $this->wd->set_protocol(1); $this->wd->set_debug(false); @@ -78,7 +78,7 @@ class repository_webdav extends repository { $path = '/'; $dir = $this->wd->ls($path); } else { - if (empty($this->webdav_type)) { + if (empty($this->options['webdav_type'])) { $partern = '#http://'.$this->webdav_host.'/#'; } else { $partern = '#http://'.$this->webdav_type.$this->webdav_host.'/#';