dolibarr  17.0.4
login.tpl.php
1 <?php
2 /* Copyright (C) 2009-2015 Regis Houssin <regis.houssin@inodbox.com>
3  * Copyright (C) 2011-2022 Laurent Destailleur <eldy@users.sourceforge.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
19 // Need global variable $urllogo, $title and $titletruedolibarrversion to be defined by caller (like dol_loginfunction in security2.lib.php)
20 // Caller can also set $morelogincontent = array(['options']=>array('js'=>..., 'table'=>...);
21 // $titletruedolibarrversion must be defined
22 
23 if (!defined('NOBROWSERNOTIF')) {
24  define('NOBROWSERNOTIF', 1);
25 }
26 
27 // Protection to avoid direct call of template
28 if (empty($conf) || !is_object($conf)) {
29  print "Error, template page can't be called as URL";
30  exit;
31 }
32 
33 // DDOS protection
34 $size = (empty($_SERVER['CONTENT_LENGTH']) ? 0 : (int) $_SERVER['CONTENT_LENGTH']);
35 if ($size > 10000) {
36  $langs->loadLangs(array("errors", "install"));
37  httponly_accessforbidden('<center>'.$langs->trans("ErrorRequestTooLarge").'.<br><a href="'.DOL_URL_ROOT.'">'.$langs->trans("ClickHereToGoToApp").'</a></center>', 413, 1);
38 }
39 
40 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
41 
42 
43 header('Cache-Control: Public, must-revalidate');
44 header("Content-type: text/html; charset=".$conf->file->character_set_client);
45 
46 if (GETPOST('dol_hide_topmenu')) {
47  $conf->dol_hide_topmenu = 1;
48 }
49 if (GETPOST('dol_hide_leftmenu')) {
50  $conf->dol_hide_leftmenu = 1;
51 }
52 if (GETPOST('dol_optimize_smallscreen')) {
53  $conf->dol_optimize_smallscreen = 1;
54 }
55 if (GETPOST('dol_no_mouse_hover')) {
56  $conf->dol_no_mouse_hover = 1;
57 }
58 if (GETPOST('dol_use_jmobile')) {
59  $conf->dol_use_jmobile = 1;
60 }
61 
62 // If we force to use jmobile, then we reenable javascript
63 if (!empty($conf->dol_use_jmobile)) {
64  $conf->use_javascript_ajax = 1;
65 }
66 
67 $php_self = empty($php_self) ? dol_escape_htmltag($_SERVER['PHP_SELF']) : $php_self;
68 $php_self .= dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '';
69 if (!preg_match('/mainmenu=/', $php_self)) {
70  $php_self .= (preg_match('/\?/', $php_self) ? '&' : '?').'mainmenu=home';
71 }
72 if (preg_match('/'.preg_quote('core/modules/oauth', '/').'/', $php_self)) {
73  $php_self = DOL_URL_ROOT.'/index.php?mainmenu=home';
74 }
75 $php_self = preg_replace('/(\?|&amp;|&)action=[^&]+/', '\1', $php_self);
76 $php_self = preg_replace('/(\?|&amp;|&)massaction=[^&]+/', '\1', $php_self);
77 $php_self = preg_replace('/(\?|&amp;|&)token=[^&]+/', '\1', $php_self);
78 
79 // Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second
80 $arrayofjs = array(
81  '/includes/jstz/jstz.min.js'.(empty($conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION)),
82  '/core/js/dst.js'.(empty($conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION))
83 );
84 
85 // We display application title instead Login term
86 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
87  $titleofloginpage = $conf->global->MAIN_APPLICATION_TITLE;
88 } else {
89  $titleofloginpage = $langs->trans('Login');
90 }
91 $titleofloginpage .= ' @ '.$titletruedolibarrversion; // $titletruedolibarrversion is defined by dol_loginfunction in security2.lib.php. We must keep the @, some tools use it to know it is login page and find true dolibarr version.
92 
93 $disablenofollow = 1;
94 if (!preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $title)) {
95  $disablenofollow = 0;
96 }
97 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
98  $disablenofollow = 0;
99 }
100 
101 top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
102 
103 
104 $colorbackhmenu1 = '60,70,100'; // topmenu
105 if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
106  $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
107 }
108 $colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TOPMENU_BACK1) ? $colorbackhmenu1 : $conf->global->THEME_ELDY_TOPMENU_BACK1) : (empty($user->conf->THEME_ELDY_TOPMENU_BACK1) ? $colorbackhmenu1 : $user->conf->THEME_ELDY_TOPMENU_BACK1);
109 $colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
110 
111 print "<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->\n";
112 
113 if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
114  // For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random'
115  ?>
116  <body class="body bodylogin" style="background-image: url('<?php echo dol_escape_htmltag($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND); ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;">
117  <?php
118 } else {
119  ?>
120  <body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file=logos/'.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
121  <?php
122 }
123 ?>
124 
125 <?php if (empty($conf->dol_use_jmobile)) { ?>
126 <script>
127 $(document).ready(function () {
128  /* Set focus on correct field */
129  <?php if ($focus_element) {
130  ?>$('#<?php echo $focus_element; ?>').focus(); <?php
131  } ?> // Warning to use this only on visible element
132 });
133 </script>
134 <?php } ?>
135 
136 <div class="login_center center"<?php
137 if (empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
138  $backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
139  // old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
140  $backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
141  print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; '.$backstyle.'"' : '';
142 }
143 ?>>
144 <div class="login_vertical_align">
145 
146 
147 <form id="login" name="login" method="post" action="<?php echo $php_self; ?>">
148 
149 <input type="hidden" name="token" value="<?php echo newToken(); ?>" />
150 <input type="hidden" name="actionlogin" value="login">
151 <input type="hidden" name="loginfunction" value="loginfunction" />
152 <input type="hidden" name="backtopage" value="<?php echo GETPOST('backtopage'); ?>" />
153 <!-- Add fields to store and send local user information. This fields are filled by the core/js/dst.js -->
154 <input type="hidden" name="tz" id="tz" value="" />
155 <input type="hidden" name="tz_string" id="tz_string" value="" />
156 <input type="hidden" name="dst_observed" id="dst_observed" value="" />
157 <input type="hidden" name="dst_first" id="dst_first" value="" />
158 <input type="hidden" name="dst_second" id="dst_second" value="" />
159 <input type="hidden" name="screenwidth" id="screenwidth" value="" />
160 <input type="hidden" name="screenheight" id="screenheight" value="" />
161 <input type="hidden" name="dol_hide_topmenu" id="dol_hide_topmenu" value="<?php echo $dol_hide_topmenu; ?>" />
162 <input type="hidden" name="dol_hide_leftmenu" id="dol_hide_leftmenu" value="<?php echo $dol_hide_leftmenu; ?>" />
163 <input type="hidden" name="dol_optimize_smallscreen" id="dol_optimize_smallscreen" value="<?php echo $dol_optimize_smallscreen; ?>" />
164 <input type="hidden" name="dol_no_mouse_hover" id="dol_no_mouse_hover" value="<?php echo $dol_no_mouse_hover; ?>" />
165 <input type="hidden" name="dol_use_jmobile" id="dol_use_jmobile" value="<?php echo $dol_use_jmobile; ?>" />
166 
167 
168 
169 <!-- Title with version -->
170 <div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>">
171 <?php
172 if ($disablenofollow) {
173  echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank" rel="noopener noreferrer external">';
174 }
175 echo dol_escape_htmltag($title);
176 if ($disablenofollow) {
177  echo '</a>';
178 }
179 ?>
180 </div>
181 
182 
183 
184 <div class="login_table">
185 
186 <div id="login_line1">
187 
188 <div id="login_left">
189 <img alt="" src="<?php echo $urllogo; ?>" id="img_logo" />
190 </div>
191 
192 <br>
193 
194 <div id="login_right">
195 
196 <div class="tagtable left centpercent" title="<?php echo $langs->trans("EnterLoginDetail"); ?>">
197 
198 <!-- Login -->
199 <div class="trinputlogin">
200 <div class="tagtd nowraponall center valignmiddle tdinputlogin">
201 <?php if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
202  ?><label for="username" class="hidden"><?php echo $langs->trans("Login"); ?></label><?php
203 } ?>
204 <!-- <span class="span-icon-user">-->
205 <span class="fa fa-user"></span>
206 <input type="text" id="username" maxlength="255" placeholder="<?php echo $langs->trans("Login"); ?>" name="username" class="flat input-icon-user minwidth150" value="<?php echo dol_escape_htmltag($login); ?>" tabindex="1" autofocus="autofocus" autocapitalize="off" autocomplete="on" spellcheck="false" autocorrect="off" />
207 </div>
208 </div>
209 
210 <!-- Password -->
211 <div class="trinputlogin">
212 <div class="tagtd nowraponall center valignmiddle tdinputlogin">
213 <?php if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
214  ?><label for="password" class="hidden"><?php echo $langs->trans("Password"); ?></label><?php
215 } ?>
216 <!--<span class="span-icon-password">-->
217 <span class="fa fa-key"></span>
218 <input type="password" id="password" maxlength="128" placeholder="<?php echo $langs->trans("Password"); ?>" name="password" class="flat input-icon-password minwidth150" value="<?php echo dol_escape_htmltag($password); ?>" tabindex="2" autocomplete="<?php echo empty($conf->global->MAIN_LOGIN_ENABLE_PASSWORD_AUTOCOMPLETE) ? 'off' : 'on'; ?>" />
219 </div></div>
220 
221 <?php
222 if (!empty($captcha)) {
223  // Add a variable param to force not using cache (jmobile)
224  $php_self = preg_replace('/[&\?]time=(\d+)/', '', $php_self); // Remove param time
225  if (preg_match('/\?/', $php_self)) {
226  $php_self .= '&time='.dol_print_date(dol_now(), 'dayhourlog');
227  } else {
228  $php_self .= '?time='.dol_print_date(dol_now(), 'dayhourlog');
229  }
230  // TODO: provide accessible captcha variants
231  ?>
232  <!-- Captcha -->
233  <div class="trinputlogin">
234  <div class="tagtd none valignmiddle tdinputlogin nowrap">
235 
236  <span class="fa fa-unlock"></span>
237  <span class="span-icon-security inline-block">
238  <input id="securitycode" placeholder="<?php echo $langs->trans("SecurityCode"); ?>" class="flat input-icon-security width125" type="text" maxlength="5" name="code" tabindex="3" autocomplete="off" />
239  </span>
240  <span class="nowrap inline-block">
241  <img class="inline-block valignmiddle" src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />
242  <a class="inline-block valignmiddle" href="<?php echo $php_self; ?>" tabindex="4" data-role="button"><?php echo $captcha_refresh; ?></a>
243  </span>
244 
245  </div></div>
246  <?php
247 }
248 
249 if (!empty($morelogincontent)) {
250  if (is_array($morelogincontent)) {
251  foreach ($morelogincontent as $format => $option) {
252  if ($format == 'table') {
253  echo '<!-- Option by hook -->';
254  echo $option;
255  }
256  }
257  } else {
258  echo '<!-- Option by hook -->';
259  echo $morelogincontent;
260  }
261 }
262 
263 ?>
264 
265 </div>
266 
267 </div> <!-- end div login_right -->
268 
269 </div> <!-- end div login_line1 -->
270 
271 
272 <div id="login_line2" style="clear: both">
273 
274 <!-- Button Connection -->
275 <br>
276 <div id="login-submit-wrapper">
277 <input type="submit" class="button" value="&nbsp; <?php echo $langs->trans('Connection'); ?> &nbsp;" tabindex="5" />
278 </div>
279 
280 <?php
281 if ($forgetpasslink || $helpcenterlink) {
282  $moreparam = '';
283  if ($dol_hide_topmenu) {
284  $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_topmenu='.$dol_hide_topmenu;
285  }
286  if ($dol_hide_leftmenu) {
287  $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_leftmenu='.$dol_hide_leftmenu;
288  }
289  if ($dol_no_mouse_hover) {
290  $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_no_mouse_hover='.$dol_no_mouse_hover;
291  }
292  if ($dol_use_jmobile) {
293  $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_use_jmobile='.$dol_use_jmobile;
294  }
295 
296  echo '<br>';
297  echo '<div class="center" style="margin-top: 5px;">';
298  if ($forgetpasslink) {
299  $url = DOL_URL_ROOT.'/user/passwordforgotten.php'.$moreparam;
300  if (!empty($conf->global->MAIN_PASSWORD_FORGOTLINK)) {
301  $url = $conf->global->MAIN_PASSWORD_FORGOTLINK;
302  }
303  echo '<a class="alogin" href="'.dol_escape_htmltag($url).'">';
304  echo $langs->trans('PasswordForgotten');
305  echo '</a>';
306  }
307 
308  if ($forgetpasslink && $helpcenterlink) {
309  echo '&nbsp;-&nbsp;';
310  }
311 
312  if ($helpcenterlink) {
313  $url = DOL_URL_ROOT.'/support/index.php'.$moreparam;
314  if (!empty($conf->global->MAIN_HELPCENTER_LINKTOUSE)) {
315  $url = $conf->global->MAIN_HELPCENTER_LINKTOUSE;
316  }
317  echo '<a class="alogin" href="'.dol_escape_htmltag($url).'" target="_blank" rel="noopener noreferrer">';
318  echo $langs->trans('NeedHelpCenter');
319  echo '</a>';
320  }
321  echo '</div>';
322 }
323 
324 if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication)) {
325  $langs->load("users");
326 
327  //if (!empty($conf->global->MAIN_OPENIDURL_PERUSER)) $url=
328  echo '<br>';
329  echo '<div class="center" style="margin-top: 4px;">';
330 
331  $url = $conf->global->MAIN_AUTHENTICATION_OPENID_URL;
332  if (!empty($url)) {
333  print '<a class="alogin" href="'.$url.'">'.$langs->trans("LoginUsingOpenID").'</a>';
334  } else {
335  $langs->load("errors");
336  print '<span class="warning">'.$langs->trans("ErrorOpenIDSetupNotComplete", 'MAIN_AUTHENTICATION_OPENID_URL').'</span>';
337  }
338 
339  echo '</div>';
340 }
341 
342 if (isset($conf->file->main_authentication) && preg_match('/google/', $conf->file->main_authentication)) {
343  $langs->load("users");
344 
345  global $dolibarr_main_url_root;
346 
347  // Define $urlwithroot
348  $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
349  $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
350  //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
351 
352  echo '<br>';
353  echo '<div class="center" style="margin-top: 4px;">';
354 
355  //$shortscope = 'userinfo_email,userinfo_profile';
356  $shortscope = 'openid,email,profile'; // For openid connect
357 
358  $oauthstateanticsrf = bin2hex(random_bytes(128/8));
359  $_SESSION['oauthstateanticsrf'] = $shortscope.'-'.$oauthstateanticsrf;
360  $urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.$shortscope.'&state=forlogin-'.$shortscope.'-'.$oauthstateanticsrf;
361 
362  $url = $urltorenew;
363 
364  print img_picto('', 'google', 'class="pictofixedwidth"').'<a class="alogin" href="'.$url.'">'.$langs->trans("LoginWith", "Google").'</a>';
365 
366  echo '</div>';
367 }
368 
369 ?>
370 
371 </div> <!-- end login line 2 -->
372 
373 </div> <!-- end login table -->
374 
375 
376 </form>
377 
378 
379 <?php
380 // Show error message if defined
381 if (!empty($_SESSION['dol_loginmesg'])) {
382  ?>
383  <div class="center login_main_message">
384  <?php
385  $message = $_SESSION['dol_loginmesg']; // By default this is an error message
386  if (preg_match('/<!-- warning -->/', $message)) { // if it contains this comment, this is a warning message
387  $message = str_replace('<!-- warning -->', '', $message);
388  print '<div class="warning">';
389  } else {
390  print '<div class="error">';
391  }
392  print dol_escape_htmltag($message);
393  print '</div>';
394  ?>
395  </div>
396  <?php
397 }
398 
399 // Add commit strip
400 if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
401  include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
402  if (substr($langs->defaultlang, 0, 2) == 'fr') {
403  $resgetcommitstrip = getURLContent("https://www.commitstrip.com/fr/feed/");
404  } else {
405  $resgetcommitstrip = getURLContent("https://www.commitstrip.com/en/feed/");
406  }
407  if ($resgetcommitstrip && $resgetcommitstrip['http_code'] == '200') {
408  $xml = simplexml_load_string($resgetcommitstrip['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
409  $little = $xml->channel->item[0]->children('content', true);
410  print preg_replace('/width="650" height="658"/', '', $little->encoded);
411  }
412 }
413 
414 ?>
415 
416 <?php if ($main_home) {
417  ?>
418  <div class="center login_main_home paddingtopbottom <?php echo empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent boxshadow'; ?>" style="max-width: 70%">
419  <?php echo $main_home; ?>
420  </div><br>
421  <?php
422 }
423 ?>
424 
425 <!-- authentication mode = <?php echo $main_authentication ?> -->
426 <!-- cookie name used for this session = <?php echo $session_name ?> -->
427 <!-- urlfrom in this session = <?php echo isset($_SESSION["urlfrom"]) ? $_SESSION["urlfrom"] : ''; ?> -->
428 
429 <!-- Common footer is not used for login page, this is same than footer but inside login tpl -->
430 
431 <?php
432 if (!empty($conf->global->MAIN_HTML_FOOTER)) {
433  print $conf->global->MAIN_HTML_FOOTER;
434 }
435 
436 if (!empty($morelogincontent) && is_array($morelogincontent)) {
437  foreach ($morelogincontent as $format => $option) {
438  if ($format == 'js') {
439  echo "\n".'<!-- Javascript by hook -->';
440  echo $option."\n";
441  }
442  }
443 } elseif (!empty($moreloginextracontent)) {
444  echo '<!-- Javascript by hook -->';
445  echo $moreloginextracontent;
446 }
447 
448 // Google Analytics
449 // TODO Add a hook here
450 if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) {
451  $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID);
452  foreach ($tmptagarray as $tmptag) {
453  print "\n";
454  print "<!-- JS CODE TO ENABLE for google analtics tag -->\n";
455  print "
456  <!-- Global site tag (gtag.js) - Google Analytics -->
457  <script async src=\"https://www.googletagmanager.com/gtag/js?id=".trim($tmptag)."\"></script>
458  <script>
459  window.dataLayer = window.dataLayer || [];
460  function gtag(){dataLayer.push(arguments);}
461  gtag('js', new Date());
462 
463  gtag('config', '".trim($tmptag)."');
464  </script>";
465  print "\n";
466  }
467 }
468 
469 // TODO Replace this with a hook
470 // Google Adsense (need Google module)
471 if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) {
472  if (empty($conf->dol_use_jmobile)) {
473  ?>
474  <div class="center"><br>
475  <script><!--
476  google_ad_client = "<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
477  google_ad_slot = "<?php echo $conf->global->MAIN_GOOGLE_AD_SLOT ?>";
478  google_ad_width = <?php echo $conf->global->MAIN_GOOGLE_AD_WIDTH ?>;
479  google_ad_height = <?php echo $conf->global->MAIN_GOOGLE_AD_HEIGHT ?>;
480  //-->
481  </script>
482  <script src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
483  </div>
484  <?php
485  }
486 }
487 ?>
488 
489 
490 </div>
491 </div><!-- end of center -->
492 
493 
494 </body>
495 </html>
496 <!-- END PHP TEMPLATE -->
API that allows to log in with an user account.
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,...
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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)
Return value of a param into GET or POST supervariable.
getURLContent($url, $postorget='GET', $param='', $followlocation=1, $addheaders=array(), $allowedschemes=array('http', 'https'), $localurl=0, $ssl_verifypeer=-1)
Function to get a content from an URL (use proxy if proxy defined).
Definition: geturl.lib.php:41
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Ouput html header of a page.
Definition: main.inc.php:1571
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition: repair.php:119
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:122
httponly_accessforbidden($message=1, $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.