23if (!defined(
'NOBROWSERNOTIF')) {
24 define(
'NOBROWSERNOTIF', 1);
46 print
"Error, template page can't be called as URL";
51$size = (int) ($_SERVER[
'CONTENT_LENGTH'] ?? 0);
53 $langs->loadLangs(array(
"errors",
"install"));
54 httponly_accessforbidden(
'<center>'.$langs->trans(
"ErrorRequestTooLarge").
'<br><a href="'.DOL_URL_ROOT.
'">'.$langs->trans(
"ClickHereToGoToApp").
'</a></center>', 413, 1);
57require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
64header(
'Cache-Control: Public, must-revalidate');
66if (
GETPOST(
'dol_hide_topmenu')) {
67 $conf->dol_hide_topmenu = 1;
69if (
GETPOST(
'dol_hide_leftmenu')) {
70 $conf->dol_hide_leftmenu = 1;
72if (
GETPOST(
'dol_optimize_smallscreen')) {
73 $conf->dol_optimize_smallscreen = 1;
75if (
GETPOST(
'dol_no_mouse_hover')) {
76 $conf->dol_no_mouse_hover = 1;
78if (
GETPOST(
'dol_use_jmobile')) {
79 $conf->dol_use_jmobile = 1;
83if (!empty(
$conf->dol_use_jmobile)) {
84 $conf->use_javascript_ajax = 1;
88$php_self = $_SERVER[
'PHP_SELF'];
89$php_self .=
dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) ?
'?'.dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) :
'';
90$php_self = str_replace(
'action=validatenewpassword',
'', $php_self);
92$titleofpage = $langs->trans(
'SendNewPassword');
98if (!preg_match(
'/'.constant(
'DOL_APPLICATION_TITLE').
'/', $title)) {
102 $disablenofollow = 0;
105top_htmlhead(
'', $titleofpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
108$colorbackhmenu1 =
'60,70,100';
109if (!isset(
$conf->global->THEME_ELDY_TOPMENU_BACK1)) {
110 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
116<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
118<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')).
'\')
"'; ?>>
120<?php if (empty($conf->dol_use_jmobile)) { ?>
122$(document).ready(function () {
123 // Set focus on correct field
124 <?php if ($focus_element) {
125 ?>$('#<?php echo $focus_element; ?>').focus(); <?php
126 } ?> // Warning to use this only on visible element
131<div class="login_center center
"<?php
132if (!getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) {
133 $backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
134 // old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
135 $backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
136 print !getDolGlobalString('MAIN_LOGIN_BACKGROUND') ? ' style="background-size: cover; background-
position: center center; background-attachment: fixed; background-repeat: no-repeat;
'.$backstyle.'"' : '';
139<div class="login_vertical_align
">
141<form id="login
" name="login
" method="POST
" action="<?php echo $php_self; ?>
">
142<input type="hidden
" name="token
" value="<?php echo
newToken(); ?>
">
143<input type="hidden
" name="action
" value="buildnewpassword
">
146<!-- Title with version -->
147<div class="login_table_title center
" title="<?php echo
dol_escape_htmltag($title); ?>
">
149if (!empty($disablenofollow)) {
150 echo '<a class="login_table_title
" href="https:
153if (!empty($disablenofollow)) {
161<div
class=
"login_table">
163<div
id=
"login_line1">
166<img alt=
"" title=
"" src=
"<?php echo $urllogo; ?>" id=
"img_logo" />
171<div
id=
"login_right">
173<div
class=
"tagtable centpercent" title=
"Login pass" >
176<div
class=
"trinputlogin">
177<div
class=
"tagtd nowraponall center valignmiddle tdinputlogin">
178<!-- <span
class=
"span-icon-user">-->
179<span
class=
"fa fa-user"></span>
180<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" />
185if (!empty($captcha)) {
187 $php_self = preg_replace(
'/[&\?]time=(\d+)/',
'', $php_self);
188 if (preg_match(
'/\?/', $php_self)) {
189 $php_self .=
'&time='.dol_print_date(
dol_now(),
'dayhourlog');
191 $php_self .=
'?time='.dol_print_date(
dol_now(),
'dayhourlog');
195 $dirModCaptcha = array_merge(array(
'main' =>
'/core/modules/security/captcha/'), is_array(
$conf->modules_parts[
'captcha']) ?
$conf->modules_parts[
'captcha'] : array());
196 $fullpathclassfile =
'';
197 foreach ($dirModCaptcha as $dir) {
198 $fullpathclassfile =
dol_buildpath($dir.
"modCaptcha".ucfirst($captcha).
'.class.php', 0, 2);
199 if ($fullpathclassfile) {
204 if ($fullpathclassfile) {
205 include_once $fullpathclassfile;
209 $classname =
"modCaptcha".ucfirst($captcha);
210 if (class_exists($classname)) {
212 $captchaobj =
new $classname($db,
$conf, $langs, $user);
213 '@phan-var-force ModeleCaptcha $captchaobj';
215 if (is_object($captchaobj) && method_exists($captchaobj,
'getCaptchaCodeForForm')) {
216 print $captchaobj->getCaptchaCodeForForm($php_self);
218 print
'Error, the captcha handler '.get_class($captchaobj).
' does not have any method getCaptchaCodeForForm()';
221 print
'Error, the captcha handler class '.$classname.
' was not found after the include';
224 print
'Error, the captcha handler '.$captcha.
' has no class file found modCaptcha'.ucfirst($captcha);
228if (!empty($morelogincontent)) {
229 if (is_array($morelogincontent)) {
230 foreach ($morelogincontent as $format => $option) {
231 if ($format ==
'table') {
232 echo
'<!-- Option by hook -->';
237 echo
'<!-- Option by hook -->';
238 echo $morelogincontent;
245</div> <!-- end div login_right -->
247</div> <!-- end div login_line1 -->
250<div
id=
"login_line2" style=
"clear: both">
252<!-- Button
"Regenerate and Send password" -->
253<br><input
type=
"submit" <?php echo $disabled; ?>
class=
"button small" name=
"button_password" value=
"<?php echo $langs->trans('SendNewPassword'); ?>" tabindex=
"4" />
256<div
class=
"center" style=
"margin-top: 15px;">
259 if (!empty(
$conf->dol_hide_topmenu)) {
260 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_topmenu='.
$conf->dol_hide_topmenu;
262 if (!empty(
$conf->dol_hide_leftmenu)) {
263 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_leftmenu='.
$conf->dol_hide_leftmenu;
265 if (!empty(
$conf->dol_no_mouse_hover)) {
266 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_no_mouse_hover='.
$conf->dol_no_mouse_hover;
268 if (!empty(
$conf->dol_use_jmobile)) {
269 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_use_jmobile='.
$conf->dol_use_jmobile;
272 print
'<a class="alogin" href="'.$dol_url_root.
'/index.php'.$moreparam.
'">'.$langs->trans(
'BackToLoginPage').
'</a>';
284if ($mode ==
'dolibarr' || !$disabled) {
285 if ($action !=
'validatenewpassword') {
286 print
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(!
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND') ?
'' :
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
287 print
'<span class="passwordmessagedesc opacitymedium">';
288 print $langs->trans(
'SendNewPasswordDesc');
293 print
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(!
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND') ?
'' :
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
294 print
'<div class="warning center">';
295 print $langs->trans(
'AuthenticationDoesNotAllowSendNewPassword', $mode);
300print
"\n".
'<br>'.
"\n";
307 if (!empty(
$conf->use_javascript_ajax)) {
308 if (preg_match(
'/<!-- warning -->/', $message) || preg_match(
'/<div class="warning/', $message)) {
309 $message = str_replace(
'<!-- warning -->',
'', $message);
310 $message = preg_replace(
'/<div class="[^"]*">/',
'', $message);
311 $message = preg_replace(
'/<\/div>/',
'', $message);
317 $(document).ready(function() {
318 $(".jnotify-container").addClass("jnotify-container-login");
323 <div
class=
"center login_main_message">
333<!-- Common footer is not used
for passwordforgotten page,
this is same than footer but inside passwordforgotten tpl -->
339if (!empty($morelogincontent) && is_array($morelogincontent)) {
340 foreach ($morelogincontent as $format => $option) {
341 if ($format ==
'js') {
342 echo
"\n".
'<!-- Javascript by hook -->';
346} elseif (!empty($moreloginextracontent)) {
347 echo
'<!-- Javascript by hook -->';
348 echo $moreloginextracontent;
352$parameters = array();
354$result = $hookmanager->executeHooks(
'getPasswordForgottenPageExtraContent', $parameters, $dummyobject, $action);
355print $hookmanager->resPrint;
361</div> <!-- end of center -->
366<!-- 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_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...
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...
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.