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");
}
/// 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 '<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->align = array ("right", "left");
$table->wrap = array ("nowrap", "nowrap");
@ -410,6 +432,7 @@
echo '</td>';
echo '<td align="center" width="33%">';
$options = array();
$options['sesskey'] = $USER->sesskey;
print_single_button('register.php', $options, get_string('registration'));
echo '</td></tr></table>';