Skip to content

Commit 0e58996

Browse files
committed
Remove collection of emails for self-registered users
1 parent 7e65f1f commit 0e58996

File tree

15 files changed

+38
-65
lines changed

15 files changed

+38
-65
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
final class Version20251130111340 extends AbstractMigration
11+
{
12+
public function getDescription(): string
13+
{
14+
return '';
15+
}
16+
17+
public function up(Schema $schema): void
18+
{
19+
$this->addSql('ALTER TABLE user DROP email');
20+
}
21+
22+
public function down(Schema $schema): void
23+
{
24+
$this->addSql('ALTER TABLE user ADD email VARCHAR(255) DEFAULT NULL COMMENT \'Email address\'');
25+
}
26+
27+
public function isTransactional(): bool
28+
{
29+
return false;
30+
}
31+
}

webapp/src/Controller/API/AccessController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ public function getStatusAction(Request $request): Access
222222
'team',
223223
'roles',
224224
'userid',
225-
'email',
226225
'last_ip',
227226
'enabled',
228227
]

webapp/src/Controller/API/UserController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ protected function addOrUpdateUser(AddUser $addUser, Request $request): Response
361361
$user
362362
->setUsername($addUser->username)
363363
->setName($addUser->name)
364-
->setEmail($addUser->email)
365364
->setIpAddress($addUser->ip)
366365
->setPlainPassword($addUser->password)
367366
->setEnabled($addUser->enabled ?? true);

webapp/src/Controller/Jury/UserController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public function indexAction(): Response
6464
'username' => ['title' => 'username', 'sort' => true, 'default_sort' => true],
6565
'externalid' => ['title' => 'external ID', 'sort' => true],
6666
'name' => ['title' => 'name', 'sort' => true],
67-
'email' => ['title' => 'email', 'sort' => true],
6867
'user_roles' => ['title' => 'roles', 'sort' => true],
6968
'teamid' => ['title' => '', 'sort' => false, 'render' => 'entity_id_badge'],
7069
'team' => ['title' => 'team', 'sort' => true],

webapp/src/DataFixtures/Test/SelfRegisteredUserFixture.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public function load(ObjectManager $manager): void
1515
$user
1616
->setUsername('selfregister')
1717
->setName('selfregistered user for example team')
18-
->setEmail('[email protected]')
1918
->setPlainPassword('demo')
2019
->setTeam($manager->getRepository(Team::class)->findOneBy(['name' => 'exteam']))
2120
->addUserRole($manager->getRepository(Role::class)->findOneBy(['dj_role' => 'team']));

webapp/src/DataTransferObject/AddUser.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class AddUser
1414
public function __construct(
1515
public readonly string $username,
1616
public readonly string $name,
17-
#[OA\Property(format: 'email', nullable: true)]
18-
public readonly ?string $email,
1917
#[OA\Property(nullable: true)]
2018
public readonly ?string $ip,
2119
#[OA\Property(format: 'password', nullable: true)]

webapp/src/DataTransferObject/UpdateUser.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ public function __construct(
1111
public readonly string $id,
1212
string $username,
1313
string $name,
14-
?string $email,
1514
?string $ip,
1615
?string $password,
1716
?bool $enabled,
1817
?string $teamId,
1918
array $roles
2019
) {
21-
parent::__construct($username, $name, $email, $ip, $password, $enabled, $teamId, $roles);
20+
parent::__construct($username, $name, $ip, $password, $enabled, $teamId, $roles);
2221
}
2322
}

webapp/src/Entity/User.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ class User extends BaseApiEntity implements
5858
#[ORM\Column(options: ['comment' => 'Name'])]
5959
private string $name = '';
6060

61-
#[ORM\Column(nullable: true, options: ['comment' => 'Email address'])]
62-
#[Assert\Email]
63-
#[OA\Property(nullable: true)]
64-
#[Serializer\Groups([ARC::GROUP_NONSTRICT])]
65-
private ?string $email = null;
66-
6761
#[ORM\Column(
6862
type: 'decimal',
6963
precision: 32,
@@ -217,17 +211,6 @@ public function getShortDescription(): string
217211
return $this->getName();
218212
}
219213

220-
public function setEmail(?string $email): User
221-
{
222-
$this->email = $email;
223-
return $this;
224-
}
225-
226-
public function getEmail(): ?string
227-
{
228-
return $this->email;
229-
}
230-
231214
public function setLastLogin(string|float|null $lastLogin): User
232215
{
233216
$this->last_login = $lastLogin;

webapp/src/Form/Type/UserRegistrationType.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\DependencyInjection\Attribute\Autowire;
1616
use Symfony\Component\Form\AbstractType;
1717
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
18-
use Symfony\Component\Form\Extension\Core\Type\EmailType;
1918
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
2019
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
2120
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
@@ -27,7 +26,6 @@
2726
use Symfony\Component\Intl\Countries;
2827
use Symfony\Component\OptionsResolver\OptionsResolver;
2928
use Symfony\Component\Validator\Constraints\Callback;
30-
use Symfony\Component\Validator\Constraints\Email;
3129
use Symfony\Component\Validator\Constraints\NotBlank;
3230
use Symfony\Component\Validator\Context\ExecutionContext;
3331

@@ -59,15 +57,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
5957
'autocomplete' => 'name',
6058
],
6159
])
62-
->add('email', EmailType::class, [
63-
'label' => false,
64-
'required' => false,
65-
'attr' => [
66-
'placeholder' => 'Email address (optional)',
67-
'autocomplete' => 'email',
68-
],
69-
'constraints' => new Email(),
70-
])
7160
->add('teamName', TextType::class, [
7261
'label' => false,
7362
'attr' => [

webapp/src/Form/Type/UserType.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
1111
use Symfony\Component\DependencyInjection\Attribute\Autowire;
1212
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
13-
use Symfony\Component\Form\Extension\Core\Type\EmailType;
1413
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
1514
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
1615
use Symfony\Component\Form\Extension\Core\Type\TextType;
@@ -53,12 +52,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
5352
'help' => 'Optional full name for the user.',
5453
'empty_data' => ''
5554
]);
56-
$builder->add('email', EmailType::class, [
57-
'required' => false,
58-
'attr' => [
59-
'autocomplete' => 'user-email',
60-
],
61-
]);
6255
$builder->add('plainPassword', PasswordType::class, [
6356
'required' => false,
6457
'label' => 'Password',

0 commit comments

Comments
 (0)