Alternc  latest
Alternc logiel libre pour l'hébergement
request_reset.php
Go to the documentation of this file.
1 <?php
2 
3 require_once("../class/config_nochk.php");
4 
5 $request = FALSE;
7 if (isset($_REQUEST['name_or_email'])) {
8  $request = TRUE;
9  // Inserted into the global namespace by config.php
10  $valid_request = !$fatalcsrf;
11  if ($fatalcsrf) {
12  $msg->raise('ERROR', _('Failed to validate CSRF token'));
13  }
14 }
15 
16 
17 // Show the form if nothing was submitted, or if what was submitted is not
18 // a valid request (eg. doesn't pass CSRF).
20 
21 if ($request && $valid_request) {
22  $mem->send_reset_url($_REQUEST['name_or_email']);
23 }
24 
25 if (!isset($charset) || ! $charset) {
26  $charset="UTF-8";
27 }
28 
29 @header("Content-Type: text/html; charset=$charset");
30 require_once("html-head.php");
31 ?>
32 
33 <body class="login_page">
34  <div id="global">
35  <div id="content">
36  <?php
37  // Getting logo. C.f. admin/index.php
38  $logo = variable_get('logo_login', '' ,'You can specify a logo for the login page, example /images/my_logo.png .', array('desc'=>'URL','type'=>'string'));
39  if ( empty($logo) || ! $logo ) {
40  $logo = 'images/logo.png';
41  }
42  ?>
43  <p id='logo'> <img src="<?php echo $logo; ?>" border="0" height="100px" alt="<?php __("Web Hosting Control Panel"); ?>" title="<?php __("Web Hosting Control Panel"); ?>" />
44  </p>
45  <p>&nbsp;</p>
46  <?php echo $msg->msg_html_all(); ?>
47  <br/>
48  <div class="block_list">
49  <?php if ($show_form): ?>
50  <div class="block_login_page">
51  <div class="menu-box">
52  <div class="menu-title"><?php echo _('Password reset'); ?></div>
53  <form action="request_reset.php" method="post" name="passwordreset">
54  <?php csrf_get(); ?>
55  <div>
56  <label for="name_or_email"><?php echo _('Username or e-mail'); ?></label>
57  <input type="text" class="int" name="name_or_email">
58  </div>
59  <div class="submit"><input type="submit" class="inb" name="submit"></div>
60  </form>
61  </div>
62  </div>
63  <div class="block_list">
64  <p><?php echo _('An e-mail with instructions will be sent'); ?></p>
65  </div>
66  <?php else: ?>
67  <div><p><a href="index.php"><?php __('Return to login page'); ?></a></p></div>
68  <?php endif; ?>
69  </div>
70  </div>
71  </div>
72 </body>
$valid_request
$logo
endif
$request
if(isset($_REQUEST['name_or_email'])) $show_form