wip
This commit is contained in:
parent
8fc45da56e
commit
f2f1eaa95e
@ -374,15 +374,15 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$valid = true;
|
$valid = true;
|
||||||
$sourcetouse = 'conferencesubscription';
|
$sourcetouse = 'conferencesubscription';
|
||||||
$reftouse = $facture->id;
|
$reftouse = $facture->id;
|
||||||
$redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse;
|
$redirection = $dolibarr_main_url_root . '/public/payment/newpayment.php?source=' . $sourcetouse . '&ref=' . $reftouse;
|
||||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||||
$redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical
|
$redirection .= '&securekey=' . dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical
|
||||||
} else {
|
} else {
|
||||||
$redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
|
$redirection .= '&securekey=' . $conf->global->PAYMENT_SECURITY_TOKEN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Header("Location: ".$redirection);
|
Header("Location: " . $redirection);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -392,8 +392,8 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$confattendee->setStatut(1);
|
$confattendee->setStatut(1);
|
||||||
|
|
||||||
// Sending mail
|
// Sending mail
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
// Set output language
|
// Set output language
|
||||||
$outputlangs = new Translate('', $conf);
|
$outputlangs = new Translate('', $conf);
|
||||||
@ -410,7 +410,7 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
|
|
||||||
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
||||||
$subject = $arraydefaultmessage->topic;
|
$subject = $arraydefaultmessage->topic;
|
||||||
$msg = $arraydefaultmessage->content;
|
$msg = $arraydefaultmessage->content;
|
||||||
}
|
}
|
||||||
|
|
||||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
|
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
|
||||||
@ -429,19 +429,23 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
|
|
||||||
$result = $mailfile->sendfile();
|
$result = $mailfile->sendfile();
|
||||||
if ($result) {
|
if ($result) {
|
||||||
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
|
dol_syslog("EMail sent to " . $sendto, LOG_DEBUG, 0, '_payment');
|
||||||
} else {
|
} else {
|
||||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
|
dol_syslog("Failed to send EMail to " . $sendto, LOG_ERR, 0, '_payment');
|
||||||
}
|
}
|
||||||
|
|
||||||
$encodedid = dol_encode($id, $dolibarr_main_instance_unique_id);
|
$encodedid = dol_encode($id, $dolibarr_main_instance_unique_id);
|
||||||
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY . 'conferenceorbooth' . $id, 2);
|
||||||
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl;
|
$redirection = $dolibarr_main_url_root . '/public/eventorganization/subscriptionok.php?id=' . $encodedid . '&securekey=' . $securekeyurl;
|
||||||
Header("Location: ".$redirection);
|
Header("Location: " . $redirection);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
//Header("Location: ".$urlback);
|
//Header("Location: ".$urlback);
|
||||||
//exit;
|
//exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$db->commit();
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,16 +100,12 @@ if ($resultproject < 0) {
|
|||||||
$errmsg .= $project->error;
|
$errmsg .= $project->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getting 'securekey'.'id' from Post and decoding it
|
// Security check
|
||||||
$encodedsecurekeyandid = GETPOST('securekey', 'alpha');
|
$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id);
|
||||||
$securekeyandid = dol_decode($encodedsecurekeyandid, $dolibarr_main_instance_unique_id);
|
$securekeyreceived = GETPOST("securekey");
|
||||||
|
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||||
|
|
||||||
// Securekey decomposition into pure securekey and id added at the end
|
if ($securekeytocompare != $securekeyreceived) {
|
||||||
$securekey = substr($securekeyandid, 0, strlen($securekeyandid)-strlen($encodedid));
|
|
||||||
$idgotfromsecurekey = dol_decode(substr($securekeyandid, -strlen($encodedid), strlen($encodedid)), $dolibarr_main_instance_unique_id);
|
|
||||||
|
|
||||||
// We check if the securekey collected is OK and if the id collected is the same than the id in the securekey
|
|
||||||
if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY || $idgotfromsecurekey != $id) {
|
|
||||||
print $langs->trans('MissingOrBadSecureKey');
|
print $langs->trans('MissingOrBadSecureKey');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -377,12 +373,13 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$conforbooth->fk_soc = $thirdparty->id;
|
$conforbooth->fk_soc = $thirdparty->id;
|
||||||
$conforbooth->fk_project = $project->id;
|
$conforbooth->fk_project = $project->id;
|
||||||
$conforbooth->note = $note;
|
$conforbooth->note = $note;
|
||||||
//$conforbooth->fk_action =
|
$conforbooth->fk_action = 63;
|
||||||
$conforbooth->datep =$datestart;
|
$conforbooth->datep =$datestart;
|
||||||
$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);
|
$resultconforbooth = $conforbooth->create($user);
|
||||||
|
var_dump($conforbooth);
|
||||||
if ($resultconforbooth<=0) {
|
if ($resultconforbooth<=0) {
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $conforbooth->error;
|
$errmsg .= $conforbooth->error;
|
||||||
@ -494,14 +491,17 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
|
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id);
|
$encodedid = dol_encode($id, $dolibarr_main_instance_unique_id);
|
||||||
|
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||||
|
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl;
|
||||||
Header("Location: ".$redirection);
|
Header("Location: ".$redirection);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->commit();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (!$error) {
|
||||||
|
$db->commit();
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
@ -540,7 +540,7 @@ print '<input type="hidden" name="token" value="'.newToken().'" / >';
|
|||||||
print '<input type="hidden" name="entity" value="'.$entity.'" />';
|
print '<input type="hidden" name="entity" value="'.$entity.'" />';
|
||||||
print '<input type="hidden" name="action" value="add" />';
|
print '<input type="hidden" name="action" value="add" />';
|
||||||
print '<input type="hidden" name="id" value="'.$encodedid.'" />';
|
print '<input type="hidden" name="id" value="'.$encodedid.'" />';
|
||||||
print '<input type="hidden" name="securekey" value="'.$encodedsecurekeyandid.'" />';
|
print '<input type="hidden" name="securekey" value="'.$securekeyreceived.'" />';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user