{"record":{"id":"c032d8d1f4b4c2c1","repo":"moodle/moodle","slug":"notlocalisederrormessage","errorCode":null,"errorMessage":"notlocalisederrormessage","messagePattern":"notlocalisederrormessage","errorType":"exception","errorClass":"moodle_exception","httpStatus":null,"severity":"error","filePath":"public/login/signup.php","lineNumber":33,"sourceCode":"// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * user signup page.\n *\n * @package    core\n * @subpackage auth\n * @copyright  1999 onwards Martin Dougiamas  http://dougiamas.com\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nrequire('../config.php');\nrequire_once($CFG->dirroot . '/user/editlib.php');\nrequire_once($CFG->libdir . '/authlib.php');\nrequire_once('lib.php');\n\nif (!$authplugin = signup_is_enabled()) {\n    throw new \\moodle_exception('notlocalisederrormessage', 'error', '', 'Sorry, you may not use this page.');\n}\n\n$PAGE->set_url('/login/signup.php');\n$PAGE->set_context(context_system::instance());\n\n// If wantsurl is empty or /login/signup.php, override wanted URL.\n// We do not want to end up here again if user clicks \"Login\".\nif (empty($SESSION->wantsurl)) {\n    $SESSION->wantsurl = $CFG->wwwroot . '/';\n} else {\n    $wantsurl = new moodle_url($SESSION->wantsurl);\n    if ($PAGE->url->compare($wantsurl, URL_MATCH_BASE)) {\n        $SESSION->wantsurl = $CFG->wwwroot . '/';\n    }\n}\n\nif (isloggedin() and !isguestuser()) {\n    // Prevent signing up when already logged in.","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/moodle/moodle/blob/48ea8c33227277e916cdd4079dbecef448b37f2c/public/login/signup.php#L15-L51","documentation":"Moodle's signup.php calls signup_is_enabled(); if no auth plugin with signup capability is enabled, it throws \\moodle_exception('notlocalisederrormessage','error','','Sorry, you may not use this page.'). The 'notlocalisederrormessage' language string does not exist in error.php, so Moodle falls back to printing the fourth parameter as the raw message. In effect the page is telling the user that self-registration is disabled.","triggerScenarios":"Visiting /login/signup.php when the site's enabled signup auth plugin is missing or does not support signup: $CFG->registerauth is set to an auth plugin that is disabled, removed after an upgrade, or set to a plugin whose is_signup_enabled() returns false.","commonSituations":"Admins set $CFG->registerauth in config.php to an auth method (e.g. 'cas', 'shibboleth') that isn't enabled under Site administration > Plugins > Authentication; after upgrading Moodle an old registerauth value no longer exists; staging sites copied from production with registerauth pointing at a plugin unavailable locally.","solutions":["Set the correct signup auth: Site administration > Plugins > Authentication > Manage authentication, enable 'Email-based self-registration' (or another signup-capable plugin) and set it as self-registration method.","Remove or fix $CFG->registerauth in config.php if it points at a disabled/nonexistent plugin.","If self-registration is intentionally off, don't link users to /login/signup.php; hide signup links in the theme/auth settings.","For testing, set $CFG->registerauth = 'email' and ensure the 'email' auth plugin is enabled."],"exampleFix":"// before (config.php)\n$CFG->registerauth = 'ldap'; // ldap has no signup / is disabled\n// after\n$CFG->registerauth = 'email'; // and enable Email-based self-registration in admin auth settings","handlingStrategy":"validation","validationCode":"// before linking to signup.php\nconst enabled = await fetch(M.cfg.wwwroot + '/login/signup.php', { method: 'HEAD' });\nif (!enabled.ok) hideSignupLink();\n// or server-side: if (!get_auth_plugin($CFG->registerauth)->is_signup_enabled()) { redirect(new moodle_url('/login/index.php')); }","typeGuard":null,"tryCatchPattern":"// server-side code that may redirect to signup\ntry {\n    require_login();\n} catch (moodle_exception $e) {\n    if (debugging()) debugging('Signup unavailable: ' . $e->getMessage(), DEBUG_DEVELOPER);\n    redirect(new moodle_url('/login/index.php'));\n}","preventionTips":["Keep $CFG->registerauth in sync with an actually enabled auth plugin.","After upgrades, audit registerauth against the installed auth plugins.","Check for enabled signup plugins during deployment health checks.","Only expose signup links when self-registration is enabled in site settings."],"tags":["moodle","configuration","authentication","signup-disabled"],"backgroundTag":"feature-not-enabled","analyzedSha":"48ea8c33227277e916cdd4079dbecef448b37f2c","analyzedAt":"2026-09-14T20:34:48.527Z","contentChangedAt":"2026-09-14T20:34:48.527Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}