25 if (!defined(
'NOLOGIN'))
27 if (!defined(
'NOCSRFCHECK'))
28 define(
'NOCSRFCHECK',
'1');
29 if (!defined(
'NOREQUIREMENU'))
30 define(
'NOREQUIREMENU',
'1');
32 require
'../../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/datapolicy/class/datapolicy.class.php';
42 $action =
GETPOST(
'action',
'aZ09');
44 $code =
GETPOST(
'key',
'alpha');
46 $acc =
"DATAPOLICIESACCEPT_".$lang;
47 $ref =
"DATAPOLICIESREFUSE_".$lang;
48 $langs->load(
'datapolicy@datapolicy', 0, 0, $lang);
50 if (empty($action) || (empty($idc) && empty($ids) && empty($ida))) {
52 } elseif (!empty($idc)) {
54 $contact->fetch($idc);
55 $check = md5($contact->email);
56 if ($check != $code) {
57 $return = $langs->trans(
'ErrorEmailDATAPOLICIES');
58 } elseif ($action == 1) {
59 $contact->array_options[
'options_datapolicy_consentement'] = 1;
60 $contact->array_options[
'options_datapolicy_opposition_traitement'] = 0;
61 $contact->array_options[
'options_datapolicy_opposition_prospection'] = 0;
62 $contact->array_options[
'options_datapolicy_date'] = date(
'Y-m-d', time());
64 $return = $conf->global->$acc;
65 } elseif ($action == 2) {
66 $contact->no_email = 1;
67 $contact->array_options[
'options_datapolicy_consentement'] = 0;
68 $contact->array_options[
'options_datapolicy_opposition_traitement'] = 1;
69 $contact->array_options[
'options_datapolicy_opposition_prospection'] = 1;
70 $contact->array_options[
'options_datapolicy_date'] = date(
'Y-m-d', time());
72 $return = $conf->global->$ref;
74 $contact->update($idc);
75 } elseif (!empty($ids)) {
77 $societe->fetch($ids);
78 $check = md5($societe->email);
79 if ($check != $code) {
80 $return = $langs->trans(
'ErrorEmailDATAPOLICIES');
81 } elseif ($action == 1) {
82 $societe->array_options[
'options_datapolicy_consentement'] = 1;
83 $societe->array_options[
'options_datapolicy_opposition_traitement'] = 0;
84 $societe->array_options[
'options_datapolicy_opposition_prospection'] = 0;
85 $societe->array_options[
'options_datapolicy_date'] = date(
'Y-m-d', time());
86 $return = $conf->global->$acc;
87 } elseif ($action == 2) {
88 $societe->array_options[
'options_datapolicy_consentement'] = 0;
89 $societe->array_options[
'options_datapolicy_opposition_traitement'] = 1;
90 $societe->array_options[
'options_datapolicy_opposition_prospection'] = 1;
91 $societe->array_options[
'options_datapolicy_date'] = date(
'Y-m-d', time());
93 $return = $conf->global->$ref;
95 $societe->update($ids);
96 } elseif (!empty($ida)) {
98 $adherent->fetch($ida);
99 $check = md5($adherent->email);
100 if ($check != $code) {
101 $return = $langs->trans(
'ErrorEmailDATAPOLICIES');
102 } elseif ($action == 1) {
103 $adherent->array_options[
'options_datapolicy_consentement'] = 1;
104 $adherent->array_options[
'options_datapolicy_opposition_traitement'] = 0;
105 $adherent->array_options[
'options_datapolicy_opposition_prospection'] = 0;
107 $return = $conf->global->$acc;
108 } elseif ($action == 2) {
109 $adherent->array_options[
'options_datapolicy_consentement'] = 0;
110 $adherent->array_options[
'options_datapolicy_opposition_traitement'] = 1;
111 $adherent->array_options[
'options_datapolicy_opposition_prospection'] = 1;
114 $return = $conf->global->$ref;
116 $newuser =
new User($db);
117 $adherent->update($newuser);
120 header(
"Content-type: text/html; charset=".$conf->file->character_set_client);
122 print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
126 print '<meta name="robots" content="noindex,nofollow">'.
"\n";
127 print '<meta name="keywords" content="dolibarr">'.
"\n";
128 print '<meta name="description" content="Dolibarr DATAPOLICIES">'.
"\n";
129 print "<title>".$langs->trans(
"DATAPOLICIESReturn").
"</title>\n";
130 print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$conf->css.
'?lang='.$lang.
'">'.
"\n";
131 print '<style type="text/css">';
132 print '.CTableRow1 { margin: 1px; padding: 3px; font: 12px verdana,arial; background: #e6E6eE; color: #000000; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px;}';
133 print '.CTableRow2 { margin: 1px; padding: 3px; font: 12px verdana,arial; background: #FFFFFF; color: #000000; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px;}';
137 print '<body style="margin: 10% 40%">'.
"\n";
138 print '<table class="CTableRow1" ><tr><td style="text_align:center;">';
139 print $return.
"<br>\n";
140 print '</td></tr></table>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage Dolibarr users.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage members of a foundation.
print
Draft customers invoices.