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