Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-36950 Pass the Moodle proxy setting to the mdeploy.php utility

  • Loading branch information...
commit 63def597a64fea047c4d2ec38ea5a80c20f223cc 1 parent 42c6731
David Mudrák mudrd8mz authored

Showing 1 changed file with 22 additions and 0 deletions. Show diff stats Hide diff stats

  1. +22 0 lib/pluginlib.php
22 lib/pluginlib.php
@@ -1691,6 +1691,28 @@ public function make_execution_widget(available_update_info $info) {
1691 1691 'returnurl' => $upgradeurl->out(true),
1692 1692 );
1693 1693
  1694 + if (!empty($CFG->proxyhost)) {
  1695 + // Beware - we should call just !is_proxybypass() here. But currently, our cURL wrapper
  1696 + // class does not do it. So, to have consistent behaviour, we pass proxy setting
  1697 + // regardless the $CFG->proxybypass setting. Once the {@link curl} class is fixed,
  1698 + // the condition should be amended.
  1699 + if (true or !is_proxybypass($info->download)) {
  1700 + if (empty($CFG->proxyport)) {
  1701 + $params['proxy'] = $CFG->proxyhost;
  1702 + } else {
  1703 + $params['proxy'] = $CFG->proxyhost.':'.$CFG->proxyport;
  1704 + }
  1705 +
  1706 + if (!empty($CFG->proxyuser) and !empty($CFG->proxypassword)) {
  1707 + $params['proxyuserpwd'] = $CFG->proxyuser.':'.$CFG->proxypassword;
  1708 + }
  1709 +
  1710 + if (!empty($CFG->proxytype)) {
  1711 + $params['proxytype'] = $CFG->proxytype;
  1712 + }
  1713 + }
  1714 + }
  1715 +
1694 1716 $widget = new single_button(
1695 1717 new moodle_url('/mdeploy.php', $params),
1696 1718 get_string('updateavailableinstall', 'core_admin'),

0 comments on commit 63def59

Please sign in to comment.
Something went wrong with that request. Please try again.