Alternc  latest
Alternc logiel libre pour l'hébergement
hta_edituser.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Edit a username for a protected folder (using htaccess for apache2)
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 include_once ("head.php");
28 
29 $fields = array (
30  "user" => array ("request", "string", ""),
31  "dir" => array ("request", "string", ""),
32 );
34 
35 $c=$admin->listPasswordPolicies();
36 $passwd_classcount = $c['hta']['classcount'];
37 
38 ?>
39 <h3><?php printf(_("Editing user %s in the protected folder %s"),$user,$dir); ?></h3>
40 <hr id="topbar"/>
41 <br />
42 
43 <?php
44 echo $msg->msg_html_all();
45 ?>
46 
47 <form method="post" action="hta_doedituser.php" name="main" id="main" autocomplete="off">
48  <?php csrf_get(); ?>
49 
50 <!-- honeypot fields -->
51 <input type="text" style="display: none" id="fakeUsername" name="fakeUsername" value="" />
52 <input type="password" style="display: none" id="fakePassword" name="fakePassword" value="" />
53 
54  <input type="hidden" name="dir" value="<?php ehe($dir); ?>">
55  <input type="hidden" name="user" value="<?php ehe($user); ?>">
56  <table border="1" cellspacing="0" cellpadding="4" class='tedit'>
57  <tr>
58  <th><?php __("Folder"); ?></th>
59  <td><code><?php echo $dir; ?></code></td>
60  </tr>
61  <tr>
62  <th><?php __("User"); ?></th>
63  <td><code><?php echo $user; ?></code></td>
64  </tr>
65  <tr>
66  <th><label for="newpass"><?php __("New password"); ?></label></th>
67  <td><input type="password" class="int" name="newpass" autocomplete="off" id="newpass" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","#newpassconf",$passwd_classcount); ?></td>
68  </tr>
69  <tr>
70  <th><label for="newpassconf"><?php __("Confirm password"); ?></label></th>
71  <td><input type="password" class="int" name="newpassconf" autocomplete="off" id="newpassconf" value="" size="20" maxlength="64" /></td>
72  </tr>
73  </table>
74  <br/>
75  <input type="submit" class="inb" value="<?php __("Change the password"); ?>" />
76 </form>
77 
78 <script type="text/javascript">
79  document.forms['main'].newpass.focus();
80 </script>
81 
82 <?php include_once("foot.php"); ?>
$msg
Definition: bootstrap.php:75
const DEFAULT_PASS_SIZE
Define constants from vars of /etc/alternc/local.sh The you can't choose where is the AlternC Panel.
Definition: config.php:81
display_div_generate_password($pass_size=DEFAULT_PASS_SIZE, $fields_to_fill1="", $fields_to_fill2="", $classcount=3)
Show a button to set a random password for a password field.
Definition: functions.php:922
__($str)
Definition: functions.php:404
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
Definition: functions.php:688
csrf_get($return=false)
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session ...
Definition: functions.php:1159
$fields
Edit a username for a protected folder (using htaccess for apache2)
$c
$passwd_classcount
$user
Definition: bootstrap.php:84