Merge branch 'MDL-58836-master' of git://github.com/damyon/moodle
authorDan Poltawski <dan@moodle.com>
Wed, 10 May 2017 05:56:42 +0000 (06:56 +0100)
committerDan Poltawski <dan@moodle.com>
Wed, 10 May 2017 05:56:42 +0000 (06:56 +0100)
auth/classes/output/login.php
login/signup.php

index fcb42b7..8bdf91d 100644 (file)
@@ -128,7 +128,7 @@ class login implements renderable, templatable {
         $data->error = $this->error;
         $data->forgotpasswordurl = $this->forgotpasswordurl->out(false);
         $data->hasidentityproviders = !empty($this->identityproviders);
-        $data->hasinstructions = !empty($this->instructions);
+        $data->hasinstructions = !empty($this->instructions) || $this->cansignup;
         $data->identityproviders = $identityproviders;
         list($data->instructions, $data->instructionsformat) = external_format_text($this->instructions, FORMAT_MOODLE,
             context_system::instance()->id);
index e145180..dc6774d 100644 (file)
@@ -97,5 +97,17 @@ $PAGE->set_heading($SITE->fullname);
 
 echo $OUTPUT->header();
 
-echo $OUTPUT->render($mform_signup);
+if ($mform_signup instanceof renderable) {
+    // Try and use the renderer from the auth plugin if it exists.
+    try {
+        $renderer = $PAGE->get_renderer('auth_' . $authplugin->authtype);
+    } catch (coding_exception $ce) {
+        // Fall back on the general renderer.
+        $renderer = $OUTPUT;
+    }
+    echo $renderer->render($mform_signup);
+} else {
+    // Fall back for auth plugins not using renderables.
+    $mform_signup->display();
+}
 echo $OUTPUT->footer();