dolibarr 19.0.3
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
23if (!defined('NOBROWSERNOTIF')) {
24 define('NOBROWSERNOTIF', 1);
25}
26
27// Protection to avoid direct call of template
28if (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']);
35if ($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
40require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
41
42
43header('Cache-Control: Public, must-revalidate');
44
45if (GETPOST('dol_hide_topmenu')) {
46 $conf->dol_hide_topmenu = 1;
47}
48if (GETPOST('dol_hide_leftmenu')) {
49 $conf->dol_hide_leftmenu = 1;
50}
51if (GETPOST('dol_optimize_smallscreen')) {
52 $conf->dol_optimize_smallscreen = 1;
53}
54if (GETPOST('dol_no_mouse_hover')) {
55 $conf->dol_no_mouse_hover = 1;
56}
57if (GETPOST('dol_use_jmobile')) {
58 $conf->dol_use_jmobile = 1;
59}
60
61// If we force to use jmobile, then we reenable javascript
62if (!empty($conf->dol_use_jmobile)) {
63 $conf->use_javascript_ajax = 1;
64}
65
66$php_self = empty($php_self) ? dol_escape_htmltag($_SERVER['PHP_SELF']) : $php_self;
67if (!empty($_SERVER["QUERY_STRING"]) && dol_escape_htmltag($_SERVER["QUERY_STRING"])) {
68 $php_self .= '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]);
69}
70if (!preg_match('/mainmenu=/', $php_self)) {
71 $php_self .= (preg_match('/\?/', $php_self) ? '&' : '?').'mainmenu=home';
72}
73if (preg_match('/'.preg_quote('core/modules/oauth', '/').'/', $php_self)) {
74 $php_self = DOL_URL_ROOT.'/index.php?mainmenu=home';
75}
76$php_self = preg_replace('/(\?|&amp;|&)action=[^&]+/', '\1', $php_self);
77$php_self = preg_replace('/(\?|&amp;|&)actionlogin=[^&]+/', '\1', $php_self);
78$php_self = preg_replace('/(\?|&amp;|&)afteroauthloginreturn=[^&]+/', '\1', $php_self);
79$php_self = preg_replace('/(\?|&amp;|&)username=[^&]*/', '\1', $php_self);
80$php_self = preg_replace('/(\?|&amp;|&)entity=\d+/', '\1', $php_self);
81$php_self = preg_replace('/(\?|&amp;|&)massaction=[^&]+/', '\1', $php_self);
82$php_self = preg_replace('/(\?|&amp;|&)token=[^&]+/', '\1', $php_self);
83$php_self = preg_replace('/(&amp;)+/', '&amp;', $php_self);
84
85// Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second
86$arrayofjs = array(
87 '/includes/jstz/jstz.min.js'.(empty($conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION)),
88 '/core/js/dst.js'.(empty($conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION))
89);
90
91// We display application title instead Login term
92if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
93 $titleofloginpage = $conf->global->MAIN_APPLICATION_TITLE;
94} else {
95 $titleofloginpage = $langs->trans('Login');
96}
97$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.
98
99$disablenofollow = 1;
100if (!preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $title)) {
101 $disablenofollow = 0;
102}
103if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
104 $disablenofollow = 0;
105}
106
107top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
108
109
110$colorbackhmenu1 = '60,70,100'; // topmenu
111if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
112 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
113}
114$colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!getDolGlobalString('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);
115$colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
116
117print "<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->\n";
118
119if (getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) {
120 // For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random'?>
121 <body class="body bodylogin" style="background-image: url('<?php echo dol_escape_htmltag(getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')); ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;">
122 <?php
123} else {
124 ?>
125 <body class="body bodylogin"<?php print !getDolGlobalString('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).'\')"'; ?>>
126 <?php
127}
128?>
129
130<?php if (empty($conf->dol_use_jmobile)) { ?>
131<script>
132$(document).ready(function () {
133 /* Set focus on correct field */
134 <?php if ($focus_element) {
135 ?>$('#<?php echo $focus_element; ?>').focus(); <?php
136 } ?> // Warning to use this only on visible element
137});
138</script>
139<?php } ?>
140
141<div class="login_center center"<?php
142if (!getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) {
143 $backstyle = 'background: linear-gradient('.((!empty($conf->browser->layout) && $conf->browser->layout == 'phone') ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
144 // old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
145 $backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
146 print !getDolGlobalString('MAIN_LOGIN_BACKGROUND') ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; '.$backstyle.'"' : '';
147}
148?>>
149<div class="login_vertical_align">
150
151
152<form id="login" name="login" method="post" action="<?php echo $php_self; ?>">
153
154<input type="hidden" name="token" value="<?php echo newToken(); ?>" />
155<input type="hidden" name="actionlogin" value="login">
156<input type="hidden" name="loginfunction" value="loginfunction" />
157<input type="hidden" name="backtopage" value="<?php echo GETPOST('backtopage'); ?>" />
158<!-- Add fields to store and send local user information. This fields are filled by the core/js/dst.js -->
159<input type="hidden" name="tz" id="tz" value="" />
160<input type="hidden" name="tz_string" id="tz_string" value="" />
161<input type="hidden" name="dst_observed" id="dst_observed" value="" />
162<input type="hidden" name="dst_first" id="dst_first" value="" />
163<input type="hidden" name="dst_second" id="dst_second" value="" />
164<input type="hidden" name="screenwidth" id="screenwidth" value="" />
165<input type="hidden" name="screenheight" id="screenheight" value="" />
166<input type="hidden" name="dol_hide_topmenu" id="dol_hide_topmenu" value="<?php echo $dol_hide_topmenu; ?>" />
167<input type="hidden" name="dol_hide_leftmenu" id="dol_hide_leftmenu" value="<?php echo $dol_hide_leftmenu; ?>" />
168<input type="hidden" name="dol_optimize_smallscreen" id="dol_optimize_smallscreen" value="<?php echo $dol_optimize_smallscreen; ?>" />
169<input type="hidden" name="dol_no_mouse_hover" id="dol_no_mouse_hover" value="<?php echo $dol_no_mouse_hover; ?>" />
170<input type="hidden" name="dol_use_jmobile" id="dol_use_jmobile" value="<?php echo $dol_use_jmobile; ?>" />
171
172
173
174<!-- Title with version -->
175<div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>">
176<?php
177if ($disablenofollow) {
178 echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank" rel="noopener noreferrer external">';
179}
180echo dol_escape_htmltag($title);
181if ($disablenofollow) {
182 echo '</a>';
183}
184?>
185</div>
186
187
188
189<div class="login_table">
190
191<div id="login_line1">
192
193<div id="login_left">
194<img alt="" src="<?php echo $urllogo; ?>" id="img_logo" />
195</div>
196
197<br>
198
199<div id="login_right">
200
201<div class="tagtable left centpercent" title="<?php echo $langs->trans("EnterLoginDetail"); ?>">
202
203<!-- Login -->
204<div class="trinputlogin">
205<div class="tagtd nowraponall center valignmiddle tdinputlogin">
206<?php if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
207 ?><label for="username" class="hidden"><?php echo $langs->trans("Login"); ?></label><?php
208} ?>
209<!-- <span class="span-icon-user">-->
210<span class="fa fa-user"></span>
211<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" />
212</div>
213</div>
214
215<!-- Password -->
216<?php if (!isset($conf->file->main_authentication) || $conf->file->main_authentication != 'googleoauth') { ?>
217<div class="trinputlogin">
218<div class="tagtd nowraponall center valignmiddle tdinputlogin">
219 <?php if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
220 ?><label for="password" class="hidden"><?php echo $langs->trans("Password"); ?></label><?php
221 } ?>
222<!--<span class="span-icon-password">-->
223<span class="fa fa-key"></span>
224<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 !getDolGlobalString('MAIN_LOGIN_ENABLE_PASSWORD_AUTOCOMPLETE') ? 'off' : 'on'; ?>" />
225</div></div>
226<?php } ?>
227
228
229<?php
230if (!empty($captcha)) {
231 // Add a variable param to force not using cache (jmobile)
232 $php_self = preg_replace('/[&\?]time=(\d+)/', '', $php_self); // Remove param time
233 if (preg_match('/\?/', $php_self)) {
234 $php_self .= '&time='.dol_print_date(dol_now(), 'dayhourlog');
235 } else {
236 $php_self .= '?time='.dol_print_date(dol_now(), 'dayhourlog');
237 }
238 // TODO: provide accessible captcha variants?>
239 <!-- Captcha -->
240 <div class="trinputlogin">
241 <div class="tagtd none valignmiddle tdinputlogin nowrap">
242
243 <span class="fa fa-unlock"></span>
244 <span class="span-icon-security inline-block">
245 <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" />
246 </span>
247 <span class="nowrap inline-block">
248 <img class="inline-block valignmiddle" src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />
249 <a class="inline-block valignmiddle" href="<?php echo $php_self; ?>" tabindex="4" data-role="button"><?php echo $captcha_refresh; ?></a>
250 </span>
251
252 </div></div>
253 <?php
254}
255
256if (!empty($morelogincontent)) {
257 if (is_array($morelogincontent)) {
258 foreach ($morelogincontent as $format => $option) {
259 if ($format == 'table') {
260 echo '<!-- Option by hook -->';
261 echo $option;
262 }
263 }
264 } else {
265 echo '<!-- Option by hook -->';
266 echo $morelogincontent;
267 }
268}
269
270?>
271
272</div>
273
274</div> <!-- end div login_right -->
275
276</div> <!-- end div login_line1 -->
277
278
279<div id="login_line2" style="clear: both">
280
281
282<!-- Button Connection -->
283<?php if (!isset($conf->file->main_authentication) || $conf->file->main_authentication != 'googleoauth') { ?>
284<br>
285<div id="login-submit-wrapper">
286<input type="submit" class="button" value="&nbsp; <?php echo $langs->trans('Connection'); ?> &nbsp;" tabindex="5" />
287</div>
288<?php } ?>
289
290
291<?php
292if (isset($conf->file->main_authentication) && $conf->file->main_authentication == 'googleoauth') {
293 $forgetpasslink = '';
294}
295
296if ($forgetpasslink || $helpcenterlink) {
297 $moreparam = '';
298 if ($dol_hide_topmenu) {
299 $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_topmenu='.$dol_hide_topmenu;
300 }
301 if ($dol_hide_leftmenu) {
302 $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_leftmenu='.$dol_hide_leftmenu;
303 }
304 if ($dol_no_mouse_hover) {
305 $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_no_mouse_hover='.$dol_no_mouse_hover;
306 }
307 if ($dol_use_jmobile) {
308 $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_use_jmobile='.$dol_use_jmobile;
309 }
310
311 echo '<br>';
312 echo '<div class="center" style="margin-top: 5px;">';
313 if ($forgetpasslink) {
314 $url = DOL_URL_ROOT.'/user/passwordforgotten.php'.$moreparam;
315 if (getDolGlobalString('MAIN_PASSWORD_FORGOTLINK')) {
316 $url = $conf->global->MAIN_PASSWORD_FORGOTLINK;
317 }
318 echo '<a class="alogin" href="'.dol_escape_htmltag($url).'">';
319 echo $langs->trans('PasswordForgotten');
320 echo '</a>';
321 }
322
323 if ($forgetpasslink && $helpcenterlink) {
324 echo '&nbsp;-&nbsp;';
325 }
326
327 if ($helpcenterlink) {
328 $url = DOL_URL_ROOT.'/support/index.php'.$moreparam;
329 if (getDolGlobalString('MAIN_HELPCENTER_LINKTOUSE')) {
330 $url = $conf->global->MAIN_HELPCENTER_LINKTOUSE;
331 }
332 echo '<a class="alogin" href="'.dol_escape_htmltag($url).'" target="_blank" rel="noopener noreferrer">';
333 echo $langs->trans('NeedHelpCenter');
334 echo '</a>';
335 }
336 echo '</div>';
337}
338
339if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication)) {
340 $langs->load("users");
341
342 //if (!empty($conf->global->MAIN_OPENIDURL_PERUSER)) $url=
343 print '<div class="center" style="margin-top: 20px; margin-bottom: 10px">';
344 print '<div class="loginbuttonexternal">';
345
346 $url = $conf->global->MAIN_AUTHENTICATION_OPENID_URL;
347 if (!empty($url)) {
348 print '<a class="alogin" href="'.$url.'">'.$langs->trans("LoginUsingOpenID").'</a>';
349 } else {
350 $langs->load("errors");
351 print '<span class="warning">'.$langs->trans("ErrorOpenIDSetupNotComplete", 'MAIN_AUTHENTICATION_OPENID_URL').'</span>';
352 }
353
354 print '</div>';
355 print '</div>';
356}
357
358if (isset($conf->file->main_authentication) && preg_match('/google/', $conf->file->main_authentication) && strpos($conf->browser->ua, 'DoliDroid') === false) {
359 $langs->load("users");
360
361 echo '<div class="center" style="margin-top: 20px; margin-bottom: 10px">';
362
363 /*global $dolibarr_main_url_root;
364
365 // Define $urlwithroot
366 $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
367 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
368 //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
369
370 //$shortscope = 'userinfo_email,userinfo_profile';
371 $shortscope = 'openid,email,profile'; // For openid connect
372
373 $oauthstateanticsrf = bin2hex(random_bytes(128/8));
374 $_SESSION['oauthstateanticsrf'] = $shortscope.'-'.$oauthstateanticsrf;
375 $urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.$shortscope.'&state=forlogin-'.$shortscope.'-'.$oauthstateanticsrf;
376
377 //$url = $urltorenew;
378 */
379
380 print '<input type="hidden" name="beforeoauthloginredirect" id="beforeoauthloginredirect" value="">';
381 print '<a class="alogin" href="#" onclick="console.log(\'Set beforeoauthloginredirect value\'); jQuery(\'#beforeoauthloginredirect\').val(\'google\'); $(this).closest(\'form\').submit(); return false;">';
382 print '<div class="loginbuttonexternal">';
383 print img_picto('', 'google', 'class="pictofixedwidth"');
384 print $langs->trans("LoginWith", "Google");
385 print '</div>';
386 print '</a>';
387 print '</div>';
388}
389
390?>
391
392</div> <!-- end login line 2 -->
393
394</div> <!-- end login table -->
395
396
397</form>
398
399
400<?php
401// Show error message if defined
402if (!empty($_SESSION['dol_loginmesg'])) {
403 ?>
404 <div class="center login_main_message">
405 <?php
406 $message = $_SESSION['dol_loginmesg']; // By default this is an error message
407 if (preg_match('/<!-- warning -->/', $message)) { // if it contains this comment, this is a warning message
408 $message = str_replace('<!-- warning -->', '', $message);
409 print '<div class="warning">';
410 } else {
411 print '<div class="error">';
412 }
413 print dol_escape_htmltag($message);
414 print '</div>'; ?>
415 </div>
416 <?php
417}
418
419// Add commit strip
420if (getDolGlobalString('MAIN_EASTER_EGG_COMMITSTRIP')) {
421 include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
422 if (substr($langs->defaultlang, 0, 2) == 'fr') {
423 $resgetcommitstrip = getURLContent("https://www.commitstrip.com/fr/feed/");
424 } else {
425 $resgetcommitstrip = getURLContent("https://www.commitstrip.com/en/feed/");
426 }
427 if ($resgetcommitstrip && $resgetcommitstrip['http_code'] == '200') {
428 if (LIBXML_VERSION < 20900) {
429 // Avoid load of external entities (security problem).
430 // Required only if LIBXML_VERSION < 20900
431 libxml_disable_entity_loader(true);
432 }
433
434 $xml = simplexml_load_string($resgetcommitstrip['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
435 $little = $xml->channel->item[0]->children('content', true);
436 print preg_replace('/width="650" height="658"/', '', $little->encoded);
437 }
438}
439
440?>
441
442<?php if ($main_home) {
443 ?>
444 <div class="center login_main_home paddingtopbottom <?php echo !getDolGlobalString('MAIN_LOGIN_BACKGROUND') ? '' : ' backgroundsemitransparent boxshadow'; ?>" style="max-width: 70%">
445 <?php echo $main_home; ?>
446 </div><br>
447 <?php
448}
449?>
450
451<!-- authentication mode = <?php echo $main_authentication ?> -->
452<!-- cookie name used for this session = <?php echo $session_name ?> -->
453<!-- urlfrom in this session = <?php echo isset($_SESSION["urlfrom"]) ? $_SESSION["urlfrom"] : ''; ?> -->
454
455<!-- Common footer is not used for login page, this is same than footer but inside login tpl -->
456
457<?php
458if (getDolGlobalString('MAIN_HTML_FOOTER')) {
459 print $conf->global->MAIN_HTML_FOOTER;
460}
461
462if (!empty($morelogincontent) && is_array($morelogincontent)) {
463 foreach ($morelogincontent as $format => $option) {
464 if ($format == 'js') {
465 echo "\n".'<!-- Javascript by hook -->';
466 echo $option."\n";
467 }
468 }
469} elseif (!empty($moreloginextracontent)) {
470 echo '<!-- Javascript by hook -->';
471 echo $moreloginextracontent;
472}
473
474// Google Analytics
475// TODO Remove this, and add content into hook getLoginPageExtraOptions() instead
476if (isModEnabled('google') && getDolGlobalString('MAIN_GOOGLE_AN_ID')) {
477 $tmptagarray = explode(',', getDolGlobalString('MAIN_GOOGLE_AN_ID'));
478 foreach ($tmptagarray as $tmptag) {
479 print "\n";
480 print "<!-- JS CODE TO ENABLE for google analtics tag -->\n";
481 print "
482 <!-- Global site tag (gtag.js) - Google Analytics -->
483 <script async src=\"https://www.googletagmanager.com/gtag/js?id=".trim($tmptag)."\"></script>
484 <script>
485 window.dataLayer = window.dataLayer || [];
486 function gtag(){dataLayer.push(arguments);}
487 gtag('js', new Date());
488
489 gtag('config', '".trim($tmptag)."');
490 </script>";
491 print "\n";
492 }
493}
494
495// TODO Replace this with a hook
496// Google Adsense (need Google module)
497if (isModEnabled('google') && getDolGlobalString('MAIN_GOOGLE_AD_CLIENT') && getDolGlobalString('MAIN_GOOGLE_AD_SLOT')) {
498 if (empty($conf->dol_use_jmobile)) {
499 ?>
500 <div class="center"><br>
501 <script><!--
502 google_ad_client = "<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
503 google_ad_slot = "<?php echo $conf->global->MAIN_GOOGLE_AD_SLOT ?>";
504 google_ad_width = <?php echo $conf->global->MAIN_GOOGLE_AD_WIDTH ?>;
505 google_ad_height = <?php echo $conf->global->MAIN_GOOGLE_AD_HEIGHT ?>;
506 //-->
507 </script>
508 <script src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
509 </div>
510 <?php
511 }
512}
513?>
514
515
516</div>
517</div><!-- end of center -->
518
519
520</body>
521</html>
522<!-- 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_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)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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...
rtl background position
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).
conf($dolibarr_main_document_root)
Load conf file (file must exists)
Definition inc.php:403
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Ouput html header of a page.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition repair.php:121
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:124
httponly_accessforbidden($message=1, $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.