dolibarr  7.0.0-beta
passwordforgotten.tpl.php
1 <?php
2 /* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.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 header('Cache-Control: Public, must-revalidate');
28 header("Content-type: text/html; charset=".$conf->file->character_set_client);
29 
30 if (GETPOST('dol_hide_topmenu')) $conf->dol_use_jmobile=1;
31 if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu=1;
32 if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1;
33 if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1;
34 if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1;
35 
36 // If we force to use jmobile, then we reenable javascript
37 if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1;
38 
39 $php_self = $_SERVER['PHP_SELF'];
40 $php_self.= dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):'';
41 
42 print top_htmlhead('',$langs->trans('SendNewPassword'));
43 ?>
44 <!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
45 
46 <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($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
47 
48 <?php if (empty($conf->dol_use_jmobile)) { ?>
49 <script type="text/javascript">
50 $(document).ready(function () {
51  /* Set focus on correct field */
52  <?php if ($focus_element) { ?>$('#<?php echo $focus_element; ?>').focus(); <?php } ?> // Warning to use this only on visible element
53 });
54 </script>
55 <?php } ?>
56 
57 
58 <div class="login_center center">
59 <div class="login_vertical_align">
60 
61 <form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
62 <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
63 <input type="hidden" name="action" value="buildnewpassword">
64 
65 
66 <!-- Title with version -->
67 <div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>">
68 <?php
69 if ($disablenofollow) echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank">';
71 if ($disablenofollow) echo '</a>';
72 ?>
73 </div>
74 
75 
76 
77 <div class="login_table">
78 
79 <div id="login_line1">
80 
81 <div id="login_left">
82 <img alt="Logo" title="" src="<?php echo $urllogo; ?>" id="img_logo" />
83 </div>
84 
85 <div id="login_right">
86 
87 <table summary="Login pass" class="centpercent">
88 
89 <!-- Login -->
90 <tr>
91 <td valign="bottom" class="nowrap center">
92 <span class="span-icon-user">
93 <input type="text" placeholder="<?php echo $langs->trans("Login"); ?>" <?php echo $disabled; ?> id="username" name="username" class="flat input-icon-user" size="20" value="<?php echo dol_escape_htmltag($username); ?>" tabindex="1" />
94 </span>
95 </td>
96 </tr>
97 
98 <?php
99 if (! empty($morelogincontent)) {
100  if (is_array($morelogincontent)) {
101  foreach ($morelogincontent as $format => $option)
102  {
103  if ($format == 'table') {
104  echo '<!-- Option by hook -->';
105  echo $option;
106  }
107  }
108  }
109  else {
110  echo '<!-- Option by hook -->';
111  echo $morelogincontent;
112  }
113 }
114 ?>
115 
116 <?php 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  ?>
122  <!-- Captcha -->
123  <tr>
124  <td class="tdtop nowrap none center">
125 
126  <table class="login_table_securitycode centpercent"><tr>
127  <td>
128  <span class="span-icon-security">
129  <input id="securitycode" placeholder="<?php echo $langs->trans("SecurityCode"); ?>" class="flat input-icon-security" type="text" size="12" maxlength="5" name="code" tabindex="3" />
130  </span>
131  </td>
132  <td><img src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" /></td>
133  <td><a href="<?php echo $php_self; ?>" tabindex="4"><?php echo $captcha_refresh; ?></a></td>
134  </tr></table>
135 
136  </td></tr>
137 <?php } ?>
138 
139 </table>
140 
141 </div> <!-- end div login right -->
142 
143 </div> <!-- end div login_line1 -->
144 
145 
146 <div id="login_line2" style="clear: both">
147 
148 <!-- Button "Regenerate and Send password" -->
149 <br><input type="submit" <?php echo $disabled; ?> class="button" name="password" value="<?php echo $langs->trans('SendNewPassword'); ?>" tabindex="4" />
150 
151 <br>
152 <div align="center" style="margin-top: 8px;">
153  <?php
154  $moreparam='';
155  if (! empty($conf->dol_hide_topmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu;
156  if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu;
157  if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover;
158  if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile;
159 
160  print '<a class="alogin" href="'.$dol_url_root.'/index.php'.$moreparam.'">('.$langs->trans('BackToLoginPage').')</a>';
161  ?>
162 </div>
163 
164 </div>
165 
166 </div>
167 
168 </form>
169 
170 
171 <div class="center login_main_home paddingtopbottom<?php echo empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' backgroundsemitransparent'; ?>" style="max-width: 70%">
172 <?php if ($mode == 'dolibarr' || ! $disabled) { ?>
173  <span class="passwordmessagedesc">
174  <?php echo $langs->trans('SendNewPasswordDesc'); ?>
175  </span>
176 <?php }else{ ?>
177  <div class="warning" align="center">
178  <?php echo $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode); ?>
179  </div>
180 <?php } ?>
181 </div>
182 
183 
184 <br>
185 
186 <?php if ($message) { ?>
187  <div class="center login_main_message">
188  <?php echo dol_htmloutput_mesg($message,'','',1); ?>
189  </div>
190 <?php } ?>
191 
192 <?php if (! empty($morelogincontent) && is_array($morelogincontent)) {
193  foreach ($morelogincontent as $format => $option)
194  {
195  if ($format == 'js') {
196  echo "\n".'<!-- Javascript by hook -->';
197  echo $option."\n";
198  }
199  }
200 }
201 else if (! empty($moreloginextracontent)) {
202  echo '<!-- Javascript by hook -->';
203  echo $moreloginextracontent;
204 }
205 ?>
206 
207 </div>
208 </div> <!-- end of center -->
209 
210 
211 </body>
212 </html>
213 <!-- END PHP TEMPLATE -->
if(GETPOST('cancel','alpha')) if(!GETPOST('confirmmassaction','alpha')&&$massaction!= 'presend'&&$massaction!= 'confirm_presend')
Draft customers invoices.
Definition: list.php:147
API that allows to log in with an user account.
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...
dol_htmloutput_mesg($mesgstring='', $mesgarray='', $style='ok', $keepembedded=0)
Print formated messages to output (Used to show messages on html output).
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($_POST["cancel"]==$langs->trans("Cancel")&&!$id) if($action== 'setdatev'&&$user->rights->tax->charges->creer) if($action== 'add'&&$_POST["cancel"]<> $langs->trans("Cancel")) if($action== 'delete') $title
Actions.
Definition: card.php:183
dol_now($mode='gmt')
Return date for now.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $disablejmobile=0, $disablenofollow=0)
Ouput html header of a page.
Definition: main.inc.php:1091
print
Draft customers invoices.
Definition: index.php:91
type
Definition: viewcat.php:283