Alternc  latest
Alternc logiel libre pour l'hébergement
hta_adduser.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  * Add a user to a protected folder (using .htaccess for apache)
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  "dir" => array ("request", "string", ""),
31  "user" => array ("post", "string", ""),
32 );
34 
35 ?>
36 <h3><?php printf(_("Adding a username in %s"),$dir); ?></h3>
37 <?php
38 echo $msg->msg_html_all();
39 
40 $c=$admin->listPasswordPolicies();
41 $passwd_classcount = $c['hta']['classcount'];
42 ?>
43 
44 <form method="post" action="hta_doadduser.php" name="main" id="main" autocomplete="off">
45  <?php csrf_get(); ?>
46 
47 <table border="1" cellspacing="0" cellpadding="4" class='tedit'>
48  <tr>
49  <th><input type="hidden" name="dir" value="<?php ehe($dir); ?>" /><?php __("Folder"); ?></th>
50  <td><code><?php echo $dir; ?></code></td>
51  </tr>
52  <tr>
53  <th><label for="user"><?php __("Username"); ?></label></th>
54  <td><input type="text" class="int" name="user" id="user" value="<?php ehe($user); ?>" size="20" maxlength="64" /></td>
55  </tr>
56  <tr>
57  <th><label for="password"><?php __("Password"); ?></label></th>
58  <td><input type="password" class="int" name="password" autocomplete="off" id="password" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#password","#passwordconf",$passwd_classcount); ?></td>
59  </tr>
60  <tr>
61  <th><label for="passwordconf"><?php __("Confirm password"); ?></label></th>
62  <td><input type="password" class="int" name="passwordconf" autocomplete="off" id="passwordconf" value="" size="20" maxlength="64" /></td>
63  </tr>
64 </table>
65 <br />
66 <input type="submit" class="inb" value="<?php __("Add this user"); ?>" />
67  <input type="button" class="inb" value="<?php __("Cancel"); ?>" onclick="document.location='hta_edit.php?dir=<?php echo urlencode($dir); ?>';" />
68 </form>
69 <script type="text/javascript">
70  document.forms['main'].user.focus();
71 </script>
72 <?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
Add a user to a protected folder (using .htaccess for apache)
Definition: hta_adduser.php:29
$c
Definition: hta_adduser.php:40
$passwd_classcount
Definition: hta_adduser.php:41