Fix Improper Authorization Check reported by Ahsan Aziz.
This commit is contained in:
parent
cea35bd208
commit
b57eb8284e
@ -314,8 +314,8 @@ if (empty($reshook)) {
|
||||
|
||||
$id = $object->create($user);
|
||||
if ($id > 0) {
|
||||
if (GETPOST('password')) {
|
||||
$object->setPassword($user, GETPOST('password'));
|
||||
if (GETPOST('password', 'none')) {
|
||||
$object->setPassword($user, GETPOST('password','none'));
|
||||
}
|
||||
if (!empty($conf->categorie->enabled)) {
|
||||
// Categories association
|
||||
|
||||
@ -1280,6 +1280,10 @@ class User extends CommonObject
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login"));
|
||||
return -1;
|
||||
} elseif (preg_match('/[,@<>"\']/', $this->login)) {
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans("ErrorBadCharIntoLoginName");
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->datec = dol_now();
|
||||
@ -1669,6 +1673,10 @@ class User extends CommonObject
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans("ErrorFieldRequired", 'Login');
|
||||
return -1;
|
||||
} elseif (preg_match('/[,@<>"\']/', $this->login)) {
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans("ErrorBadCharIntoLoginName");
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user