Skip to content

Commit

Permalink
Merged from stable
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed May 26, 2005
1 parent fba0c5b commit a2a3c59
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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>';
Expand Down
1 change: 1 addition & 0 deletions lang/en/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
$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).';
Expand Down

0 comments on commit a2a3c59

Please sign in to comment.