From 249bdbe3cfd6f6e936eb64dae90201c3e790c963 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 17 Feb 2004 14:11:19 +0000 Subject: [PATCH] Don't allow signup page to work unless necessary --- login/signup.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/login/signup.php b/login/signup.php index ef655dda37..c5a740be29 100644 --- a/login/signup.php +++ b/login/signup.php @@ -3,6 +3,10 @@ require_once("../config.php"); require_once("../auth/$CFG->auth/lib.php"); + if ($CFG->auth != 'email' and (empty($CFG->auth_user_create) or !(function_exists('auth_user_create'))) ) { + error("Sorry, you may not use this page."); + } + if ($user = data_submitted()) { $user->firstname = strip_tags($user->firstname); @@ -19,7 +23,7 @@ $user->lang = current_language(); $user->firstaccess = time(); $user->secret = random_string(15); - if (isset($CFG->auth_user_create) and $CFG->auth_user_create==1 and function_exists('auth_user_create') ){ + if (!empty($CFG->auth_user_create) and function_exists('auth_user_create') ){ if (! auth_user_exists($user->username)) { if (! auth_user_create($user,$plainpass)) { error("Could not add user to authentication module!"); -- 2.39.5