Skip to content

Commit

Permalink
registration MDL-24215 fix navigation + crumb trail + hardcoded admin…
Browse files Browse the repository at this point in the history
… folder
  • Loading branch information
mouneyrac committed Sep 17, 2010
1 parent c7bb34b commit a0a036f
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions admin/registration/confirmregistration.php
Expand Up @@ -36,24 +36,19 @@

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);
$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
Expand All @@ -70,7 +65,8 @@
$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;

Expand All @@ -83,7 +79,8 @@

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');
}


0 comments on commit a0a036f

Please sign in to comment.