dolibarr 24.0.3
new.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org>
4 * Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
5 * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
6 * Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
7 * Copyright (C) 2018-2026 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
9 * Copyright (C) 2021 Waël Almoman <info@almoman.com>
10 * Copyright (C) 2022 Udo Tamm <dev@dolibit.de>
11 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <https://www.gnu.org/licenses/>.
25 */
26
33if (!defined('NOLOGIN')) {
34 define("NOLOGIN", 1); // This means this output page does not require to be logged.
35}
36if (!defined('NOCSRFCHECK')) {
37 define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
38}
39if (!defined('NOBROWSERNOTIF')) {
40 define('NOBROWSERNOTIF', '1');
41}
42
43
44// For MultiCompany module.
45// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
46// Because 2 entities can have the same ref
47$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
48// if (is_numeric($entity)) { // value is casted to int so always numeric
49define("DOLENTITY", $entity);
50// }
51
52
53// Load Dolibarr environment
54require '../../main.inc.php';
55require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
56require_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
57require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
58require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php';
59require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
60require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
61require_once DOL_DOCUMENT_ROOT . '/core/class/cunits.class.php';
62require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
63require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php';
64require_once DOL_DOCUMENT_ROOT . '/core/lib/public.lib.php';
65
73// Init vars
74$backtopage = GETPOST('backtopage', 'alpha');
75$action = GETPOST('action', 'aZ09');
76
77$errmsg = '';
78$num = 0;
79$error = 0;
80
81// Load translation files
82$langs->loadLangs(array("main", "members", "companies", "install", "other", "errors"));
83
84// Security check
85if (!isModEnabled('societe')) {
86 httponly_accessforbidden('Module Thirdparty not enabled');
87}
88
89if (!getDolGlobalString('SOCIETE_ENABLE_PUBLIC')) {
90 httponly_accessforbidden("Online form for contact for public visitors has not been enabled (option SOCIETE_ENABLE_PUBLIC)");
91}
92
93
94// permissions
95
96$permissiontoadd = $user->hasRight('societe', 'creer');
97
98// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
99$hookmanager->initHooks(array('publicnewmembercard', 'globalcard'));
100
101$extrafields = new ExtraFields($db);
102
103$object = new Societe($db);
104$user->loadDefaultValues();
105
106$extrafields->fetch_name_optionals_label($object->table_element); // fetch optionals attributes and labels
107
108
123function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [], $ws = '') // @phan-suppress-current-line PhanRedefineFunction
124{
125 global $langs, $mysoc;
126
127 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
128
129 print '<body id="mainbody" class="publicnewmemberform">';
130
131 include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
132 htmlPrintOnlineHeader($mysoc, $langs, 1, getDolGlobalString('THIRDPARTY_PUBLIC_INTERFACE_TOPIC'), 'THIRDPARTY_PUBLIC_INTERFACE_IMAGE');
133
134 print '<div class="divmainbodylarge">';
135}
136
144function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction
145{
146 global $conf, $langs;
147
148 print '</div>';
149
150 printCommonFooter('public');
151
152 if (!empty($conf->use_javascript_ajax)) {
153 print "\n" . '<!-- Includes JS Footer of Dolibarr -->' . "\n";
154 print '<script src="' . DOL_URL_ROOT . '/core/js/lib_foot.js.php?lang=' . $langs->defaultlang . '"></script>' . "\n";
155 }
156
157 print "</body>\n";
158 print "</html>\n";
159}
160
161
162
163/*
164 * Actions
165 */
166
167$parameters = array();
168// Note that $action and $object may have been modified by some hooks
169$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
170if ($reshook < 0) {
171 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
172}
173
174// Action called when page is submitted
175if (empty($reshook) && $action == 'add') { // Test on permission not required here. This is a public page. Security is done on constant and mitigation.
176 $error = 0;
177 $urlback = '';
178
179 $db->begin();
180
181 if (!GETPOST('name')) {
182 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Company")), null, 'errors');
183 $error++;
184 }
185
186 // Check Captcha code if is enabled
187 if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY')) {
188 $sessionkey = 'dol_antispam_value';
189 $ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) === strtolower(GETPOST('code'))));
190 unset($_SESSION[$sessionkey]); // A code can be used only once. The page shows a new image, so a new code is set.
191 if (!$ok) {
192 $error++;
193 $errmsg .= $langs->trans("ErrorBadValueForCode") . "<br>\n";
194 $action = '';
195 }
196 }
197
198 if (!$error) {
199 $societe = new Societe($db);
200
201 $societe->name = GETPOST('name', 'alphanohtml');
202 $societe->client = GETPOSTINT('client') ? GETPOSTINT('client') : $societe->client;
203 $societe->address = GETPOST('address', 'alphanohtml');
204 $societe->country_id = GETPOSTINT('country_id');
205 $societe->phone = GETPOST('phone', 'alpha');
206 $societe->fax = GETPOST('fax', 'alpha');
207 $societe->email = trim(GETPOST('email', 'email'));
208 $societe->client = 2 ; // our client is a prospect
209 $societe->code_client = '-1';
210 $societe->name_alias = GETPOST('name_alias', 'alphanohtml');
211 $societe->note_private = GETPOST('note_private', 'alphanohtml');
212 $societe->ip = getUserRemoteIP();
213
214 // Fill array 'array_options' with data from add form
215 /*
216 $extrafields->fetch_name_optionals_label($societe->table_element);
217 $ret = $extrafields->setOptionalsFromPost(null, $societe);
218 if ($ret < 0) {
219 $error++;
220 $errmsg .= $societe->error;
221 }
222 */
223
224 $nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
225
226 if (checkNbPostsForASpeceificIp($societe, $nb_post_max) <= 0) {
227 $error++;
228 $errmsg .= implode('<br>', $societe->errors);
229 }
230
231 if (!$error) {
232 $result = $societe->create($user);
233 if ($result > 0) {
234 require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
235 $object = $societe;
236
237 if (!empty($backtopage)) {
238 $urlback = $backtopage;
239 } elseif (getDolGlobalString('MEMBER_URL_REDIRECT_SUBSCRIPTION')) {
240 $urlback = getDolGlobalString('MEMBER_URL_REDIRECT_SUBSCRIPTION');
241 // TODO Make replacement of __AMOUNT__, etc...
242 } else {
243 $urlback = $_SERVER["PHP_SELF"] . "?action=added&token=" . newToken();
244 }
245 } else {
246 $error++;
247 $errmsg .= implode('<br>', $societe->errors);
248 }
249 }
250 }
251
252 if (!$error) {
253 $db->commit();
254
255 header("Location: " . $urlback);
256 exit;
257 } else {
258 $db->rollback();
259 $action = "create";
260 }
261}
262
263// Action called after a submitted was send and prospect created successfully
264// If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to an url, we never go here because a redirect was done to this url. Same if we ask to redirect to the payment page.
265// backtopage parameter with an url was set on prospect submit page, we never go here because a redirect was done to this url.
266
267if (empty($reshook) && $action == 'added') { // Test on permission not required here
268 llxHeaderVierge("newSocieteAdded");
269
270 // If we have not been redirected
271 print '<br><br>';
272 print '<div class="center">';
273 print $langs->trans("newSocieteAdded");
274 print '</div>';
275
277 exit;
278}
279
280
281
282/*
283 * View
284 */
285
286$form = new Form($db);
287$formcompany = new FormCompany($db);
288$adht = new AdherentType($db);
289$formadmin = new FormAdmin($db);
290
291
292llxHeaderVierge($langs->trans("ContactUs"));
293
294print '<br>';
295print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"') . ' &nbsp; ' . $langs->trans("ContactUs"), '', '', 0, '', 'center');
296
297
298print '<div align="center">';
299print '<div id="divsubscribe">';
300
301print '<div class="center subscriptionformhelptext opacitymedium">';
302if (getDolGlobalString('COMPANY_NEWFORM_TEXT')) {
303 print $langs->trans(getDolGlobalString('COMPANY_NEWFORM_TEXT')) . "<br>\n";
304} else {
305 print $langs->trans("ContactUsDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL")) . "<br>\n";
306}
307print '</div>';
308
309dol_htmloutput_errors($errmsg);
311
312// Print form
313print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="newprospect">' . "\n";
314print '<input type="hidden" name="token" value="' . newToken() . '" / >';
315print '<input type="hidden" name="entity" value="' . $entity . '" />';
316print '<input type="hidden" name="action" value="add" />';
317print '<br>';
318
319$messagemandatory = '<span class="">' . $langs->trans("FieldsWithAreMandatory", '*') . '</span>';
320//print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
321//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
322
323print dol_get_fiche_head();
324
325print '<script type="text/javascript">
326jQuery(document).ready(function () {
327 jQuery(document).ready(function () {
328 function initmorphy()
329 {
330 console.log("Call initmorphy");
331 if (jQuery("#morphy").val() == \'phy\') {
332 jQuery("#trcompany").hide();
333 }
334 if (jQuery("#morphy").val() == \'mor\') {
335 jQuery("#trcompany").show();
336 }
337 }
338 initmorphy();
339 jQuery("#morphy").change(function() {
340 initmorphy();
341 });
342 jQuery("#selectcountry_id").change(function() {
343 document.newprospect.action.value="create";
344 document.newprospect.submit();
345 });
346 jQuery("#typeid").change(function() {
347 document.newprospect.action.value="create";
348 document.newprospect.submit();
349 });
350 });
351});
352</script>';
353
354
355print '<table class="border" summary="form to subscribe" id="tablesubscribe">' . "\n";
356//Third party name
357/*
358if ($object->particulier || $private) {
359 print '<span id="TypeName" class="fieldrequired">'.$langs->trans('ThirdPartyName').' / '.$langs->trans('LastName', 'name').'</span>';
360} else {
361 print '<span id="TypeName" class="fieldrequired">'.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0).'</span>';
362}
363*/
364print '<tr class="tr-field-thirdparty-name"><td class="titlefieldcreate">'; // text appreas left
365print '<input type="hidden" name="ThirdPartyName" value="' . $langs->trans('ThirdPartyName') . '">';
366print '<span id="TypeName" title="' .dol_escape_htmltag($langs->trans("FieldsWithAreMandatory", '*')) . '" >' . $form->editfieldkey('Company', 'name', '', $object, 0) . '<span class="star"> *</span></span>';
367print '</td><td>'; // inline input
368print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="' . dol_escape_htmltag($object->name) . '" autofocus="autofocus">';
369//
370
371// Name and lastname
372print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Firstname") . ' <span class="star">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('firstname')) . '"></td></tr>' . "\n";
373
374print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Lastname") . ' <span class="star">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('lastname')) . '"></td></tr>' . "\n";
375
376// Address
377print '<tr><td class="tdtop">';
378print $form->editfieldkey('Address', 'address', '', $object, 0);
379print '</td>';
380print '<td>';
381print '<textarea name="address" id="address" class="quatrevingtpercent" rows="' . ROWS_2 . '" wrap="soft">';
382print dol_escape_htmltag($object->address, 0, 1);
383print '</textarea>';
384print $form->widgetForTranslation("address", $object, $permissiontoadd, 'textarea', 'alphanohtml', 'quatrevingtpercent');
385print '</td></tr>';
386
387// Country
388print '<tr><td>' . $form->editfieldkey('Country', 'selectcountry_id', '', $object, 0) . '</td><td class="maxwidthonsmartphone">';
389print img_picto('', 'country', 'class="pictofixedwidth"');
390print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 maxwidth500 widthcentpercentminusx');
391if ($user->admin) {
392 print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
393}
394print '</td></tr>';
395
396// Phone / Fax
397print '<tr><td>' . $form->editfieldkey('Phone', 'phone', '', $object, 0) . '</td>';
398print '<td>' . img_picto('', 'object_phoning', 'class="pictofixedwidth"') . ' <input type="text" name="phone" id="phone" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $object->phone) . '"></td>';
399print '</tr>';
400
401print '<tr>';
402print '<td>' . $form->editfieldkey('Fax', 'fax', '', $object, 0) . '</td>';
403print '<td>' . img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"') . ' <input type="text" name="fax" id="fax" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : $object->fax) . '"></td>';
404print '</tr>';
405
406// Email / Web
407print '<tr><td>' . $form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', !getDolGlobalString('SOCIETE_EMAIL_MANDATORY') ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY) . '</td>';
408print '<td>' . img_picto('', 'object_email', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth200 widthcentpercentminusx" name="email" id="email" value="' . $object->email . '"></td>';
409if (isModEnabled('mailing') && getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) {
410 if ($conf->browser->layout == 'phone') {
411 print '</tr><tr>';
412 }
413 print '<td class="individualline noemail">' . $form->editfieldkey($langs->trans('No_Email') . ' (' . $langs->trans('Contact') . ')', 'contact_no_email', '', $object, 0) . '</td>';
414 print '<td class="individualline" ' . (($conf->browser->layout == 'phone') /* || !isModEnabled('mailing') */ ? ' colspan="3"' : '') . '>' . $form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1) . '</td>';
415}
416print '</tr>';
417
418print '<tr><td>' . $form->editfieldkey('Web', 'url', '', $object, 0) . '</td>';
419print '<td>' . img_picto('', 'globe', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="' . $object->url . '"></td></tr>';
420
421
422// Comments
423print '<tr>';
424print '<td class="tdtop">' . $langs->trans("Comments") . '</td>';
425print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="' . ROWS_3 . '">' . dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1) . '</textarea></td>';
426print '</tr>' . "\n";
427
428
429// Other attributes
430$parameters['tpl_context'] = 'public'; // define template context to public
431include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
432
433
434// TODO Move this into generic feature.
435
436// Display Captcha code if is enabled
437if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY')) {
438 require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php';
439 print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">' . $langs->trans("SecurityCode") . '</span></label></td><td>';
440 print '<span class="span-icon-security inline-block">';
441 print '<input id="securitycode" placeholder="' . $langs->trans("SecurityCode") . '" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />';
442 print '</span>';
443 print '<span class="nowrap inline-block">';
444 print '<img class="inline-block valignmiddle" src="' . DOL_URL_ROOT . '/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />';
445 print '<a class="inline-block valignmiddle" href="' . $_SERVER['PHP_SELF'] . '" tabindex="4" data-role="button">' . img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"') . '</a>';
446 print '</span>';
447 print '</td></tr>';
448}
449
450print "</table>\n";
451
452print dol_get_fiche_end();
453
454// Save / Submit
455print '<div class="center">';
456print '<input type="submit" value="' . $langs->trans("Send") . '" id="submitsave" class="button">';
457if (!empty($backtopage)) {
458 print ' &nbsp; &nbsp; <input type="submit" value="' . $langs->trans("Cancel") . '" id="submitcancel" class="button button-cancel">';
459}
460print '</div>';
461
462
463print "</form>\n";
464print "<br>";
465print '</div></div>';
466
467
468
470
471$db->close();
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
Class to manage members type.
Class to manage standard extra fields.
Class to generate html code for admin pages.
Class to build HTML component for third parties management Only common components are here.
Class to manage generation of HTML components Only common components must be here.
Class to manage third parties objects (customers, suppliers, prospects...)
llxHeaderVierge($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs=[], $arrayofcss=[], $ws='')
Show header for new prospect.
Definition new.php:123
llxFooterVierge()
Show footer for new societe.
Definition new.php:144
htmlPrintOnlineHeader($mysoc, $langs, $showlogo=1, $alttext='', $subimageconst='', $altlogo1='', $altlogo2='')
Show the header of a company in HTML public pages.
global $mysoc
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
printCommonFooter($zone='private')
Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global-...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_htmloutput_events($disabledoutputofmessages=0)
Print formatted messages to output (Used to show messages on html output).
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getUserRemoteIP($trusted=0)
Return the real IP of remote user.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_htmloutput_errors($mesgstring='', $mesgarray=array(), $keepembedded=0)
Print formatted error messages to output (Used to show messages on html output).
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
checkNbPostsForASpeceificIp($object, $nb_post_max)
Check if the object exceeded the number of posts for a specific ip in the same week.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.