dolibarr 21.0.0-alpha
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 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20// Need global variable $urllogo, $title and $titletruedolibarrversion to be defined by caller (like dol_loginfunction in security2.lib.php)
21// Caller can also set $morelogincontent = array(['options']=>array('js'=>..., 'table'=>...);
22// $titletruedolibarrversion must be defined
23
24if (!defined('NOBROWSERNOTIF')) {
25 define('NOBROWSERNOTIF', 1);
26}
27
28// Protection to avoid direct call of template
29if (empty($conf) || !is_object($conf)) {
30 print "Error, template page can't be called as URL";
31 exit(1);
32}
33
34// DDOS protection
35$size = (empty($_SERVER['CONTENT_LENGTH']) ? 0 : (int) $_SERVER['CONTENT_LENGTH']);
36if ($size > 10000) {
37 $langs->loadLangs(array("errors", "install"));
38 httponly_accessforbidden('<center>'.$langs->trans("ErrorRequestTooLarge").'.<br><a href="'.DOL_URL_ROOT.'">'.$langs->trans("ClickHereToGoToApp").'</a></center>', 413, 1);
39}
40
41require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
42
43
44header('Cache-Control: Public, must-revalidate');
45
46if (GETPOST('dol_hide_topmenu')) {
47 $conf->dol_hide_topmenu = 1;
48}
49if (GETPOST('dol_hide_leftmenu')) {
50 $conf->dol_hide_leftmenu = 1;
51}
52if (GETPOST('dol_optimize_smallscreen')) {
53 $conf->dol_optimize_smallscreen = 1;
54}
55if (GETPOST('dol_no_mouse_hover')) {
56 $conf->dol_no_mouse_hover = 1;
57}
58if (GETPOST('dol_use_jmobile')) {
59 $conf->dol_use_jmobile = 1;
60}
61
62// If we force to use jmobile, then we reenable javascript
63if (!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;
68if (!empty($_SERVER["QUERY_STRING"]) && dol_escape_htmltag($_SERVER["QUERY_STRING"])) {
69 $php_self .= '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]);
70}
71if (!preg_match('/mainmenu=/', $php_self)) {
72 $php_self .= (preg_match('/\?/', $php_self) ? '&' : '?').'mainmenu=home';
73}
74if (preg_match('/'.preg_quote('core/modules/oauth', '/').'/', $php_self)) {
75 $php_self = DOL_URL_ROOT.'/index.php?mainmenu=home';
76}
77$php_self = preg_replace('/(\?|&amp;|&)action=[^&]+/', '\1', $php_self);
78$php_self = preg_replace('/(\?|&amp;|&)actionlogin=[^&]+/', '\1', $php_self);
79$php_self = preg_replace('/(\?|&amp;|&)afteroauthloginreturn=[^&]+/', '\1', $php_self);
80$php_self = preg_replace('/(\?|&amp;|&)username=[^&]*/', '\1', $php_self);
81$php_self = preg_replace('/(\?|&amp;|&)entity=\d+/', '\1', $php_self);
82$php_self = preg_replace('/(\?|&amp;|&)massaction=[^&]+/', '\1', $php_self);
83$php_self = preg_replace('/(\?|&amp;|&)token=[^&]+/', '\1', $php_self);
84$php_self = preg_replace('/(&amp;)+/', '&amp;', $php_self);
85
86// Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second
87$arrayofjs = array(
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 = getDolGlobalString('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
107// If OpenID Connect is set as an authentication
108if (getDolGlobalInt('MAIN_MODULE_OPENIDCONNECT', 0) > 0 && isset($conf->file->main_authentication) && preg_match('/openid_connect/', $conf->file->main_authentication)) {
109 // Set a cookie to transfer rollback page information
110 $prefix = dol_getprefix('');
111 if (empty($_COOKIE["DOL_rollback_url_$prefix"])) {
112 setcookie('DOL_rollback_url_' . $prefix, $_SERVER['REQUEST_URI'], time() + 3600, '/');
113 }
114
115 // Auto redirect if OpenID Connect is the only authentication
116 if ($conf->file->main_authentication === 'openid_connect') {
117 // Avoid redirection hell
118 if (empty(GETPOST('openid_mode'))) {
119 dol_include_once('/core/lib/openid_connect.lib.php');
120 header("Location: " . openid_connect_get_url(), true, 302);
121 } elseif (!empty($_SESSION['dol_loginmesg'])) {
122 // Show login error without the login form
123 print '<div class="center login_main_message"><div class="error">' . dol_escape_htmltag($_SESSION['dol_loginmesg']) . '</div></div>';
124 }
125 // We shouldn't continue executing this page
126 exit();
127 }
128}
129
130top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
131
132
133$colorbackhmenu1 = '60,70,100'; // topmenu
134if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
135 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
136}
137$colorbackhmenu1 = getDolUserString('THEME_ELDY_ENABLE_PERSONALIZED') ? getDolUserString('THEME_ELDY_TOPMENU_BACK1', $colorbackhmenu1) : getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', $colorbackhmenu1);
138$colorbackhmenu1 = implode(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
139
140print "<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->\n";
141
142if (getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) {
143 // For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random'?>
144 <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;">
145 <?php
146} else {
147 ?>
148 <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(getDolGlobalString('MAIN_LOGIN_BACKGROUND')).'\')"'; ?>>
149 <?php
150}
151?>
152
153<?php if (empty($conf->dol_use_jmobile)) { ?>
154<script>
155$(document).ready(function () {
156 /* Set focus on correct field */
157 <?php if ($focus_element) {
158 ?>$('#<?php echo $focus_element; ?>').focus(); <?php
159 } ?> // Warning to use this only on visible element
160});
161</script>
162<?php } ?>
163
164<div class="login_center center"<?php
165if (!getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) {
166 $backstyle = 'background: linear-gradient('.((!empty($conf->browser->layout) && $conf->browser->layout == 'phone') ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
167 // old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
168 $backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
169 print !getDolGlobalString('MAIN_LOGIN_BACKGROUND') ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; '.$backstyle.'"' : '';
170}
171?>>
172<div class="login_vertical_align">
173
174
175<form id="login" name="login" method="post" action="<?php echo $php_self; ?>">
176
177<input type="hidden" name="token" value="<?php echo newToken(); ?>" />
178<input type="hidden" name="actionlogin" value="login">
179<input type="hidden" name="loginfunction" value="loginfunction" />
180<input type="hidden" name="backtopage" value="<?php echo GETPOST('backtopage'); ?>" />
181<!-- Add fields to store and send local user information. This fields are filled by the core/js/dst.js -->
182<input type="hidden" name="tz" id="tz" value="" />
183<input type="hidden" name="tz_string" id="tz_string" value="" />
184<input type="hidden" name="dst_observed" id="dst_observed" value="" />
185<input type="hidden" name="dst_first" id="dst_first" value="" />
186<input type="hidden" name="dst_second" id="dst_second" value="" />
187<input type="hidden" name="screenwidth" id="screenwidth" value="" />
188<input type="hidden" name="screenheight" id="screenheight" value="" />
189<input type="hidden" name="dol_hide_topmenu" id="dol_hide_topmenu" value="<?php echo $dol_hide_topmenu; ?>" />
190<input type="hidden" name="dol_hide_leftmenu" id="dol_hide_leftmenu" value="<?php echo $dol_hide_leftmenu; ?>" />
191<input type="hidden" name="dol_optimize_smallscreen" id="dol_optimize_smallscreen" value="<?php echo $dol_optimize_smallscreen; ?>" />
192<input type="hidden" name="dol_no_mouse_hover" id="dol_no_mouse_hover" value="<?php echo $dol_no_mouse_hover; ?>" />
193<input type="hidden" name="dol_use_jmobile" id="dol_use_jmobile" value="<?php echo $dol_use_jmobile; ?>" />
194
195
196
197<!-- Title with version -->
198<div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>">
199<?php
200if ($disablenofollow) {
201 echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank" rel="noopener noreferrer external">';
202}
203echo dol_escape_htmltag($title);
204if ($disablenofollow) {
205 echo '</a>';
206}
207?>
208</div>
209
210
211
212<div class="login_table">
213
214<div id="login_line1">
215
216<div id="login_left">
217<img alt="" src="<?php echo $urllogo; ?>" id="img_logo" />
218</div>
219
220<br>
221
222<div id="login_right">
223
224<div class="tagtable left centpercent" title="<?php echo $langs->trans("EnterLoginDetail"); ?>">
225
226<!-- Login -->
227<div class="trinputlogin">
228<div class="tagtd nowraponall center valignmiddle tdinputlogin">
229<?php if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
230 ?><label for="username" class="hidden"><?php echo $langs->trans("Login"); ?></label><?php
231} ?>
232<!-- <span class="span-icon-user">-->
233<span class="fa fa-user"></span>
234<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" />
235</div>
236</div>
237
238<!-- Password -->
239<?php if (!isset($conf->file->main_authentication) || $conf->file->main_authentication != 'googleoauth') { ?>
240<div class="trinputlogin">
241<div class="tagtd nowraponall center valignmiddle tdinputlogin">
242 <?php if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
243 ?><label for="password" class="hidden"><?php echo $langs->trans("Password"); ?></label><?php
244 } ?>
245<!--<span class="span-icon-password">-->
246<span class="fa fa-key"></span>
247<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'; ?>" />
248</div></div>
249<?php } ?>
250
251
252<?php
253if (!empty($captcha)) {
254 // Add a variable param to force not using cache (jmobile)
255 $php_self = preg_replace('/[&\?]time=(\d+)/', '', $php_self); // Remove param time
256 if (preg_match('/\?/', $php_self)) {
257 $php_self .= '&time='.dol_print_date(dol_now(), 'dayhourlog');
258 } else {
259 $php_self .= '?time='.dol_print_date(dol_now(), 'dayhourlog');
260 }
261 // TODO: provide accessible captcha variants?>
262 <!-- Captcha -->
263 <div class="trinputlogin">
264 <div class="tagtd none valignmiddle tdinputlogin nowrap">
265
266 <span class="fa fa-unlock"></span>
267 <span class="span-icon-security inline-block">
268 <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" />
269 </span>
270 <span class="nowrap inline-block">
271 <img class="inline-block valignmiddle" src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />
272 <a class="inline-block valignmiddle" href="<?php echo $php_self; ?>" tabindex="4" data-role="button"><?php echo $captcha_refresh; ?></a>
273 </span>
274
275 </div></div>
276 <?php
277}
278
279if (!empty($morelogincontent)) {
280 if (is_array($morelogincontent)) {
281 foreach ($morelogincontent as $format => $option) {
282 if ($format == 'table') {
283 echo '<!-- Option by hook -->';
284 echo $option;
285 }
286 }
287 } else {
288 echo '<!-- Option by hook -->';
289 echo $morelogincontent;
290 }
291}
292
293?>
294
295</div>
296
297</div> <!-- end div login_right -->
298
299</div> <!-- end div login_line1 -->
300
301
302<div id="login_line2" style="clear: both">
303
304
305<!-- Button Connection -->
306<?php if (!isset($conf->file->main_authentication) || $conf->file->main_authentication != 'googleoauth') { ?>
307<br>
308<div id="login-submit-wrapper">
309<input type="submit" class="button" value="&nbsp; <?php echo $langs->trans('Connection'); ?> &nbsp;" tabindex="5" />
310</div>
311<?php } ?>
312
313
314<?php
315if (isset($conf->file->main_authentication) && $conf->file->main_authentication == 'googleoauth') {
316 $forgetpasslink = '';
317}
318
319if ($forgetpasslink || $helpcenterlink) {
320 $moreparam = '';
321 if ($dol_hide_topmenu) {
322 $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_topmenu='.$dol_hide_topmenu;
323 }
324 if ($dol_hide_leftmenu) {
325 $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_leftmenu='.$dol_hide_leftmenu;
326 }
327 if ($dol_no_mouse_hover) {
328 $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_no_mouse_hover='.$dol_no_mouse_hover;
329 }
330 if ($dol_use_jmobile) {
331 $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_use_jmobile='.$dol_use_jmobile;
332 }
333
334 echo '<br>';
335 echo '<div class="center" style="margin-top: 5px;">';
336 if ($forgetpasslink) {
337 $url = DOL_URL_ROOT.'/user/passwordforgotten.php'.$moreparam;
338 if (getDolGlobalString('MAIN_PASSWORD_FORGOTLINK')) {
339 $url = getDolGlobalString('MAIN_PASSWORD_FORGOTLINK');
340 }
341 echo '<a class="alogin" href="'.dol_escape_htmltag($url).'">';
342 echo $langs->trans('PasswordForgotten');
343 echo '</a>';
344 }
345
346 if ($forgetpasslink && $helpcenterlink) {
347 echo '&nbsp;-&nbsp;';
348 }
349
350 if ($helpcenterlink) {
351 $url = DOL_URL_ROOT.'/support/index.php'.$moreparam;
352 if (getDolGlobalString('MAIN_HELPCENTER_LINKTOUSE')) {
353 $url = getDolGlobalString('MAIN_HELPCENTER_LINKTOUSE');
354 }
355 echo '<a class="alogin" href="'.dol_escape_htmltag($url).'" target="_blank" rel="noopener noreferrer">';
356 echo $langs->trans('NeedHelpCenter');
357 echo '</a>';
358 }
359 echo '</div>';
360}
361
362if (getDolGlobalInt('MAIN_MODULE_OPENIDCONNECT', 0) > 0 && isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication)) {
363 dol_include_once('/core/lib/openid_connect.lib.php');
364 $langs->load("users");
365
366 //if (!empty($conf->global->MAIN_OPENIDURL_PERUSER)) $url=
367 print '<div class="center" style="margin-top: 20px; margin-bottom: 10px">';
368 print '<div class="loginbuttonexternal">';
369
370 if (!getDolGlobalString("MAIN_AUTHENTICATION_OPENID_URL")) {
371 $url = openid_connect_get_url();
372 } else {
373 $url = getDolGlobalString('MAIN_AUTHENTICATION_OPENID_URL').'&state=' . openid_connect_get_state();
374 }
375 if (!empty($url)) {
376 print '<a class="alogin" href="'.$url.'">'.$langs->trans("LoginUsingOpenID").'</a>';
377 } else {
378 $langs->load("errors");
379 print '<span class="warning">'.$langs->trans("ErrorOpenIDSetupNotComplete", 'MAIN_AUTHENTICATION_OPENID_URL').'</span>';
380 }
381
382 print '</div>';
383 print '</div>';
384}
385
386if (isset($conf->file->main_authentication) && preg_match('/google/', $conf->file->main_authentication) && strpos($conf->browser->ua, 'DoliDroid') === false) {
387 $langs->load("users");
388
389 echo '<div class="center" style="margin-top: 20px; margin-bottom: 10px">';
390
391 /*global $dolibarr_main_url_root;
392
393 // Define $urlwithroot
394 $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
395 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
396 //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
397
398 //$shortscope = 'userinfo_email,userinfo_profile';
399 $shortscope = 'openid,email,profile'; // For openid connect
400
401 $oauthstateanticsrf = bin2hex(random_bytes(128/8));
402 $_SESSION['oauthstateanticsrf'] = $shortscope.'-'.$oauthstateanticsrf;
403 $urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.$shortscope.'&state=forlogin-'.$shortscope.'-'.$oauthstateanticsrf;
404
405 //$url = $urltorenew;
406 */
407
408 print '<input type="hidden" name="beforeoauthloginredirect" id="beforeoauthloginredirect" value="">';
409 print '<a class="alogin" href="#" onclick="console.log(\'Set beforeoauthloginredirect value\'); jQuery(\'#beforeoauthloginredirect\').val(\'google\'); $(this).closest(\'form\').submit(); return false;">';
410 print '<div class="loginbuttonexternal">';
411 print img_picto('', 'google', 'class="pictofixedwidth"');
412 print $langs->trans("LoginWith", "Google");
413 print '</div>';
414 print '</a>';
415 print '</div>';
416}
417
418?>
419
420</div> <!-- end login line 2 -->
421
422</div> <!-- end login table -->
423
424
425</form>
426
427
428<?php
429// Show error message if defined
430if (!empty($_SESSION['dol_loginmesg'])) {
431 $message = $_SESSION['dol_loginmesg']; // By default this is an error message
432 if (!empty($conf->use_javascript_ajax)) {
433 if (preg_match('/<!-- warning -->/', $message)) { // if it contains this comment, this is a warning message
434 $message = str_replace('<!-- warning -->', '', $message);
435 dol_htmloutput_mesg($message, array(), 'warning');
436 } else {
437 dol_htmloutput_mesg($message, array(), 'error');
438 }
439 print '<script>
440 $(document).ready(function() {
441 $(".jnotify-container").addClass("jnotify-container-login");
442 });
443 </script>';
444 } else {
445 ?>
446 <div class="center login_main_message">
447 <?php
448 if (preg_match('/<!-- warning -->/', $message)) { // if it contains this comment, this is a warning message
449 $message = str_replace('<!-- warning -->', '', $message);
450 print '<div class="warning" role="alert">';
451 } else {
452 print '<div class="error" role="alert">';
453 }
454 print dol_escape_htmltag($message);
455 print '</div>'; ?>
456 </div>
457 <?php
458 }
459}
460
461// Add commit strip
462if (getDolGlobalString('MAIN_EASTER_EGG_COMMITSTRIP')) {
463 include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
464 if (substr($langs->defaultlang, 0, 2) == 'fr') {
465 $resgetcommitstrip = getURLContent("https://www.commitstrip.com/fr/feed/");
466 } else {
467 $resgetcommitstrip = getURLContent("https://www.commitstrip.com/en/feed/");
468 }
469 if ($resgetcommitstrip && $resgetcommitstrip['http_code'] == '200') {
470 if (LIBXML_VERSION < 20900) {
471 // Avoid load of external entities (security problem).
472 // Required only if LIBXML_VERSION < 20900
473 // @phan-suppress-next-line PhanDeprecatedFunctionInternal
474 libxml_disable_entity_loader(true);
475 }
476
477 $xml = simplexml_load_string($resgetcommitstrip['content'], 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
478 // @phan-suppress-next-line PhanPluginUnknownObjectMethodCall
479 $little = $xml->channel->item[0]->children('content', true);
480 print preg_replace('/width="650" height="658"/', '', $little->encoded);
481 }
482}
483
484?>
485
486<?php if ($main_home) {
487 ?>
488 <div class="center login_main_home paddingtopbottom <?php echo !getDolGlobalString('MAIN_LOGIN_BACKGROUND') ? '' : ' backgroundsemitransparent boxshadow'; ?>" style="max-width: 70%">
489 <?php echo $main_home; ?>
490 </div><br>
491 <?php
492}
493?>
494
495<!-- authentication mode = <?php echo $main_authentication ?> -->
496<!-- cookie name used for this session = <?php echo $session_name ?> -->
497<!-- urlfrom in this session = <?php echo isset($_SESSION["urlfrom"]) ? $_SESSION["urlfrom"] : ''; ?> -->
498
499<!-- Common footer is not used for login page, this is same than footer but inside login tpl -->
500
501<?php
502if (getDolGlobalString('MAIN_HTML_FOOTER')) {
503 print $conf->global->MAIN_HTML_FOOTER;
504}
505
506if (!empty($morelogincontent) && is_array($morelogincontent)) {
507 foreach ($morelogincontent as $format => $option) {
508 if ($format == 'js') {
509 echo "\n".'<!-- Javascript by hook -->';
510 echo $option."\n";
511 }
512 }
513} elseif (!empty($moreloginextracontent)) {
514 echo '<!-- Javascript by hook -->';
515 echo $moreloginextracontent;
516}
517
518// Google Analytics
519// TODO Remove this, and add content into hook getLoginPageExtraOptions() instead
520if (isModEnabled('google') && getDolGlobalString('MAIN_GOOGLE_AN_ID')) {
521 $tmptagarray = explode(',', getDolGlobalString('MAIN_GOOGLE_AN_ID'));
522 foreach ($tmptagarray as $tmptag) {
523 print "\n";
524 print "<!-- JS CODE TO ENABLE for google analtics tag -->\n";
525 print "
526 <!-- Global site tag (gtag.js) - Google Analytics -->
527 <script async src=\"https://www.googletagmanager.com/gtag/js?id=".trim($tmptag)."\"></script>
528 <script>
529 window.dataLayer = window.dataLayer || [];
530 function gtag(){dataLayer.push(arguments);}
531 gtag('js', new Date());
532
533 gtag('config', '".trim($tmptag)."');
534 </script>";
535 print "\n";
536 }
537}
538
539// TODO Replace this with a hook
540// Google Adsense (need Google module)
541if (isModEnabled('google') && getDolGlobalString('MAIN_GOOGLE_AD_CLIENT') && getDolGlobalString('MAIN_GOOGLE_AD_SLOT')) {
542 if (empty($conf->dol_use_jmobile)) {
543 ?>
544 <div class="center"><br>
545 <script><!--
546 google_ad_client = "<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
547 google_ad_slot = "<?php echo $conf->global->MAIN_GOOGLE_AD_SLOT ?>";
548 google_ad_width = <?php echo $conf->global->MAIN_GOOGLE_AD_WIDTH ?>;
549 google_ad_height = <?php echo $conf->global->MAIN_GOOGLE_AD_HEIGHT ?>;
550 //-->
551 </script>
552 <script src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
553 </div>
554 <?php
555 }
556}
557?>
558
559
560</div>
561</div><!-- end of center -->
562
563
564</body>
565</html>
566<!-- END PHP TEMPLATE -->
print $object position
Definition edit.php:195
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,...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
getDolUserString($key, $default='', $tmpuser=null)
Return Dolibarr user constant string value.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
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.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formatted messages to output (Used to show messages on html output).
getDolGlobalString($key, $default='')
Return a 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...
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).
treeview li table
No Email.
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output 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:139
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:142
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.