Permalink
Browse files

MDL-46811 update download.moodle.org url to https

https is now the prefferd protocol for this site
  • Loading branch information...
danpoltawski committed Sep 9, 2014
1 parent 31059fd commit 5101f9b1318adaed4c9baea98d23210c46167812
View
@@ -45,15 +45,15 @@
// Handle the 'updatecomponent' action
if ($action == 'updatecomponent' && confirm_sesskey()) {
// Create component installer and execute it
if ($cd = new component_installer('http://download.moodle.org',
if ($cd = new component_installer('https://download.moodle.org',
'environment',
'environment.zip')) {
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
switch ($status) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/environment/environment.zip';
$a->url = 'https://download.moodle.org/environment/environment.zip';
$a->dest = $CFG->dataroot . '/';
print_error($cd->get_error(), 'error', $PAGE->url, $a);
die();
@@ -17,7 +17,7 @@
/**
* Fetches language packages from download.moodle.org server
*
* Language packages are available at http://download.moodle.org/langpack/
* Language packages are available at https://download.moodle.org/langpack/
* in ZIP format together with a file languages.md5 containing their hashes
* and meta info.
* Locally, language packs are saved into $CFG->dataroot/lang/
@@ -37,7 +37,7 @@
$string['nolangupdateneeded'] = 'All your language packs are up to date, no update is needed';
$string['pluginname'] = 'Language packs';
$string['purgestringcaches'] = 'Purge string caches';
$string['remotelangnotavailable'] = 'Because Moodle cannot connect to download.moodle.org, it is not possible for language packs to be installed automatically. Please download the appropriate ZIP file(s) from <a href="http://download.moodle.org/langpack/">download.moodle.org/langpack</a>, copy them to your {$a} directory and unzip them manually.';
$string['remotelangnotavailable'] = 'Because Moodle cannot connect to download.moodle.org, it is not possible for language packs to be installed automatically. Please download the appropriate ZIP file(s) from <a href="https://download.moodle.org/langpack/">download.moodle.org/langpack</a>, copy them to your {$a} directory and unzip them manually.';
$string['uninstall'] = 'Uninstall selected language pack';
$string['uninstallconfirm'] = 'You are about to completely uninstall language pack {$a}, are you sure?';
$string['updatelangs'] = 'Update all installed language packs';
@@ -45,7 +45,7 @@
$message = '<br /><br />';
$message .= $CFG->tempdir.'/olson.txt<br />';
$message .= $CFG->tempdir.'/timezone.txt<br />';
$message .= '<a href="http://download.moodle.org/timezone/">http://download.moodle.org/timezone/</a><br />';
$message .= '<a href="https://download.moodle.org/timezone/">https://download.moodle.org/timezone/</a><br />';
$message .= '<a href="'.$CFG->wwwroot.'/lib/timezone.txt">'.$CFG->dirroot.'/lib/timezone.txt</a><br />';
$message .= '<br />';
@@ -83,7 +83,7 @@
}
/// Otherwise, let's try moodle.org's copy
$source = 'http://download.moodle.org/timezone/';
$source = 'https://download.moodle.org/timezone/';
if (!$importdone && ($content=download_file_content($source))) {
if ($file = fopen($CFG->tempdir.'/timezone.txt', 'w')) { // Make local copy
fwrite($file, $content);
View
@@ -67,14 +67,14 @@
* To install one component:
* <code>
* require_once($CFG->libdir.'/componentlib.class.php');
* if ($cd = new component_installer('http://download.moodle.org', 'langpack/2.0',
* if ($cd = new component_installer('https://download.moodle.org', 'langpack/2.0',
* 'es.zip', 'languages.md5', 'lang')) {
* $status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
* switch ($status) {
* case COMPONENT_ERROR:
* if ($cd->get_error() == 'remotedownloaderror') {
* $a = new stdClass();
* $a->url = 'http://download.moodle.org/langpack/2.0/es.zip';
* $a->url = 'https://download.moodle.org/langpack/2.0/es.zip';
* $a->dest= $CFG->dataroot.'/lang';
* print_error($cd->get_error(), 'error', '', $a);
* } else {
@@ -225,7 +225,7 @@ function check_requisites() {
return false;
}
/// Check for correct sourcebase (this will be out in the future)
if (!PHPUNIT_TEST and $this->sourcebase != 'http://download.moodle.org') {
if (!PHPUNIT_TEST and $this->sourcebase != 'https://download.moodle.org') {
$this->errorstring='wrongsourcebase';
return false;
}
@@ -674,9 +674,9 @@ public function run() {
public function lang_pack_url($langcode = '') {
if (empty($langcode)) {
return 'http://download.moodle.org/langpack/'.$this->version.'/';
return 'https://download.moodle.org/langpack/'.$this->version.'/';
} else {
return 'http://download.moodle.org/download.php/langpack/'.$this->version.'/'.$langcode.'.zip';
return 'https://download.moodle.org/download.php/langpack/'.$this->version.'/'.$langcode.'.zip';
}
}
@@ -686,7 +686,7 @@ public function lang_pack_url($langcode = '') {
* @return array|bool false if can not download
*/
public function get_remote_list_of_languages() {
$source = 'http://download.moodle.org/langpack/' . $this->version . '/languages.md5';
$source = 'https://download.moodle.org/langpack/' . $this->version . '/languages.md5';
$availablelangs = array();
if ($content = download_file_content($source)) {
@@ -778,7 +778,7 @@ protected function get_parent_language($langcode) {
protected function install_language_pack($langcode) {
// initialise new component installer to process this language
$installer = new component_installer('http://download.moodle.org', 'download.php/direct/langpack/' . $this->version,
$installer = new component_installer('https://download.moodle.org', 'download.php/direct/langpack/' . $this->version,
$langcode . '.zip', 'languages.md5', 'lang');
if (!$installer->requisitesok) {
@@ -121,7 +121,7 @@ public function get_last_timefetched() {
private function get_fake_response() {
$fakeresponse = array(
'status' => 'OK',
'provider' => 'http://download.moodle.org/api/1.0/updates.php',
'provider' => 'https://download.moodle.org/api/1.0/updates.php',
'apiver' => '1.0',
'timegenerated' => time(),
'forversion' => '2012010100.00',
@@ -133,15 +133,15 @@ private function get_fake_response() {
'version' => 2012060103.00,
'release' => '2.3.3 (Build: 20121201)',
'maturity' => 200,
'url' => 'http://download.moodle.org/',
'download' => 'http://download.moodle.org/download.php/MOODLE_23_STABLE/moodle-2.3.3-latest.zip',
'url' => 'https://download.moodle.org/',
'download' => 'https://download.moodle.org/download.php/MOODLE_23_STABLE/moodle-2.3.3-latest.zip',
),
array(
'version' => 2012120100.00,
'release' => '2.4dev (Build: 20121201)',
'maturity' => 50,
'url' => 'http://download.moodle.org/',
'download' => 'http://download.moodle.org/download.php/MOODLE_24_STABLE/moodle-2.4.0-latest.zip',
'url' => 'https://download.moodle.org/',
'download' => 'https://download.moodle.org/download.php/MOODLE_24_STABLE/moodle-2.4.0-latest.zip',
),
),
'mod_foo' => array(
View
@@ -16,13 +16,3 @@ BSD ctags (Default on Mac OS X):
-------------------------------
(TODO)
Downloading the tags file
=========================
If for some reason you can't generate one, you can download a recent one from here:
http://download.moodle.org/tags (for head)
http://download.moodle.org/stable19/tags (Moodle 1.9.x)
http://download.moodle.org/stable18/tags (Moodle 1.8.x)

0 comments on commit 5101f9b

Please sign in to comment.