MDL-11515:
[moodle-linuxchix.git] / admin / index.php
blobc597fbe9922a1fff833fe14042ccbc0803be11b9
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 $navigation = build_navigation(array(array('name'=>$strlicense, 'link'=>null, 'type'=>'misc')));
133 print_header($strlicense, $strlicense, $navigation, "", "", false, "&nbsp;", "&nbsp;");
134 print_heading("<a href=\"http://moodle.org\">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment");
135 print_heading(get_string('copyrightnotice'));
136 print_box(text_to_html(get_string('gpl')), 'copyrightnotice');
137 echo "<br />";
138 notice_yesno(get_string('doyouagree'), "index.php?agreelicense=1",
139 "http://docs.moodle.org/en/License");
140 print_footer('none');
141 exit;
143 if (empty($confirmrelease)) {
144 $strcurrentrelease = get_string("currentrelease");
145 $navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc')));
146 print_header($strcurrentrelease, $strcurrentrelease, $navigation, "", "", false, "&nbsp;", "&nbsp;");
147 print_heading("Moodle $release");
148 print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'generalbox boxaligncenter boxwidthwide');
149 echo '<form action="index.php"><div>';
150 echo '<input type="hidden" name="agreelicense" value="1" />';
151 echo '<input type="hidden" name="confirmrelease" value="1" />';
152 echo '</div>';
153 echo '<div class="continuebutton"><input name="autopilot" id="autopilot" type="checkbox" value="1" /><label for="autopilot">'.get_string('unattendedoperation', 'admin').'</label>';
154 echo '<br /><br /><input type="submit" value="'.get_string('continue').'" /></div>';
155 echo '</form>';
156 print_footer('none');
157 die;
160 $strdatabasesetup = get_string("databasesetup");
161 $strdatabasesuccess = get_string("databasesuccess");
162 $navigation = build_navigation(array(array('name'=>$strdatabasesetup, 'link'=>null, 'type'=>'misc')));
163 print_header($strdatabasesetup, $strdatabasesetup, $navigation,
164 "", upgrade_get_javascript(), false, "&nbsp;", "&nbsp;");
165 /// return to original debugging level
166 $CFG->debug = $origdebug;
167 error_reporting($CFG->debug);
168 upgrade_log_start();
169 $db->debug = true;
171 /// Both old .sql files and new install.xml are supported
172 /// But we prioritise install.xml (XMLDB) if present
174 change_db_encoding(); // first try to change db encoding to utf8
175 if (!setup_is_unicodedb()) {
176 // If could not convert successfully, throw error, and prevent installation
177 print_error('unicoderequired', 'admin');
180 $status = false;
181 if (file_exists("$CFG->libdir/db/install.xml")) {
182 $status = install_from_xmldb_file("$CFG->libdir/db/install.xml"); //New method
183 } else if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
184 $status = modify_database("$CFG->libdir/db/$CFG->dbtype.sql"); //Old method
185 } else {
186 error("Error: Your database ($CFG->dbtype) is not yet fully supported by Moodle or install.xml is not present. See the lib/db directory.");
189 // all new installs are in unicode - keep for backwards compatibility and 1.8 upgrade checks
190 set_config('unicodedb', 1);
192 /// Continue with the instalation
193 $db->debug = false;
194 if ($status) {
196 /// Groups install is now in core above.
198 // Install the roles system.
199 moodle_install_roles();
200 set_config('statsrolesupgraded',time());
202 // install core event handlers
203 events_update_definition();
205 // Write default settings unconditionally (i.e. even if a setting is already set, overwrite it)
206 // (this should only have any effect during initial install).
207 $adminroot = admin_get_root();
208 $adminroot->prune('backups'); // backup settings table not created yet
209 apply_default_settings($adminroot);
211 /// This is used to handle any settings that must exist in $CFG but which do not exist in
212 /// admin_get_root()/$ADMIN as admin_setting objects (there are some exceptions).
213 apply_default_exception_settings(array('alternateloginurl' => '',
214 'auth' => 'email',
215 'auth_pop3mailbox' => 'INBOX',
216 'changepassword' => '',
217 'enrol' => 'manual',
218 'enrol_plugins_enabled' => 'manual',
219 'guestloginbutton' => 1,
220 'registerauth' => 'email',
221 'style' => 'default',
222 'template' => 'default',
223 'theme' => 'standardwhite',
224 'filter_multilang_converted' => 1));
226 notify($strdatabasesuccess, "green");
227 require_once $CFG->dirroot.'/mnet/lib.php';
228 } else {
229 error("Error: Main databases NOT set up successfully");
231 print_continue('index.php');
232 print_footer('none');
233 die;
237 /// Check version of Moodle code on disk compared with database
238 /// and upgrade if possible.
240 if (file_exists("$CFG->dirroot/lib/db/$CFG->dbtype.php")) {
241 include_once("$CFG->dirroot/lib/db/$CFG->dbtype.php"); # defines old upgrades
243 if (file_exists("$CFG->dirroot/lib/db/upgrade.php")) {
244 include_once("$CFG->dirroot/lib/db/upgrade.php"); # defines new upgrades
247 $stradministration = get_string("administration");
249 if ($CFG->version) {
250 if ($version > $CFG->version) { // upgrade
252 /// If the database is not already Unicode then we do not allow upgrading!
253 /// Instead, we print an error telling them to upgrade to 1.7 first. MDL-6857
254 if (empty($CFG->unicodedb)) {
255 print_error('unicodeupgradeerror', 'error', '', $version);
258 $a->oldversion = "$CFG->release ($CFG->version)";
259 $a->newversion = "$release ($version)";
260 $strdatabasechecking = get_string("databasechecking", "", $a);
262 // hide errors from headers in case debug is enabled
263 $origdebug = $CFG->debug;
264 $CFG->debug = DEBUG_MINIMAL;
265 error_reporting($CFG->debug);
267 // logout in case we are upgrading from pre 1.7 version - prevention of weird session problems
268 if ($CFG->version < 2006050600) {
269 require_logout();
272 if (empty($confirmupgrade)) {
273 $navigation = build_navigation(array(array('name'=>$strdatabasechecking, 'link'=>null, 'type'=>'misc')));
274 print_header($strdatabasechecking, $stradministration, $navigation,
275 "", "", false, "&nbsp;", "&nbsp;");
277 notice_yesno(get_string('upgradesure', 'admin', $a->newversion), 'index.php?confirmupgrade=1', 'index.php');
278 exit;
280 } else if (empty($confirmrelease)){
281 $strcurrentrelease = get_string("currentrelease");
282 $navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc')));
283 print_header($strcurrentrelease, $strcurrentrelease, $navigation, "", "", false, "&nbsp;", "&nbsp;");
284 print_heading("Moodle $release");
285 print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'));
287 require_once($CFG->libdir.'/environmentlib.php');
288 print_heading(get_string('environment', 'admin'));
289 if (!check_moodle_environment($release, $environment_results, true)) {
290 notice_yesno(get_string('environmenterrorupgrade', 'admin'),
291 'index.php?confirmupgrade=1&confirmrelease=1', 'index.php');
292 } else {
293 notify(get_string('environmentok', 'admin'), 'notifysuccess');
295 echo '<form action="index.php"><div>';
296 echo '<input type="hidden" name="confirmupgrade" value="1" />';
297 echo '<input type="hidden" name="confirmrelease" value="1" />';
298 echo '</div>';
299 echo '<div class="continuebutton"><input name="autopilot" id="autopilot" type="checkbox" value="1" /><label for="autopilot">'.get_string('unattendedoperation', 'admin').'</label>';
300 echo '<br /><br /><input type="submit" value="'.get_string('continue').'" /></div>';
301 echo '</form>';
304 print_footer('none');
305 die;
306 } else {
307 $strdatabasesuccess = get_string("databasesuccess");
308 $navigation = build_navigation(array(array('name'=>$strdatabasesuccess, 'link'=>null, 'type'=>'misc')));
309 print_header($strdatabasechecking, $stradministration, $navigation,
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)) {
336 /// Groups upgrade is now in core above.
338 // Upgrade to the roles system.
339 moodle_install_roles();
340 set_config('rolesactive', 1);
341 } else if (!update_capabilities()) {
342 error('Had trouble upgrading the core capabilities for the Roles System');
344 // update core events
345 events_update_definition();
347 require_once($CFG->libdir.'/statslib.php');
348 if (!stats_upgrade_for_roles_wrapper()) {
349 notify('Couldn\'t upgrade the stats tables to use the new roles system');
351 if (set_config("version", $version)) {
352 remove_dir($CFG->dataroot . '/cache', true); // flush cache
353 notify($strdatabasesuccess, "green");
354 print_continue("upgradesettings.php");
355 print_footer('none');
356 exit;
357 } else {
358 error('Upgrade failed! (Could not update version in config table)');
360 /// Main upgrade not success
361 } else {
362 notify('Main Upgrade failed! See lib/db/upgrade.php');
363 print_continue('index.php?confirmupgrade=1&amp;confirmrelease=1');
364 print_footer('none');
365 die;
367 upgrade_log_finish();
369 } else if ($version < $CFG->version) {
370 upgrade_log_start();
371 notify("WARNING!!! The code you are using is OLDER than the version that made these databases!");
372 upgrade_log_finish();
374 } else {
375 if (!set_config("version", $version)) {
376 error("A problem occurred inserting current version into databases");
380 /// Updated human-readable release version if necessary
382 if ($release <> $CFG->release) { // Update the release version
383 if (!set_config("release", $release)) {
384 error("ERROR: Could not update release version in database!!");
388 /// Groups install/upgrade is now in core above.
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 course formats and upgrade if necessary
419 upgrade_plugins('format','course/format',"$CFG->wwwroot/$CFG->admin/index.php");
421 /// Check for local database customisations
422 /// first old *.php update and then the new upgrade.php script
423 require_once("$CFG->dirroot/lib/locallib.php");
424 upgrade_local_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
426 /// Check for changes to RPC functions
427 require_once($CFG->dirroot.'/admin/mnet/adminlib.php');
428 upgrade_RPC_functions("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
430 /// Upgrade all plugins for gradebook
431 upgrade_plugins('gradeexport', 'grade/export', "$CFG->wwwroot/$CFG->admin/index.php");
432 upgrade_plugins('gradeimport', 'grade/import', "$CFG->wwwroot/$CFG->admin/index.php");
433 upgrade_plugins('gradereport', 'grade/report', "$CFG->wwwroot/$CFG->admin/index.php");
435 /// Check all message output plugins and upgrade if necessary
436 upgrade_plugins('message','message/output',"$CFG->wwwroot/$CFG->admin/index.php");
439 /// just make sure upgrade logging is properly terminated
440 upgrade_log_finish();
442 unset($_SESSION['installautopilot']);
444 /// Set up the blank site - to be customized later at the end of install.
445 if (! $site = get_site()) {
446 // We are about to create the site "course"
447 require_once($CFG->libdir.'/blocklib.php');
449 $newsite = new object();
450 $newsite->fullname = "";
451 $newsite->shortname = "";
452 $newsite->summary = NULL;
453 $newsite->newsitems = 3;
454 $newsite->numsections = 0;
455 $newsite->category = 0;
456 $newsite->format = 'site'; // Only for this course
457 $newsite->teacher = get_string("defaultcourseteacher");
458 $newsite->teachers = get_string("defaultcourseteachers");
459 $newsite->student = get_string("defaultcoursestudent");
460 $newsite->students = get_string("defaultcoursestudents");
461 $newsite->timemodified = time();
463 if (!$newid = insert_record('course', $newsite)) {
464 error("Serious Error! Could not set up the site!");
466 // make sure course context exists
467 get_context_instance(CONTEXT_COURSE, $newid);
469 // Site created, add blocks for it
470 $page = page_create_object(PAGE_COURSE_VIEW, $newid);
471 blocks_repopulate_page($page); // Return value not checked because you can always edit later
473 $cat = new object();
474 $cat->name = get_string('miscellaneous');
475 if (!$catid = insert_record('course_categories', $cat)) {
476 error("Serious Error! Could not set up a default course category!");
478 // make sure category context exists
479 get_context_instance(CONTEXT_COURSECAT, $catid);
480 mark_context_dirty('/'.SYSCONTEXTID);
482 redirect('index.php');
485 // initialise default blocks on admin and site page if needed
486 if (empty($CFG->adminblocks_initialised)) {
487 require_once("$CFG->dirroot/$CFG->admin/pagelib.php");
488 require_once($CFG->libdir.'/blocklib.php');
489 page_map_class(PAGE_ADMIN, 'page_admin');
490 $page = page_create_object(PAGE_ADMIN, 0); // there must be some id number
491 blocks_repopulate_page($page);
493 //add admin_tree block to site if not already present
494 if ($admintree = get_record('block', 'name', 'admin_tree')) {
495 $page = page_create_object(PAGE_COURSE_VIEW, SITEID);
496 blocks_execute_action($page, blocks_get_by_page($page), 'add', (int)$admintree->id, false, false);
497 if ($admintreeinstance = get_record('block_instance', 'pagetype', $page->type, 'pageid', SITEID, 'blockid', $admintree->id)) {
498 blocks_execute_action($page, blocks_get_by_page($page), 'moveleft', $admintreeinstance, false, false);
502 set_config('adminblocks_initialised', 1);
505 /// Define the unique site ID code if it isn't already
506 if (empty($CFG->siteidentifier)) { // Unique site identification code
507 set_config('siteidentifier', random_string(32).$_SERVER['HTTP_HOST']);
510 /// Check if the guest user exists. If not, create one.
511 if (! record_exists("user", "username", "guest")) {
512 if (! $guest = create_guest_record()) {
513 notify("Could not create guest user record !!!");
518 /// Set up the admin user
519 if (empty($CFG->rolesactive)) {
520 build_context_path();
521 create_admin_user();
524 /// Check for valid admin user
525 require_login();
527 $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
529 require_capability('moodle/site:config', $context);
531 /// check that site is properly customized
532 if (empty($site->shortname)) {
533 // probably new installation - lets return to frontpage after this step
534 redirect('upgradesettings.php?return=site');
537 /// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders
539 if (!empty($id)) {
540 if ($id == $CFG->siteidentifier) {
541 set_config('registered', time());
545 $adminroot = admin_get_root();
547 /// Check if there are any new admin settings which have still yet to be set
548 if( any_new_admin_settings( $adminroot ) ){
549 redirect('upgradesettings.php');
552 /// Everything should now be set up, and the user is an admin
554 /// Print default admin page with notifications.
556 admin_externalpage_setup('adminnotifications');
557 admin_externalpage_print_header();
559 /// Deprecated database! Warning!!
560 if (!empty($CFG->migrated_to_new_db)) {
561 print_box(print_string('dbmigrationdeprecateddb', 'admin'), 'generalbox adminwarning');
564 /// Check for any special upgrades that might need to be run
565 if (!empty($CFG->upgrade)) {
566 print_box(get_string("upgrade$CFG->upgrade", "admin", "$CFG->wwwroot/$CFG->admin/upgrade$CFG->upgrade.php"));
569 if (ini_get_bool('register_globals') && !ini_get_bool('magic_quotes_gpc')) {
570 print_box(get_string('globalsquoteswarning', 'admin'), 'generalbox adminwarning');
573 if (is_dataroot_insecure()) {
574 print_box(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot), 'generalbox adminwarning');
577 /// If no recently cron run
578 $lastcron = get_field_sql('SELECT max(lastcron) FROM ' . $CFG->prefix . 'modules');
579 if (time() - $lastcron > 3600 * 24) {
580 $strinstallation = get_string('installation', 'install');
581 $helpbutton = helpbutton('install', $strinstallation, 'moodle', true, false, '', true);
582 print_box(get_string('cronwarning', 'admin')."&nbsp;".$helpbutton, 'generalbox adminwarning');
585 /// Print multilang upgrade notice if needed
586 if (empty($CFG->filter_multilang_converted)) {
587 print_box(get_string('multilangupgradenotice', 'admin'), 'generalbox adminwarning');
590 /// Alert if we are currently in maintenance mode
591 if (file_exists($CFG->dataroot.'/1/maintenance.html')) {
592 print_box(get_string('sitemaintenancewarning', 'admin'), 'generalbox adminwarning');
596 /// Print slightly annoying registration button every six months ;-)
597 /// You can set the "registered" variable to something far in the future
598 /// if you really want to prevent this. eg 9999999999
599 if (!isset($CFG->registered) || $CFG->registered < (time() - 3600*24*30*6)) {
600 $options = array();
601 $options['sesskey'] = $USER->sesskey;
602 print_box_start('generalbox adminwarning');
603 print_string('pleaseregister', 'admin');
604 print_single_button('register.php', $options, get_string('registration'));
605 print_box_end();
606 $registrationbuttonshown = true;
609 //////////////////////////////////////////////////////////////////////////////////////////////////
610 //// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
611 $copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
612 '<a href="http://docs.moodle.org/en/Release">'.$CFG->release.'</a> ('.$CFG->version.')<br />'.
613 'Copyright &copy; 1999 onwards, Martin Dougiamas<br />'.
614 'and <a href="http://docs.moodle.org/en/Credits">many other contributors</a>.<br />'.
615 '<a href="http://docs.moodle.org/en/License">GNU Public License</a>';
616 print_box($copyrighttext, 'copyright');
617 //////////////////////////////////////////////////////////////////////////////////////////////////
620 if (empty($registrationbuttonshown)) {
621 $options = array();
622 $options['sesskey'] = $USER->sesskey;
623 print_single_button('register.php', $options, get_string('registration'));
627 admin_externalpage_print_footer();