Prevent duplicate keys

This commit is contained in:
Roman Hergenreder 2020-06-23 21:18:45 +02:00
parent 28558fe63f
commit 950527804a

@ -148,6 +148,9 @@ namespace Api\User {
return false;
}
// prevent duplicate keys
$email = (!is_null($email) && empty($email)) ? null : $email;
$id = $this->insertUser($username, $email, $password);
if ($this->success) {
$this->result["userId"] = $id;
@ -605,6 +608,8 @@ If the registration was not intended, you can simply ignore this email.<br><br><
$password = $this->getParam("password");
$groups = $this->getParam("groups");
$email = (!is_null($email) && empty($email)) ? null : $email;
$groupIds = array();
if (!is_null($groups)) {
$param = new Parameter('groupId', Parameter::TYPE_INT);