Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Upgrade notification: Difference between revisions

From MoodleDocs
No edit summary
Line 3: Line 3:
* '''DISCUSSION AND COMMENTS''': n/a
* '''DISCUSSION AND COMMENTS''': n/a
* '''AUTHOR''': [[User:Petr Škoda (škoďák)|Petr Škoda (škoďák)]] + feedback and ideas from other developers
* '''AUTHOR''': [[User:Petr Škoda (škoďák)|Petr Škoda (škoďák)]] + feedback and ideas from other developers
* '''TIME NEEDED FOR IMPLEMENTATION''': 3days
* '''TIME NEEDED FOR IMPLEMENTATION''': 2 days


=Overview=
=Overview=
Line 17: Line 17:
Simple PHP script which accepts one optional parameter ''version'' (ex.:1.9.5) and returns XML file which includes following info:
Simple PHP script which accepts one optional parameter ''version'' (ex.:1.9.5) and returns XML file which includes following info:
* status - 0 (ok), 1 (needs update), 2 (not maintained)
* status - 0 (ok), 1 (needs update), 2 (not maintained)
* update to version recommendation (ex.: 1.9.6)
* end of maintenance dat if known (unix timestamp)
* end of maintenance dat if known (unix timestamp)
* update to version recommendation (ex.: 1.9.6)
* optional upgrade link


=Implementation=
=Implementation=


New Function lib/adminlib.php/fetch_latest_version() - uses standard download_file_content() to fetch XML info from http://moodle.org/version_info.php?version=1.9.5
New Function lib/adminlib.php/uptodate_info() - uses standard download_file_content() to fetch XML info from http://moodle.org/uptodate_info.php?version=1.9.5


XML is stored in config table:
XML is stored in config table:
*
* $CFG->uptodate_status
* $CFG->uptodate_nextversion
* $CFG->uptodate_maintenanceend

Revision as of 21:35, 5 October 2009

  • PROJECT STATE: Proposal, probably to be included in 1.9.x
  • MAIN TRACKER ISSUE: MDL-20438
  • DISCUSSION AND COMMENTS: n/a
  • AUTHOR: Petr Škoda (škoďák) + feedback and ideas from other developers
  • TIME NEEDED FOR IMPLEMENTATION: 2 days

Overview

The mandatory security measure is to always keep Moodle software up to date. This page describes new mechanism that notifies each admin about available Moodle upgrades. At present upgrade information is available from moodle.org site, we are also sending new version notices via email to registered administrators. Unfortunately many sites are not upgraded regularly :-(

The general idea is that each Moodle instance contacts regularly (every 7 days) moodle.org and fetches the latest version information. Admin is notified by own server when new version available and any new version available. The notification would be also printed on the security overview report, the site notification and the front page (only when admin logged in). Admins would be also notified when branch not maintained any more

The side effect would be that we could get much better version statistics, of course we need to provide opt-out option ;-)

moodle.org side

Simple PHP script which accepts one optional parameter version (ex.:1.9.5) and returns XML file which includes following info:

  • status - 0 (ok), 1 (needs update), 2 (not maintained)
  • update to version recommendation (ex.: 1.9.6)
  • end of maintenance dat if known (unix timestamp)

Implementation

New Function lib/adminlib.php/uptodate_info() - uses standard download_file_content() to fetch XML info from http://moodle.org/uptodate_info.php?version=1.9.5

XML is stored in config table:

  • $CFG->uptodate_status
  • $CFG->uptodate_nextversion
  • $CFG->uptodate_maintenanceend