Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct()

public function showRegistrationForm(Request $request): View
{
if (config('auth.user_registration_form_enabled') === false) {
if (config('cdash.user_registration_form_enabled') === false) {
abort(404, 'Registration via form is disabled');
}
// We can route a user here with our form pre-populated
Expand Down Expand Up @@ -117,7 +117,7 @@ protected function registered(Request $request, $user)
*/
public function register(Request $request): Response|RedirectResponse
{
if (config('auth.user_registration_form_enabled') === false) {
if (config('cdash.user_registration_form_enabled') === false) {
return response('Registration via form is disabled', 404);
}
try {
Expand Down
3 changes: 0 additions & 3 deletions config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
use App\Models\User;

return [
// Whether or not "normal" username+password authentication is enabled
'user_registration_form_enabled' => env('USER_REGISTRATION_FORM_ENABLED', true),

/*
|--------------------------------------------------------------------------
| Authentication Defaults
Expand Down
2 changes: 2 additions & 0 deletions config/cdash.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
'project_admin_registration_form_enabled' => env('PROJECT_ADMIN_REGISTRATION_FORM_ENABLED', true),
// Text displayed at the top of all pages. Accepts inline markdown (links, bold, italics).
'global_banner' => env('GLOBAL_BANNER'),
// Whether or not new CDash users can register email+password accounts
'user_registration_form_enabled' => env('USER_REGISTRATION_FORM_ENABLED', true),
// Whether or not "normal" username+password authentication is enabled
'username_password_authentication_enabled' => env('USERNAME_PASSWORD_AUTHENTICATION_ENABLED', true),
'ldap_enabled' => env('CDASH_AUTHENTICATION_PROVIDER') === 'ldap',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
$logoid = $project->ImageId;
}

$hideRegistration = config('auth.user_registration_form_enabled') === false;
$hideRegistration = config('cdash.user_registration_form_enabled') === false;

$currentDateString = now()->toDateString();

Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

$routeList = ['verify' => true];

if (config('auth.user_registration_form_enabled') === false) {
if (config('cdash.user_registration_form_enabled') === false) {
$routeList['register'] = false;
}
Auth::routes($routeList);
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/LoginAndRegistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public function testRegisterUserWhenDisabled(): void
{
// Create a user by sending proper data

config(['auth.user_registration_form_enabled' => false]);
config(['cdash.user_registration_form_enabled' => false]);
$post_data = [
'fname' => 'Test',
'lname' => 'User',
Expand All @@ -370,7 +370,7 @@ public function testDisabledRegistrationForm(): void
{
// Disable username+password authentication and verify that the
// form is no longer displayed.
config(['auth.user_registration_form_enabled' => false]);
config(['cdash.user_registration_form_enabled' => false]);
$response = $this->get('/register');
$response->assertStatus(404);
}
Expand Down