diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 57e6ae4f266..6110687f587 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -493,11 +493,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner - $link_subscription = 'http://localhost/dolibarr/htdocs/public/members/attendee_subscription.php'; - $link_subscription .= '?id='.GETPOST("id"); + $link_subscription = 'http://localhost/dolibarr/htdocs/public/members/attendee_subscription.php?id='; + //$link_subscription .= base64_encode($id); + $key = 'DV3PH'; + $link_subscription .= openssl_encrypt($id, 'aes-256-ctr', $key); $object->fields['pubregister'] = array('type'=>'url', 'label'=>'Lien public d\'enregistrement à une conférence', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); $object->pubregister = $link_subscription; $keyforbreak='pubregister'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; //var_dump($object); // Other attributes. Fields from hook formObjectOptions and Extrafields. diff --git a/htdocs/public/members/attendee_subscription.php b/htdocs/public/members/attendee_subscription.php index 9ded588b54b..33034be7019 100644 --- a/htdocs/public/members/attendee_subscription.php +++ b/htdocs/public/members/attendee_subscription.php @@ -74,7 +74,10 @@ $num = 0; $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); -$id = GETPOST("id"); +//$id = base64_decode(GETPOST("id")); +$key = 'DV3PH'; +$id = openssl_decrypt(GETPOST('id'), 'aes-256-ctr', $key); +var_dump($id); // Load translation files $langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); @@ -186,24 +189,42 @@ if (empty($reshook) && $action == 'add') { // Vérifier si client existe $thirdparty = new Societe($db); $nomsociete = GETPOST("societe"); - // @todo utiliser fetch avec la "réf" + // @todo utiliser fetch avec la "réf" $resultfetchthirdparty = $thirdparty->fetch('', $nomsociete); if($resultfetchthirdparty<0){ $error++; $errmsg .= $thirdparty->error; $res = -1; } elseif($resultfetchthirdparty==0){ - // si retour =0 : le créer + // creation of a new thirdparty $thirdparty->name = $nomsociete; $thirdparty->address = GETPOST("address"); $thirdparty->zip = GETPOST("zipcode"); $thirdparty->town = GETPOST("town"); - // It's a prospect $thirdparty->client = 2; $thirdparty->fournisseur = 0; $thirdparty->country_id = GETPOST("country_id", 'int'); $thirdparty->state_id = GETPOST("state_id", 'int'); + //@todo jusqu'à la ligne 223 : pas sûr + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + $tmpcode = $object->code_client; + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($object, 0); + } + $res = $thirdparty->create($user); } @@ -272,11 +293,11 @@ print '
| '.$langs->trans('State').' | '; |