Merge remote-tracking branch 'upstream/develop' into 17b11
This commit is contained in:
commit
8dff478f39
@ -605,7 +605,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
// Insert member
|
// Insert member
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent";
|
||||||
$sql .= " (ref, datec,login,fk_user_author,fk_user_mod,fk_user_valid,morphy,fk_adherent_type,entity,import_key)";
|
$sql .= " (ref, datec,login,fk_user_author,fk_user_mod,fk_user_valid,morphy,fk_adherent_type,entity,import_key, ip)";
|
||||||
$sql .= " VALUES (";
|
$sql .= " VALUES (";
|
||||||
$sql .= " '(PROV)'";
|
$sql .= " '(PROV)'";
|
||||||
$sql .= ", '".$this->db->idate($this->datec)."'";
|
$sql .= ", '".$this->db->idate($this->datec)."'";
|
||||||
@ -615,6 +615,7 @@ class Adherent extends CommonObject
|
|||||||
$sql .= ", ".((int) $this->typeid);
|
$sql .= ", ".((int) $this->typeid);
|
||||||
$sql .= ", ".$conf->entity;
|
$sql .= ", ".$conf->entity;
|
||||||
$sql .= ", ".(!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null");
|
$sql .= ", ".(!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null");
|
||||||
|
$sql .= ", ".(!empty($this->ip) ? "'".$this->db->escape($this->ip)."'" : "null");
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||||
|
|||||||
@ -148,7 +148,7 @@ print '<tr class="oddeven">';
|
|||||||
print '<td>'.$langs->trans("RESTRICT_ON_IP");
|
print '<td>'.$langs->trans("RESTRICT_ON_IP");
|
||||||
print ' '.$langs->trans("Example").': '.$langs->trans("IPListExample");
|
print ' '.$langs->trans("Example").': '.$langs->trans("IPListExample");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input type="text" name="API_RESTRICT_ON_IP" value="'.dol_escape_htmltag($conf->global->API_RESTRICT_ON_IP).'"></td>';
|
print '<td><input type="text" name="API_RESTRICT_ON_IP" value="'.dol_escape_htmltag(getDolGlobalString('API_RESTRICT_ON_IP')).'"></td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="submit" class="button button-save" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></td>';
|
print '<input type="submit" class="button button-save" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></td>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -555,7 +555,8 @@ class ActionComm extends CommonObject
|
|||||||
$sql .= "recurdateend,";
|
$sql .= "recurdateend,";
|
||||||
$sql .= "num_vote,";
|
$sql .= "num_vote,";
|
||||||
$sql .= "event_paid,";
|
$sql .= "event_paid,";
|
||||||
$sql .= "status";
|
$sql .= "status,";
|
||||||
|
$sql .= "ip";
|
||||||
$sql .= ") VALUES (";
|
$sql .= ") VALUES (";
|
||||||
$sql .= "'(PROV)', ";
|
$sql .= "'(PROV)', ";
|
||||||
$sql .= "'".$this->db->idate($now)."', ";
|
$sql .= "'".$this->db->idate($now)."', ";
|
||||||
@ -596,7 +597,8 @@ class ActionComm extends CommonObject
|
|||||||
$sql .= (!empty($this->recurdateend) ? "'".$this->db->idate($this->recurdateend)."'" : "null").", ";
|
$sql .= (!empty($this->recurdateend) ? "'".$this->db->idate($this->recurdateend)."'" : "null").", ";
|
||||||
$sql .= (!empty($this->num_vote) ? (int) $this->num_vote : "null").", ";
|
$sql .= (!empty($this->num_vote) ? (int) $this->num_vote : "null").", ";
|
||||||
$sql .= (!empty($this->event_paid) ? (int) $this->event_paid : 0).", ";
|
$sql .= (!empty($this->event_paid) ? (int) $this->event_paid : 0).", ";
|
||||||
$sql .= (!empty($this->status) ? (int) $this->status : "0");
|
$sql .= (!empty($this->status) ? (int) $this->status : "0").", ";
|
||||||
|
$sql .= (!empty($this->ip) ? "'".$this->db->escape($this->ip)."'" : "null");
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::add", LOG_DEBUG);
|
dol_syslog(get_class($this)."::add", LOG_DEBUG);
|
||||||
|
|||||||
@ -3656,8 +3656,8 @@ class Commande extends CommonOrder
|
|||||||
}
|
}
|
||||||
$statusType = 'status4';
|
$statusType = 'status4';
|
||||||
} elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) {
|
} elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) {
|
||||||
$labelStatus = $langs->transnoentitiesnoconv('StatusOrderToBill');
|
$labelStatus = $langs->transnoentitiesnoconv('StatusOrderToBill'); // translated into Delivered
|
||||||
$labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderToBillShort');
|
$labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderToBillShort'); // translated into Delivered
|
||||||
$statusType = 'status4';
|
$statusType = 'status4';
|
||||||
} elseif ($status == self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) {
|
} elseif ($status == self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) {
|
||||||
$labelStatus = $langs->transnoentitiesnoconv('StatusOrderProcessed').$billedtext;
|
$labelStatus = $langs->transnoentitiesnoconv('StatusOrderProcessed').$billedtext;
|
||||||
|
|||||||
@ -188,7 +188,7 @@ class FormProjets
|
|||||||
$sql .= natural_search(array('p.title', 'p.ref'), $filterkey);
|
$sql .= natural_search(array('p.title', 'p.ref'), $filterkey);
|
||||||
}
|
}
|
||||||
if ($morefilter) {
|
if ($morefilter) {
|
||||||
$sql .= ' AND ('.$morefilter.')';
|
$sql .= ' AND ('.$this->db->sanitize($morefilter, 0, 1).')';
|
||||||
}
|
}
|
||||||
$sql .= " ORDER BY p.ref ASC";
|
$sql .= " ORDER BY p.ref ASC";
|
||||||
|
|
||||||
|
|||||||
@ -136,15 +136,12 @@ abstract class DoliDB implements Database
|
|||||||
*
|
*
|
||||||
* @param string $stringtosanitize String to escape
|
* @param string $stringtosanitize String to escape
|
||||||
* @param int $allowsimplequote 1=Allow simple quotes in string. When string is used as a list of SQL string ('aa', 'bb', ...)
|
* @param int $allowsimplequote 1=Allow simple quotes in string. When string is used as a list of SQL string ('aa', 'bb', ...)
|
||||||
|
* @param string $allowsequals 1=Allow equals sign
|
||||||
* @return string String escaped
|
* @return string String escaped
|
||||||
*/
|
*/
|
||||||
public function sanitize($stringtosanitize, $allowsimplequote = 0)
|
public function sanitize($stringtosanitize, $allowsimplequote = 0, $allowsequals = 0)
|
||||||
{
|
{
|
||||||
if ($allowsimplequote) {
|
return preg_replace('/[^a-z0-9_\-\.,'.($allowsequals ? '=' : '').($allowsimplequote ? "\'" : '').']/i', '', $stringtosanitize);
|
||||||
return preg_replace('/[^a-z0-9_\-\.,\']/i', '', $stringtosanitize);
|
|
||||||
} else {
|
|
||||||
return preg_replace('/[^a-z0-9_\-\.,]/i', '', $stringtosanitize);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -123,6 +123,7 @@ class ConferenceOrBoothAttendee extends CommonObject
|
|||||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
|
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
|
||||||
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
|
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
|
||||||
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>0, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Canceled'),),
|
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>0, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Canceled'),),
|
||||||
|
'ip' => array('type'=>'varchar(250)', 'label'=>'Ip', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
|
||||||
);
|
);
|
||||||
public $rowid;
|
public $rowid;
|
||||||
public $ref;
|
public $ref;
|
||||||
|
|||||||
@ -403,8 +403,8 @@ class CommentParser
|
|||||||
$code = 500;
|
$code = 500;
|
||||||
$exception = 'Exception';
|
$exception = 'Exception';
|
||||||
if (count($value) > 1) {
|
if (count($value) > 1) {
|
||||||
$v1 = $value[0];
|
$v1 = empty($value[0]) ? null : $value[0];
|
||||||
$v2 = $value[1];
|
$v2 = empty($value[1]) ? null : $value[1];
|
||||||
if (is_numeric($v1)) {
|
if (is_numeric($v1)) {
|
||||||
$code = $v1;
|
$code = $v1;
|
||||||
$exception = $v2;
|
$exception = $v2;
|
||||||
|
|||||||
@ -66,6 +66,11 @@ UPDATE llx_c_paiement SET code = 'BANCON' WHERE code = 'BAN' AND libelle = 'Banc
|
|||||||
|
|
||||||
ALTER TABLE llx_partnership ADD COLUMN ip varchar(250);
|
ALTER TABLE llx_partnership ADD COLUMN ip varchar(250);
|
||||||
ALTER TABLE llx_adherent ADD COLUMN ip varchar(250);
|
ALTER TABLE llx_adherent ADD COLUMN ip varchar(250);
|
||||||
|
ALTER TABLE llx_projet ADD COLUMN ip varchar(250);
|
||||||
|
ALTER TABLE llx_actioncomm ADD COLUMN ip varchar(250);
|
||||||
|
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN ip varchar(250);
|
||||||
|
ALTER TABLE llx_opensurvey_user_studs ADD COLUMN ip varchar(250);
|
||||||
|
ALTER TABLE llx_opensurvey_comments ADD COLUMN ip varchar(250);
|
||||||
|
|
||||||
ALTER TABLE llx_fichinterdet_rec DROP COLUMN remise;
|
ALTER TABLE llx_fichinterdet_rec DROP COLUMN remise;
|
||||||
ALTER TABLE llx_fichinterdet_rec DROP COLUMN fk_export_commpta;
|
ALTER TABLE llx_fichinterdet_rec DROP COLUMN fk_export_commpta;
|
||||||
|
|||||||
@ -244,6 +244,7 @@ ErrorObjectMustHaveStatusActiveToBeDisabled=Objects must have status 'Active' to
|
|||||||
ErrorObjectMustHaveStatusDraftOrDisabledToBeActivated=Objects must have status 'Draft' or 'Disabled' to be enabled
|
ErrorObjectMustHaveStatusDraftOrDisabledToBeActivated=Objects must have status 'Draft' or 'Disabled' to be enabled
|
||||||
ErrorNoFieldWithAttributeShowoncombobox=No fields has property 'showoncombobox' into definition of object '%s'. No way to show the combolist.
|
ErrorNoFieldWithAttributeShowoncombobox=No fields has property 'showoncombobox' into definition of object '%s'. No way to show the combolist.
|
||||||
ErrorFieldRequiredForProduct=Field '%s' is required for product %s
|
ErrorFieldRequiredForProduct=Field '%s' is required for product %s
|
||||||
|
AlreadyTooMuchPostOnThisIPAdress=You have already posted too much on this IP address.
|
||||||
ProblemIsInSetupOfTerminal=Problem is in setup of terminal %s.
|
ProblemIsInSetupOfTerminal=Problem is in setup of terminal %s.
|
||||||
ErrorAddAtLeastOneLineFirst=Add at least one line first
|
ErrorAddAtLeastOneLineFirst=Add at least one line first
|
||||||
ErrorRecordAlreadyInAccountingDeletionNotPossible=Error, record is already transferred in accounting, deletion is not possible.
|
ErrorRecordAlreadyInAccountingDeletionNotPossible=Error, record is already transferred in accounting, deletion is not possible.
|
||||||
|
|||||||
@ -45,6 +45,7 @@ NoError=Aucune erreur
|
|||||||
Error=Erreur
|
Error=Erreur
|
||||||
Errors=Erreurs
|
Errors=Erreurs
|
||||||
ErrorFieldRequired=Le champ '%s' est obligatoire
|
ErrorFieldRequired=Le champ '%s' est obligatoire
|
||||||
|
AlreadyTooMuchPostOnThisIPAdress=Vous avez déjà posté trop de messages depuis cette adresse IP.
|
||||||
ErrorFieldFormat=Le champ '%s' a une valeur incorrecte
|
ErrorFieldFormat=Le champ '%s' a une valeur incorrecte
|
||||||
ErrorFileDoesNotExists=Le fichier %s n'existe pas
|
ErrorFileDoesNotExists=Le fichier %s n'existe pas
|
||||||
ErrorFailedToOpenFile=Impossible d'ouvrir le fichier %s
|
ErrorFailedToOpenFile=Impossible d'ouvrir le fichier %s
|
||||||
|
|||||||
@ -571,12 +571,13 @@ class Opensurveysondage extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param string $comment Comment content
|
* @param string $comment Comment content
|
||||||
* @param string $comment_user Comment author
|
* @param string $comment_user Comment author
|
||||||
|
* @param string $user_ip Comment author IP
|
||||||
* @return boolean False in case of the query fails, true if it was successful
|
* @return boolean False in case of the query fails, true if it was successful
|
||||||
*/
|
*/
|
||||||
public function addComment($comment, $comment_user)
|
public function addComment($comment, $comment_user, $user_ip = '')
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."opensurvey_comments (id_sondage, comment, usercomment)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."opensurvey_comments (id_sondage, comment, usercomment, ip)";
|
||||||
$sql .= " VALUES ('".$this->db->escape($this->id_sondage)."','".$this->db->escape($comment)."','".$this->db->escape($comment_user)."')";
|
$sql .= " VALUES ('".$this->db->escape($this->id_sondage)."','".$this->db->escape($comment)."','".$this->db->escape($comment_user)."'".($user_ip ? ",'".$this->db->escape($user_ip)."'" : '').")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
|
|||||||
@ -22,6 +22,8 @@
|
|||||||
* \brief This file is a CRUD class file for Partnership (Create/Read/Update/Delete)
|
* \brief This file is a CRUD class file for Partnership (Create/Read/Update/Delete)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
|
||||||
// Put here all includes required by your class file
|
// Put here all includes required by your class file
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||||
//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||||
@ -124,6 +126,7 @@ class Partnership extends CommonObject
|
|||||||
'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>-2,),
|
'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>-2,),
|
||||||
'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>73, 'notnull'=>0, 'visible'=>-2,),
|
'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>73, 'notnull'=>0, 'visible'=>-2,),
|
||||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150',),
|
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150',),
|
||||||
|
'ip' => array('type'=>'varchar(250)', 'label'=>'Ip', 'enabled'=>'1', 'position'=>74, 'notnull'=>0, 'visible'=>-2,),
|
||||||
);
|
);
|
||||||
public $rowid;
|
public $rowid;
|
||||||
public $ref;
|
public $ref;
|
||||||
|
|||||||
@ -308,7 +308,7 @@ class Project extends CommonObject
|
|||||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>0, 'position'=>415),
|
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>0, 'position'=>415),
|
||||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>0, 'position'=>420),
|
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>0, 'position'=>420),
|
||||||
'email_msgid'=>array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'enabled'=>1, 'visible'=>-1, 'position'=>450, 'help'=>'EmailMsgIDWhenSourceisEmail'),
|
'email_msgid'=>array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'enabled'=>1, 'visible'=>-1, 'position'=>450, 'help'=>'EmailMsgIDWhenSourceisEmail'),
|
||||||
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500)
|
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500),
|
||||||
);
|
);
|
||||||
// END MODULEBUILDER PROPERTIES
|
// END MODULEBUILDER PROPERTIES
|
||||||
|
|
||||||
@ -435,6 +435,7 @@ class Project extends CommonObject
|
|||||||
$sql .= ", note_private";
|
$sql .= ", note_private";
|
||||||
$sql .= ", note_public";
|
$sql .= ", note_public";
|
||||||
$sql .= ", entity";
|
$sql .= ", entity";
|
||||||
|
$sql .= ", ip";
|
||||||
$sql .= ") VALUES (";
|
$sql .= ") VALUES (";
|
||||||
$sql .= "'".$this->db->escape($this->ref)."'";
|
$sql .= "'".$this->db->escape($this->ref)."'";
|
||||||
$sql .= ", '".$this->db->escape($this->title)."'";
|
$sql .= ", '".$this->db->escape($this->title)."'";
|
||||||
@ -466,6 +467,7 @@ class Project extends CommonObject
|
|||||||
$sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : 'null');
|
$sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : 'null');
|
||||||
$sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null');
|
$sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null');
|
||||||
$sql .= ", ".((int) $conf->entity);
|
$sql .= ", ".((int) $conf->entity);
|
||||||
|
$sql .= ", ".(!isset($this->ip) ? 'NULL' : "'".$this->db->escape($this->ip)."'");
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||||
|
|||||||
@ -229,7 +229,7 @@ if ($reshook < 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Action called when page is submitted
|
// Action called when page is submitted
|
||||||
if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status!=2 || !empty($project->id) && $project->status == Project::STATUS_VALIDATED)) {
|
if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status==2 || !empty($project->id) && $project->status == Project::STATUS_VALIDATED)) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$urlback = '';
|
$urlback = '';
|
||||||
@ -259,10 +259,12 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
|||||||
// Check if attendee already exists (by email and for this event)
|
// Check if attendee already exists (by email and for this event)
|
||||||
$confattendee = new ConferenceOrBoothAttendee($db);
|
$confattendee = new ConferenceOrBoothAttendee($db);
|
||||||
|
|
||||||
|
$filter = array();
|
||||||
|
|
||||||
if ($type == 'global') {
|
if ($type == 'global') {
|
||||||
$filter = array('t.fk_project'=>((int) $id), 'customsql'=>'t.email="'.$db->escape($email).'"');
|
$filter = array('t.fk_project'=>((int) $id), 'customsql'=>'t.email="'.$db->escape($email).'"');
|
||||||
}
|
}
|
||||||
if ($action == 'conf') {
|
if ($type == 'conf') {
|
||||||
$filter = array('t.fk_actioncomm'=>((int) $id), 'customsql'=>'t.email="'.$db->escape($email).'"');
|
$filter = array('t.fk_actioncomm'=>((int) $id), 'customsql'=>'t.email="'.$db->escape($email).'"');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,7 +283,37 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
|||||||
$confattendee->fk_actioncomm = $id;
|
$confattendee->fk_actioncomm = $id;
|
||||||
$confattendee->note_public = $note_public;
|
$confattendee->note_public = $note_public;
|
||||||
|
|
||||||
$resultconfattendee = $confattendee->create($user);
|
$confattendee->ip = getUserRemoteIP();
|
||||||
|
$nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000);
|
||||||
|
|
||||||
|
// Calculate nb of post for IP
|
||||||
|
$nb_post_ip = 0;
|
||||||
|
if ($nb_post_max > 0) { // Calculate only if there is a limit to check
|
||||||
|
$sql = "SELECT COUNT(ref) as nb_attendee";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee";
|
||||||
|
$sql .= " WHERE ip = '".$db->escape($confattendee->ip)."'";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num) {
|
||||||
|
$i++;
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nb_post_ip = $obj->nb_attendee;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$resultconforbooth = -1;
|
||||||
|
|
||||||
|
if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
|
||||||
|
$error++;
|
||||||
|
$errmsg .= $langs->trans("AlreadyTooMuchPostOnThisIPAdress");
|
||||||
|
array_push($confattendee->errors, $langs->trans("AlreadyTooMuchPostOnThisIPAdress"));
|
||||||
|
setEventMessage($errmsg, 'errors');
|
||||||
|
} else {
|
||||||
|
$resultconfattendee = $confattendee->create($user);
|
||||||
|
}
|
||||||
if ($resultconfattendee < 0) {
|
if ($resultconfattendee < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $confattendee->error;
|
$errmsg .= $confattendee->error;
|
||||||
|
|||||||
@ -284,12 +284,41 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$adh->morphy = getDolGlobalString("MEMBER_NEWFORM_FORCEMORPHY", GETPOST('morphy'));
|
$adh->morphy = getDolGlobalString("MEMBER_NEWFORM_FORCEMORPHY", GETPOST('morphy'));
|
||||||
$adh->birth = $birthday;
|
$adh->birth = $birthday;
|
||||||
|
|
||||||
|
$adh->ip = getUserRemoteIP();
|
||||||
|
|
||||||
|
$nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000);
|
||||||
|
|
||||||
|
// Calculate nb of post for IP
|
||||||
|
$nb_post_ip = 0;
|
||||||
|
if ($nb_post_max > 0) { // Calculate only if there is a limit to check
|
||||||
|
$sql = "SELECT COUNT(ref) as nb_adh";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent";
|
||||||
|
$sql .= " WHERE ip = '".$db->escape($adh->ip)."'";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num) {
|
||||||
|
$i++;
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nb_post_ip = $obj->nb_adh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$extrafields->fetch_name_optionals_label($adh->table_element);
|
$extrafields->fetch_name_optionals_label($adh->table_element);
|
||||||
$ret = $extrafields->setOptionalsFromPost(null, $adh);
|
$ret = $extrafields->setOptionalsFromPost(null, $adh);
|
||||||
if ($ret < 0) {
|
if ($ret < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
|
$errmsg .= $adh->error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
|
||||||
|
$error++;
|
||||||
|
$errmsg .= $langs->trans("AlreadyTooMuchPostOnThisIPAdress");
|
||||||
|
array_push($adh->errors, $langs->trans("AlreadyTooMuchPostOnThisIPAdress"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
|
|||||||
@ -97,8 +97,34 @@ if (GETPOST('ajoutcomment', 'alpha')) {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$user_ip = getUserRemoteIP();
|
||||||
|
$nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000);
|
||||||
|
|
||||||
|
// Calculate nb of post for IP
|
||||||
|
$nb_post_ip = 0;
|
||||||
|
if ($nb_post_max > 0) { // Calculate only if there is a limit to check
|
||||||
|
$sql = "SELECT COUNT(id_comment) as nb_comments";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."opensurvey_comments";
|
||||||
|
$sql .= " WHERE ip = '".$db->escape($user_ip)."'";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num) {
|
||||||
|
$i++;
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nb_post_ip = $obj->nb_comments;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
|
||||||
|
setEventMessages($langs->trans("AlreadyTooMuchPostOnThisIPAdress"), null, 'errors');
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$resql = $object->addComment($comment, $comment_user);
|
$resql = $object->addComment($comment, $comment_user, $user_ip);
|
||||||
|
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -125,6 +151,28 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$user_ip = getUserRemoteIP();
|
||||||
|
$nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000);
|
||||||
|
|
||||||
|
// Calculate nb of post for IP
|
||||||
|
$nb_post_ip = 0;
|
||||||
|
if ($nb_post_max > 0) { // Calculate only if there is a limit to check
|
||||||
|
$sql = "SELECT COUNT(id_users) as nb_records";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."opensurvey_user_studs";
|
||||||
|
$sql .= " WHERE ip = '".$db->escape($user_ip)."'";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num) {
|
||||||
|
$i++;
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nb_post_ip = $obj->nb_records;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$nom = substr(GETPOST("nom", 'alphanohtml'), 0, 64);
|
$nom = substr(GETPOST("nom", 'alphanohtml'), 0, 64);
|
||||||
|
|
||||||
// Check if vote already exists
|
// Check if vote already exists
|
||||||
@ -137,12 +185,16 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo
|
|||||||
}
|
}
|
||||||
|
|
||||||
$num_rows = $db->num_rows($resql);
|
$num_rows = $db->num_rows($resql);
|
||||||
|
|
||||||
if ($num_rows > 0) {
|
if ($num_rows > 0) {
|
||||||
setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors');
|
setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
|
} elseif ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
|
||||||
|
setEventMessages($langs->trans("AlreadyTooMuchPostOnThisIPAdress"), null, 'errors');
|
||||||
|
$error++;
|
||||||
} else {
|
} else {
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses, ip)';
|
||||||
$sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')";
|
$sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."', '".$db->escape($user_ip)."')";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
|
|||||||
@ -223,7 +223,27 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$partnership->fk_user_creat = 0;
|
$partnership->fk_user_creat = 0;
|
||||||
$partnership->fk_type = GETPOST('partnershiptype', 'int');
|
$partnership->fk_type = GETPOST('partnershiptype', 'int');
|
||||||
//$partnership->typeid = $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE ? $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE : GETPOST('typeid', 'int');
|
//$partnership->typeid = $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE ? $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE : GETPOST('typeid', 'int');
|
||||||
|
$partnership->ip = getUserRemoteIP();
|
||||||
|
|
||||||
|
$nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000);
|
||||||
|
|
||||||
|
// Calculate nb of post for IP
|
||||||
|
$nb_post_ip = 0;
|
||||||
|
if ($nb_post_max > 0) { // Calculate only if there is a limit to check
|
||||||
|
$sql = "SELECT COUNT(ref) as nb_partnerships";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."partnership";
|
||||||
|
$sql .= " WHERE ip = '".$db->escape($partnership->ip)."'";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num) {
|
||||||
|
$i++;
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nb_post_ip = $obj->nb_partnerships;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// test if societe already exist
|
// test if societe already exist
|
||||||
$company = new Societe($db);
|
$company = new Societe($db);
|
||||||
$result = $company->fetch(0, GETPOST('societe'));
|
$result = $company->fetch(0, GETPOST('societe'));
|
||||||
@ -290,6 +310,11 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
|
||||||
|
$error++;
|
||||||
|
$errmsg = $langs->trans("AlreadyTooMuchPostOnThisIPAdress");
|
||||||
|
array_push($partnership->errors, $langs->trans("AlreadyTooMuchPostOnThisIPAdress"));
|
||||||
|
}
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$result = $partnership->create($user);
|
$result = $partnership->create($user);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
@ -464,6 +489,8 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$error++;
|
$error++;
|
||||||
$errmsg .= join('<br>', $partnership->errors);
|
$errmsg .= join('<br>', $partnership->errors);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
setEventMessage($errmsg, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -296,6 +296,26 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$proj->opp_status = $defaultoppstatus;
|
$proj->opp_status = $defaultoppstatus;
|
||||||
$proj->fk_opp_status = $defaultoppstatus;
|
$proj->fk_opp_status = $defaultoppstatus;
|
||||||
|
|
||||||
|
$proj->ip = getUserRemoteIP();
|
||||||
|
$nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000);
|
||||||
|
// Calculate nb of post for IP
|
||||||
|
$nb_post_ip = 0;
|
||||||
|
if ($nb_post_max > 0) { // Calculate only if there is a limit to check
|
||||||
|
$sql = "SELECT COUNT(rowid) as nb_projets";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."projet";
|
||||||
|
$sql .= " WHERE ip = '".$db->escape($proj->ip)."'";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num) {
|
||||||
|
$i++;
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nb_post_ip = $obj->nb_projets;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Fill array 'array_options' with data from the form
|
// Fill array 'array_options' with data from the form
|
||||||
$extrafields->fetch_name_optionals_label($proj->table_element);
|
$extrafields->fetch_name_optionals_label($proj->table_element);
|
||||||
$ret = $extrafields->setOptionalsFromPost(null, $proj);
|
$ret = $extrafields->setOptionalsFromPost(null, $proj);
|
||||||
@ -303,74 +323,83 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the project
|
if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
|
||||||
$result = $proj->create($user);
|
|
||||||
if ($result > 0) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
|
||||||
$object = $proj;
|
|
||||||
|
|
||||||
if ($object->email) {
|
|
||||||
$subject = '';
|
|
||||||
$msg = '';
|
|
||||||
|
|
||||||
// Send subscription email
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
|
||||||
$formmail = new FormMail($db);
|
|
||||||
// Set output language
|
|
||||||
$outputlangs = new Translate('', $conf);
|
|
||||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
|
||||||
// Load traductions files required by page
|
|
||||||
$outputlangs->loadLangs(array("main", "members", "projects"));
|
|
||||||
// Get email content from template
|
|
||||||
$arraydefaultmessage = null;
|
|
||||||
$labeltouse = $conf->global->PROJECT_EMAIL_TEMPLATE_AUTOLEAD;
|
|
||||||
|
|
||||||
if (!empty($labeltouse)) {
|
|
||||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'project', $user, $outputlangs, 0, 1, $labeltouse);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
|
||||||
$subject = $arraydefaultmessage->topic;
|
|
||||||
$msg = $arraydefaultmessage->content;
|
|
||||||
}
|
|
||||||
if (empty($labeltosue)) {
|
|
||||||
$labeltouse = '['.$mysoc->name.'] '.$langs->trans("YourMessage");
|
|
||||||
$msg = $langs->trans("YourMessageHasBeenReceived");
|
|
||||||
}
|
|
||||||
|
|
||||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
|
||||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
|
||||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
|
||||||
$texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
|
|
||||||
|
|
||||||
if ($subjecttosend && $texttosend) {
|
|
||||||
$moreinheader = 'X-Dolibarr-Info: send_an_email by public/lead/new.php'."\r\n";
|
|
||||||
|
|
||||||
$result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
|
||||||
}
|
|
||||||
/*if ($result < 0) {
|
|
||||||
$error++;
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($backtopage)) {
|
|
||||||
$urlback = $backtopage;
|
|
||||||
} elseif (!empty($conf->global->PROJECT_URL_REDIRECT_LEAD)) {
|
|
||||||
$urlback = $conf->global->PROJECT_URL_REDIRECT_LEAD;
|
|
||||||
// TODO Make replacement of __AMOUNT__, etc...
|
|
||||||
} else {
|
|
||||||
$urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($entity)) {
|
|
||||||
$urlback .= '&entity='.$entity;
|
|
||||||
}
|
|
||||||
|
|
||||||
dol_syslog("project lead ".$proj->ref." has been created, we redirect to ".$urlback);
|
|
||||||
} else {
|
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $proj->error.'<br>'.join('<br>', $proj->errors);
|
$errmsg = $langs->trans("AlreadyTooMuchPostOnThisIPAdress");
|
||||||
|
array_push($proj->errors, $langs->trans("AlreadyTooMuchPostOnThisIPAdress"));
|
||||||
|
}
|
||||||
|
// Create the project
|
||||||
|
if (!$error) {
|
||||||
|
$result = $proj->create($user);
|
||||||
|
if ($result > 0) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
|
$object = $proj;
|
||||||
|
|
||||||
|
if ($object->email) {
|
||||||
|
$subject = '';
|
||||||
|
$msg = '';
|
||||||
|
|
||||||
|
// Send subscription email
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
|
$formmail = new FormMail($db);
|
||||||
|
// Set output language
|
||||||
|
$outputlangs = new Translate('', $conf);
|
||||||
|
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||||
|
// Load traductions files required by page
|
||||||
|
$outputlangs->loadLangs(array("main", "members", "projects"));
|
||||||
|
// Get email content from template
|
||||||
|
$arraydefaultmessage = null;
|
||||||
|
$labeltouse = $conf->global->PROJECT_EMAIL_TEMPLATE_AUTOLEAD;
|
||||||
|
|
||||||
|
if (!empty($labeltouse)) {
|
||||||
|
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'project', $user, $outputlangs, 0, 1, $labeltouse);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
||||||
|
$subject = $arraydefaultmessage->topic;
|
||||||
|
$msg = $arraydefaultmessage->content;
|
||||||
|
}
|
||||||
|
if (empty($labeltosue)) {
|
||||||
|
$labeltouse = '['.$mysoc->name.'] '.$langs->trans("YourMessage");
|
||||||
|
$msg = $langs->trans("YourMessageHasBeenReceived");
|
||||||
|
}
|
||||||
|
|
||||||
|
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||||
|
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||||
|
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||||
|
$texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
|
||||||
|
|
||||||
|
if ($subjecttosend && $texttosend) {
|
||||||
|
$moreinheader = 'X-Dolibarr-Info: send_an_email by public/lead/new.php'."\r\n";
|
||||||
|
|
||||||
|
$result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
||||||
|
}
|
||||||
|
/*if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($backtopage)) {
|
||||||
|
$urlback = $backtopage;
|
||||||
|
} elseif (!empty($conf->global->PROJECT_URL_REDIRECT_LEAD)) {
|
||||||
|
$urlback = $conf->global->PROJECT_URL_REDIRECT_LEAD;
|
||||||
|
// TODO Make replacement of __AMOUNT__, etc...
|
||||||
|
} else {
|
||||||
|
$urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($entity)) {
|
||||||
|
$urlback .= '&entity='.$entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_syslog("project lead ".$proj->ref." has been created, we redirect to ".$urlback);
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
|
$errmsg .= $proj->error.'<br>'.join('<br>', $proj->errors);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setEventMessage($errmsg, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -361,7 +361,37 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$conforbooth->datep2 = $dateend;
|
$conforbooth->datep2 = $dateend;
|
||||||
$conforbooth->datec = dol_now();
|
$conforbooth->datec = dol_now();
|
||||||
$conforbooth->tms = dol_now();
|
$conforbooth->tms = dol_now();
|
||||||
$resultconforbooth = $conforbooth->create($user);
|
$conforbooth->ip = getUserRemoteIP();
|
||||||
|
$nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000);
|
||||||
|
|
||||||
|
// Calculate nb of post for IP
|
||||||
|
$nb_post_ip = 0;
|
||||||
|
if ($nb_post_max > 0) { // Calculate only if there is a limit to check
|
||||||
|
$sql = "SELECT COUNT(ref) as nb_confs";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
|
||||||
|
$sql .= " WHERE ip = '".$db->escape($conforbooth->ip)."'";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num) {
|
||||||
|
$i++;
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nb_post_ip = $obj->nb_confs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$resultconforbooth = 0;
|
||||||
|
|
||||||
|
if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
|
||||||
|
$error++;
|
||||||
|
$errmsg .= $langs->trans("AlreadyTooMuchPostOnThisIPAdress");
|
||||||
|
array_push($conforbooth->errors, $langs->trans("AlreadyTooMuchPostOnThisIPAdress"));
|
||||||
|
setEventMessage($errmsg, 'errors');
|
||||||
|
} else {
|
||||||
|
$resultconforbooth = $conforbooth->create($user);
|
||||||
|
}
|
||||||
if ($resultconforbooth<=0) {
|
if ($resultconforbooth<=0) {
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $conforbooth->error;
|
$errmsg .= $conforbooth->error;
|
||||||
|
|||||||
@ -359,7 +359,37 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$conforbooth->tms = dol_now();
|
$conforbooth->tms = dol_now();
|
||||||
$conforbooth->firstname = $contact->firstname;
|
$conforbooth->firstname = $contact->firstname;
|
||||||
$conforbooth->lastname = $contact->lastname;
|
$conforbooth->lastname = $contact->lastname;
|
||||||
$resultconforbooth = $conforbooth->create($user);
|
$conforbooth->ip = getUserRemoteIP();
|
||||||
|
$nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000);
|
||||||
|
|
||||||
|
// Calculate nb of post for IP
|
||||||
|
$nb_post_ip = 0;
|
||||||
|
if ($nb_post_max > 0) { // Calculate only if there is a limit to check
|
||||||
|
$sql = "SELECT COUNT(ref) as nb_confs";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
|
||||||
|
$sql .= " WHERE ip = '".$db->escape($conforbooth->ip)."'";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num) {
|
||||||
|
$i++;
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nb_post_ip = $obj->nb_confs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$resultconforbooth = 0;
|
||||||
|
|
||||||
|
if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
|
||||||
|
$error++;
|
||||||
|
$errmsg .= $langs->trans("AlreadyTooMuchPostOnThisIPAdress");
|
||||||
|
array_push($conforbooth->errors, $langs->trans("AlreadyTooMuchPostOnThisIPAdress"));
|
||||||
|
setEventMessage($errmsg, 'errors');
|
||||||
|
} else {
|
||||||
|
$resultconforbooth = $conforbooth->create($user);
|
||||||
|
}
|
||||||
if ($resultconforbooth<=0) {
|
if ($resultconforbooth<=0) {
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $conforbooth->error;
|
$errmsg .= $conforbooth->error;
|
||||||
|
|||||||
@ -337,7 +337,8 @@ div.paymentbordline
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
overflow: visible;
|
overflow-x: hidden;
|
||||||
|
overfloy-y: scroll;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,6 +365,7 @@ div.paymentbordline
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 55%;
|
height: 55%;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.div1{
|
.div1{
|
||||||
@ -940,17 +942,19 @@ div#moreinfo, div#infowarehouse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrows {
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
justify-content: space-between;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.indicator {
|
.indicator {
|
||||||
background: #00000042;
|
background: #00000042;
|
||||||
padding: 15px 5px;
|
padding: 15px 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
position:absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.indicator.left {
|
||||||
|
left:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.indicator.right {
|
||||||
|
right:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indicator:hover {
|
.indicator:hover {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user