20if (!defined(
'NOBROWSERNOTIF')) {
21 define(
'NOBROWSERNOTIF', 1);
25if (empty($conf) || !is_object($conf)) {
26 print
"Error, template page can't be called as URL";
31$size = (int) ($_SERVER[
'CONTENT_LENGTH'] ?? 0);
33 $langs->loadLangs(array(
"errors",
"install"));
34 httponly_accessforbidden(
'<center>'.$langs->trans(
"ErrorRequestTooLarge").
'<br><a href="'.DOL_URL_ROOT.
'">'.$langs->trans(
"ClickHereToGoToApp").
'</a></center>', 413, 1);
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
39header(
'Cache-Control: Public, must-revalidate');
41if (
GETPOST(
'dol_hide_topmenu')) {
42 $conf->dol_hide_topmenu = 1;
44if (
GETPOST(
'dol_hide_leftmenu')) {
45 $conf->dol_hide_leftmenu = 1;
47if (
GETPOST(
'dol_optimize_smallscreen')) {
48 $conf->dol_optimize_smallscreen = 1;
50if (
GETPOST(
'dol_no_mouse_hover')) {
51 $conf->dol_no_mouse_hover = 1;
53if (
GETPOST(
'dol_use_jmobile')) {
54 $conf->dol_use_jmobile = 1;
58if (!empty($conf->dol_use_jmobile)) {
59 $conf->use_javascript_ajax = 1;
62$php_self = $_SERVER[
'PHP_SELF'];
63$php_self .=
dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) ?
'?'.dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) :
'';
64$php_self = str_replace(
'action=validatenewpassword',
'', $php_self);
66$titleofpage = $langs->trans(
'SendNewPassword');
72if (!preg_match(
'/'.constant(
'DOL_APPLICATION_TITLE').
'/', $title)) {
79top_htmlhead(
'', $titleofpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
82$colorbackhmenu1 =
'60,70,100';
83if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
84 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
90<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
92<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')).
'\')
"'; ?>>
94<?php if (empty($conf->dol_use_jmobile)) { ?>
96$(document).ready(function () {
97 // Set focus on correct field
98 <?php if ($focus_element) {
99 ?>$('#<?php echo $focus_element; ?>').focus(); <?php
100 } ?> // Warning to use this only on visible element
105<div class="login_center center
"<?php
106if (!getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) {
107 $backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
108 // old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
109 $backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
110 print !getDolGlobalString('MAIN_LOGIN_BACKGROUND') ? ' style="background-size: cover; background-
position: center center; background-attachment: fixed; background-repeat: no-repeat;
'.$backstyle.'"' : '';
113<div class="login_vertical_align
">
115<form id="login
" name="login
" method="POST
" action="<?php echo $php_self; ?>
">
116<input type="hidden
" name="token
" value="<?php echo
newToken(); ?>
">
117<input type="hidden
" name="action
" value="buildnewpassword
">
120<!-- Title with version -->
121<div class="login_table_title center
" title="<?php echo
dol_escape_htmltag($title); ?>
">
123if (!empty($disablenofollow)) {
124 echo '<a class="login_table_title
" href="https:
127if (!empty($disablenofollow)) {
135<div
class=
"login_table">
137<div
id=
"login_line1">
140<img alt=
"" title=
"" src=
"<?php echo $urllogo; ?>" id=
"img_logo" />
145<div
id=
"login_right">
147<div
class=
"tagtable centpercent" title=
"Login pass" >
150<div
class=
"trinputlogin">
151<div
class=
"tagtd nowraponall center valignmiddle tdinputlogin">
152<!-- <span
class=
"span-icon-user">-->
153<span
class=
"fa fa-user"></span>
154<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" />
159if (!empty($captcha)) {
161 $php_self = preg_replace(
'/[&\?]time=(\d+)/',
'', $php_self);
162 if (preg_match(
'/\?/', $php_self)) {
163 $php_self .=
'&time='.dol_print_date(
dol_now(),
'dayhourlog');
165 $php_self .=
'?time='.dol_print_date(
dol_now(),
'dayhourlog');
169 <div
class=
"trinputlogin">
170 <div
class=
"tagtd tdinputlogin nowrap none valignmiddle">
172 <span
class=
"fa fa-unlock"></span>
173 <span
class=
"nofa inline-block">
174 <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" />
176 <span
class=
"nowrap inline-block">
177 <img
class=
"inline-block valignmiddle" src=
"<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border=
"0" width=
"80" height=
"32" id=
"img_securitycode" />
178 <a
class=
"inline-block valignmiddle" href=
"<?php echo $php_self; ?>" tabindex=
"4"><?php echo $captcha_refresh; ?></a>
185if (!empty($morelogincontent)) {
186 if (is_array($morelogincontent)) {
187 foreach ($morelogincontent as $format => $option) {
188 if ($format ==
'table') {
189 echo
'<!-- Option by hook -->';
194 echo
'<!-- Option by hook -->';
195 echo $morelogincontent;
202</div> <!-- end div login_right -->
204</div> <!-- end div login_line1 -->
207<div
id=
"login_line2" style=
"clear: both">
209<!-- Button
"Regenerate and Send password" -->
210<br><input
type=
"submit" <?php echo $disabled; ?>
class=
"button small" name=
"button_password" value=
"<?php echo $langs->trans('SendNewPassword'); ?>" tabindex=
"4" />
213<div
class=
"center" style=
"margin-top: 15px;">
216 if (!empty($conf->dol_hide_topmenu)) {
217 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_topmenu='.$conf->dol_hide_topmenu;
219 if (!empty($conf->dol_hide_leftmenu)) {
220 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_leftmenu='.$conf->dol_hide_leftmenu;
222 if (!empty($conf->dol_no_mouse_hover)) {
223 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_no_mouse_hover='.$conf->dol_no_mouse_hover;
225 if (!empty($conf->dol_use_jmobile)) {
226 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_use_jmobile='.$conf->dol_use_jmobile;
229 print
'<a class="alogin" href="'.$dol_url_root.
'/index.php'.$moreparam.
'">'.$langs->trans(
'BackToLoginPage').
'</a>';
241if ($mode ==
'dolibarr' || !$disabled) {
242 if ($action !=
'validatenewpassword' && empty($message)) {
243 print
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(!
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND') ?
'' :
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
244 print
'<span class="passwordmessagedesc opacitymedium">';
245 print $langs->trans(
'SendNewPasswordDesc');
250 print
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(!
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND') ?
'' :
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
251 print
'<div class="warning center">';
252 print $langs->trans(
'AuthenticationDoesNotAllowSendNewPassword', $mode);
261<?php
if (!empty($message)) { ?>
262 <div
class=
"center login_main_message">
268<!-- Common footer is not used
for passwordforgotten page,
this is same than footer but inside passwordforgotten tpl -->
272 print $conf->global->MAIN_HTML_FOOTER;
275if (!empty($morelogincontent) && is_array($morelogincontent)) {
276 foreach ($morelogincontent as $format => $option) {
277 if ($format ==
'js') {
278 echo
"\n".
'<!-- Javascript by hook -->';
282} elseif (!empty($moreloginextracontent)) {
283 echo
'<!-- Javascript by hook -->';
284 echo $moreloginextracontent;
291 foreach ($tmptagarray as $tmptag) {
293 print
"<!-- JS CODE TO ENABLE for google analtics tag -->\n";
295 <!-- Global site tag (gtag.js) - Google Analytics -->
296 <script async src=\"https://www.googletagmanager.com/gtag/js?id=".trim($tmptag).
"\"></script>
298 window.dataLayer = window.dataLayer || [];
299 function gtag(){dataLayer.push(arguments);}
300 gtag('js', new Date());
302 gtag('config', '".trim($tmptag).
"');
311 if (empty($conf->dol_use_jmobile)) {
313 <div
class=
"center"><br>
315 google_ad_client =
"<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
316 google_ad_slot =
"<?php echo $conf->global->MAIN_GOOGLE_AD_SLOT ?>";
317 google_ad_width = <?php echo $conf->global->MAIN_GOOGLE_AD_WIDTH ?>;
318 google_ad_height = <?php echo $conf->global->MAIN_GOOGLE_AD_HEIGHT ?>;
321 <script src=
"//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
330</div> <!-- end of center -->
335<!-- 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,...
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.