mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-34685 auth Allow auth plugins to override user signup form
This commit is contained in:
parent
7b3c1c9d8c
commit
57d38adc58
@ -8,6 +8,8 @@ required changes in code:
|
||||
* use role_get_name() or role_fix_names() if you need any role names, using role.name
|
||||
directly from database is not correct any more
|
||||
|
||||
optional - no changes needed:
|
||||
* add support for custom user signup form - see auth_plugin_base::signup_form() function
|
||||
|
||||
=== 2.2 ===
|
||||
|
||||
|
@ -278,6 +278,18 @@ class auth_plugin_base {
|
||||
//override when can signup
|
||||
print_error('mustbeoveride', 'debug', '', 'user_signup()' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a form to capture user details for account creation.
|
||||
* This is used in /login/signup.php.
|
||||
* @return moodle_form A form which edits a record from the user table.
|
||||
*/
|
||||
function signup_form() {
|
||||
global $CFG;
|
||||
|
||||
require_once($CFG->dirroot.'/login/signup_form.php');
|
||||
return new login_signup_form(null, null, 'post', '', array('autocomplete'=>'on'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if plugin allows confirming of new users.
|
||||
|
@ -25,8 +25,6 @@
|
||||
*/
|
||||
|
||||
require('../config.php');
|
||||
require_once('signup_form.php');
|
||||
|
||||
|
||||
if (empty($CFG->registerauth)) {
|
||||
print_error('notlocalisederrormessage', 'error', '', 'Sorry, you may not use this page.');
|
||||
@ -43,7 +41,7 @@ $PAGE->https_required();
|
||||
$PAGE->set_url('/login/signup.php');
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
$mform_signup = new login_signup_form(null, null, 'post', '', array('autocomplete'=>'on'));
|
||||
$mform_signup = $authplugin->signup_form();
|
||||
|
||||
if ($mform_signup->is_cancelled()) {
|
||||
redirect(get_login_url());
|
||||
|
Loading…
x
Reference in New Issue
Block a user