mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
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
|
||||
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($this->email))
|
||||
{
|
||||
$langs->load("companies");
|
||||
$this->error = $langs->trans("ErrorBadEMail",$this->email);
|
||||
return -1;
|
||||
}
|
||||
if (! $this->datec) $this->datec=gmmktime();
|
||||
if (empty($this->login))
|
||||
{
|
||||
$this->error = $langs->trans("ErrorWrongValueForParameterX","Login");
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
|
@ -275,7 +281,7 @@ class Adherent extends CommonObject
|
|||
$sql.= " VALUES (";
|
||||
$sql.= " '".$this->db->idate($this->datec)."',";
|
||||
$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.= " '".$this->typeid."'";
|
||||
$sql.= ")";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user