set_url('/mod/sloodle/login/sl_welcome_reg.php'); $PAGE->set_context(context_course::instance(SITEID, IGNORE_MISSING)); // Display the page header sloodle_print_header_simple(get_string('welcometosloodle', 'sloodle'), " ", get_string('welcometosloodle', 'sloodle'), "", "", true); // Process the request data $sloodle = new SloodleSession(); // Check parameters $sloodleuuid = required_param('sloodleuuid', PARAM_TEXT); $sloodlelst = required_param('sloodlelst', PARAM_TEXT); $sloodlechannel = optional_param('sloodlechannel', NULL, PARAM_RAW); $sloodlecourseid = optional_param('sloodlecourseid', NULL, PARAM_INT); // Attempt to find a pending avatar entry which matches the given details $pa = sloodle_get_record('sloodle_pending_avatars', 'uuid', $sloodleuuid, 'lst', $sloodlelst); if (!$pa) { ?>

user->add_linked_avatar($USER->id, $sloodleuuid, $pa->avname)) { // Failed ?>

?", array($USER->id, $sloodleuuid)); /// /// END MOODLE-SPECIFIC /// /// echo "
\n"; echo get_string('welcometosloodle','sloodle').', '.$pa->avname.'

'.get_string('userlinksuccessful','sloodle'); echo "
\n"; // If the object passed us a channel parameter, we'll use it to tell the object that the authentication is done. // (Parameter name: sloodlechannel) if (is_string($sloodlechannel) && !empty($sloodlechannel)) { flush(); // XMLRPC messages going into SL strip \n, so we use \\n instead $sloodle->response->set_line_separator("\\n"); // Prepare a response as a string $str = ''; $sloodle->response->set_status_code(1); $sloodle->response->set_status_descriptor('USER_AUTH'); $sloodle->response->add_data_line('User has been successfully registered.'); $sloodle->response->render_to_string($str); // Send the message $xmlrpcresult = sloodle_send_xmlrpc_message($channel, 0, $str); if (!$xmlrpcresult) { echo '
'; echo 'ERROR: Unable to tell the object that sent you here that you have been authenticated.'; echo '
'; } } // We we asked to enrol the user as well? if ($sloodlecourseid != NULL) { echo "


"; redirect("{$CFG->wwwroot}/course/enrol.php?id=$sloodlecourseid", get_string('nowenrol','sloodle'), 3); } sloodle_print_footer(); exit();