bepolytech / ULBDiscordBot

Discord bot to verify a user's ULB studentship
https://hub.docker.com/r/bepolytech/ulbdiscordbot
GNU General Public License v3.0
4 stars 1 forks source link

Feat: Prevent users from entering wrong type of working email #50

Open LucasPlacentino opened 3 months ago

LucasPlacentino commented 3 months ago

Basically, ULB uses aliases for the name.surname@ email address, the actual real address is tver0001@ (t for Theodore and ver for Verhaegen) where the first letter is the first letter of the user's name, the next three letters are the first three letters of their surname and the four digits is the number of occurrences of these four-letter combination inside ULB's email system.
Users are able to verify using this email address which results in their name on the server being Tver0001 (or maybe Tver000 since #43 got merged and removes the last character if it's a digit, see #42 ).

Example showing the database entry: image

Solution: The filter on user email address input that checks if it has the correct domain should also check if this address format is used and reject it. Could use regex to check the combination of 4letters followed by 4digits (something like "^[a-zA-Z]{4}\d{4}@ulb.be"g see on regex101.com)