feat: integrated OAuth2 server

This commit is contained in:
Björn Fromme
2025-04-24 20:28:27 +02:00
parent c418ae6399
commit adbfb49c11
84 changed files with 2542 additions and 312 deletions
+1 -1
View File
@@ -19,4 +19,4 @@ class RegistrationData
#[Assert\NotBlank(message: 'Bitte angeben')]
#[Assert\Email(message: 'Bitte eine gültige E-Mail Adresse angeben', mode: 'strict')]
public ?string $email = null;
}
}
+17 -14
View File
@@ -39,13 +39,13 @@ class ParticipantType extends AbstractType
'label' => 'Vorname',
'attr' => [
'readonly' => false === $personalDataMutable,
]
],
])
->add('lastName', TextType::class, [
'label' => 'Nachname',
'attr' => [
'readonly' => false === $personalDataMutable,
]
],
])
->add('dateOfBirth', BirthdayType::class, [
'label' => 'Geburtsdatum',
@@ -54,7 +54,7 @@ class ParticipantType extends AbstractType
'input' => 'datetime_immutable',
'attr' => [
'readonly' => false === $personalDataMutable,
]
],
])
->add('gender', ChoiceType::class, [
'label' => 'Geschlecht',
@@ -68,7 +68,7 @@ class ParticipantType extends AbstractType
'attr' => [
'readonly' => false === $personalDataMutable,
'style' => false === $personalDataMutable ? 'pointer-events: none' : null,
]
],
])
->add('nationality', CountryType::class, [
'label' => 'Nationalität',
@@ -77,21 +77,21 @@ class ParticipantType extends AbstractType
'attr' => [
'readonly' => false === $personalDataMutable,
'style' => false === $personalDataMutable ? 'pointer-events: none' : null,
]
],
])
->add('email', EmailType::class, [
'label' => 'E-Mail',
'required' => false,
'attr' => [
'readonly' => false === $personalDataMutable,
]
],
])
->add('mobile', TextType::class, [
'label' => 'Telefon (mobil)',
'required' => false,
'attr' => [
'readonly' => false === $personalDataMutable,
]
],
])
->add('height', ChoiceType::class, [
'label' => 'Körpergröße',
@@ -144,7 +144,8 @@ class ParticipantType extends AbstractType
return $service->label;
}
return sprintf('%s (%s €)',
return sprintf(
'%s (%s €)',
$service->label,
number_format($price, 2, ',', '.')
);
@@ -189,8 +190,8 @@ class ParticipantType extends AbstractType
// remove choices only available in booking data and
// which are not mapped to the current participant
if (
Service::SOURCE_TRAVEL === $service->source ||
Service::CATEGORY_ADDITIONAL !== $service->category
Service::SOURCE_TRAVEL === $service->source
|| Service::CATEGORY_ADDITIONAL !== $service->category
) {
return true;
}
@@ -293,7 +294,8 @@ class ParticipantType extends AbstractType
return $pickupLabel;
}
return sprintf('%s %s€',
return sprintf(
'%s %s€',
$pickupLabel,
number_format($price, 2, ',', '.')
);
@@ -308,7 +310,7 @@ class ParticipantType extends AbstractType
},
'attr' => [
'readonly' => false === $options['pickups_mutable'],
]
],
]);
})
->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($options) {
@@ -331,8 +333,9 @@ class ParticipantType extends AbstractType
// forcibly select mandatory services that potentially have been disabled in PRE_SET_DATA
$mandatoryServices = array_filter($options['selectable_services'], function (Service $service) use ($form) {
$participantIndex = $form->getData()->index;
return true === $service->mandatory ||
(Service::SOURCE_BOOKING === $service->source && in_array($participantIndex, $service->mapping));
return true === $service->mandatory
|| (Service::SOURCE_BOOKING === $service->source && in_array($participantIndex, $service->mapping));
});
if (0 < count($mandatoryServices)) {
-2
View File
@@ -4,8 +4,6 @@ namespace App\Form;
use App\BusProNet\Form\CountryType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\BirthdayType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
+1 -1
View File
@@ -43,4 +43,4 @@ class RegistrationType extends AbstractType
'anti_xss' => true,
]);
}
}
}