22if (!defined(
'NOBROWSERNOTIF')) {
23 define(
'NOBROWSERNOTIF', 1);
27if (empty($conf) || !is_object($conf)) {
28 print
"Error, template page can't be called as URL";
33$size = (int) ($_SERVER[
'CONTENT_LENGTH'] ?? 0);
35 $langs->loadLangs(array(
"errors",
"install"));
36 httponly_accessforbidden(
'<center>'.$langs->trans(
"ErrorRequestTooLarge").
'<br><a href="'.DOL_URL_ROOT.
'">'.$langs->trans(
"ClickHereToGoToApp").
'</a></center>', 413, 1);
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
41header(
'Cache-Control: Public, must-revalidate');
43if (
GETPOST(
'dol_hide_topmenu')) {
44 $conf->dol_hide_topmenu = 1;
46if (
GETPOST(
'dol_hide_leftmenu')) {
47 $conf->dol_hide_leftmenu = 1;
49if (
GETPOST(
'dol_optimize_smallscreen')) {
50 $conf->dol_optimize_smallscreen = 1;
52if (
GETPOST(
'dol_no_mouse_hover')) {
53 $conf->dol_no_mouse_hover = 1;
55if (
GETPOST(
'dol_use_jmobile')) {
56 $conf->dol_use_jmobile = 1;
60if (!empty($conf->dol_use_jmobile)) {
61 $conf->use_javascript_ajax = 1;
64$php_self = $_SERVER[
'PHP_SELF'];
65$php_self .=
dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) ?
'?'.dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) :
'';
66$php_self = str_replace(
'action=validatenewpassword',
'', $php_self);
68$titleofpage = $langs->trans(
'SendNewPassword');
74if (!preg_match(
'/'.constant(
'DOL_APPLICATION_TITLE').
'/', $title)) {
81top_htmlhead(
'', $titleofpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
84$colorbackhmenu1 =
'60,70,100';
85if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
86 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
92<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
94<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='.urlencode(
'logos/' .
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND')).
'\')
"'; ?>>
96<?php if (empty($conf->dol_use_jmobile)) { ?>
98$(document).ready(function () {
99 // Set focus on correct field
100 <?php if ($focus_element) {
101 ?>$('#<?php echo $focus_element; ?>').focus(); <?php
102 } ?> // Warning to use this only on visible element
107<div class="login_center center
"<?php
108if (!getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) {
109 $backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
110 // old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
111 $backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
112 print !getDolGlobalString('MAIN_LOGIN_BACKGROUND') ? ' style="background-size: cover; background-
position: center center; background-attachment: fixed; background-repeat: no-repeat;
'.$backstyle.'"' : '';
115<div class="login_vertical_align
">
117<form id="login
" name="login
" method="POST
" action="<?php echo $php_self; ?>
">
118<input type="hidden
" name="token
" value="<?php echo
newToken(); ?>
">
119<input type="hidden
" name="action
" value="buildnewpassword
">
122<!-- Title with version -->
123<div class="login_table_title center
" title="<?php echo
dol_escape_htmltag($title); ?>
">
125if (!empty($disablenofollow)) {
126 echo '<a class="login_table_title
" href="https:
129if (!empty($disablenofollow)) {
137<div
class=
"login_table">
139<div
id=
"login_line1">
142<img alt=
"" title=
"" src=
"<?php echo $urllogo; ?>" id=
"img_logo" />
147<div
id=
"login_right">
149<div
class=
"tagtable centpercent" title=
"Login pass" >
152<div
class=
"trinputlogin">
153<div
class=
"tagtd nowraponall center valignmiddle tdinputlogin">
154<!-- <span
class=
"span-icon-user">-->
155<span
class=
"fa fa-user"></span>
156<input
type=
"text" maxlength=
"255" placeholder=
"<?php echo $langs->trans("Login"); ?>" <?php echo $disabled; ?>
id=
"username" name=
"username" class=
"flat input-icon-user minwidth150" value=
"<?php echo dol_escape_htmltag($username); ?>" tabindex=
"1" autocapitalize=
"off" autocomplete=
"on" spellcheck=
"false" autocorrect=
"off" />
161if (!empty($captcha)) {
163 $php_self = preg_replace(
'/[&\?]time=(\d+)/',
'', $php_self);
164 if (preg_match(
'/\?/', $php_self)) {
165 $php_self .=
'&time='.dol_print_date(
dol_now(),
'dayhourlog');
167 $php_self .=
'?time='.dol_print_date(
dol_now(),
'dayhourlog');
170 $classfile = DOL_DOCUMENT_ROOT.
"/core/modules/security/captcha/modCaptcha".ucfirst($captcha).
'.class.php';
171 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
175 $classname =
"modCaptcha".ucfirst($captcha);
176 require_once $classfile;
178 $captchaobj =
new $classname($db, $conf, $langs, $user);
181 if (is_object($captchaobj) && method_exists($captchaobj,
'getCaptchaCodeForForm')) {
186 <div
class=
"trinputlogin">
187 <div
class=
"tagtd tdinputlogin nowrap none valignmiddle">
189 <span
class=
"fa fa-unlock"></span>
190 <span
class=
"nofa inline-block">
191 <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" />
193 <span
class=
"nowrap inline-block">
194 <img
class=
"inline-block valignmiddle" src=
"<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border=
"0" width=
"80" height=
"32" id=
"img_securitycode" />
195 <a
class=
"inline-block valignmiddle" href=
"<?php echo $php_self; ?>" tabindex=
"4"><?php echo
img_picto($langs->trans(
"Refresh"),
'refresh',
'id="captcha_refresh_img"'); ?></a>
204if (!empty($morelogincontent)) {
205 if (is_array($morelogincontent)) {
206 foreach ($morelogincontent as $format => $option) {
207 if ($format ==
'table') {
208 echo
'<!-- Option by hook -->';
213 echo
'<!-- Option by hook -->';
214 echo $morelogincontent;
221</div> <!-- end div login_right -->
223</div> <!-- end div login_line1 -->
226<div
id=
"login_line2" style=
"clear: both">
228<!-- Button
"Regenerate and Send password" -->
229<br><input
type=
"submit" <?php echo $disabled; ?>
class=
"button small" name=
"button_password" value=
"<?php echo $langs->trans('SendNewPassword'); ?>" tabindex=
"4" />
232<div
class=
"center" style=
"margin-top: 15px;">
235 if (!empty($conf->dol_hide_topmenu)) {
236 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_topmenu='.$conf->dol_hide_topmenu;
238 if (!empty($conf->dol_hide_leftmenu)) {
239 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_leftmenu='.$conf->dol_hide_leftmenu;
241 if (!empty($conf->dol_no_mouse_hover)) {
242 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_no_mouse_hover='.$conf->dol_no_mouse_hover;
244 if (!empty($conf->dol_use_jmobile)) {
245 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_use_jmobile='.$conf->dol_use_jmobile;
248 print
'<a class="alogin" href="'.$dol_url_root.
'/index.php'.$moreparam.
'">'.$langs->trans(
'BackToLoginPage').
'</a>';
260if ($mode ==
'dolibarr' || !$disabled) {
261 if ($action !=
'validatenewpassword' && empty($message)) {
262 print
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(!
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND') ?
'' :
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
263 print
'<span class="passwordmessagedesc opacitymedium">';
264 print $langs->trans(
'SendNewPasswordDesc');
269 print
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(!
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND') ?
'' :
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
270 print
'<div class="warning center">';
271 print $langs->trans(
'AuthenticationDoesNotAllowSendNewPassword', $mode);
280<?php
if (!empty($message)) { ?>
281 <div
class=
"center login_main_message">
287<!-- Common footer is not used
for passwordforgotten page,
this is same than footer but inside passwordforgotten tpl -->
291 print $conf->global->MAIN_HTML_FOOTER;
294if (!empty($morelogincontent) && is_array($morelogincontent)) {
295 foreach ($morelogincontent as $format => $option) {
296 if ($format ==
'js') {
297 echo
"\n".
'<!-- Javascript by hook -->';
301} elseif (!empty($moreloginextracontent)) {
302 echo
'<!-- Javascript by hook -->';
303 echo $moreloginextracontent;
310 foreach ($tmptagarray as $tmptag) {
312 print
"<!-- JS CODE TO ENABLE for google analtics tag -->\n";
314 <!-- Global site tag (gtag.js) - Google Analytics -->
315 <script async src=\"https://www.googletagmanager.com/gtag/js?id=".trim($tmptag).
"\"></script>
317 window.dataLayer = window.dataLayer || [];
318 function gtag(){dataLayer.push(arguments);}
319 gtag('js', new Date());
321 gtag('config', '".trim($tmptag).
"');
330 if (empty($conf->dol_use_jmobile)) {
332 <div
class=
"center"><br>
334 google_ad_client =
"<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
335 google_ad_slot =
"<?php echo $conf->global->MAIN_GOOGLE_AD_SLOT ?>";
336 google_ad_width = <?php echo $conf->global->MAIN_GOOGLE_AD_WIDTH ?>;
337 google_ad_height = <?php echo $conf->global->MAIN_GOOGLE_AD_HEIGHT ?>;
340 <script src=
"//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
349</div> <!-- end of center -->
354<!-- END PHP TEMPLATE -->
API that allows to log in with an user account.
dol_is_file($pathoffile)
Return if path is a file.
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.
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...
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.