23if (!defined(
'NOBROWSERNOTIF')) {
24 define(
'NOBROWSERNOTIF', 1);
45@phan-var-force string $captcha
46@phan-var-force string $disabled
47@phan-var-force string $dol_url_root
48@phan-var-force string $focus_element
49@phan-var-force string $mode
50@phan-var-force string $message
51@phan-var-force string $title
52@phan-var-force string $urllogo
53@phan-var-force User $user
54@phan-var-force string $username
57if (empty($conf) || !is_object($conf)) {
58 print
"Error, template page can't be called as URL";
63$size = (int) ($_SERVER[
'CONTENT_LENGTH'] ?? 0);
65 $langs->loadLangs(array(
"errors",
"install"));
66 httponly_accessforbidden(
'<center>'.$langs->trans(
"ErrorRequestTooLarge").
'<br><a href="'.DOL_URL_ROOT.
'">'.$langs->trans(
"ClickHereToGoToApp").
'</a></center>', 413, 1);
69require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
76header(
'Cache-Control: Public, must-revalidate');
78if (
GETPOST(
'dol_hide_topmenu')) {
79 $conf->dol_hide_topmenu = 1;
81if (
GETPOST(
'dol_hide_leftmenu')) {
82 $conf->dol_hide_leftmenu = 1;
84if (
GETPOST(
'dol_optimize_smallscreen')) {
85 $conf->dol_optimize_smallscreen = 1;
87if (
GETPOST(
'dol_no_mouse_hover')) {
88 $conf->dol_no_mouse_hover = 1;
90if (
GETPOST(
'dol_use_jmobile')) {
91 $conf->dol_use_jmobile = 1;
95if (!empty($conf->dol_use_jmobile)) {
96 $conf->use_javascript_ajax = 1;
100$php_self = $_SERVER[
'PHP_SELF'];
101$php_self .=
dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) ?
'?'.dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) :
'';
102$php_self = str_replace(
'action=validatenewpassword',
'', $php_self);
104$titleofpage = $langs->trans(
'SendNewPassword');
110if (!preg_match(
'/'.constant(
'DOL_APPLICATION_TITLE').
'/', $title)) {
111 $disablenofollow = 0;
114 $disablenofollow = 0;
117top_htmlhead(
'', $titleofpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
120$colorbackhmenu1 =
'60,70,100';
121if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
122 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
128<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
130<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')).
'\')
"'; ?>>
132<?php if (empty($conf->dol_use_jmobile)) { ?>
134$(document).ready(function () {
135 // Set focus on correct field
136 <?php if ($focus_element) {
137 ?>$('#<?php echo $focus_element; ?>').focus(); <?php
138 } ?> // Warning to use this only on visible element
143<div class="login_center center
"<?php
144if (!getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) {
145 $backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', var(--colorbackbody) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
146 // old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
147 $backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
148 print !getDolGlobalString('MAIN_LOGIN_BACKGROUND') ? ' style="background-size: cover; background-
position: center center; background-attachment: fixed; background-repeat: no-repeat;
'.$backstyle.'"' : '';
151<div class="login_vertical_align
">
153<form id="login
" name="login
" method="POST
" action="<?php echo $php_self; ?>
">
154<input type="hidden
" name="token
" value="<?php echo
newToken(); ?>
">
155<input type="hidden
" name="action
" value="buildnewpassword
">
158<!-- Title with version -->
159<div class="login_table_title center
" title="<?php echo
dol_escape_htmltag($title); ?>
">
161if (!empty($disablenofollow)) {
162 echo '<a class="login_table_title
" href="https:
165if (!empty($disablenofollow)) {
173<div
class=
"login_table">
175<div
id=
"login_line1">
178<img alt=
"" title=
"" src=
"<?php echo $urllogo; ?>" id=
"img_logo" />
183<div
id=
"login_right">
185<div
class=
"tagtable centpercent" title=
"Login pass" >
188<div
class=
"trinputlogin">
189<div
class=
"tagtd nowraponall center valignmiddle tdinputlogin">
190<!-- <span
class=
"span-icon-user">-->
191<span
class=
"fa fa-user"></span>
192<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" />
197if (!empty($captcha)) {
199 $php_self = preg_replace(
'/[&\?]time=(\d+)/',
'', $php_self);
200 if (preg_match(
'/\?/', $php_self)) {
201 $php_self .=
'&time='.dol_print_date(
dol_now(),
'dayhourlog');
203 $php_self .=
'?time='.dol_print_date(
dol_now(),
'dayhourlog');
207 $dirModCaptcha = array_merge(array(
'main' =>
'/core/modules/security/captcha/'), ((isset($conf->modules_parts[
'captcha']) && is_array($conf->modules_parts[
'captcha'])) ? $conf->modules_parts[
'captcha'] : array()));
208 $fullpathclassfile =
'';
209 foreach ($dirModCaptcha as $dir) {
210 $fullpathclassfile =
dol_buildpath($dir.
"modCaptcha".ucfirst($captcha).
'.class.php', 0, 2);
211 if ($fullpathclassfile) {
216 if ($fullpathclassfile) {
217 include_once $fullpathclassfile;
221 $classname =
"modCaptcha".ucfirst($captcha);
222 if (class_exists($classname)) {
224 $captchaobj =
new $classname($db, $conf, $langs, $user);
225 '@phan-var-force ModeleCaptcha $captchaobj';
227 if (is_object($captchaobj) && method_exists($captchaobj,
'getCaptchaCodeForForm')) {
228 print $captchaobj->getCaptchaCodeForForm($php_self);
230 print
'Error, the captcha handler '.get_class($captchaobj).
' does not have any method getCaptchaCodeForForm()';
233 print
'Error, the captcha handler class '.$classname.
' was not found after the include';
236 print
'Error, the captcha handler '.$captcha.
' has no class file found modCaptcha'.ucfirst($captcha);
240if (!empty($morelogincontent)) {
241 if (is_array($morelogincontent)) {
242 foreach ($morelogincontent as $format => $option) {
243 if ($format ==
'table') {
244 echo
'<!-- Option by hook -->';
249 echo
'<!-- Option by hook -->';
250 echo $morelogincontent;
257</div> <!-- end div login_right -->
259</div> <!-- end div login_line1 -->
262<div
id=
"login_line2" style=
"clear: both">
264<!-- Button
"Regenerate and Send password" -->
265<br><input
type=
"submit" <?php echo $disabled; ?>
class=
"butAction butActionLogin noborderfocus small" id=
"button_password" name=
"button_password" value=
"<?php echo $langs->trans('SendNewPassword'); ?>" tabindex=
"4" />
268<div
class=
"center" style=
"margin-top: 15px;">
271 if (!empty($conf->dol_hide_topmenu)) {
272 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_topmenu='.$conf->dol_hide_topmenu;
274 if (!empty($conf->dol_hide_leftmenu)) {
275 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_leftmenu='.$conf->dol_hide_leftmenu;
277 if (!empty($conf->dol_no_mouse_hover)) {
278 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_no_mouse_hover='.$conf->dol_no_mouse_hover;
280 if (!empty($conf->dol_use_jmobile)) {
281 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_use_jmobile='.$conf->dol_use_jmobile;
284 print
'<a class="alogin" href="'.$dol_url_root.
'/index.php'.$moreparam.
'">'.$langs->trans(
'BackToLoginPage').
'</a>';
296if ($mode ==
'dolibarr' || !$disabled) {
297 if ($action !=
'validatenewpassword') {
298 print
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(!
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND') ?
'' :
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
299 print
'<span class="passwordmessagedesc opacitymedium">';
300 print $langs->trans(
'SendNewPasswordDesc');
305 print
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(!
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND') ?
'' :
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
306 print
'<div class="warning center">';
307 print $langs->trans(
'AuthenticationDoesNotAllowSendNewPassword', $mode);
312print
"\n".
'<br>'.
"\n";
319 if (!empty($conf->use_javascript_ajax)) {
320 if (preg_match(
'/<!-- warning -->/', $message) || preg_match(
'/<div class="warning/', $message)) {
321 $message = str_replace(
'<!-- warning -->',
'', $message);
322 $message = preg_replace(
'/<div class="[^"]*">/',
'', $message);
323 $message = preg_replace(
'/<\/div>/',
'', $message);
329 $(document).ready(function() {
330 $(".jnotify-container").addClass("jnotify-container-login");
335 <div
class=
"center login_main_message">
345<!-- Common footer is not used
for passwordforgotten page,
this is same than footer but inside passwordforgotten tpl -->
351if (!empty($morelogincontent) && is_array($morelogincontent)) {
352 foreach ($morelogincontent as $format => $option) {
353 if ($format ==
'js') {
354 echo
"\n".
'<!-- Javascript by hook -->';
358} elseif (!empty($moreloginextracontent)) {
359 echo
'<!-- Javascript by hook -->';
360 echo $moreloginextracontent;
364$parameters = array();
366$result = $hookmanager->executeHooks(
'getPasswordForgottenPageExtraContent', $parameters, $dummyobject, $action);
367print $hookmanager->resPrint;
373</div> <!-- end of center -->
378<!-- 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,...
dol_now($mode='gmt')
Return date for now.
getDolUserString($key, $default='', $tmpuser=null)
Return Dolibarr user constant string value.
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.
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
$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.