23if (!defined(
'NOBROWSERNOTIF')) {
24 define(
'NOBROWSERNOTIF', 1);
28if (empty($conf) || !is_object($conf)) {
29 print
"Error, template page can't be called as URL";
34$size = (empty($_SERVER[
'CONTENT_LENGTH']) ? 0 : (int) $_SERVER[
'CONTENT_LENGTH']);
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);
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
43header(
'Cache-Control: Public, must-revalidate');
45if (
GETPOST(
'dol_hide_topmenu')) {
46 $conf->dol_hide_topmenu = 1;
48if (
GETPOST(
'dol_hide_leftmenu')) {
49 $conf->dol_hide_leftmenu = 1;
51if (
GETPOST(
'dol_optimize_smallscreen')) {
52 $conf->dol_optimize_smallscreen = 1;
54if (
GETPOST(
'dol_no_mouse_hover')) {
55 $conf->dol_no_mouse_hover = 1;
57if (
GETPOST(
'dol_use_jmobile')) {
58 $conf->dol_use_jmobile = 1;
62if (!empty($conf->dol_use_jmobile)) {
63 $conf->use_javascript_ajax = 1;
68 $php_self .=
'?'.dol_escape_htmltag($_SERVER[
"QUERY_STRING"]);
70if (!preg_match(
'/mainmenu=/', $php_self)) {
71 $php_self .= (preg_match(
'/\?/', $php_self) ?
'&' :
'?').
'mainmenu=home';
73if (preg_match(
'/'.preg_quote(
'core/modules/oauth',
'/').
'/', $php_self)) {
74 $php_self = DOL_URL_ROOT.
'/index.php?mainmenu=home';
76$php_self = preg_replace(
'/(\?|&|&)action=[^&]+/',
'\1', $php_self);
77$php_self = preg_replace(
'/(\?|&|&)actionlogin=[^&]+/',
'\1', $php_self);
78$php_self = preg_replace(
'/(\?|&|&)afteroauthloginreturn=[^&]+/',
'\1', $php_self);
79$php_self = preg_replace(
'/(\?|&|&)username=[^&]*/',
'\1', $php_self);
80$php_self = preg_replace(
'/(\?|&|&)entity=\d+/',
'\1', $php_self);
81$php_self = preg_replace(
'/(\?|&|&)massaction=[^&]+/',
'\1', $php_self);
82$php_self = preg_replace(
'/(\?|&|&)token=[^&]+/',
'\1', $php_self);
83$php_self = preg_replace(
'/(&)+/',
'&', $php_self);
87 '/core/js/dst.js'.(empty($conf->dol_use_jmobile) ?
'' :
'?version='.urlencode(DOL_VERSION))
94 $titleofloginpage = $langs->trans(
'Login');
96$titleofloginpage .=
' @ '.$titletruedolibarrversion;
99if (!preg_match(
'/'.constant(
'DOL_APPLICATION_TITLE').
'/', $title)) {
100 $disablenofollow = 0;
103 $disablenofollow = 0;
106top_htmlhead(
'', $titleofloginpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
109$colorbackhmenu1 =
'60,70,100';
110if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
111 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
116print
"<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->\n";
120 <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;">
124 <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')).
'\')
"'; ?>>
129<?php if (empty($conf->dol_use_jmobile)) { ?>
131$(document).ready(function () {
132 /* Set focus on correct field */
133 <?php if ($focus_element) {
134 ?>$('#<?php echo $focus_element; ?>').focus(); <?php
135 } ?> // Warning to use this only on visible element
140<div class="login_center center
"<?php
141if (!getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) {
142 $backstyle = 'background: linear-gradient('.((!empty($conf->browser->layout) && $conf->browser->layout == 'phone') ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
143 // old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
144 $backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
145 print !getDolGlobalString('MAIN_LOGIN_BACKGROUND') ? ' style="background-size: cover; background-
position: center center; background-attachment: fixed; background-repeat: no-repeat;
'.$backstyle.'"' : '';
148<div class="login_vertical_align
">
151<form id="login
" name="login
" method="post
" action="<?php echo $php_self; ?>
">
153<input type="hidden
" name="token
" value="<?php echo
newToken(); ?>
" />
154<input type="hidden
" name="actionlogin
" value="login
">
155<input type="hidden
" name="loginfunction
" value="loginfunction
" />
156<input type="hidden
" name="backtopage
" value="<?php echo
GETPOST(
'backtopage'); ?>
" />
157<!-- Add fields to store and send local user information. This fields are filled by the core/js/dst.js -->
158<input type="hidden
" name="tz
" id="tz
" value="" />
159<input type="hidden
" name="tz_string
" id="tz_string
" value="" />
160<input type="hidden
" name="dst_observed
" id="dst_observed
" value="" />
161<input type="hidden
" name="dst_first
" id="dst_first
" value="" />
162<input type="hidden
" name="dst_second
" id="dst_second
" value="" />
163<input type="hidden
" name="screenwidth
" id="screenwidth
" value="" />
164<input type="hidden
" name="screenheight
" id="screenheight
" value="" />
165<input type="hidden
" name="dol_hide_topmenu
" id="dol_hide_topmenu
" value="<?php echo $dol_hide_topmenu; ?>
" />
166<input type="hidden
" name="dol_hide_leftmenu
" id="dol_hide_leftmenu
" value="<?php echo $dol_hide_leftmenu; ?>
" />
167<input type="hidden
" name="dol_optimize_smallscreen
" id="dol_optimize_smallscreen
" value="<?php echo $dol_optimize_smallscreen; ?>
" />
168<input type="hidden
" name="dol_no_mouse_hover
" id="dol_no_mouse_hover
" value="<?php echo $dol_no_mouse_hover; ?>
" />
169<input type="hidden
" name="dol_use_jmobile
" id="dol_use_jmobile
" value="<?php echo $dol_use_jmobile; ?>
" />
173<!-- Title with version -->
174<div class="login_table_title center
" title="<?php echo
dol_escape_htmltag($title); ?>
">
176if ($disablenofollow) {
177 echo '<a class="login_table_title
" href="https:
180if ($disablenofollow) {
188<div
class=
"login_table">
190<div
id=
"login_line1">
193<img alt=
"" src=
"<?php echo $urllogo; ?>" id=
"img_logo" />
198<div
id=
"login_right">
200<div
class=
"tagtable left centpercent" title=
"<?php echo $langs->trans("EnterLoginDetail
"); ?>">
203<div
class=
"trinputlogin">
204<div
class=
"tagtd nowraponall center valignmiddle tdinputlogin">
206 ?><label
for=
"username" class=
"hidden"><?php echo $langs->trans(
"Login"); ?></label><?php
208<!-- <span
class=
"span-icon-user">-->
209<span
class=
"fa fa-user"></span>
210<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" />
215<?php
if (!isset($conf->file->main_authentication) || $conf->file->main_authentication !=
'googleoauth') { ?>
216<div
class=
"trinputlogin">
217<div
class=
"tagtd nowraponall center valignmiddle tdinputlogin">
219 ?><label
for=
"password" class=
"hidden"><?php echo $langs->trans(
"Password"); ?></label><?php
221<!--<span
class=
"span-icon-password">-->
222<span
class=
"fa fa-key"></span>
223<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'; ?>" />
229if (!empty($captcha)) {
231 $php_self = preg_replace(
'/[&\?]time=(\d+)/',
'', $php_self);
232 if (preg_match(
'/\?/', $php_self)) {
233 $php_self .=
'&time='.dol_print_date(
dol_now(),
'dayhourlog');
235 $php_self .=
'?time='.dol_print_date(
dol_now(),
'dayhourlog');
239 <div
class=
"trinputlogin">
240 <div
class=
"tagtd none valignmiddle tdinputlogin nowrap">
242 <span
class=
"fa fa-unlock"></span>
243 <span
class=
"span-icon-security inline-block">
244 <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
class=
"nowrap inline-block">
247 <img
class=
"inline-block valignmiddle" src=
"<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border=
"0" width=
"80" height=
"32" id=
"img_securitycode" />
248 <a
class=
"inline-block valignmiddle" href=
"<?php echo $php_self; ?>" tabindex=
"4" data-role=
"button"><?php echo $captcha_refresh; ?></a>
255if (!empty($morelogincontent)) {
256 if (is_array($morelogincontent)) {
257 foreach ($morelogincontent as $format => $option) {
258 if ($format ==
'table') {
259 echo
'<!-- Option by hook -->';
264 echo
'<!-- Option by hook -->';
265 echo $morelogincontent;
273</div> <!-- end div login_right -->
275</div> <!-- end div login_line1 -->
278<div
id=
"login_line2" style=
"clear: both">
281<!-- Button Connection -->
282<?php
if (!isset($conf->file->main_authentication) || $conf->file->main_authentication !=
'googleoauth') { ?>
284<div
id=
"login-submit-wrapper">
285<input
type=
"submit" class=
"button" value=
" <?php echo $langs->trans('Connection'); ?> " tabindex=
"5" />
291if (isset($conf->file->main_authentication) && $conf->file->main_authentication ==
'googleoauth') {
292 $forgetpasslink =
'';
295if ($forgetpasslink || $helpcenterlink) {
297 if ($dol_hide_topmenu) {
298 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_topmenu='.$dol_hide_topmenu;
300 if ($dol_hide_leftmenu) {
301 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_leftmenu='.$dol_hide_leftmenu;
303 if ($dol_no_mouse_hover) {
304 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_no_mouse_hover='.$dol_no_mouse_hover;
306 if ($dol_use_jmobile) {
307 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_use_jmobile='.$dol_use_jmobile;
311 echo
'<div class="center" style="margin-top: 5px;">';
312 if ($forgetpasslink) {
313 $url = DOL_URL_ROOT.
'/user/passwordforgotten.php'.$moreparam;
317 echo
'<a class="alogin" href="'.dol_escape_htmltag($url).
'">';
318 echo $langs->trans(
'PasswordForgotten');
322 if ($forgetpasslink && $helpcenterlink) {
323 echo
' - ';
326 if ($helpcenterlink) {
327 $url = DOL_URL_ROOT.
'/support/index.php'.$moreparam;
331 echo
'<a class="alogin" href="'.dol_escape_htmltag($url).
'" target="_blank" rel="noopener noreferrer">';
332 echo $langs->trans(
'NeedHelpCenter');
338if (isset($conf->file->main_authentication) && preg_match(
'/openid/', $conf->file->main_authentication)) {
339 $langs->load(
"users");
342 print
'<div class="center" style="margin-top: 20px; margin-bottom: 10px">';
343 print
'<div class="loginbuttonexternal">';
345 $state = hash(
'sha256', session_id());
348 print
'<a class="alogin" href="'.$url.
'">'.$langs->trans(
"LoginUsingOpenID").
'</a>';
350 $langs->load(
"errors");
351 print
'<span class="warning">'.$langs->trans(
"ErrorOpenIDSetupNotComplete",
'MAIN_AUTHENTICATION_OPENID_URL').
'</span>';
358if (isset($conf->file->main_authentication) && preg_match(
'/google/', $conf->file->main_authentication) && strpos($conf->browser->ua,
'DoliDroid') ===
false) {
359 $langs->load(
"users");
361 echo
'<div class="center" style="margin-top: 20px; margin-bottom: 10px">';
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");
392</div> <!-- end login line 2 -->
394</div> <!-- end login
table -->
402if (!empty($_SESSION[
'dol_loginmesg'])) {
404 <div
class=
"center login_main_message">
406 $message = $_SESSION[
'dol_loginmesg'];
407 if (preg_match(
'/<!-- warning -->/', $message)) {
408 $message = str_replace(
'<!-- warning -->',
'', $message);
409 print
'<div class="warning" role="alert">';
411 print
'<div class="error" role="alert">';
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/");
425 $resgetcommitstrip =
getURLContent(
"https://www.commitstrip.com/en/feed/");
427 if ($resgetcommitstrip && $resgetcommitstrip[
'http_code'] ==
'200') {
428 if (LIBXML_VERSION < 20900) {
432 libxml_disable_entity_loader(
true);
435 $xml = simplexml_load_string($resgetcommitstrip[
'content'],
'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
436 $little = $xml->channel->item[0]->children(
'content',
true);
437 print preg_replace(
'/width="650" height="658"/',
'', $little->encoded);
443<?php
if ($main_home) {
445 <div
class=
"center login_main_home paddingtopbottom <?php echo !getDolGlobalString('MAIN_LOGIN_BACKGROUND') ? '' : ' backgroundsemitransparent boxshadow'; ?>" style=
"max-width: 70%">
446 <?php echo $main_home; ?>
452<!-- authentication mode = <?php echo $main_authentication ?> -->
453<!-- cookie
name used
for this session = <?php echo $session_name ?> -->
454<!-- urlfrom in
this session = <?php echo isset($_SESSION[
"urlfrom"]) ? $_SESSION[
"urlfrom"] :
''; ?> -->
456<!-- Common footer is not used
for login page,
this is same than footer but inside login tpl -->
460 print $conf->global->MAIN_HTML_FOOTER;
463if (!empty($morelogincontent) && is_array($morelogincontent)) {
464 foreach ($morelogincontent as $format => $option) {
465 if ($format ==
'js') {
466 echo
"\n".
'<!-- Javascript by hook -->';
470} elseif (!empty($moreloginextracontent)) {
471 echo
'<!-- Javascript by hook -->';
472 echo $moreloginextracontent;
479 foreach ($tmptagarray as $tmptag) {
481 print
"<!-- JS CODE TO ENABLE for google analtics tag -->\n";
483 <!-- Global site tag (gtag.js) - Google Analytics -->
484 <script async src=\"https://www.googletagmanager.com/gtag/js?id=".trim($tmptag).
"\"></script>
486 window.dataLayer = window.dataLayer || [];
487 function gtag(){dataLayer.push(arguments);}
488 gtag('js', new Date());
490 gtag('config', '".trim($tmptag).
"');
499 if (empty($conf->dol_use_jmobile)) {
501 <div
class=
"center"><br>
503 google_ad_client =
"<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
504 google_ad_slot =
"<?php echo $conf->global->MAIN_GOOGLE_AD_SLOT ?>";
505 google_ad_width = <?php echo $conf->global->MAIN_GOOGLE_AD_WIDTH ?>;
506 google_ad_height = <?php echo $conf->global->MAIN_GOOGLE_AD_HEIGHT ?>;
509 <script src=
"//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
518</div><!-- end of center -->
523<!-- 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.
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.
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...
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.