}
-/// 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 ///
$copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
// register.php - allows admin to register their site on moodle.org
require_once('../config.php');
+ require_once($CFG->libdir.'/adminlib.php');
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
+
+ admin_externalpage_setup('adminregistration');
+
if (!$site = get_site()) {
redirect("index.php");
}
- if (!confirm_sesskey()) {
- print_error('confirmsesskeybad', 'error');
- }
-
if (!$admin = get_admin()) {
print_error('noadmins', 'error');
}
set_config('siteidentifier', random_string(32).$_SERVER['HTTP_HOST']);
}
+/// Print the header stuff
+ admin_externalpage_print_header();
/// Print headings
$navlinks[] = array('name' => $stradministration, 'link' => "../$CFG->admin/index.php", 'type' => 'misc');
$navlinks[] = array('name' => $strregistration, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
- print_header("$site->shortname: $strregistration", $site->fullname, $navigation);
print_heading($strregistration);
FROM {role_capabilities} rc,
{role_assignments} ra,
{user} u
- WHERE (rc.capability = 'moodle/course:update' or rc.capability='moodle/site:doanything')
+ WHERE (rc.capability = ? or rc.capability = ?)
AND rc.roleid = ra.roleid
AND u.id = ra.userid";
- $count = $DB->count_records_sql($sql);
+ $count = $DB->count_records_sql($sql, array('moodle/course:update', 'moodle/site:doanything'));
echo get_string("teachers").": ".$count;
echo "<input type=\"hidden\" name=\"courseupdaters\" value=\"$count\" />\n";
echo '<br />';
echo "</form>\n";
- print_footer();
-
-?>
+/// Print footer
+ admin_externalpage_print_footer();
get_string('configmemcachedpconn', 'admin'), 0,
array( '0' => get_string('no'),
'1' => get_string('yes'))));
+$ADMIN->add('server', new admin_externalpage('adminregistration', get_string('registration','admin'), "$CFG->wwwroot/$CFG->admin/register.php"));
+
$ADMIN->add('server', $temp);
$dbfamily = $DB->get_dbfamily();
$ADMIN->add('root', new admin_externalpage('adminnotifications', get_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
+// Show the annoying registration button if registration hasn't been done or is 6 months old (15552000 seconds) MDL-17429
+if (empty($CFG->registered) || ($CFG->registered < (time() - 15552000))) {
+ $ADMIN->add('root', new admin_externalpage('adminregistration', get_string('registration','admin'), "$CFG->wwwroot/$CFG->admin/register.php"));
+}
+
// hidden upgrade script
$ADMIN->add('root', new admin_externalpage('upgradesettings', get_string('upgradesettings', 'admin'), "$CFG->wwwroot/$CFG->admin/upgradesettings.php", 'moodle/site:config', true));
if ($hassiteconfig) {
- $optionalsubsystems = new admin_settingpage('optionalsubsystems', get_string('optionalsubsystems', 'admin'));
+ $optionalsubsystems = new admin_settingpage('optionalsubsystems', get_string('advancedfeatures', 'admin'));
$ADMIN->add('root', $optionalsubsystems);
}
$string['adminseesall'] = 'Admins See All';
$string['adminseesallevents'] = 'Administrators see all events';
$string['adminseesownevents'] = 'Administrators are just like other users';
+$string['advancedfeatures'] = 'Advanced features';
$string['allowcategorythemes'] = 'Allow category themes';
$string['allowcoursethemes'] = 'Allow course themes';
$string['allowdeletes'] = 'Allow deletes';
$string['opensslrecommended'] = 'Installing the optional OpenSSL library is highly recommended -- it enables Moodle Networking functionality.';
$string['opentogoogle'] = 'Open to Google';
$string['optionalmaintenancemessage'] = 'Optional maintenance message';
-$string['optionalsubsystems'] = 'Optional subsystems';
$string['order1'] = 'First';
$string['order2'] = 'Second';
$string['order3'] = 'Third';
$string['rcachettl'] = 'Record cache TTL';
$string['recaptchapublickey'] = 'ReCAPTCHA public key';
$string['recaptchaprivatekey'] = 'ReCAPTCHA private key';
+$string['registration'] = 'Registration';
$string['releasenoteslink'] = 'For information about this version of Moodle, please see the online <a target=\"_blank\" href=\"$a\">Release Notes</a>';
$string['remotelangnotavailable'] = 'Because Moodle can not connect to download.moodle.org, we are unable to do language pack installation automatically. Please download the appropriate zip file(s) from the list below, copy them to your $a directory and unzip them manually.';
$string['renameerrors'] = 'Rename errors';