21if (!defined(
'NOBROWSERNOTIF')) {
 
   22  define(
'NOBROWSERNOTIF', 1);
 
   26if (empty($conf) || !is_object($conf)) {
 
   27  print 
"Error, template page can't be called as URL";
 
   32$size = (int) $_SERVER[
'CONTENT_LENGTH'];
 
   34  $langs->loadLangs(array(
"errors", 
"install"));
 
   35  httponly_accessforbidden(
'<center>'.$langs->trans(
"ErrorRequestTooLarge").
'<br><a href="'.DOL_URL_ROOT.
'">'.$langs->trans(
"ClickHereToGoToApp").
'</a></center>', 413, 1);
 
   38require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
 
   40header(
'Cache-Control: Public, must-revalidate');
 
   42if (
GETPOST(
'dol_hide_topmenu')) {
 
   43  $conf->dol_hide_topmenu = 1;
 
   45if (
GETPOST(
'dol_hide_leftmenu')) {
 
   46  $conf->dol_hide_leftmenu = 1;
 
   48if (
GETPOST(
'dol_optimize_smallscreen')) {
 
   49  $conf->dol_optimize_smallscreen = 1;
 
   51if (
GETPOST(
'dol_no_mouse_hover')) {
 
   52  $conf->dol_no_mouse_hover = 1;
 
   54if (
GETPOST(
'dol_use_jmobile')) {
 
   55  $conf->dol_use_jmobile = 1;
 
   59if (!empty($conf->dol_use_jmobile)) {
 
   60  $conf->use_javascript_ajax = 1;
 
   63$php_self = $_SERVER[
'PHP_SELF'];
 
   64$php_self .= 
dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) ? 
'?'.dol_escape_htmltag($_SERVER[
"QUERY_STRING"]) : 
'';
 
   65$php_self = str_replace(
'action=validatenewpassword', 
'', $php_self);
 
   67$titleofpage = $langs->trans(
'ResetPassword');
 
   73if (!preg_match(
'/'.constant(
'DOL_APPLICATION_TITLE').
'/', $title)) {
 
   76if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
 
   80top_htmlhead(
'', $titleofpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
 
   83$colorbackhmenu1 = 
'60,70,100'; 
 
   84if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
 
   85  $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
 
   87$colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TOPMENU_BACK1) ? $colorbackhmenu1 : $conf->global->THEME_ELDY_TOPMENU_BACK1) : (empty($user->
conf->THEME_ELDY_TOPMENU_BACK1) ? $colorbackhmenu1 : $user->
conf->THEME_ELDY_TOPMENU_BACK1);
 
   91$edituser = 
new User($db);
 
   95if ($setnewpassword && $username && $passworduidhash) {
 
   96  $result = $edituser->fetch(
'', $username);
 
   98    $message = 
'<div class="error">'.dol_escape_htmltag($langs->trans(
"ErrorTechnicalError")).
'</div>';
 
  103    if ($edituser->pass_temp && 
dol_verifyHash($edituser->pass_temp.
'-'.$edituser->id.
'-'.$conf->file->instance_unique_id, $passworduidhash)) {
 
  105      unset($_SESSION[
'dol_login']);
 
  109      $langs->load(
"errors");
 
  110      $message = 
'<div class="error">'.$langs->trans(
"ErrorFailedToValidatePasswordReset").
'</div>';
 
  114  $langs->load(
"errors");
 
  115  $message = 
'<div class="error">'.$langs->trans(
"ErrorFailedToValidatePasswordReset").
'</div>';
 
  120<!-- BEGIN PHP TEMPLATE PASSWORDRESET.TPL.PHP -->
 
  122<body 
class=
"body bodylogin"<?php print empty($conf->global->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/'.$conf->global->MAIN_LOGIN_BACKGROUND).
'\')
"'; ?>> 
  124<?php if (empty($conf->dol_use_jmobile)) { ?> 
  126$(document).ready(function () { 
  127  // Set focus on correct field 
  128  <?php if ($focus_element) { 
  129    ?>$('#<?php echo $focus_element; ?>').focus(); <?php 
  130  } ?>    // Warning to use this only on visible element 
  136<div class="login_center center
"<?php 
  137if (empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) { 
  138  $backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);'; 
  139  // old style:  $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));'; 
  140  $backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle); 
  141  print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-
position: center center; background-attachment: fixed; background-repeat: no-repeat; 
'.$backstyle.'"' : ''; 
  144<div class="login_vertical_align
"> 
  146<form id="login
" name="login
" method="POST
" action="<?php echo $php_self; ?>
"> 
  147<input type="hidden
" name="token
" value="<?php echo newToken(); ?>
"> 
  148<input type="hidden
" name="action
" value="buildnewpassword
"> 
  151<!-- Title with version --> 
  152<div class="login_table_title center
" title="<?php echo 
dol_escape_htmltag($title); ?>
"> 
  154if (!empty($disablenofollow)) { 
  155  echo '<a class="login_table_title
" href="https:
 
  158if (!empty($disablenofollow)) {
 
  166<div 
class=
"login_table">
 
  168<div 
id=
"login_line1">
 
  171<img alt=
"" title=
"" src=
"<?php echo $urllogo; ?>" id=
"img_logo" />
 
  176<div 
id=
"login_right">
 
  178<div 
class=
"tagtable centpercent" title=
"Login pass" >
 
  181<div 
class=
"trinputlogin">
 
  182<div 
class=
"tagtd nowraponall center valignmiddle tdinputlogin">
 
  183<!-- <span 
class=
"span-icon-user">-->
 
  184<span 
class=
"fa fa-user"></span>
 
  185<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 />
 
  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("PasswordRetype
"); ?>" <?php echo $disabled; ?> 
id=
"newpass2" name=
"newpass2" class=
"flat input-icon-user minwidth150" value=
"<?php echo dol_escape_htmltag($newpass2); ?>" tabindex=
"1" />
 
  199if (!empty($captcha)) {
 
  201  $php_self = preg_replace(
'/[&\?]time=(\d+)/', 
'', $php_self); 
 
  202  if (preg_match(
'/\?/', $php_self)) {
 
  203    $php_self .= 
'&time='.dol_print_date(
dol_now(), 
'dayhourlog');
 
  205    $php_self .= 
'?time='.dol_print_date(
dol_now(), 
'dayhourlog');
 
  210  <div 
class=
"trinputlogin">
 
  211  <div 
class=
"tagtd tdinputlogin nowrap none valignmiddle">
 
  213  <span 
class=
"fa fa-unlock"></span>
 
  214  <span 
class=
"nofa inline-block">
 
  215  <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" />
 
  217  <span 
class=
"nowrap inline-block">
 
  218  <img 
class=
"inline-block valignmiddle" src=
"<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border=
"0" width=
"80" height=
"32" id=
"img_securitycode" />
 
  219  <a 
class=
"inline-block valignmiddle" href=
"<?php echo $php_self; ?>" tabindex=
"4"><?php echo $captcha_refresh; ?></a>
 
  226if (!empty($morelogincontent)) {
 
  227  if (is_array($morelogincontent)) {
 
  228    foreach ($morelogincontent as $format => $option) {
 
  229      if ($format == 
'table') {
 
  230        echo 
'<!-- Option by hook -->';
 
  235    echo 
'<!-- Option by hook -->';
 
  236    echo $morelogincontent;
 
  243</div> <!-- end div login_right -->
 
  245</div> <!-- end div login_line1 -->
 
  248<div 
id=
"login_line2" style=
"clear: both">
 
  250<!-- Button 
"Regenerate and Send password" -->
 
  251<br><input 
type=
"submit" <?php echo $disabled; ?> 
class=
"button small" name=
"button_password" value=
"<?php echo $langs->trans('Save'); ?>" tabindex=
"4" />
 
  254<div 
class=
"center" style=
"margin-top: 15px;">
 
  257  if (!empty($conf->dol_hide_topmenu)) {
 
  258    $moreparam .= (strpos($moreparam, 
'?') === 
false ? 
'?' : 
'&').
'dol_hide_topmenu='.$conf->dol_hide_topmenu;
 
  260  if (!empty($conf->dol_hide_leftmenu)) {
 
  261    $moreparam .= (strpos($moreparam, 
'?') === 
false ? 
'?' : 
'&').
'dol_hide_leftmenu='.$conf->dol_hide_leftmenu;
 
  263  if (!empty($conf->dol_no_mouse_hover)) {
 
  264    $moreparam .= (strpos($moreparam, 
'?') === 
false ? 
'?' : 
'&').
'dol_no_mouse_hover='.$conf->dol_no_mouse_hover;
 
  266  if (!empty($conf->dol_use_jmobile)) {
 
  267    $moreparam .= (strpos($moreparam, 
'?') === 
false ? 
'?' : 
'&').
'dol_use_jmobile='.$conf->dol_use_jmobile;
 
  270  print 
'<a class="alogin" href="'.$dol_url_root.
'/index.php'.$moreparam.
'">'.$langs->trans(
'BackToLoginPage').
'</a>';
 
  282if ($mode == 
'dolibarr' || !$disabled) {
 
  283  if (empty($message)) {
 
  284    print 
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? 
'' : 
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
 
  285    print 
'<span class="passwordmessagedesc opacitymedium">';
 
  286    print $langs->trans(
'EnterNewPasswordHere');
 
  291  print 
'<div class="center login_main_home divpasswordmessagedesc paddingtopbottom'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? 
'' : 
' backgroundsemitransparent boxshadow').
'" style="max-width: 70%">';
 
  292  print 
'<div class="warning center">';
 
  293  print $langs->trans(
'AuthenticationDoesNotAllowSendNewPassword', $mode);
 
  302<?php 
if (!empty($message)) { ?>
 
  303  <div 
class=
"center login_main_message">
 
  309<!-- Common footer is not used 
for passwordforgotten page, 
this is same than footer but inside passwordforgotten tpl -->
 
  312if (!empty($conf->global->MAIN_HTML_FOOTER)) {
 
  313  print $conf->global->MAIN_HTML_FOOTER;
 
  316if (!empty($morelogincontent) && is_array($morelogincontent)) {
 
  317  foreach ($morelogincontent as $format => $option) {
 
  318    if ($format == 
'js') {
 
  319      echo 
"\n".
'<!-- Javascript by hook -->';
 
  323} elseif (!empty($moreloginextracontent)) {
 
  324  echo 
'<!-- Javascript by hook -->';
 
  325  echo $moreloginextracontent;
 
  330if (isModEnabled(
'google') && !empty($conf->global->MAIN_GOOGLE_AN_ID)) {
 
  331  $tmptagarray = explode(
',', $conf->global->MAIN_GOOGLE_AN_ID);
 
  332  foreach ($tmptagarray as $tmptag) {
 
  334    print 
"<!-- JS CODE TO ENABLE for google analtics tag -->\n";
 
  336          <!-- Global site tag (gtag.js) - Google Analytics --> 
  337          <script async src=\"https://www.googletagmanager.com/gtag/js?id=".trim($tmptag).
"\"></script> 
  339          window.dataLayer = window.dataLayer || []; 
  340          function gtag(){dataLayer.push(arguments);} 
  341          gtag('js', new Date()); 
  343          gtag('config', '".trim($tmptag).
"'); 
  351if (isModEnabled(
'google') && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) {
 
  352  if (empty($conf->dol_use_jmobile)) {
 
  354  <div 
class=
"center"><br>
 
  356      google_ad_client = 
"<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
 
  357      google_ad_slot = 
"<?php echo $conf->global->MAIN_GOOGLE_AD_SLOT ?>";
 
  358      google_ad_width = <?php echo $conf->global->MAIN_GOOGLE_AD_WIDTH ?>;
 
  359      google_ad_height = <?php echo $conf->global->MAIN_GOOGLE_AD_HEIGHT ?>;
 
  362    <script src=
"//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
 
  371</div>  <!-- end of center -->
 
  376<!-- END PHP TEMPLATE -->
 
Class to manage Dolibarr users.
 
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='auto')
Return date for now.
 
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 formated messages to output (Used to show messages on html output).
 
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...
 
conf($dolibarr_main_document_root)
Load conf file (file must exists)
 
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Ouput 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.
 
dol_verifyHash($chain, $hash, $type='0')
Compute a hash and compare it to the given one For backward compatibility reasons,...
 
httponly_accessforbidden($message=1, $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.