dolibarr  9.0.0
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 <http://www.gnu.org/licenses/>.
17  */
18 
19 // Protection to avoid direct call of template
20 if (empty($conf) || ! is_object($conf))
21 {
22  print "Error, template page can't be called as URL";
23  exit;
24 }
25 
26 
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
28 
29 header('Cache-Control: Public, must-revalidate');
30 header("Content-type: text/html; charset=".$conf->file->character_set_client);
31 
32 if (GETPOST('dol_hide_topmenu')) $conf->dol_hide_topmenu=1;
33 if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu=1;
34 if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1;
35 if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1;
36 if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1;
37 
38 // If we force to use jmobile, then we reenable javascript
39 if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1;
40 
41 $php_self = $_SERVER['PHP_SELF'];
42 $php_self.= dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):'';
43 
44 $titleofpage=$langs->trans('SendNewPassword');
45 
46 print top_htmlhead('', $titleofpage);
47 
48 
49 $colorbackhmenu1='60,70,100'; // topmenu
50 if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1=$colorbackhmenu1;
51 $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);
52 $colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
53 
54 ?>
55 <!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
56 
57 <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).'\')"'; ?>>
58 
59 <?php if (empty($conf->dol_use_jmobile)) { ?>
60 <script type="text/javascript">
61 $(document).ready(function () {
62  // Set focus on correct field
63  <?php if ($focus_element) { ?>$('#<?php echo $focus_element; ?>').focus(); <?php } ?> // Warning to use this only on visible element
64 });
65 </script>
66 <?php } ?>
67 
68 
69 <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));"':'' ?>>
70 <div class="login_vertical_align">
71 
72 <form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
73 <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
74 <input type="hidden" name="action" value="buildnewpassword">
75 
76 
77 <!-- Title with version -->
78 <div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>">
79 <?php
80 if ($disablenofollow) echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank">';
81 echo dol_escape_htmltag($title);
82 if ($disablenofollow) echo '</a>';
83 ?>
84 </div>
85 
86 
87 
88 <div class="login_table">
89 
90 <div id="login_line1">
91 
92 <div id="login_left">
93 <img alt="" title="" src="<?php echo $urllogo; ?>" id="img_logo" />
94 </div>
95 
96 <br>
97 
98 <div id="login_right">
99 
100 <div class="tagtable centpercent" title="Login pass" >
101 
102 <!-- Login -->
103 <div class="trinputlogin">
104 <div class="tagtd nowraponall center valignmiddle tdinputlogin">
105 <!-- <span class="span-icon-user">-->
106 <span class="fa fa-user">
107 </span>
108 <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" />
109 </div>
110 </div>
111 
112 <?php
113 if (! empty($morelogincontent)) {
114  if (is_array($morelogincontent)) {
115  foreach ($morelogincontent as $format => $option)
116  {
117  if ($format == 'table') {
118  echo '<!-- Option by hook -->';
119  echo $option;
120  }
121  }
122  }
123  else {
124  echo '<!-- Option by hook -->';
125  echo $morelogincontent;
126  }
127 }
128 ?>
129 
130 <?php if ($captcha) {
131  // Add a variable param to force not using cache (jmobile)
132  $php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time
133  if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog');
134  else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog');
135  ?>
136  <!-- Captcha -->
137  <div class="trinputlogin">
138  <div class="tdinputlogin nowraponall none center valignmiddle tdinputlogin">
139 
140  <table class="login_table_securitycode centpercent">
141  <tr class="valignmiddle">
142  <td>
143  <!-- <span class="span-icon-security"> -->
144  <span class="nofa">
145  <input id="securitycode" placeholder="<?php echo $langs->trans("SecurityCode"); ?>" class="flat input-icon-security width100" type="text" maxlength="5" name="code" tabindex="3" />
146  </span>
147  </td>
148  <td><img src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" /></td>
149  <td><a href="<?php echo $php_self; ?>" tabindex="4"><?php echo $captcha_refresh; ?></a></td>
150  </tr></table>
151 
152  </div></div>
153 <?php } ?>
154 
155 </div>
156 
157 </div> <!-- end div login_right -->
158 
159 </div> <!-- end div login_line1 -->
160 
161 
162 <div id="login_line2" style="clear: both">
163 
164 <!-- Button "Regenerate and Send password" -->
165 <br><input type="submit" <?php echo $disabled; ?> class="button" name="button_password" value="<?php echo $langs->trans('SendNewPassword'); ?>" tabindex="4" />
166 
167 <br>
168 <div align="center" style="margin-top: 15px;">
169  <?php
170  $moreparam='';
171  if (! empty($conf->dol_hide_topmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu;
172  if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu;
173  if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover;
174  if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile;
175 
176  print '<a class="alogin" href="'.$dol_url_root.'/index.php'.$moreparam.'">'.$langs->trans('BackToLoginPage').'</a>';
177  ?>
178 </div>
179 
180 </div>
181 
182 </div>
183 
184 </form>
185 
186 
187 <div class="center login_main_home divpasswordmessagedesc paddingtopbottom<?php echo empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' backgroundsemitransparent'; ?>" style="max-width: 70%">
188 <?php if ($mode == 'dolibarr' || ! $disabled) { ?>
189  <span class="passwordmessagedesc">
190  <?php echo $langs->trans('SendNewPasswordDesc'); ?>
191  </span>
192 <?php }else{ ?>
193  <div class="warning" align="center">
194  <?php echo $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode); ?>
195  </div>
196 <?php } ?>
197 </div>
198 
199 
200 <br>
201 
202 <?php if ($message) { ?>
203  <div class="center login_main_message">
204  <?php echo dol_htmloutput_mesg($message,'','',1); ?>
205  </div>
206 <?php } ?>
207 
208 <?php if (! empty($morelogincontent) && is_array($morelogincontent)) {
209  foreach ($morelogincontent as $format => $option)
210  {
211  if ($format == 'js') {
212  echo "\n".'<!-- Javascript by hook -->';
213  echo $option."\n";
214  }
215  }
216 }
217 else if (! empty($moreloginextracontent)) {
218  echo '<!-- Javascript by hook -->';
219  echo $moreloginextracontent;
220 }
221 ?>
222 
223 </div>
224 </div> <!-- end of center -->
225 
226 
227 </body>
228 </html>
229 <!-- END PHP TEMPLATE -->
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
Definition: index.php:91
API that allows to log in with an user account.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:103
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
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).
type
Definition: viewcat.php:284
if(GETPOST('cancel', 'alpha')) if(! GETPOST( 'confirmmassaction', 'alpha') &&$massaction !='presend' &&$massaction !='confirm_presend')
Draft customers invoices.
Definition: list.php:156
dol_now($mode='gmt')
Return date for now.
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $disablejmobile=0, $disablenofollow=0)
Ouput html header of a page.
Definition: main.inc.php:1172
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formated messages to output (Used to show messages on html output).