diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 996fd86bca7..64ef3487f29 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -134,8 +134,16 @@ if ($action == "importSignature") { // Index the new file and update the last_main_doc property of object. $object->indexFile($newpdffilename, 1); + $online_sign_ip = getUserRemoteIP(); + $online_sign_name = ''; // TODO Ask name on form to sign + $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql .= " SET fk_statut = ".((int) $object::STATUS_SIGNED).", note_private = '".$object->note_private."', date_signature='".$db->idate(dol_now())."'"; + $sql .= " SET fk_statut = ".((int) $object::STATUS_SIGNED).", note_private = '".$this->db->escape($object->note_private)."',"; + $sql .= " date_signature = '".$this->db->idate(dol_now())."',"; + $sql .= " online_sign_ip = '".$this->db->escape($online_sign_ip)."'"; + if ($online_sign_name) { + $sql .= ", online_sign_name = '".$this->db->escape($online_sign_name)."'"; + } $sql .= " WHERE rowid = ".((int) $object->id); dol_syslog(__METHOD__, LOG_DEBUG);