diff --git a/auth/oauth2/classes/auth.php b/auth/oauth2/classes/auth.php index bd1fbf7c45b..57887e3c3ba 100644 --- a/auth/oauth2/classes/auth.php +++ b/auth/oauth2/classes/auth.php @@ -151,22 +151,6 @@ class auth extends \auth_plugin_base { return true; } - /** - * Prints a form for configuring this authentication plugin. - * - * This function is called from admin/auth.php, and outputs a full page with - * a form for configuring this plugin. - * - * @param stdClass $config - * @param string $err - * @param array $userfields - */ - public function config_form($config, $err, $userfields) { - include(__DIR__ . "/../config.html"); - - return; - } - /** * Return the userinfo from the oauth handshake. Will only be valid * for the logged in user. diff --git a/auth/oauth2/config.html b/auth/oauth2/config.html deleted file mode 100644 index e7ce6066b3d..00000000000 --- a/auth/oauth2/config.html +++ /dev/null @@ -1,12 +0,0 @@ - -
- -
- - -authtype, $userfields, get_string('auth_fieldlocks_help', 'auth'), false, false); - -?> -
diff --git a/auth/oauth2/settings.php b/auth/oauth2/settings.php new file mode 100644 index 00000000000..51e15b7ebaa --- /dev/null +++ b/auth/oauth2/settings.php @@ -0,0 +1,35 @@ +. + +/** + * Admin settings and defaults. + * + * @package auth_oauth2 + * @copyright 2017 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die; + +if ($ADMIN->fulltree) { + + $warning = $OUTPUT->notification(get_string('createaccountswarning', 'auth_oauth2'), 'warning'); + $settings->add(new admin_setting_heading('auth_oauth2/pluginname', '', $warning)); + + $authplugin = get_auth_plugin($this->name); + display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields, + get_string('auth_fieldlocks_help', 'auth'), false, false); +}