Skip to content
Open
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
1 change: 0 additions & 1 deletion webapp/migrations/Version20190803123217.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ protected function createTables()
`userid` int(4) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique ID',
`username` varchar(255) NOT NULL COMMENT 'User login name',
`name` varchar(255) NOT NULL COMMENT 'Name',
`email` varchar(255) DEFAULT NULL COMMENT 'Email address',
`last_login` decimal(32,9) unsigned DEFAULT NULL COMMENT 'Time of last successful login',
`first_login` decimal(32,9) unsigned DEFAULT NULL COMMENT 'Time of first login',
`last_ip_address` varchar(255) DEFAULT NULL COMMENT 'Last IP address of successful login',
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/AccessController.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ public function getStatusAction(Request $request): Access
'team',
'roles',
'userid',
'email',
'last_ip',
'enabled',
]
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ protected function addOrUpdateUser(AddUser $addUser, Request $request): Response
$user
->setUsername($addUser->username)
->setName($addUser->name)
->setEmail($addUser->email)
->setIpAddress($addUser->ip)
->setPlainPassword($addUser->password)
->setEnabled($addUser->enabled ?? true);
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/Jury/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public function indexAction(): Response
'username' => ['title' => 'username', 'sort' => true, 'default_sort' => true],
'externalid' => ['title' => 'external ID', 'sort' => true],
'name' => ['title' => 'name', 'sort' => true],
'email' => ['title' => 'email', 'sort' => true],
'user_roles' => ['title' => 'roles', 'sort' => true],
'teamid' => ['title' => '', 'sort' => false, 'render' => 'entity_id_badge'],
'team' => ['title' => 'team', 'sort' => true],
Expand Down
1 change: 0 additions & 1 deletion webapp/src/DataFixtures/Test/SelfRegisteredUserFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public function load(ObjectManager $manager): void
$user
->setUsername('selfregister')
->setName('selfregistered user for example team')
->setEmail('[email protected]')
->setPlainPassword('demo')
->setTeam($manager->getRepository(Team::class)->findOneBy(['name' => 'exteam']))
->addUserRole($manager->getRepository(Role::class)->findOneBy(['dj_role' => 'team']));
Expand Down
2 changes: 0 additions & 2 deletions webapp/src/DataTransferObject/AddUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class AddUser
public function __construct(
public readonly string $username,
public readonly string $name,
#[OA\Property(format: 'email', nullable: true)]
public readonly ?string $email,
#[OA\Property(nullable: true)]
public readonly ?string $ip,
#[OA\Property(format: 'password', nullable: true)]
Expand Down
3 changes: 1 addition & 2 deletions webapp/src/DataTransferObject/UpdateUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ public function __construct(
public readonly string $id,
string $username,
string $name,
?string $email,
?string $ip,
?string $password,
?bool $enabled,
?string $teamId,
array $roles
) {
parent::__construct($username, $name, $email, $ip, $password, $enabled, $teamId, $roles);
parent::__construct($username, $name, $ip, $password, $enabled, $teamId, $roles);
}
}
17 changes: 0 additions & 17 deletions webapp/src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ class User extends BaseApiEntity implements
#[ORM\Column(options: ['comment' => 'Name'])]
private string $name = '';

#[ORM\Column(nullable: true, options: ['comment' => 'Email address'])]
#[Assert\Email]
#[OA\Property(nullable: true)]
#[Serializer\Groups([ARC::GROUP_NONSTRICT])]
private ?string $email = null;

#[ORM\Column(
type: 'decimal',
precision: 32,
Expand Down Expand Up @@ -217,17 +211,6 @@ public function getShortDescription(): string
return $this->getName();
}

public function setEmail(?string $email): User
{
$this->email = $email;
return $this;
}

public function getEmail(): ?string
{
return $this->email;
}

