ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç db/access.php000064400000002417152266404200007110 0ustar00. /** * Plugin capabilities. * * @package repository_webdav * @copyright 2009 Dongsheng Cai * @author Dongsheng Cai * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $capabilities = array( 'repository/webdav:view' => array( 'captype' => 'read', 'contextlevel' => CONTEXT_MODULE, 'archetypes' => array( 'coursecreator' => CAP_ALLOW, 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, 'manager' => CAP_ALLOW ) ) ); lang/en/repository_webdav.php000064400000003315152266404200012352 0ustar00. /** * Strings for component 'repository_webdav', language 'en', branch 'MOODLE_20_STABLE' * * @package repository_webdav * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ $string['configplugin'] = 'WebDAV configuration'; $string['http'] = 'HTTP'; $string['https'] = 'HTTPS'; $string['pluginname'] = 'WebDAV repository'; $string['webdav_password'] = 'WebDAV server password'; $string['webdav_port'] = 'WebDAV server port'; $string['webdav_server'] = 'WebDAV server'; $string['webdav_path'] = 'WebDAV path'; $string['webdav_type'] = 'WebDAV type'; $string['webdav_user'] = 'WebDAV server user'; $string['webdavbasicauth'] = 'WebDAV basic authentication'; $string['webdavdigestauth'] = 'WebDAV digest authentication'; $string['webdav'] = 'WebDAV'; $string['webdav:view'] = 'View WebDav repository'; $string['privacy:metadata'] = 'The WebDAV repository plugin does not store any personal data, but it is transmitted from Moodle to the remote system.'; pix/icon.png000064400000002476152266404200007014 0ustar00PNG  IHDR IDATxV$W4=۶YUbI9f!mmLf1l|rQ?_0 eia}eOӪv޽%x<^SS{Nl_W ŗ뺂MsεLEe=s NQUE rP/d8ֲI UЋ鬑hh> `"5TC\vMZc;/1SW?l$D(ŵ"56M)!\4` 9 [6mq#5;XAڪ 'lUYi%Pdc.@ekql5 9Ð0f `U7Ӊt9]Ei]m0Ma4xviQ/ n3(-ҧyd 0 &dc< [~gU(*h+q$ H'aڐ!CZ`paݰaC= ;i$80ZQpaGۏh4`=}tC&Ϝ9VS`.j٥KC I0d!I$mcذa@رc޽UӴBV?cƌP(v:LΛ70 nВ f.p>| A"ŏX4< +{M8(sQ  ˌ[DJ+GƅWGOX==ݐNd:WwNRo6y^6>y$…nݺz!n+3%M~-Ww:_Bn̅.*i}^~],e6a9!n.6I$=.A8Vceb qŭ+#^sUjUБhˍ`/F;IENDB`lib.php000064400000021317152266404200006030 0ustar00. /** * This plugin is used to access webdav files * * @since Moodle 2.0 * @package repository_webdav * @copyright 2010 Dongsheng Cai {@link http://dongsheng.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once($CFG->dirroot . '/repository/lib.php'); require_once($CFG->libdir.'/webdavlib.php'); /** * repository_webdav class * * @since Moodle 2.0 * @package repository_webdav * @copyright 2009 Dongsheng Cai {@link http://dongsheng.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class repository_webdav extends repository { /** @var string webdav type. */ protected $webdav_type; /** @var mixed webdav port. */ protected $webdav_port; /** @var string webdav host. */ protected $webdav_host; /** @var webdav_client webdav client. */ protected $dav; public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array()) { parent::__construct($repositoryid, $context, $options); // set up webdav client if (empty($this->options['webdav_server'])) { return; } if ($this->options['webdav_auth'] == 'none') { $this->options['webdav_auth'] = false; } if (empty($this->options['webdav_type'])) { $this->webdav_type = ''; } else { $this->webdav_type = 'ssl://'; } if (empty($this->options['webdav_port'])) { $port = ''; if (empty($this->webdav_type)) { $this->webdav_port = 80; } else { $this->webdav_port = 443; $port = ':443'; } } else { $this->webdav_port = $this->options['webdav_port']; $port = ':' . $this->webdav_port; } $this->webdav_host = $this->webdav_type.$this->options['webdav_server'].$port; $this->dav = new webdav_client($this->options['webdav_server'], $this->options['webdav_user'], $this->options['webdav_password'], $this->options['webdav_auth'], $this->webdav_type); $this->dav->port = $this->webdav_port; $this->dav->debug = false; } public function check_login() { return true; } public function get_file($url, $title = '') { $url = urldecode($url); // Prepare a file with an arbitrary name - cannot be $title because of special chars (cf. MDL-57002). $path = $this->prepare_file(uniqid()); if (!$this->dav->open()) { return false; } $webdavpath = rtrim('/'.ltrim($this->options['webdav_path'], '/ '), '/ '); // without slash in the end $this->dav->get_file($webdavpath. $url, $path); return array('path'=>$path); } public function global_search() { return false; } public function get_listing($path='', $page = '') { global $CFG, $OUTPUT; $list = array(); $ret = array(); $ret['dynload'] = true; $ret['nosearch'] = true; $ret['nologin'] = true; $ret['path'] = array(array('name'=>get_string('webdav', 'repository_webdav'), 'path'=>'')); $ret['list'] = array(); if (!$this->dav->open()) { return $ret; } $webdavpath = rtrim('/'.ltrim($this->options['webdav_path'], '/ '), '/ '); // without slash in the end if (empty($path) || $path =='/') { $path = '/'; } else { $chunks = preg_split('|/|', trim($path, '/')); for ($i = 0; $i < count($chunks); $i++) { $ret['path'][] = array( 'name' => urldecode($chunks[$i]), 'path' => '/'. join('/', array_slice($chunks, 0, $i+1)). '/' ); } } $dir = $this->dav->ls($webdavpath. urldecode($path)); if (!is_array($dir)) { return $ret; } $folders = array(); $files = array(); foreach ($dir as $v) { if (!empty($v['lastmodified'])) { $v['lastmodified'] = strtotime($v['lastmodified']); } else { $v['lastmodified'] = null; } // Remove the server URL from the path (if present), otherwise links will not work - MDL-37014 $server = preg_quote($this->options['webdav_server']); $v['href'] = preg_replace("#https?://{$server}#", '', $v['href']); // Extracting object title from absolute path $v['href'] = substr(urldecode($v['href']), strlen($webdavpath)); $title = substr($v['href'], strlen($path)); if (!empty($v['resourcetype']) && $v['resourcetype'] == 'collection') { // A folder. if ($path != $v['href']) { $folders[strtoupper($title)] = array( 'title' => rtrim($title, '/'), 'thumbnail' => $OUTPUT->image_url(file_folder_icon())->out(false), 'children' => array(), 'datemodified' => $v['lastmodified'], 'path' => $v['href'], ); } }else{ // A file. $size = !empty($v['getcontentlength'])? $v['getcontentlength']:''; $files[strtoupper($title)] = array( 'title' => $title, 'thumbnail' => $OUTPUT->image_url(file_extension_icon($title))->out(false), 'size' => $size, 'datemodified' => $v['lastmodified'], 'source' => $v['href'], ); } } ksort($files); ksort($folders); $ret['list'] = array_merge($folders, $files); return $ret; } public static function get_instance_option_names() { return array('webdav_type', 'webdav_server', 'webdav_port', 'webdav_path', 'webdav_user', 'webdav_password', 'webdav_auth'); } public static function instance_config_form($mform) { $choices = array(0 => get_string('http', 'repository_webdav'), 1 => get_string('https', 'repository_webdav')); $mform->addElement('select', 'webdav_type', get_string('webdav_type', 'repository_webdav'), $choices); $mform->addRule('webdav_type', get_string('required'), 'required', null, 'client'); $mform->addElement('text', 'webdav_server', get_string('webdav_server', 'repository_webdav'), array('size' => '40')); $mform->addRule('webdav_server', get_string('required'), 'required', null, 'client'); $mform->setType('webdav_server', PARAM_HOST); $mform->addElement('text', 'webdav_path', get_string('webdav_path', 'repository_webdav'), array('size' => '40')); $mform->addRule('webdav_path', get_string('required'), 'required', null, 'client'); $mform->setType('webdav_path', PARAM_PATH); $choices = array(); $choices['none'] = get_string('none'); $choices['basic'] = get_string('webdavbasicauth', 'repository_webdav'); $choices['digest'] = get_string('webdavdigestauth', 'repository_webdav'); $mform->addElement('select', 'webdav_auth', get_string('authentication', 'admin'), $choices); $mform->addRule('webdav_auth', get_string('required'), 'required', null, 'client'); $mform->addElement('text', 'webdav_port', get_string('webdav_port', 'repository_webdav'), array('size' => '40')); $mform->setType('webdav_port', PARAM_INT); $mform->addElement('text', 'webdav_user', get_string('webdav_user', 'repository_webdav'), array('size' => '40')); $mform->setType('webdav_user', PARAM_RAW_TRIMMED); // Not for us to clean. $mform->addElement('passwordunmask', 'webdav_password', get_string('webdav_password', 'repository_webdav'), array('size' => '40')); } public function supported_returntypes() { return (FILE_INTERNAL | FILE_EXTERNAL); } /** * Is this repository accessing private data? * * @return bool */ public function contains_private_data() { return false; } } version.php000064400000002304152266404200006742 0ustar00. /** * Version details * * @package repository * @subpackage webdav * @copyright 2009 Dongsheng Cai * @author Dongsheng Cai * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $plugin->version = 2025041400; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2025040800; // Requires this Moodle version. $plugin->component = 'repository_webdav'; // Full name of the plugin (used for diagnostics) classes/privacy/provider.php000064400000002764152266404200012233 0ustar00. /** * Privacy Subsystem implementation for repository_webdav. * * @package repository_webdav * @copyright 2018 Zig Tan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace repository_webdav\privacy; defined('MOODLE_INTERNAL') || die(); /** * Privacy Subsystem for repository_webdav implementing null_provider. * * @copyright 2018 Zig Tan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class provider implements \core_privacy\local\metadata\null_provider { /** * Get the language string identifier with the component's language * file to explain why this plugin stores no data. * * @return string */ public static function get_reason(): string { return 'privacy:metadata'; } } tests/generator/lib.php000064400000004147152266404200011162 0ustar00. /** * WebDAV repository data generator * * @package repository_webdav * @category test * @copyright 2013 Frédéric Massart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** * WebDAV repository data generator class * * @package repository_webdav * @category test * @copyright 2013 Frédéric Massart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class repository_webdav_generator extends testing_repository_generator { /** * Fill in record defaults. * * @param array $record * @return array */ protected function prepare_record(array $record) { $record = parent::prepare_record($record); if (!isset($record['webdav_type'])) { $record['webdav_type'] = 0; } if (!isset($record['webdav_server'])) { $record['webdav_server'] = 'webdav.server.local'; } if (!isset($record['webdav_port'])) { $record['webdav_port'] = ''; } if (!isset($record['webdav_path'])) { $record['webdav_path'] = '/'; } if (!isset($record['webdav_user'])) { $record['webdav_user'] = ''; } if (!isset($record['webdav_password'])) { $record['webdav_password'] = ''; } if (!isset($record['webdav_auth'])) { $record['webdav_auth'] = 'none'; } return $record; } }