Add protection if login not provided
This commit is contained in:
parent
9f01a861dd
commit
16e2890da8
@ -262,10 +262,16 @@ class Adherent extends CommonObject
|
|||||||
// Check parameters
|
// Check parameters
|
||||||
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($this->email))
|
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($this->email))
|
||||||
{
|
{
|
||||||
|
$langs->load("companies");
|
||||||
$this->error = $langs->trans("ErrorBadEMail",$this->email);
|
$this->error = $langs->trans("ErrorBadEMail",$this->email);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (! $this->datec) $this->datec=gmmktime();
|
if (! $this->datec) $this->datec=gmmktime();
|
||||||
|
if (empty($this->login))
|
||||||
|
{
|
||||||
|
$this->error = $langs->trans("ErrorWrongValueForParameterX","Login");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@ -275,7 +281,7 @@ class Adherent extends CommonObject
|
|||||||
$sql.= " VALUES (";
|
$sql.= " VALUES (";
|
||||||
$sql.= " '".$this->db->idate($this->datec)."',";
|
$sql.= " '".$this->db->idate($this->datec)."',";
|
||||||
$sql.= " '".$this->login."',";
|
$sql.= " '".$this->login."',";
|
||||||
$sql.= " ".($user->id>0?$user->id:"null").","; // Can be null because member can be create by a guest
|
$sql.= " ".($user->id>0?$user->id:"null").","; // Can be null because member can be create by a guest or a script
|
||||||
$sql.= " null,null,'".$this->morphy."',";
|
$sql.= " null,null,'".$this->morphy."',";
|
||||||
$sql.= " '".$this->typeid."'";
|
$sql.= " '".$this->typeid."'";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user