MDL-11401 - This simplifies the code and makes the registration page a bit more clear & coherent. Also fixes an issue where the $id was mangled when coming back from moodle.org registration.

This commit is contained in:
scyrma
2007-11-15 02:02:12 +00:00
parent 59a24c227e
commit 42cf57fb26
2 changed files with 16 additions and 23 deletions
+14 -22
View File
@@ -25,7 +25,7 @@
require_once($CFG->libdir.'/adminlib.php'); // Contains various admin-only functions
require_once($CFG->libdir.'/ddllib.php'); // Install/upgrade related db functions
$id = optional_param('id', '', PARAM_ALPHANUM);
$id = optional_param('id', '', PARAM_TEXT);
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
$confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL);
$agreelicense = optional_param('agreelicense', 0, PARAM_BOOL);
@@ -605,18 +605,19 @@
}
/// 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_box_start('generalbox adminwarning');
print_string('pleaseregister', 'admin');
print_single_button('register.php', $options, get_string('registration'));
print_box_end();
$registrationbuttonshown = true;
/// Print slightly annoying registration button
$options = array();
$options['sesskey'] = $USER->sesskey;
print_box_start('generalbox adminwarning');
if(!isset($CFG->registered)) {
print_string('pleaseregister', 'admin');
}
else { /* if (isset($CFG->registered) && $CFG->registered < (time() - 3600*24*30*6)) { */
print_string('pleaserefreshregistration', 'admin', userdate($CFG->registered));
}
print_single_button('register.php', $options, get_string('registration'));
print_box_end();
//////////////////////////////////////////////////////////////////////////////////////////////////
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
@@ -628,15 +629,6 @@
print_box($copyrighttext, 'copyright');
//////////////////////////////////////////////////////////////////////////////////////////////////
if (empty($registrationbuttonshown)) {
$options = array();
$options['sesskey'] = $USER->sesskey;
print_single_button('register.php', $options, get_string('registration'));
}
admin_externalpage_print_footer();
?>
?>
+2 -1
View File
@@ -478,6 +478,7 @@ $string['pgcluster'] = 'PostgreSQL Cluster';
$string['pgclusterdescription'] = 'PostgreSQL version/cluster parameter for command line operations. If you only have one postgresql on your system or you are not sure what this is, leave this blank.';
$string['php50restricted'] = 'PHP 5.0.x has a number of known problems, please upgrade to 5.1.x or downgrade to 4.3.x or 4.4.x';
$string['pleaseregister'] = 'Please register your site to remove this button';
$string['pleaserefreshregistration'] = 'Your site has been registered with moodle.org, please consider updating the registration if significant changes happened since your last update, on $a';
$string['plugins'] = 'Modules';
$string['profilecategory'] = 'Category';
$string['profilecategoryname'] = 'Category name (must be unique)';
@@ -676,4 +677,4 @@ $string['uuupdatetype'] = 'Existing user details';
$string['validateerror'] = 'This value was not valid:';
$string['xmlstrictheaders'] = 'XML strict headers';
?>
?>