Skip to content
Browse files

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

  • Loading branch information...
1 parent 42c6731 commit 63def597a64fea047c4d2ec38ea5a80c20f223cc @mudrd8mz mudrd8mz committed Nov 30, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 lib/pluginlib.php
View
22 lib/pluginlib.php
@@ -1691,6 +1691,28 @@ public function make_execution_widget(available_update_info $info) {
'returnurl' => $upgradeurl->out(true),
);
+ if (!empty($CFG->proxyhost)) {
+ // Beware - we should call just !is_proxybypass() here. But currently, our cURL wrapper
+ // class does not do it. So, to have consistent behaviour, we pass proxy setting
+ // regardless the $CFG->proxybypass setting. Once the {@link curl} class is fixed,
+ // the condition should be amended.
+ if (true or !is_proxybypass($info->download)) {
+ if (empty($CFG->proxyport)) {
+ $params['proxy'] = $CFG->proxyhost;
+ } else {
+ $params['proxy'] = $CFG->proxyhost.':'.$CFG->proxyport;
+ }
+
+ if (!empty($CFG->proxyuser) and !empty($CFG->proxypassword)) {
+ $params['proxyuserpwd'] = $CFG->proxyuser.':'.$CFG->proxypassword;
+ }
+
+ if (!empty($CFG->proxytype)) {
+ $params['proxytype'] = $CFG->proxytype;
+ }
+ }
+ }
+
$widget = new single_button(
new moodle_url('/mdeploy.php', $params),
get_string('updateavailableinstall', 'core_admin'),

0 comments on commit 63def59

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