public function setLastLogin(string|float|null $lastLogin): User
{
$this->last_login = $lastLogin;
Expand Down
11 changes: 0 additions & 11 deletions webapp/src/Form/Type/UserRegistrationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
Expand All @@ -27,7 +26,6 @@
use Symfony\Component\Intl\Countries;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Context\ExecutionContext;

Expand Down Expand Up @@ -59,15 +57,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'autocomplete' => 'name',
],
])
->add('email', EmailType::class, [
'label' => false,
'required' => false,
'attr' => [
'placeholder' => 'Email address (optional)',
'autocomplete' => 'email',
],
'constraints' => new Email(),
])
->add('teamName', TextType::class, [
'label' => false,
'attr' => [
Expand Down
7 changes: 0 additions & 7 deletions webapp/src/Form/Type/UserType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
Expand Down Expand Up @@ -53,12 +52,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'help' => 'Optional full name for the user.',
'empty_data' => ''
]);
$builder->add('email', EmailType::class, [
'required' => false,
'attr' => [
'autocomplete' => 'user-email',
],
]);
$builder->add('plainPassword', PasswordType::class, [
'required' => false,
'label' => 'Password',
Expand Down
10 changes: 0 additions & 10 deletions webapp/templates/jury/user.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@
<th>Login</th>
<td class="teamid">{{ user.username }}</td>
</tr>
<tr>
<th>Email</th>
<td>
{% if user.email %}
<a href="mailto:{{ user.email }}">{{ user.email }}</a>
{% else %}
-
{% endif %}
</td>
</tr>
<tr>
<th>Password</th>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function testUserEndpoint(string $username, string $fullname, string $tea
static::assertTrue($response['enabled']);
static::assertNull($response['last_login_time']);
static::assertGreaterThanOrEqual($response['first_login_time'], $response['last_api_login_time']);
$keysExpected = ['id', 'ip', 'last_ip', 'email'];
$keysExpected = ['id', 'ip', 'last_ip'];
foreach ($keysExpected as $keyExpected) {
static::assertArrayHasKey($keyExpected, $response);
}
Expand Down
3 changes: 0 additions & 3 deletions webapp/tests/Unit/Controller/API/UserControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class UserControllerTest extends AccountBaseTestCase
"id" => "admin",
"username" => "admin",
"name" => "Administrator",
"email" => null,
"ip" => null,
"enabled" => true
],
Expand All @@ -30,7 +29,6 @@ class UserControllerTest extends AccountBaseTestCase
"id" => "judgehost",
"username" => "judgehost",
"name" => "User for judgedaemons",
"email" => null,
"ip" => null,
"enabled" => true
],
Expand All @@ -42,7 +40,6 @@ class UserControllerTest extends AccountBaseTestCase
"id" => "demo",
"username" => "demo",
"name" => "demo user for example team",
"email" => null,
"ip" => null,
"enabled" => true
],
Expand Down
5 changes: 1 addition & 4 deletions webapp/tests/Unit/Controller/Jury/UserControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,16 @@ class UserControllerTest extends JuryControllerTestCase
protected static string $className = User::class;
protected static array $DOM_elements = ['h1' => ['Users']];
protected static string $addForm = 'user[';
protected static array $addEntitiesShown = ['name', 'username', 'email'];
protected static array $addEntitiesShown = ['name', 'username'];
protected static array $overviewSingleNotShown = ['plainPassword'];
protected static array $addEntities = [['username' => 'un',
'name' => 'Alice',
'email' => '[email protected]',
'plainPassword' => 'plainpassword',
'ipAddress' => '10.0.0.0',
'enabled' => '1',
'team' => '0',
'user_roles' => ['0' => true, '1' => true]],
['username' => 'ABCabc123_-@', 'name' => 'Allowed username'],
['username' => 'nem', 'name' => 'No Email',
'email' => ''],
['username' => 'npw', 'name' => 'No password',
'plainPassword' => ''],
['username' => 'specialchar', 'name' => 'Special char in password',
Expand Down
8 changes: 4 additions & 4 deletions webapp/tests/Unit/Controller/PublicControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PublicControllerTest extends BaseTestCase
protected static string $urlTeams = '/jury/teams';
protected static string $urlAffil = '/jury/affiliations';
protected static array $requiredFields = ['teamName','affiliationName','affiliationShortName','existingAffiliation'];
protected static array $formFields = ['username','name','email','teamName','affiliation','affiliationName',
protected static array $formFields = ['username','name','teamName','affiliation','affiliationName',
'affiliationShortName','affiliationCountry','existingAffiliation'];
protected static array $duplicateFields = ['username'=>['input'=>'selfregister','error'=>'The username \'"selfregistered"\' is already in use.'],
'teamName'=>['input'=>'Example teamname','error'=>'This team name is already in use.'],
Expand Down Expand Up @@ -199,7 +199,7 @@ public function testSelfRegisterWrongPassword(
self::assertSelectorExists($selector);
}

// username, name, email, teamName, affiliation, affiliationName
// username, name, teamName, affiliation, affiliationName
// affiliationShortName, affiliationCountry, existingAffiliation
// plainPassword
public function selfRegisterProvider(): Generator
Expand All @@ -211,7 +211,7 @@ public function selfRegisterProvider(): Generator
}
yield[['username'=>'minimaluser', 'teamName'=>'NewTeam','affiliation'=>'none'],'shirt-recognize-bar-together', $fixtures, $category];
yield[['username'=>'bruteforce', 'teamName'=>'Fib(9)','affiliation'=>'none'],'01123581321', $fixtures, $category];
yield[['username'=>'fullUser', 'name'=>'Full User', 'email'=>'[email protected]','teamName'=>'Trial','affiliation'=>'none'],'..........', $fixtures, $category];
yield[['username'=>'fullUser', 'name'=>'Full User', 'teamName'=>'Trial','affiliation'=>'none'],'..........', $fixtures, $category];
yield[['username'=>'student@', 'teamName'=>'Student@Uni',
'affiliation'=>'new','affiliationName'=>'NewUni','affiliationShortName'=>'nu'],'p@ssword_Is_long', $fixtures, $category];
yield[['username'=>'winner@', 'teamName'=>'FunnyTeamname',
Expand All @@ -220,7 +220,7 @@ public function selfRegisterProvider(): Generator
yield[['username'=>'newinstsamecountry', 'name'=>'CompetingDutchTeam', 'teamName'=>'SupperT3@m','affiliation'=>'new','affiliationName'=>'Vrije Universiteit',
'affiliationShortName'=>'vu','affiliationCountry'=>'NLD'],'demodemodemo', $fixtures, $category];
if (count($fixtures)===1) {
yield[['username'=>'reusevaluesofexistinguser', 'name'=>'selfregistered user for example team','email'=>'[email protected]','teamName'=>'EasyEnough','affiliation'=>'none'],'demodemodemo', [...$fixtures, SelfRegisteredUserFixture::class],''];
yield[['username'=>'reusevaluesofexistinguser', 'name'=>'selfregistered user for example team','teamName'=>'EasyEnough','affiliation'=>'none'],'demodemodemo', [...$fixtures, SelfRegisteredUserFixture::class],''];
}
}
}
Expand Down
Loading