diff --git a/admin/langimport.php b/admin/langimport.php index c098ec12ec33b..0a45eb0bb58da 100755 --- a/admin/langimport.php +++ b/admin/langimport.php @@ -173,19 +173,16 @@ $lang16 = array(); //all the Moodle 1.6 unicode lang packs (updated and not updated) $packs = array(); //all the packs that needs updating - if ($fp = fopen($source, 'r')) { /// attempt to get the list from Moodle.org. - while(!feof ($fp)) { - $availablelangs[] = split(',', fgets($fp,1024)); - } - } else { - error('can not fopen!'); + + if (!$availablelangs = proxy_url($source)) { + error ('can not read from course'); } + //and build an associative array foreach ($availablelangs as $alang) { $md5array[$alang[0]] = $alang[1]; } - //filtering out non-16 packs foreach ($alllangs as $clang) { $dest1 = $CFG->dataroot.'/lang/'.$clang; @@ -275,6 +272,12 @@ $source = 'http://download.moodle.org/lang16/languages.md5'; $remote = 0; //flag for reading from remote or local + if ($availablelangs = proxy_url($source)) { + $remote = 1; + } else { + $availablelangs = get_local_list_of_languages(); + } +/* if ($fp = fopen($source, 'r')){ /// attempt to get the list from Moodle.org. while(!feof ($fp)) { $availablelangs[] = split(',', fgets($fp,1024)); @@ -283,7 +286,7 @@ } else { /// fopen failed, we find local copy of list. $availablelangs = get_local_list_of_languages(); } - +*/ if (!$remote) { print_simple_box_start('center','60%'); echo '