MDL-38509 Add hook for the installaddonrequest into admin/index.php
authorDavid Mudrák <david@moodle.com>
Fri, 29 Mar 2013 00:00:16 +0000 (01:00 +0100)
committerDavid Mudrák <david@moodle.com>
Fri, 29 Mar 2013 00:00:16 +0000 (01:00 +0100)
commit0a6a344d29c333fb9e498afdc173e112dd14c1f1
tree821d4e1f055ccdf6825ec150b0ba788fde65b00e
parentaf96f120e9fa46f12f6acc67d763058265c95f71
MDL-38509 Add hook for the installaddonrequest into admin/index.php

If the user selects a plugin in Moodle plugins directory to be installed
into their site, Moodle plugins directory will redirect them into their
site's admin/index.php script, providing the installaddonrequest
parameter.

This patch makes sure that only if the user is logged-in as the admin
and the site is fully installed and up-to-date, the add-on installation
request will be dispatched to the tool_installaddon for actual
processing.

We need to store the installaddonrequest value in the $PAGE's URL so
that is is stored in $SESSION->wantsurl in case the user needs to log in
at their site. Thanks to this, the request is dispatched after the user
logs in.
admin/index.php