dolibarr  13.0.2
passwordforgotten.tpl.php
1 <?php
2 /* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@inodbox.com>
3  * Copyright (C) 2011-2013 Laurent Destailleur <eldy@users.sourceforge.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
19 
20 if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', 1);
21 
22 // Protection to avoid direct call of template
23 if (empty($conf) || !is_object($conf))
24 {
25  print "Error, template page can't be called as URL";
26  exit;
27 }
28 
29 
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
31 
32 header('Cache-Control: Public, must-revalidate');
33 header("Content-type: text/html; charset=".$conf->file->character_set_client);
34 
35 if (GETPOST('dol_hide_topmenu')) $conf->dol_hide_topmenu = 1;
36 if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu = 1;
37 if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen = 1;
38 if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover = 1;
39 if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile = 1;
40 
41 // If we force to use jmobile, then we reenable javascript
42 if (!empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax = 1;
43 
44 $php_self = $_SERVER['PHP_SELF'];
45 $php_self .= dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '';
46 $php_self = str_replace('action=validatenewpassword', '', $php_self);
47 
48 $titleofpage = $langs->trans('SendNewPassword');
49 
50 print top_htmlhead('', $titleofpage);
51 
52 
53 $colorbackhmenu1 = '60,70,100'; // topmenu
54 if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
55 $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);
56 $colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
57 
58 ?>
59 <!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
60 
61 <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).'\')"'; ?>>
62 
63 <?php if (empty($conf->dol_use_jmobile)) { ?>
64 <script>
65 $(document).ready(function () {
66  // Set focus on correct field
67  <?php if ($focus_element) { ?>$('#<?php echo $focus_element; ?>').focus(); <?php } ?> // Warning to use this only on visible element
68 });
69 </script>
70 <?php } ?>
71 
72 
73 <div class="login_center center"<?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: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));"' : '' ?>>
74 <div class="login_vertical_align">
75 
76 <form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
77 <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
78 <input type="hidden" name="action" value="buildnewpassword">
79 
80 
81 <!-- Title with version -->
82 <div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>">
83 <?php
84 if ($disablenofollow) echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank">';
85 echo dol_escape_htmltag($title);
86 if ($disablenofollow) echo '</a>';
87 ?>
88 </div>
89 
90 
91 
92 <div class="login_table">
93 
94 <div id="login_line1">
95 
96 <div id="login_left">
97 <img alt="" title="" src="<?php echo $urllogo; ?>" id="img_logo" />
98 </div>
99 
100 <br>
101 
102 <div id="login_right">
103 
104 <div class="tagtable centpercent" title="Login pass" >
105 
106 <!-- Login -->
107 <div class="trinputlogin">
108 <div class="tagtd nowraponall center valignmiddle tdinputlogin">
109 <!-- <span class="span-icon-user">-->
110 <span class="fa fa-user"></span>
111 <input type="text" 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" />
112 </div>
113 </div>
114 
115 <?php
116 if ($captcha) {
117  // Add a variable param to force not using cache (jmobile)
118  $php_self = preg_replace('/[&\?]time=(\d+)/', '', $php_self); // Remove param time
119  if (preg_match('/\?/', $php_self)) $php_self .= '&time='.dol_print_date(dol_now(), 'dayhourlog');
120  else $php_self .= '?time='.dol_print_date(dol_now(), 'dayhourlog');
121  // TODO: provide accessible captcha variants
122  ?>
123  <!-- Captcha -->
124  <div class="trinputlogin">
125  <div class="tagtd tdinputlogin nowraponall none valignmiddle">
126 
127  <span class="fa fa-unlock"></span>
128  <span class="nofa inline-block">
129  <input id="securitycode" placeholder="<?php echo $langs->trans("SecurityCode"); ?>" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />
130  </span>
131  <span class="nowrap inline-block">
132  <img class="inline-block valignmiddle" src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />
133  <a class="inline-block valignmiddle" href="<?php echo $php_self; ?>" tabindex="4"><?php echo $captcha_refresh; ?></a>
134  </span>
135 
136  </div></div>
137  <?php
138 }
139 
140 if (!empty($morelogincontent)) {
141  if (is_array($morelogincontent)) {
142  foreach ($morelogincontent as $format => $option)
143  {
144  if ($format == 'table') {
145  echo '<!-- Option by hook -->';
146  echo $option;
147  }
148  }
149  } else {
150  echo '<!-- Option by hook -->';
151  echo $morelogincontent;
152  }
153 }
154 ?>
155 
156 </div>
157 
158 </div> <!-- end div login_right -->
159 
160 </div> <!-- end div login_line1 -->
161 
162 
163 <div id="login_line2" style="clear: both">
164 
165 <!-- Button "Regenerate and Send password" -->
166 <br><input type="submit" <?php echo $disabled; ?> class="button" name="button_password" value="<?php echo $langs->trans('SendNewPassword'); ?>" tabindex="4" />
167 
168 <br>
169 <div class="center" style="margin-top: 15px;">
170  <?php
171  $moreparam = '';
172  if (!empty($conf->dol_hide_topmenu)) $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_topmenu='.$conf->dol_hide_topmenu;
173  if (!empty($conf->dol_hide_leftmenu)) $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu;
174  if (!empty($conf->dol_no_mouse_hover)) $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover;
175  if (!empty($conf->dol_use_jmobile)) $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_use_jmobile='.$conf->dol_use_jmobile;
176 
177  print '<a class="alogin" href="'.$dol_url_root.'/index.php'.$moreparam.'">'.$langs->trans('BackToLoginPage').'</a>';
178  ?>
179 </div>
180 
181 </div>
182 
183 </div>
184 
185 </form>
186 
187 
188 <div class="center login_main_home divpasswordmessagedesc paddingtopbottom<?php echo empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent'; ?>" style="max-width: 70%">
189 <?php if ($mode == 'dolibarr' || !$disabled) { ?>
190  <span class="passwordmessagedesc">
191  <?php echo $langs->trans('SendNewPasswordDesc'); ?>
192  </span>
193 <?php } else { ?>
194  <div class="warning center">
195  <?php echo $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode); ?>
196  </div>
197 <?php } ?>
198 </div>
199 
200 
201 <br>
202 
203 <?php if ($message) { ?>
204  <div class="center login_main_message">
205  <?php echo dol_htmloutput_mesg($message, '', '', 1); ?>
206  </div>
207 <?php } ?>
208 
209 
210 <!-- Common footer is not used for passwordforgotten page, this is same than footer but inside passwordforgotten tpl -->
211 
212 <?php
213 if (!empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER;
214 
215 if (!empty($morelogincontent) && is_array($morelogincontent)) {
216  foreach ($morelogincontent as $format => $option)
217  {
218  if ($format == 'js') {
219  echo "\n".'<!-- Javascript by hook -->';
220  echo $option."\n";
221  }
222  }
223 } elseif (!empty($moreloginextracontent)) {
224  echo '<!-- Javascript by hook -->';
225  echo $moreloginextracontent;
226 }
227 
228 // Google Analytics
229 // TODO Add a hook here
230 if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID))
231 {
232  $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID);
233  foreach ($tmptagarray as $tmptag) {
234  print "\n";
235  print "<!-- JS CODE TO ENABLE for google analtics tag -->\n";
236  print "
237  <!-- Global site tag (gtag.js) - Google Analytics -->
238  <script async src=\"https://www.googletagmanager.com/gtag/js?id=".trim($tmptag)."\"></script>
239  <script>
240  window.dataLayer = window.dataLayer || [];
241  function gtag(){dataLayer.push(arguments);}
242  gtag('js', new Date());
243 
244  gtag('config', '".trim($tmptag)."');
245  </script>";
246  print "\n";
247  }
248 }
249 
250 // TODO Replace this with a hook
251 // Google Adsense (need Google module)
252 if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT))
253 {
254  if (empty($conf->dol_use_jmobile))
255  {
256  ?>
257  <div class="center"><br>
258  <script><!--
259  google_ad_client = "<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
260  google_ad_slot = "<?php echo $conf->global->MAIN_GOOGLE_AD_SLOT ?>";
261  google_ad_width = <?php echo $conf->global->MAIN_GOOGLE_AD_WIDTH ?>;
262  google_ad_height = <?php echo $conf->global->MAIN_GOOGLE_AD_HEIGHT ?>;
263  //-->
264  </script>
265  <script src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
266  </div>
267  <?php
268  }
269 }
270 ?>
271 
272 
273 </div>
274 </div> <!-- end of center -->
275 
276 
277 </body>
278 </html>
279 <!-- END PHP TEMPLATE -->
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_now($mode= 'auto')
Return date for now.
API that allows to log in with an user account.
top_htmlhead($head, $title= '', $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '', $disablejmobile=0, $disablenofollow=0)
Ouput html header of a page.
Definition: main.inc.php:1280
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:108
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value (&#39;FFFFFF&#39;, &#39;255,255,255&#39;) into an array RGB array(255,255,255).
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_htmloutput_mesg($mesgstring= '', $mesgarray=array(), $style= 'ok', $keepembedded=0)
Print formated messages to output (Used to show messages on html output).
print
Draft customers invoices.
Definition: index.php:89
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition: repair.php:105
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...