Skip to content

Commit

Permalink
Merge branch 'MDL-38509-tool-installaddon' of git://github.com/mudrd8…
Browse files Browse the repository at this point in the history
…mz/moodle
  • Loading branch information
danpoltawski committed Apr 3, 2013
2 parents 6867302 + 3e6a8ae commit 6833c6d
Show file tree
Hide file tree
Showing 47 changed files with 3,318 additions and 15 deletions.
21 changes: 20 additions & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,18 @@
$showallplugins = optional_param('showallplugins', 0, PARAM_BOOL);
$agreelicense = optional_param('agreelicense', 0, PARAM_BOOL);
$fetchupdates = optional_param('fetchupdates', 0, PARAM_BOOL);
$newaddonreq = optional_param('installaddonrequest', null, PARAM_RAW);

// Check some PHP server settings

$PAGE->set_url('/admin/index.php');
if (is_null($newaddonreq)) {
$PAGE->set_url('/admin/index.php');
} else {
// We need to set the eventual add-on installation request in the $PAGE's URL
// so that it is stored in $SESSION->wantsurl and the admin is redirected
// correctly once they are logged-in.
$PAGE->set_url('/admin/index.php', array('installaddonrequest' => $newaddonreq));
}
$PAGE->set_pagelayout('admin'); // Set a default pagelayout

$documentationlink = '<a href="http://docs.moodle.org/en/Installation">Installation docs</a>';
Expand Down Expand Up @@ -423,6 +431,17 @@
set_config('registered', time());
}

// Check if we are returning from an add-on installation request at moodle.org/plugins
if (!is_null($newaddonreq)) {
if (!empty($CFG->disableonclickaddoninstall)) {
// The feature is disabled in config.php, ignore the request.
} else {
redirect(new moodle_url('/admin/tool/installaddon/index.php', array(
'installaddonrequest' => $newaddonreq,
'confirm' => 0)));
}
}

// setup critical warnings before printing admin tree block
$insecuredataroot = is_dataroot_insecure(true);
$SESSION->admin_critical_warning = ($insecuredataroot==INSECURE_DATAROOT_ERROR);
Expand Down
Loading

0 comments on commit 6833c6d

Please sign in to comment.