Bumping version for 1.8.10 release (note new convention for numbering)
[moodle.git] / admin / index.php
blob8c9acb03024c40afb0c885276779cab600c17fd1
1 <?php // $Id$
3 /// Check that config.php exists, if not then call the install script
4 if (!file_exists('../config.php')) {
5 header('Location: ../install.php');
6 die;
9 /// Check that PHP is of a sufficient version
10 /// Moved here because older versions do not allow while(@ob_end_clean());
11 if (version_compare(phpversion(), "4.3.0") < 0) {
12 $phpversion = phpversion();
13 echo "Sorry, Moodle requires PHP 4.3.0 or later (currently using version $phpversion)";
14 die;
17 /// Turn off time limits and try to flush everything all the time, sometimes upgrades can be slow.
19 @set_time_limit(0);
20 @ob_implicit_flush(true);
21 while(@ob_end_clean()); // ob_end_flush prevents sending of headers
24 require_once('../config.php');
25 require_once($CFG->libdir.'/adminlib.php'); // Contains various admin-only functions
26 require_once($CFG->libdir.'/ddllib.php'); // Install/upgrade related db functions
28 $id = optional_param('id', '', PARAM_ALPHANUM);
29 $confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
30 $confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL);
31 $agreelicense = optional_param('agreelicense', 0, PARAM_BOOL);
32 $autopilot = optional_param('autopilot', 0, PARAM_BOOL);
33 $ignoreupgradewarning = optional_param('ignoreupgradewarning', 0, PARAM_BOOL);
35 /// check upgrade status first
36 if ($ignoreupgradewarning and !empty($_SESSION['upgraderunning'])) {
37 $_SESSION['upgraderunning'] = 0;
39 upgrade_check_running("Upgrade already running in this session, please wait!<br />Click on the exclamation marks to ignore this warning (<a href=\"index.php?ignoreupgradewarning=1\">!!!</a>).", 10);
41 /// set install/upgrade autocontinue session flag
42 if ($autopilot) {
43 $_SESSION['installautopilot'] = $autopilot;
46 /// Check some PHP server settings
48 $documentationlink = '<a href="http://docs.moodle.org/en/Installation">Installation docs</a>';
50 if (ini_get_bool('session.auto_start')) {
51 error("The PHP server variable 'session.auto_start' should be Off - $documentationlink");
54 if (ini_get_bool('magic_quotes_runtime')) {
55 error("The PHP server variable 'magic_quotes_runtime' should be Off - $documentationlink");
58 if (!ini_get_bool('file_uploads')) {
59 error("The PHP server variable 'file_uploads' is not turned On - $documentationlink");
62 if (empty($CFG->prefix) && $CFG->dbfamily != 'mysql') { //Enforce prefixes for everybody but mysql
63 error('$CFG->prefix can\'t be empty for your target DB (' . $CFG->dbtype . ')');
66 if ($CFG->dbfamily == 'oracle' && strlen($CFG->prefix) > 2) { //Max prefix length for Oracle is 2cc
67 error('$CFG->prefix maximum allowed length for Oracle DBs is 2cc.');
70 /// Check that config.php has been edited
72 if ($CFG->wwwroot == "http://example.com/moodle") {
73 error("Moodle has not been configured yet. You need to edit config.php first.");
77 /// Check settings in config.php
79 $dirroot = dirname(realpath("../index.php"));
80 if (!empty($dirroot) and $dirroot != $CFG->dirroot) {
81 error("Please fix your settings in config.php:
82 <p>You have:
83 <p>\$CFG->dirroot = \"".addslashes($CFG->dirroot)."\";
84 <p>but it should be:
85 <p>\$CFG->dirroot = \"".addslashes($dirroot)."\";",
86 "./");
89 /// Set some necessary variables during set-up to avoid PHP warnings later on this page
90 if (!isset($CFG->framename)) {
91 $CFG->framename = "_top";
93 if (!isset($CFG->release)) {
94 $CFG->release = "";
96 if (!isset($CFG->version)) {
97 $CFG->version = "";
100 if (is_readable("$CFG->dirroot/version.php")) {
101 include_once("$CFG->dirroot/version.php"); # defines $version
104 if (!$version or !$release) {
105 error('Main version.php was not readable or specified');# without version, stop
108 /// Check if the main tables have been installed yet or not.
110 if (! $tables = $db->Metatables() ) { // No tables yet at all.
111 $maintables = false;
113 } else { // Check for missing main tables
114 $maintables = true;
115 $mtables = array("config", "course", "course_categories", "course_modules",
116 "course_sections", "log", "log_display", "modules",
117 "user");
118 foreach ($mtables as $mtable) {
119 if (!in_array($CFG->prefix.$mtable, $tables)) {
120 $maintables = false;
121 break;
125 if (! $maintables) {
126 /// hide errors from headers in case debug enabled in config.php
127 $origdebug = $CFG->debug;
128 $CFG->debug = DEBUG_MINIMAL;
129 error_reporting($CFG->debug);
130 if (empty($agreelicense)) {
131 $strlicense = get_string('license');
132 print_header($strlicense, $strlicense, $strlicense, "", "", false, "&nbsp;", "&nbsp;");
133 print_heading("<a href=\"http://moodle.org\">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment");
134 print_heading(get_string('copyrightnotice'));
135 print_box(text_to_html(get_string('gpl')), 'copyrightnotice');
136 echo "<br />";
137 notice_yesno(get_string('doyouagree'), "index.php?agreelicense=1",
138 "http://docs.moodle.org/en/License");
139 print_footer('none');
140 exit;
142 if (empty($confirmrelease)) {
143 $strcurrentrelease = get_string("currentrelease");
144 print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, "&nbsp;", "&nbsp;");
145 print_heading("Moodle $release");
146 print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'generalbox boxaligncenter boxwidthwide');
147 echo '<form action="index.php"><div>';
148 echo '<input type="hidden" name="agreelicense" value="1" />';
149 echo '<input type="hidden" name="confirmrelease" value="1" />';
150 echo '</div>';
151 echo '<div class="continuebutton"><input name="autopilot" id="autopilot" type="checkbox" value="1" /><label for="autopilot">'.get_string('unattendedoperation', 'admin').'</label>';
152 echo '<br /><br /><input type="submit" value="'.get_string('continue').'" /></div>';
153 echo '</form>';
154 print_footer('none');
155 die;
158 $strdatabasesetup = get_string("databasesetup");
159 $strdatabasesuccess = get_string("databasesuccess");
160 print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup,
161 "", upgrade_get_javascript(), false, "&nbsp;", "&nbsp;");
162 /// return to original debugging level
163 $CFG->debug = $origdebug;
164 error_reporting($CFG->debug);
165 upgrade_log_start();
166 $db->debug = true;
168 /// Both old .sql files and new install.xml are supported
169 /// But we prioritise install.xml (XMLDB) if present
171 change_db_encoding(); // first try to change db encoding to utf8
172 if (!setup_is_unicodedb()) {
173 // If could not convert successfully, throw error, and prevent installation
174 print_error('unicoderequired', 'admin');
177 $status = false;
178 if (file_exists("$CFG->libdir/db/install.xml")) {
179 $status = install_from_xmldb_file("$CFG->libdir/db/install.xml"); //New method
180 } else if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
181 $status = modify_database("$CFG->libdir/db/$CFG->dbtype.sql"); //Old method
182 } else {
183 error("Error: Your database ($CFG->dbtype) is not yet fully supported by Moodle or install.xml is not present. See the lib/db directory.");
186 // all new installs are in unicode - keep for backwards compatibility and 1.8 upgrade checks
187 set_config('unicodedb', 1);
189 /// Continue with the instalation
190 $db->debug = false;
191 if ($status) {
192 //ugly hack - install new groups: MDL-9217
193 require("$CFG->dirroot/group/version.php");
194 set_config('group_version', $group_version);
195 //install_group_db();
197 // Install the roles system.
198 moodle_install_roles();
199 set_config('statsrolesupgraded',time());
202 // Write default settings unconditionally (i.e. even if a setting is already set, overwrite it)
203 // (this should only have any effect during initial install).
204 $adminroot = admin_get_root();
205 $adminroot->prune('backups'); // backup settings table not created yet
206 apply_default_settings($adminroot);
208 /// This is used to handle any settings that must exist in $CFG but which do not exist in
209 /// admin_get_root()/$ADMIN as admin_setting objects (there are some exceptions).
210 apply_default_exception_settings(array('alternateloginurl' => '',
211 'auth' => 'email',
212 'auth_pop3mailbox' => 'INBOX',
213 'changepassword' => '',
214 'enrol' => 'manual',
215 'enrol_plugins_enabled' => 'manual',
216 'guestloginbutton' => 1,
217 'registerauth' => 'email',
218 'style' => 'default',
219 'template' => 'default',
220 'theme' => 'standardwhite',
221 'filter_multilang_converted' => 1));
223 notify($strdatabasesuccess, "green");
224 require_once $CFG->dirroot.'/mnet/lib.php';
225 } else {
226 error("Error: Main databases NOT set up successfully");
228 print_continue('index.php');
229 print_footer('none');
230 die;
234 /// Check version of Moodle code on disk compared with database
235 /// and upgrade if possible.
237 if (file_exists("$CFG->dirroot/lib/db/$CFG->dbtype.php")) {
238 include_once("$CFG->dirroot/lib/db/$CFG->dbtype.php"); # defines old upgrades
240 if (file_exists("$CFG->dirroot/lib/db/upgrade.php")) {
241 include_once("$CFG->dirroot/lib/db/upgrade.php"); # defines new upgrades
244 $stradministration = get_string("administration");
246 if ($CFG->version) {
247 if ($version > $CFG->version) { // upgrade
249 /// If the database is not already Unicode then we do not allow upgrading!
250 /// Instead, we print an error telling them to upgrade to 1.7 first. MDL-6857
251 if (empty($CFG->unicodedb)) {
252 print_error('unicodeupgradeerror', 'error', '', $version);
255 $a->oldversion = "$CFG->release ($CFG->version)";
256 $a->newversion = "$release ($version)";
257 $strdatabasechecking = get_string("databasechecking", "", $a);
259 // hide errors from headers in case debug is enabled
260 $origdebug = $CFG->debug;
261 $CFG->debug = DEBUG_MINIMAL;
262 error_reporting($CFG->debug);
264 // logout in case we are upgrading from pre 1.7 version - prevention of weird session problems
265 if ($CFG->version < 2006050600) {
266 require_logout();
269 if (empty($confirmupgrade)) {
270 print_header($strdatabasechecking, $stradministration, $strdatabasechecking,
271 "", "", false, "&nbsp;", "&nbsp;");
273 notice_yesno(get_string('upgradesure', 'admin', $a->newversion), 'index.php?confirmupgrade=1', 'index.php');
274 exit;
276 } else if (empty($confirmrelease)){
277 $strcurrentrelease = get_string("currentrelease");
278 print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, "&nbsp;", "&nbsp;");
279 print_heading("Moodle $release");
280 print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'));
282 require_once($CFG->libdir.'/environmentlib.php');
283 print_heading(get_string('environment', 'admin'));
284 remove_dir($CFG->dataroot . '/environment'); /// Always delete downloaded env. info to force use of the released one. MDL-9796
285 if (!check_moodle_environment($release, $environment_results, true)) {
286 print_box_start('generalbox', 'notice'); // MDL-8330
287 print_string('langpackwillbeupdated', 'admin');
288 print_box_end();
289 notice_yesno(get_string('environmenterrorupgrade', 'admin'),
290 'index.php?confirmupgrade=1&confirmrelease=1', 'index.php');
291 } else {
292 notify(get_string('environmentok', 'admin'), 'notifysuccess');
293 print_box_start('generalbox', 'notice'); // MDL-8330
294 print_string('langpackwillbeupdated', 'admin');
295 print_box_end();
296 echo '<form action="index.php"><div>';
297 echo '<input type="hidden" name="confirmupgrade" value="1" />';
298 echo '<input type="hidden" name="confirmrelease" value="1" />';
299 echo '</div>';
300 echo '<div class="continuebutton"><input name="autopilot" id="autopilot" type="checkbox" value="1" /><label for="autopilot">'.get_string('unattendedoperation', 'admin').'</label>';
301 echo '<br /><br /><input type="submit" value="'.get_string('continue').'" /></div>';
302 echo '</form>';
305 print_footer('none');
306 die;
307 } else {
308 $strdatabasesuccess = get_string("databasesuccess");
309 print_header($strdatabasechecking, $stradministration, $strdatabasechecking,
310 "", upgrade_get_javascript(), false, "&nbsp;", "&nbsp;");
312 /// return to original debugging level
313 $CFG->debug = $origdebug;
314 error_reporting($CFG->debug);
315 upgrade_log_start();
317 /// Upgrade current language pack if we can
318 upgrade_language_pack();
320 print_heading($strdatabasechecking);
321 $db->debug=true;
322 /// Launch the old main upgrade (if exists)
323 $status = true;
324 if (function_exists('main_upgrade')) {
325 $status = main_upgrade($CFG->version);
327 /// If succesful and exists launch the new main upgrade (XMLDB), called xmldb_main_upgrade
328 if ($status && function_exists('xmldb_main_upgrade')) {
329 $status = xmldb_main_upgrade($CFG->version);
331 $db->debug=false;
332 /// If successful, continue upgrading roles and setting everything properly
333 if ($status) {
334 if (empty($CFG->rolesactive)) {
335 // ugly hack - upgrade to new groups (from 1.6) : MDL-9217
336 // require_once("$CFG->dirroot/group/db/upgrade.php");
337 // MDL-11062, proper group upgrade code is done in lib/db/upgrade.php
338 // install_group_db();
339 // Upgrade to the roles system.
340 moodle_install_roles();
341 set_config('rolesactive', 1);
342 } else if (!update_capabilities()) {
343 error('Had trouble upgrading the core capabilities for the Roles System');
345 require_once($CFG->libdir.'/statslib.php');
346 if (!stats_upgrade_for_roles_wrapper()) {
347 notify('Couldn\'t upgrade the stats tables to use the new roles system');
349 if (set_config("version", $version)) {
350 remove_dir($CFG->dataroot . '/cache', true); // flush cache
351 notify($strdatabasesuccess, "green");
352 print_continue("upgradesettings.php");
353 print_footer('none');
354 exit;
355 } else {
356 error('Upgrade failed! (Could not update version in config table)');
358 /// Main upgrade not success
359 } else {
360 notify('Main Upgrade failed! See lib/db/upgrade.php');
361 print_continue('index.php?confirmupgrade=1&amp;confirmrelease=1');
362 print_footer('none');
363 die;
365 upgrade_log_finish();
367 } else if ($version < $CFG->version) {
368 upgrade_log_start();
369 notify("WARNING!!! The code you are using is OLDER than the version that made these databases!");
370 upgrade_log_finish();
372 } else {
373 if (!set_config("version", $version)) {
374 error("A problem occurred inserting current version into databases");
378 /// Updated human-readable release version if necessary
380 if ($release <> $CFG->release) { // Update the release version
381 if (!set_config("release", $release)) {
382 error("ERROR: Could not update release version in database!!");
386 /// ugly hack - convert to new groups if upgrading from 1.7; must be reworked
387 require_once("$CFG->dirroot/group/db/upgrade.php");
388 upgrade_group_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
391 /// Find and check all main modules and load them up or upgrade them if necessary
392 /// first old *.php update and then the new upgrade.php script
393 upgrade_activity_modules("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
395 /// Check all questiontype plugins and upgrade if necessary
396 /// first old *.php update and then the new upgrade.php script
397 /// It is important that this is done AFTER the quiz module has been upgraded
398 upgrade_plugins('qtype', 'question/type', "$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
400 /// Upgrade backup/restore system if necessary
401 /// first old *.php update and then the new upgrade.php script
402 require_once("$CFG->dirroot/backup/lib.php");
403 upgrade_backup_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
405 /// Upgrade blocks system if necessary
406 /// first old *.php update and then the new upgrade.php script
407 require_once("$CFG->dirroot/lib/blocklib.php");
408 upgrade_blocks_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
410 /// Check all blocks and load (or upgrade them if necessary)
411 /// first old *.php update and then the new upgrade.php script
412 upgrade_blocks_plugins("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
414 /// Check all enrolment plugins and upgrade if necessary
415 /// first old *.php update and then the new upgrade.php script
416 upgrade_plugins('enrol', 'enrol', "$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
418 /// Check all auth plugins and upgrade if necessary
419 upgrade_plugins('auth','auth',"$CFG->wwwroot/$CFG->admin/index.php");
421 /// Check all course formats and upgrade if necessary
422 upgrade_plugins('format','course/format',"$CFG->wwwroot/$CFG->admin/index.php");
424 /// Check for local database customisations
425 /// first old *.php update and then the new upgrade.php script
426 require_once("$CFG->dirroot/lib/locallib.php");
427 upgrade_local_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
429 /// Check for changes to RPC functions
430 require_once("$CFG->dirroot/$CFG->admin/mnet/adminlib.php");
431 upgrade_RPC_functions("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
434 /// just make sure upgrade logging is properly terminated
435 upgrade_log_finish();
437 unset($_SESSION['installautopilot']);
439 /// Set up the blank site - to be customized later at the end of install.
440 if (! $site = get_site()) {
441 // We are about to create the site "course"
442 require_once($CFG->libdir.'/blocklib.php');
444 $newsite = new Object();
445 $newsite->fullname = "";
446 $newsite->shortname = "";
447 $newsite->summary = "";
448 $newsite->newsitems = 3;
449 $newsite->numsections = 0;
450 $newsite->category = 0;
451 $newsite->format = 'site'; // Only for this course
452 $newsite->teacher = get_string("defaultcourseteacher");
453 $newsite->teachers = get_string("defaultcourseteachers");
454 $newsite->student = get_string("defaultcoursestudent");
455 $newsite->students = get_string("defaultcoursestudents");
456 $newsite->timemodified = time();
458 if ($newid = insert_record('course', $newsite)) {
459 // Site created, add blocks for it
460 $page = page_create_object(PAGE_COURSE_VIEW, $newid);
461 blocks_repopulate_page($page); // Return value not checked because you can always edit later
463 $cat = new Object();
464 $cat->name = get_string('miscellaneous');
465 if (insert_record('course_categories', $cat)) {
466 redirect('index.php');
467 } else {
468 error("Serious Error! Could not set up a default course category!");
470 } else {
471 error("Serious Error! Could not set up the site!");
475 // initialise default blocks on admin and site page if needed
476 if (empty($CFG->adminblocks_initialised)) {
477 require_once("$CFG->dirroot/$CFG->admin/pagelib.php");
478 require_once($CFG->libdir.'/blocklib.php');
479 page_map_class(PAGE_ADMIN, 'page_admin');
480 $page = page_create_object(PAGE_ADMIN, 0); // there must be some id number
481 blocks_repopulate_page($page);
483 //add admin_tree block to site if not already present
484 if ($admintree = get_record('block', 'name', 'admin_tree')) {
485 $page = page_create_object(PAGE_COURSE_VIEW, SITEID);
486 blocks_execute_action($page, blocks_get_by_page($page), 'add', (int)$admintree->id, false, false);
487 if ($admintreeinstance = get_record('block_instance', 'pagetype', $page->type, 'pageid', SITEID, 'blockid', $admintree->id)) {
488 blocks_execute_action($page, blocks_get_by_page($page), 'moveleft', $admintreeinstance, false, false);
492 set_config('adminblocks_initialised', 1);
495 /// Define the unique site ID code if it isn't already
496 if (empty($CFG->siteidentifier)) { // Unique site identification code
497 set_config('siteidentifier', random_string(32).$_SERVER['HTTP_HOST']);
500 /// Check if the guest user exists. If not, create one.
501 if (! record_exists("user", "username", "guest")) {
502 if (! $guest = create_guest_record()) {
503 notify("Could not create guest user record !!!");
508 /// Set up the admin user
509 if (empty($CFG->rolesactive)) {
510 create_admin_user();
513 /// Check for valid admin user
514 require_login();
516 $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
518 require_capability('moodle/site:config', $context);
520 /// check that site is properly customized
521 if (empty($site->shortname) or empty($site->shortname)) {
522 redirect('settings.php?section=frontpagesettings&amp;return=site');
525 /// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders
527 if (!empty($id)) {
528 if ($id == $CFG->siteidentifier) {
529 set_config('registered', time());
533 /// Everything should now be set up, and the user is an admin
535 /// Print default admin page with notifications.
537 $adminroot = admin_get_root();
538 admin_externalpage_setup('adminnotifications', $adminroot);
539 admin_externalpage_print_header($adminroot);
541 /// Deprecated database! Warning!!
542 if (!empty($CFG->migrated_to_new_db)) {
543 print_box(print_string('dbmigrationdeprecateddb', 'admin'), 'generalbox adminwarning');
546 /// Check for any special upgrades that might need to be run
547 if (!empty($CFG->upgrade)) {
548 print_box(get_string("upgrade$CFG->upgrade", "admin", "$CFG->wwwroot/$CFG->admin/upgrade$CFG->upgrade.php"));
551 if (ini_get_bool('register_globals')) {
552 print_box(get_string('globalswarning', 'admin'), 'generalbox adminwarning');
555 if (is_dataroot_insecure()) {
556 print_box(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot), 'generalbox adminwarning');
559 if (defined('WARN_DISPLAY_ERRORS_ENABLED')) {
560 print_box(get_string('displayerrorswarning', 'admin'), 'generalbox adminwarning');
563 if (substr($CFG->wwwroot, -1) == '/') {
564 print_box(get_string('cfgwwwrootslashwarning', 'admin'), 'generalbox adminwarning');
566 if (strpos($ME, $CFG->httpswwwroot.'/') === false) {
567 print_box(get_string('cfgwwwrootwarning', 'admin'), 'generalbox adminwarning');
570 /// If no recently cron run
571 $lastcron = get_field_sql('SELECT max(lastcron) FROM ' . $CFG->prefix . 'modules');
572 if (time() - $lastcron > 3600 * 24) {
573 $strinstallation = get_string('installation', 'install');
574 $helpbutton = helpbutton('install', $strinstallation, 'moodle', true, false, '', true);
575 print_box(get_string('cronwarning', 'admin')."&nbsp;".$helpbutton, 'generalbox adminwarning');
578 /// Print multilang upgrade notice if needed
579 if (empty($CFG->filter_multilang_converted)) {
580 print_box(get_string('multilangupgradenotice', 'admin'), 'generalbox adminwarning');
583 /// Alert if we are currently in maintenance mode
584 if (file_exists($CFG->dataroot.'/1/maintenance.html')) {
585 print_box(get_string('sitemaintenancewarning', 'admin'), 'generalbox adminwarning');
589 /// Print slightly annoying registration button every six months ;-)
590 /// You can set the "registered" variable to something far in the future
591 /// if you really want to prevent this. eg 9999999999
592 if (!isset($CFG->registered) || $CFG->registered < (time() - 3600*24*30*6)) {
593 $options = array();
594 $options['sesskey'] = $USER->sesskey;
595 print_box_start('generalbox adminwarning');
596 print_string('pleaseregister', 'admin');
597 print_single_button('register.php', $options, get_string('registration'));
598 print_box_end();
599 $registrationbuttonshown = true;
602 //////////////////////////////////////////////////////////////////////////////////////////////////
603 //// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
604 $copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
605 '<a href="http://docs.moodle.org/en/Release" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
606 'Copyright &copy; 1999 onwards, Martin Dougiamas<br />'.
607 'and <a href="http://docs.moodle.org/en/Credits">many other contributors</a>.<br />'.
608 '<a href="http://docs.moodle.org/en/License">GNU Public License</a>';
609 print_box($copyrighttext, 'copyright');
610 //////////////////////////////////////////////////////////////////////////////////////////////////
613 if (empty($registrationbuttonshown)) {
614 $options = array();
615 $options['sesskey'] = $USER->sesskey;
616 print_single_button('register.php', $options, get_string('registration'));
620 if (optional_param('dbmigrate')) { // ??? Is this actually used?
621 print_box_start();
622 require_once($CFG->dirroot.'/'.$CFG->admin.'/utfdbmigrate.php');
623 db_migrate2utf8();
624 print_box_end();
628 admin_externalpage_print_footer($adminroot);