Alternc  3.2
Alternc logiel libre pour l'h├ębergement
 All Data Structures Namespaces Files Functions Variables Pages
aws_pass.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  AlternC - Web Hosting System
5  Copyright (C) 2000-2012 by the AlternC Development Team.
6  https://alternc.org/
7  ----------------------------------------------------------------------
8  LICENSE
9 
10  This program is free software; you can redistribute it and/or
11  modify it under the terms of the GNU General Public License (GPL)
12  as published by the Free Software Foundation; either version 2
13  of the License, or (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  To read the license please visit http://www.gnu.org/copyleft/gpl.html
21  ----------------------------------------------------------------------
22  Purpose of file: Change a user's password.
23  ----------------------------------------------------------------------
24 */
25 require_once("../class/config.php");
26 
27 $fields = array (
28  "login" => array ("request", "string", ""),
29  "pass" => array ("request", "string", ""),
30  "passconf" => array ("request", "string", ""),
31 );
32 
34 
35 if (!$aws->login_exists($login)) {
36  $error=$err->errstr();
37  include("aws_users.php");
38  exit();
39 }
40 
41 if ($pass) {
42  if ($pass != $passconf) {
43  $error = _("Passwords do not match");
44  include("aws_users.php");
45  exit();
46  }else{
47  if (!$aws->change_pass($login,$pass)) {
48  $error=$err->errstr();
49  } else {
50  $error = _("Password successfuly updated");
51  include("aws_users.php");
52  exit();
53  }
54  }
55 }
56 
57 include_once("head.php");
58 
59 ?>
60 <h3><?php __("Change a user's password"); ?></h3>
61 <?php
62 if (isset($error) && $error) {
63 ?>
64 <p class="error"><?php echo $error ; $error=''; ?></p>
65 <?php } ?>
66 
67 <form method="post" action="aws_pass.php" name="main" id="main">
68 <table class="tedit">
69 <tr><th>
70 <?php __("Username"); ?></th><td>
71  <code><?php echo $login; ?></code> <input type="hidden" name="login" value="<?php echo $login; ?>" />
72 </td></tr>
73 <tr><th><label for="pass"><?php __("New Password"); ?></label></th><td><input type="password" class="int" name="pass" id="pass" value="<?php echo $pass; ?>" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td></tr>
74 <tr><th><label for="passconf"><?php __("Confirm password"); ?></label></th><td><input type="password" class="int" name="passconf" id="passconf" value="" size="20" maxlength="64" /></td></tr>
75 <tr class="trbtn"><td colspan="2">
76  <input type="submit" class="inb" name="submit" value="<?php __("Change this user's password"); ?>" />
77  <input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='aws_users.php'"/>
78 </td></tr>
79 </table>
80 </form>
81 
82 <script type="text/javascript">
83 document.forms['main'].pass.focus();
84 document.forms['main'].setAttribute('autocomplete', 'off');
85 </script>
86 
87 
88 <?php include_once("foot.php"); ?>