24if (!defined(
'NOBROWSERNOTIF')) {
25 define(
'NOBROWSERNOTIF', 1);
29if (empty($conf) || !is_object($conf)) {
30 print
"Error, template page can't be called as URL";
35$size = (empty($_SERVER[
'CONTENT_LENGTH']) ? 0 : (int) $_SERVER[
'CONTENT_LENGTH']);
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);
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
44header(
'Cache-Control: Public, must-revalidate');
46if (
GETPOST(
'dol_hide_topmenu')) {
47 $conf->dol_hide_topmenu = 1;
49if (
GETPOST(
'dol_hide_leftmenu')) {
50 $conf->dol_hide_leftmenu = 1;
52if (
GETPOST(
'dol_optimize_smallscreen')) {
53 $conf->dol_optimize_smallscreen = 1;
55if (
GETPOST(
'dol_no_mouse_hover')) {
56 $conf->dol_no_mouse_hover = 1;
58if (
GETPOST(
'dol_use_jmobile')) {
59 $conf->dol_use_jmobile = 1;
63if (!empty($conf->dol_use_jmobile)) {
64 $conf->use_javascript_ajax = 1;
69 $php_self .=
'?'.dol_escape_htmltag($_SERVER[
"QUERY_STRING"]);
71if (!preg_match(
'/mainmenu=/', $php_self)) {
72 $php_self .= (preg_match(
'/\?/', $php_self) ?
'&' :
'?').
'mainmenu=home';
74if (preg_match(
'/'.preg_quote(
'core/modules/oauth',
'/').
'/', $php_self)) {
75 $php_self = DOL_URL_ROOT.
'/index.php?mainmenu=home';
77$php_self = preg_replace(
'/(\?|&|&)action=[^&]+/',
'\1', $php_self);
78$php_self = preg_replace(
'/(\?|&|&)actionlogin=[^&]+/',
'\1', $php_self);
79$php_self = preg_replace(
'/(\?|&|&)afteroauthloginreturn=[^&]+/',
'\1', $php_self);
80$php_self = preg_replace(
'/(\?|&|&)username=[^&]*/',
'\1', $php_self);
81$php_self = preg_replace(
'/(\?|&|&)entity=\d+/',
'\1', $php_self);
82$php_self = preg_replace(
'/(\?|&|&)massaction=[^&]+/',
'\1', $php_self);
83$php_self = preg_replace(
'/(\?|&|&)token=[^&]+/',
'\1', $php_self);
84$php_self = preg_replace(
'/(&)+/',
'&', $php_self);
88 '/core/js/dst.js'.(empty($conf->dol_use_jmobile) ?
'' :
'?version='.urlencode(DOL_VERSION))
95 $titleofloginpage = $langs->trans(
'Login');
97$titleofloginpage .=
' @ '.$titletruedolibarrversion;
100if (!preg_match(
'/'.constant(
'DOL_APPLICATION_TITLE').
'/', $title)) {
101 $disablenofollow = 0;
104 $disablenofollow = 0;
108if (
getDolGlobalInt(
'MAIN_MODULE_OPENIDCONNECT', 0) > 0 && isset($conf->file->main_authentication) && preg_match(
'/openid_connect/', $conf->file->main_authentication)) {
110 $prefix = dol_getprefix(
'');
111 if (empty($_COOKIE[
"DOL_rollback_url_$prefix"])) {
112 setcookie(
'DOL_rollback_url_' . $prefix, $_SERVER[
'REQUEST_URI'], time() + 3600,
'/');
116 if ($conf->file->main_authentication ===
'openid_connect') {
118 if (empty(
GETPOST(
'openid_mode'))) {
120 header(
"Location: " . openid_connect_get_url(),
true, 302);
121 } elseif (!empty($_SESSION[
'dol_loginmesg'])) {
123 print
'<div class="center login_main_message"><div class="error">' .
dol_escape_htmltag($_SESSION[
'dol_loginmesg']) .
'</div></div>';
130top_htmlhead(
'', $titleofloginpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
133$colorbackhmenu1 =
'60,70,100';
134if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
135 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
140print
"<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->\n";
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;">
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')).
'\')
"'; ?>>
153<?php if (empty($conf->dol_use_jmobile)) { ?>
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
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.'"' : '';
172<div class="login_vertical_align
">
175<form id="login
" name="login
" method="post
" action="<?php echo $php_self; ?>
">
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; ?>
" />
197<!-- Title with version -->
198<div class="login_table_title center
" title="<?php echo
dol_escape_htmltag($title); ?>
">
200if ($disablenofollow) {
201 echo '<a class="login_table_title
" href="https:
204if ($disablenofollow) {
212<div
class=
"login_table">
214<div
id=
"login_line1">
217<img alt=
"" src=
"<?php echo $urllogo; ?>" id=
"img_logo" />
222<div
id=
"login_right">
224<div
class=
"tagtable left centpercent" title=
"<?php echo $langs->trans("EnterLoginDetail
"); ?>">
227<div
class=
"trinputlogin">
228<div
class=
"tagtd nowraponall center valignmiddle tdinputlogin">
230 ?><label
for=
"username" class=
"hidden"><?php echo $langs->trans(
"Login"); ?></label><?php
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" />
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">
243 ?><label
for=
"password" class=
"hidden"><?php echo $langs->trans(
"Password"); ?></label><?php
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'; ?>" />
253if (!empty($captcha)) {
255 $php_self = preg_replace(
'/[&\?]time=(\d+)/',
'', $php_self);
256 if (preg_match(
'/\?/', $php_self)) {
257 $php_self .=
'&time='.dol_print_date(
dol_now(),
'dayhourlog');
259 $php_self .=
'?time='.dol_print_date(
dol_now(),
'dayhourlog');
263 <div
class=
"trinputlogin">
264 <div
class=
"tagtd none valignmiddle tdinputlogin nowrap">
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" />
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>
279if (!empty($morelogincontent)) {
280 if (is_array($morelogincontent)) {
281 foreach ($morelogincontent as $format => $option) {
282 if ($format ==
'table') {
283 echo
'<!-- Option by hook -->';
288 echo
'<!-- Option by hook -->';
289 echo $morelogincontent;
297</div> <!-- end div login_right -->
299</div> <!-- end div login_line1 -->
302<div
id=
"login_line2" style=
"clear: both">
305<!-- Button Connection -->
306<?php
if (!isset($conf->file->main_authentication) || $conf->file->main_authentication !=
'googleoauth') { ?>
308<div
id=
"login-submit-wrapper">
309<input
type=
"submit" class=
"button" value=
" <?php echo $langs->trans('Connection'); ?> " tabindex=
"5" />
315if (isset($conf->file->main_authentication) && $conf->file->main_authentication ==
'googleoauth') {
316 $forgetpasslink =
'';
319if ($forgetpasslink || $helpcenterlink) {
321 if ($dol_hide_topmenu) {
322 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_topmenu='.$dol_hide_topmenu;
324 if ($dol_hide_leftmenu) {
325 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_leftmenu='.$dol_hide_leftmenu;
327 if ($dol_no_mouse_hover) {
328 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_no_mouse_hover='.$dol_no_mouse_hover;
330 if ($dol_use_jmobile) {
331 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_use_jmobile='.$dol_use_jmobile;
335 echo
'<div class="center" style="margin-top: 5px;">';
336 if ($forgetpasslink) {
337 $url = DOL_URL_ROOT.
'/user/passwordforgotten.php'.$moreparam;
341 echo
'<a class="alogin" href="'.dol_escape_htmltag($url).
'">';
342 echo $langs->trans(
'PasswordForgotten');
346 if ($forgetpasslink && $helpcenterlink) {
347 echo
' - ';
350 if ($helpcenterlink) {
351 $url = DOL_URL_ROOT.
'/support/index.php'.$moreparam;
355 echo
'<a class="alogin" href="'.dol_escape_htmltag($url).
'" target="_blank" rel="noopener noreferrer">';
356 echo $langs->trans(
'NeedHelpCenter');
362if (
getDolGlobalInt(
'MAIN_MODULE_OPENIDCONNECT', 0) > 0 && isset($conf->file->main_authentication) && preg_match(
'/openid/', $conf->file->main_authentication)) {
364 $langs->load(
"users");
367 print
'<div class="center" style="margin-top: 20px; margin-bottom: 10px">';
368 print
'<div class="loginbuttonexternal">';
371 $url = openid_connect_get_url();
373 $url =
getDolGlobalString(
'MAIN_AUTHENTICATION_OPENID_URL').
'&state=' . openid_connect_get_state();
376 print
'<a class="alogin" href="'.$url.
'">'.$langs->trans(
"LoginUsingOpenID").
'</a>';
378 $langs->load(
"errors");
379 print
'<span class="warning">'.$langs->trans(
"ErrorOpenIDSetupNotComplete",
'MAIN_AUTHENTICATION_OPENID_URL').
'</span>';
386if (isset($conf->file->main_authentication) && preg_match(
'/google/', $conf->file->main_authentication) && strpos($conf->browser->ua,
'DoliDroid') ===
false) {
387 $langs->load(
"users");
389 echo
'<div class="center" style="margin-top: 20px; margin-bottom: 10px">';
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");
420</div> <!-- end login line 2 -->
422</div> <!-- end login
table -->
430if (!empty($_SESSION[
'dol_loginmesg'])) {
431 $message = $_SESSION[
'dol_loginmesg'];
432 if (!empty($conf->use_javascript_ajax)) {
433 if (preg_match(
'/<!-- warning -->/', $message)) {
434 $message = str_replace(
'<!-- warning -->',
'', $message);
440 $(document).ready(function() {
441 $(".jnotify-container").addClass("jnotify-container-login");
446 <div
class=
"center login_main_message">
448 if (preg_match(
'/<!-- warning -->/', $message)) {
449 $message = str_replace(
'<!-- warning -->',
'', $message);
450 print
'<div class="warning" role="alert">';
452 print
'<div class="error" role="alert">';
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/");
467 $resgetcommitstrip =
getURLContent(
"https://www.commitstrip.com/en/feed/");
469 if ($resgetcommitstrip && $resgetcommitstrip[
'http_code'] ==
'200') {
470 if (LIBXML_VERSION < 20900) {
474 libxml_disable_entity_loader(
true);
477 $xml = simplexml_load_string($resgetcommitstrip[
'content'],
'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
479 $little = $xml->channel->item[0]->children(
'content',
true);
480 print preg_replace(
'/width="650" height="658"/',
'', $little->encoded);
486<?php
if ($main_home) {
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; ?>
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"] :
''; ?> -->
499<!-- Common footer is not used
for login page,
this is same than footer but inside login tpl -->
503 print $conf->global->MAIN_HTML_FOOTER;
506if (!empty($morelogincontent) && is_array($morelogincontent)) {
507 foreach ($morelogincontent as $format => $option) {
508 if ($format ==
'js') {
509 echo
"\n".
'<!-- Javascript by hook -->';
513} elseif (!empty($moreloginextracontent)) {
514 echo
'<!-- Javascript by hook -->';
515 echo $moreloginextracontent;
522 foreach ($tmptagarray as $tmptag) {
524 print
"<!-- JS CODE TO ENABLE for google analtics tag -->\n";
526 <!-- Global site tag (gtag.js) - Google Analytics -->
527 <script async src=\"https://www.googletagmanager.com/gtag/js?id=".trim($tmptag).
"\"></script>
529 window.dataLayer = window.dataLayer || [];
530 function gtag(){dataLayer.push(arguments);}
531 gtag('js', new Date());
533 gtag('config', '".trim($tmptag).
"');
542 if (empty($conf->dol_use_jmobile)) {
544 <div
class=
"center"><br>
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 ?>;
552 <script src=
"//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
561</div><!-- end of center -->
566<!-- 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,...
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
$conf db name
Only used if Module[ID]Name translation string is not found.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.