registration MDL-24215 fix navigation + crumb trail + hardcoded admin folder

This commit is contained in:
jerome mouneyrac
2010-09-17 02:53:49 +00:00
parent c7bb34b626
commit a0a036ff1d
+8 -11
View File
@@ -36,7 +36,7 @@
require('../../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->dirroot . '/admin/registration/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
$newtoken = optional_param('newtoken', '', PARAM_ALPHANUM);
$url = optional_param('url', '', PARAM_URL);
@@ -44,16 +44,11 @@ $hubname = optional_param('hubname', '', PARAM_TEXT);
$token = optional_param('token', '', PARAM_TEXT);
$error = optional_param('error', '', PARAM_ALPHANUM);
$PAGE->navbar->ignore_active(true);
$PAGE->navbar->add(get_string('administrationsite'));
$PAGE->navbar->add(get_string('registration'),
new moodle_url('/admin/registration/index.php'));
$PAGE->navbar->add(get_string('registrationconfirmed', 'hub'));
admin_externalpage_setup('siteregistrationconfirmed');
admin_externalpage_setup('registrationindex');
if (!empty($error) and $error == 'urlalreadyexist') {
throw new moodle_exception('urlalreadyregistered', 'hub', $CFG->wwwroot . '/admin/registration/index.php');
throw new moodle_exception('urlalreadyregistered', 'hub',
$CFG->wwwroot . '/' . $CFG->admin . '/registration/index.php');
}
//check that we are waiting a confirmation from this hub, and check that the token is correct
@@ -70,7 +65,8 @@ if (!empty($registeredhub) and $registeredhub->token == $token) {
$registeredhub->hubname = $hubname;
$registrationmanager->update_registeredhub($registeredhub);
$notificationmessage = $OUTPUT->notification(get_string('registrationconfirmedon', 'hub', $hublink), 'notifysuccess');
$notificationmessage = $OUTPUT->notification(
get_string('registrationconfirmedon', 'hub', $hublink), 'notifysuccess');
echo $notificationmessage;
@@ -83,7 +79,8 @@ if (!empty($registeredhub) and $registeredhub->token == $token) {
echo $OUTPUT->footer();
} else {
throw new moodle_exception('wrongtoken', 'hub', $CFG->wwwroot . '/admin/registration/index.php');
throw new moodle_exception('wrongtoken', 'hub',
$CFG->wwwroot . '/' . $CFG->admin . '/registration/index.php');
}