MDL-38509 Add ability to install add-ons from the remote repository
authorDavid Mudrák <david@moodle.com>
Thu, 28 Mar 2013 23:06:06 +0000 (00:06 +0100)
committerDavid Mudrák <david@moodle.com>
Thu, 28 Mar 2013 23:16:06 +0000 (00:16 +0100)
commitaf96f120e9fa46f12f6acc67d763058265c95f71
tree3fb99296c5b731c6c1a139cd3c700c47771a48f4
parent399ddcc73e26d8f5fd1d7d130a62c4c649559a02
MDL-38509 Add ability to install add-ons from the remote repository

There is a new hook in the index.php file. If valid HTTP parameter
installaddonrequest is detected, the installer asks the administrator to
confirm the request.

If confirmed, the installer calls download.moodle.org/api/1.2/pluginfo.php
service to get information about the given plugin version. The essential
data are the URL of the ZIP to download and the MD5 hash of the ZIP.
These data must be fetched via HTTPS to protect against MiM attack.

If the ZIP is downloaded and the MD5 content hash is correct, the user
is redirected to the previously implemented ZIP validation page, as if
the ZIP was uploaded manually.

The valid format of the installaddonrequest is documented via the
test_decode_remote_request() unit test method.
admin/tool/installaddon/classes/installer.php
admin/tool/installaddon/classes/pluginfo_client.php [new file with mode: 0644]
admin/tool/installaddon/index.php
admin/tool/installaddon/lang/en/tool_installaddon.php
admin/tool/installaddon/renderer.php
admin/tool/installaddon/tests/installer_test.php