diff --git a/admin/index.php b/admin/index.php index 36b90ef64a7..c78d9df78f7 100644 --- a/admin/index.php +++ b/admin/index.php @@ -291,6 +291,14 @@ error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php"); } +/// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders + + if (!empty($_GET['id'])) { + if ($_GET['id'] == $CFG->siteidentifier) { + set_config('registered', time()); + } + } + /// At this point everything is set up and the user is an admin, so print menu $stradministration = get_string("administration"); @@ -315,6 +323,20 @@ print_simple_box(get_string('sitemaintenancewarning', 'admin') , 'center'); } +/// Print slightly annoying registration button every six months ;-) +/// You can set the "registered" variable to something far in the future +/// if you really want to prevent this. eg 9999999999 + if (!isset($CFG->registered) || $CFG->registered < (time() - 3600*24*30*6)) { + $options = array(); + $options['sesskey'] = $USER->sesskey; + print_simple_box_start('center'); + echo '
'; + print_string('pleaseregister', 'admin'); + print_single_button('register.php', $options, get_string('registration')); + echo '
'; + print_simple_box_end(); + } + $table->tablealign = "right"; $table->align = array ("right", "left"); $table->wrap = array ("nowrap", "nowrap"); @@ -410,6 +432,7 @@ echo ''; echo ''; + $options = array(); $options['sesskey'] = $USER->sesskey; print_single_button('register.php', $options, get_string('registration')); echo ''; diff --git a/lang/en/admin.php b/lang/en/admin.php index 7b6eab1173e..d481eb2c22c 100755 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -106,6 +106,7 @@ $string['importtimezonescount'] = '$a->count entries imported from $a->source'; $string['importtimezonesfailed'] = 'No sources found! (Bad news)'; $string['nodstpresetsexist'] = 'DST support is disabled for all users because there are no DST presets defined. You can define some presets using the button below.'; $string['optionalmaintenancemessage'] = 'Optional maintenance messsage'; +$string['pleaseregister'] = 'Please register your site to remove this button'; $string['sitemaintenance'] = 'The site is undergoing maintenance and is currently not available'; $string['sitemaintenancemode'] = 'Maintenance mode'; $string['sitemaintenanceon'] = 'Your site is currently in maintenance mode (only admins can log in or use the site).';