Merged from stable

This commit is contained in:
moodler 2005-05-26 14:46:28 +00:00
parent fba0c5b99c
commit a2a3c59019
2 changed files with 24 additions and 0 deletions

View file

@ -291,6 +291,14 @@
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php"); 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 /// At this point everything is set up and the user is an admin, so print menu
$stradministration = get_string("administration"); $stradministration = get_string("administration");
@ -315,6 +323,20 @@
print_simple_box(get_string('sitemaintenancewarning', 'admin') , 'center'); 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 '<div align="center">';
print_string('pleaseregister', 'admin');
print_single_button('register.php', $options, get_string('registration'));
echo '</div>';
print_simple_box_end();
}
$table->tablealign = "right"; $table->tablealign = "right";
$table->align = array ("right", "left"); $table->align = array ("right", "left");
$table->wrap = array ("nowrap", "nowrap"); $table->wrap = array ("nowrap", "nowrap");
@ -410,6 +432,7 @@
echo '</td>'; echo '</td>';
echo '<td align="center" width="33%">'; echo '<td align="center" width="33%">';
$options = array();
$options['sesskey'] = $USER->sesskey; $options['sesskey'] = $USER->sesskey;
print_single_button('register.php', $options, get_string('registration')); print_single_button('register.php', $options, get_string('registration'));
echo '</td></tr></table>'; echo '</td></tr></table>';

View file

@ -106,6 +106,7 @@ $string['importtimezonescount'] = '$a->count entries imported from $a->source';
$string['importtimezonesfailed'] = 'No sources found! (Bad news)'; $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['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['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['sitemaintenance'] = 'The site is undergoing maintenance and is currently not available';
$string['sitemaintenancemode'] = 'Maintenance mode'; $string['sitemaintenancemode'] = 'Maintenance mode';
$string['sitemaintenanceon'] = 'Your site is currently in maintenance mode (only admins can log in or use the site).'; $string['sitemaintenanceon'] = 'Your site is currently in maintenance mode (only admins can log in or use the site).';