mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
registration MDL-19313 implement password for private hub
This commit is contained in:
parent
b2aea6c674
commit
4b1acb3ae8
5 changed files with 29 additions and 13 deletions
|
@ -46,9 +46,8 @@ $token = optional_param('token', '', PARAM_ALPHANUM);
|
|||
$hub = new hub();
|
||||
|
||||
//check that the token/url couple exist and is not confirmed
|
||||
$registeredhub = $hub->get_registeredhub($url);
|
||||
if (!empty($registeredhub) and $registeredhub->confirmed == 0
|
||||
and $registeredhub->token == $token) {
|
||||
$registeredhub = $hub->get_unconfirmedhub($url);
|
||||
if (!empty($registeredhub) and $registeredhub->token == $token) {
|
||||
|
||||
$registeredhub->token = $newtoken;
|
||||
$registeredhub->confirmed = 1;
|
||||
|
@ -58,7 +57,7 @@ if (!empty($registeredhub) and $registeredhub->confirmed == 0
|
|||
echo $OUTPUT->notification(get_string('registrationconfirmed', 'hub'), 'notifysuccess');
|
||||
echo $OUTPUT->footer();
|
||||
} else {
|
||||
throw new moodle_exception('wrongtoken');
|
||||
throw new moodle_exception('wrongtoken', 'hub', $CFG->wwwroot.'/admin/registration/index.php');
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue