|
@@ -178,16 +178,16 @@ if ($action == 'add' && $canadduser)
|
|
|
|
|
|
if (! $message)
|
|
|
{
|
|
|
- $object->lastname = GETPOST("lastname");
|
|
|
- $object->firstname = GETPOST("firstname");
|
|
|
- $object->login = GETPOST("login");
|
|
|
- $object->admin = GETPOST("admin");
|
|
|
- $object->office_phone = GETPOST("office_phone");
|
|
|
- $object->office_fax = GETPOST("office_fax");
|
|
|
+ $object->lastname = GETPOST("lastname",'alpha');
|
|
|
+ $object->firstname = GETPOST("firstname",'alpha');
|
|
|
+ $object->login = GETPOST("login",'alpha');
|
|
|
+ $object->admin = GETPOST("admin",'alpha');
|
|
|
+ $object->office_phone = GETPOST("office_phone",'alpha');
|
|
|
+ $object->office_fax = GETPOST("office_fax",'alpha');
|
|
|
$object->user_mobile = GETPOST("user_mobile");
|
|
|
$object->skype = GETPOST("skype");
|
|
|
- $object->email = GETPOST("email");
|
|
|
- $object->job = GETPOST("job");
|
|
|
+ $object->email = GETPOST("email",'alpha');
|
|
|
+ $object->job = GETPOST("job",'alpha');
|
|
|
$object->signature = GETPOST("signature");
|
|
|
$object->accountancy_code = GETPOST("accountancy_code");
|
|
|
$object->note = GETPOST("note");
|
|
@@ -200,6 +200,7 @@ if ($action == 'add' && $canadduser)
|
|
|
// If multicompany is off, admin users must all be on entity 0.
|
|
|
if (! empty($conf->multicompany->enabled))
|
|
|
{
|
|
|
+ $entity=GETPOST('entity','int');
|
|
|
if (! empty($_POST["superadmin"]))
|
|
|
{
|
|
|
$object->entity = 0;
|
|
@@ -210,12 +211,12 @@ if ($action == 'add' && $canadduser)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- $object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]);
|
|
|
+ $object->entity = (empty($entity) ? 0 : $entity);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- $object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]);
|
|
|
+ $object->entity = (empty($entity) ? 0 : $entity);
|
|
|
}
|
|
|
|
|
|
$db->begin();
|
|
@@ -316,17 +317,17 @@ if ($action == 'update' && ! $_POST["cancel"])
|
|
|
|
|
|
$object->oldcopy=dol_clone($object);
|
|
|
|
|
|
- $object->lastname = GETPOST("lastname");
|
|
|
- $object->firstname = GETPOST("firstname");
|
|
|
- $object->login = GETPOST("login");
|
|
|
+ $object->lastname = GETPOST("lastname",'alpha');
|
|
|
+ $object->firstname = GETPOST("firstname",'alpha');
|
|
|
+ $object->login = GETPOST("login",'alpha');
|
|
|
$object->pass = GETPOST("password");
|
|
|
$object->admin = empty($user->admin)?0:GETPOST("admin"); // A user can only be set admin by an admin
|
|
|
- $object->office_phone=GETPOST("office_phone");
|
|
|
- $object->office_fax = GETPOST("office_fax");
|
|
|
+ $object->office_phone=GETPOST("office_phone",'alpha');
|
|
|
+ $object->office_fax = GETPOST("office_fax",'alpha');
|
|
|
$object->user_mobile= GETPOST("user_mobile");
|
|
|
- $object->skype =GETPOST("skype");
|
|
|
- $object->email = GETPOST("email");
|
|
|
- $object->job = GETPOST("job");
|
|
|
+ $object->skype = GETPOST("skype");
|
|
|
+ $object->email = GETPOST("email",'alpha');
|
|
|
+ $object->job = GETPOST("job",'alpha');
|
|
|
$object->signature = GETPOST("signature");
|
|
|
$object->accountancy_code = GETPOST("accountancy_code");
|
|
|
$object->openid = GETPOST("openid");
|
|
@@ -384,8 +385,8 @@ if ($action == 'update' && ! $_POST["cancel"])
|
|
|
$contact->fetch($contactid);
|
|
|
|
|
|
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
|
|
- $sql.= " SET fk_socpeople=".$contactid;
|
|
|
- if ($contact->socid) $sql.=", fk_societe=".$contact->socid;
|
|
|
+ $sql.= " SET fk_socpeople=".$db->escape($contactid);
|
|
|
+ if ($contact->socid) $sql.=", fk_societe=".$db->escape($contact->socid);
|
|
|
$sql.= " WHERE rowid=".$object->id;
|
|
|
}
|
|
|
else
|