-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xnetevents non x subscription #26
base: master
Are you sure you want to change the base?
Conversation
$full_name = build_full_name($firstname, $lastname); | ||
$directory_name = build_directory_name($firstname, $lastname); | ||
$sort_name = build_sort_name($firstname, $lastname); | ||
XDB::execute('INSERT INTO accounts SET firstname={?}, lastname={?}, full_name={?}, directory_name={?}, sort_name={?}, hruid={?}, email={?}, type={?}, state={?}', $firstname, $lastname, $full_name, $directory_name, $sort_name, $hruid, Get::v('email'), "xnet", "active"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may break if an hruid already exists for the given email address? User::makeHrid
(https://github.com/Polytechnique-org/platal/blob/core/1.1.16/maint/classes/pluser.php#L431) is not injective. For example:
makeHrid("[email protected]") == makeHrid("[email protected]")
A possible solution would be to add a counter when a collision happens
XDB::execute('INSERT INTO accounts SET firstname={?}, lastname={?}, hruid={?}, email={?}', Get::v('prenom'), Get::v('nom'), Get::v('prenom').".".Get::v('nom'), Get::v('email')); | ||
|
||
//check if the email address is already registered | ||
$res=XDB::query("SELECT hruid FROM accounts WHERE email={?}", Get::v('email')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to check the email redirections too
À voir :
|
No description provided.