Skip to content

Commit

Permalink
MDL-51827 account confirm: take users to their dashboard
Browse files Browse the repository at this point in the history
This is an old bit of UI inconsistency. For some reason it used to take
people to the list of all courses. Given modern Moodle usability
conventions, that does not really make sense any more.
  • Loading branch information
timhunt committed Aug 22, 2017
1 parent 27466d7 commit e95fe51
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions login/confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

require('../config.php');
require(__DIR__ . '/../config.php');
require(__DIR__ . '/lib.php');
require_once($CFG->libdir . '/authlib.php');

$data = optional_param('data', '', PARAM_RAW); // Formatted as: secret/username
Expand Down Expand Up @@ -61,7 +62,7 @@
echo $OUTPUT->header();
echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter');
echo "<p>".get_string("alreadyconfirmed")."</p>\n";
echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses'));
echo $OUTPUT->single_button(core_login_get_return_url(), get_string('courses'));
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
exit;
Expand All @@ -78,16 +79,6 @@
complete_user_login($user);

\core\session\manager::apply_concurrent_login_limit($user->id, session_id());

// Check where to go, $redirect has a higher preference.
if (empty($redirect) and !empty($SESSION->wantsurl) ) {
$redirect = $SESSION->wantsurl;
unset($SESSION->wantsurl);
}

if (!empty($redirect)) {
redirect($redirect);
}
}

$PAGE->navbar->add(get_string("confirmed"));
Expand All @@ -97,7 +88,7 @@
echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter');
echo "<h3>".get_string("thanks").", ". fullname($USER) . "</h3>\n";
echo "<p>".get_string("confirmed")."</p>\n";
echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses'));
echo $OUTPUT->single_button(core_login_get_return_url(), get_string('continue'));
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
exit;
Expand Down

0 comments on commit e95fe51

Please sign in to comment.