22if (!defined(
'NOBROWSERNOTIF')) {
23 define(
'NOBROWSERNOTIF', 1);
50 print
"Error, template page can't be called as URL";
55$size = (int) $_SERVER[
'CONTENT_LENGTH'];
57 $langs->loadLangs(array(
"errors",
"install"));
58 httponly_accessforbidden(
'<center>'.$langs->trans(
"ErrorRequestTooLarge").
'<br><a href="'.DOL_URL_ROOT.
'">'.$langs->trans(
"ClickHereToGoToApp").
'</a></center>', 413, 1);
61require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
68header(
'Cache-Control: Public, must-revalidate');
70if (
GETPOST(
'dol_hide_topmenu')) {
71 $conf->dol_hide_topmenu = 1;
73if (
GETPOST(
'dol_hide_leftmenu')) {
74 $conf->dol_hide_leftmenu = 1;
76if (
GETPOST(
'dol_optimize_smallscreen')) {
77 $conf->dol_optimize_smallscreen = 1;
79if (
GETPOST(
'dol_no_mouse_hover')) {
80 $conf->dol_no_mouse_hover = 1;
82if (
GETPOST(
'dol_use_jmobile')) {
83 $conf->dol_use_jmobile = 1;
87if (!empty(
$conf->dol_use_jmobile)) {
88 $conf->use_javascript_ajax = 1;
91$php_self = $_SERVER[
'PHP_SELF'];
92$php_self .=
dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) ?
'?'.dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) :
'';
93$php_self = str_replace(
'action=validatenewpassword',
'', $php_self);
95$titleofpage = $langs->trans(
'ResetPassword');
101if (!preg_match(
'/'.constant(
'DOL_APPLICATION_TITLE').
'/', $title)) {
102 $disablenofollow = 0;
105 $disablenofollow = 0;
108top_htmlhead(
'', $titleofpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
111$colorbackhmenu1 =
'60,70,100';
112if (!isset(
$conf->global->THEME_ELDY_TOPMENU_BACK1)) {
113 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
119$edituser =
new User($db);
123if ($setnewpassword && $username && $passworduidhash) {
124 $result = $edituser->fetch(0, $username);
126 $message =
'<div class="error">'.dol_escape_htmltag($langs->trans(
"ErrorTechnicalError")).
'</div>';
131 if ($edituser->pass_temp &&
dol_verifyHash($edituser->pass_temp.
'-'.$edituser->id.
'-'.
$conf->file->instance_unique_id, $passworduidhash)) {
133 unset($_SESSION[
'dol_login']);
137 $langs->load(
"errors");
138 $message =
'<div class="error">'.$langs->trans(
"ErrorFailedToValidatePasswordReset").
'</div>';
142 $langs->load(
"errors");
143 $message =
'<div class="error">'.$langs->trans(
"ErrorFailedToValidatePasswordReset").
'</div>';
148<!-- BEGIN PHP TEMPLATE PASSWORDRESET.TPL.PHP -->
150<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')).
'\')
"'; ?>>
152<?php if (empty($conf->dol_use_jmobile)) { ?>
154$(document).ready(function () {
155 // Set focus on correct field
156 <?php if ($focus_element) {
157 ?>$('#<?php echo $focus_element; ?>').focus(); <?php
158 } ?> // Warning to use this only on visible element
164<div class="login_center center
"<?php
165if (!getDolGlobalString('ADD_UNSPLASH_LOGIN_BACKGROUND')) {
166 $backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
167 // old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
168 $backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
169 print !getDolGlobalString('MAIN_LOGIN_BACKGROUND') ? ' style="background-size: cover; background-
position: center center; background-attachment: fixed; background-repeat: no-repeat;
'.$backstyle.'"' : '';
172<div class="login_vertical_align
">
174<form id="login
" name="login
" method="POST
" action="<?php echo $php_self; ?>
">
175<input type="hidden
" name="token
" value="<?php echo
newToken(); ?>
">
176<input type="hidden
" name="action
" value="buildnewpassword
">
179<!-- Title with version -->
180<div class="login_table_title center
" title="<?php echo
dol_escape_htmltag($title); ?>
">
182if (!empty($disablenofollow)) {
183 echo '<a class="login_table_title
" href="https:
186if (!empty($disablenofollow)) {
194<div
class=
"login_table">
196<div
id=
"login_line1">
199<img alt=
"" title=
"" src=
"<?php echo $urllogo; ?>" id=
"img_logo" />
204<div
id=
"login_right">
206<div
class=
"tagtable centpercent" title=
"Login pass" >
209<div
class=
"trinputlogin">
210<div
class=
"tagtd nowraponall center valignmiddle tdinputlogin">
211<!-- <span
class=
"span-icon-user">-->
212<span
class=
"fa fa-user"></span>
213<input
type=
"text" maxlength=
"255" placeholder=
"<?php echo $langs->trans("NewPassword
"); ?>" <?php echo $disabled; ?>
id=
"newpass1" name=
"newpass1" class=
"flat input-icon-user minwidth150" value=
"<?php echo dol_escape_htmltag($newpass1); ?>" tabindex=
"1" autofocus />
216<div
class=
"trinputlogin">
217<div
class=
"tagtd nowraponall center valignmiddle tdinputlogin">
218<!-- <span
class=
"span-icon-user">-->
219<span
class=
"fa fa-user"></span>
220<input
type=
"text" maxlength=
"255" placeholder=
"<?php echo $langs->trans("PasswordRetype
"); ?>" <?php echo $disabled; ?>
id=
"newpass2" name=
"newpass2" class=
"flat input-icon-user minwidth150" value=
"<?php echo dol_escape_htmltag($newpass2); ?>" tabindex=
"1" />
226if (!empty($captcha)) {
228 $php_self = preg_replace(
'/[&\?]time=(\d+)/',
'', $php_self);
229 if (preg_match(
'/\?/', $php_self)) {
230 $php_self .=
'&time='.dol_print_date(
dol_now(),
'dayhourlog');
232 $php_self .=
'?time='.dol_print_date(
dol_now(),
'dayhourlog');
235 $classfile = DOL_DOCUMENT_ROOT.
"/core/modules/security/captcha/modCaptcha".ucfirst($captcha).
'.class.php';
236 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
240 $classname =
"modCaptcha".ucfirst($captcha);
241 require_once $classfile;
243 $captchaobj =
new $classname($db,
$conf, $langs, $user);
246 if (is_object($captchaobj) && method_exists($captchaobj,
'getCaptchaCodeForForm')) {
251 <div
class=
"trinputlogin">
252 <div
class=
"tagtd tdinputlogin nowrap none valignmiddle">
254 <span
class=
"fa fa-unlock"></span>
255 <span
class=
"nofa inline-block">
256 <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" />
258 <span
class=
"nowrap inline-block">
259 <img
class=
"inline-block valignmiddle" src=
"<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border=
"0" width=
"80" height=
"32" id=
"img_securitycode" />
260 <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>
269if (!empty($morelogincontent)) {
270 if (is_array($morelogincontent)) {
271 foreach ($morelogincontent as $format => $option) {
272 if ($format ==
'table') {
273 echo
'<!-- Option by hook -->';
278 echo
'<!-- Option by hook -->';
279 echo $morelogincontent;
286</div> <!-- end div login_right -->
288</div> <!-- end div login_line1 -->
291<div
id=
"login_line2" style=
"clear: both">
293<!-- Button
"Regenerate and Send password" -->
294<br><input
type=
"submit" <?php echo $disabled; ?>
class=
"button small" name=
"button_password" value=
"<?php echo $langs->trans('Save'); ?>" tabindex=
"4" />
297<div
class=
"center" style=
"margin-top: 15px;">
300 if (!empty(
$conf->dol_hide_topmenu)) {
301 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_topmenu='.
$conf->dol_hide_topmenu;
303 if (!empty(
$conf->dol_hide_leftmenu)) {
304 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_hide_leftmenu='.
$conf->dol_hide_leftmenu;
306 if (!empty(
$conf->dol_no_mouse_hover)) {
307 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_no_mouse_hover='.
$conf->dol_no_mouse_hover;
309 if (!empty(
$conf->dol_use_jmobile)) {
310 $moreparam .= (strpos($moreparam,
'?') ===
false ?
'?' :
'&').
'dol_use_jmobile='.
$conf->dol_use_jmobile;
313 print
'<a class="alogin" href="'.$dol_url_root.
'/index.php'.$moreparam.
'">'.$langs->trans(
'BackToLoginPage').
'</a>';
325if ($mode ==
'dolibarr' || !$disabled) {
326 if (empty($message)) {
327 print
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(!
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND') ?
'' :
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
328 print
'<span class="passwordmessagedesc opacitymedium">';
329 print $langs->trans(
'EnterNewPasswordHere');
334 print
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(!
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND') ?
'' :
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
335 print
'<div class="warning center">';
336 print $langs->trans(
'AuthenticationDoesNotAllowSendNewPassword', $mode);
345<?php
if (!empty($message)) { ?>
346 <div
class=
"center login_main_message">
352<!-- Common footer is not used
for passwordforgotten page,
this is same than footer but inside passwordforgotten tpl -->
356 print
$conf->global->MAIN_HTML_FOOTER;
359if (!empty($morelogincontent) && is_array($morelogincontent)) {
360 foreach ($morelogincontent as $format => $option) {
361 if ($format ==
'js') {
362 echo
"\n".
'<!-- Javascript by hook -->';
366} elseif (!empty($moreloginextracontent)) {
367 echo
'<!-- Javascript by hook -->';
368 echo $moreloginextracontent;
372$parameters = array();
374$result = $hookmanager->executeHooks(
'getPasswordResetExtraContent', $parameters, $dummyobject, $action);
375print $hookmanager->resPrint;
381</div> <!-- end of center -->
386<!-- END PHP TEMPLATE -->
Class to manage Dolibarr users.
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.
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.
dol_verifyHash($chain, $hash, $type='0')
Compute a hash and compare it to the given one For backward compatibility reasons,...