Skip to content
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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

godefv
Copy link

@godefv godefv commented Jan 26, 2017

No description provided.

$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");
Copy link
Member

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'));
Copy link
Member

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

@godefv
Copy link
Author

godefv commented Jan 30, 2017

À voir :

  • forcer les gens à remplir nom prénom
  • mettre à jour le nom prénom au moins s'il est actuellement vide
  • gérer le cas des comptes extérieurs disabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants