Alternc  latest
Alternc logiel libre pour l'hébergement
hta_edit.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 protected folder parameters
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 if (!isset($is_include)) {
30  $fields = array (
31  "dir" => array ("request", "string", ""),
32  );
34 }
35 
36 if (!$dir) {
37  echo "<p class=\"alert alert-warning\">"._("No folder selected!")."</p>";
38  require_once('foot.php');
39  die();
40 } else {
41  $r=$hta->get_hta_detail($dir);
42 } // if !$dir
43 
44 $c=$admin->listPasswordPolicies();
45 $passwd_classcount = $c['hta']['classcount'];
46 
47 ?>
48 <h3><?php printf(_("List of authorized user in folder %s"),$dir); ?></h3>
49 <hr id="topbar"/>
50 <br />
51 <?php
52  if (!count($r)) {
53  $msg->raise("INFO", "hta", _("No authorized user in %s"),$dir);
54  echo $msg->msg_html_all();
55  } else {
56  reset($r);
57  echo $msg->msg_html_all();
58 ?>
59 <form method="post" action="hta_dodeluser.php">
60  <?php csrf_get(); ?>
61 <table cellspacing="0" cellpadding="4" class='tlist'>
62  <tr>
63  <th colspan="2" ><input type="hidden" name="dir" value="<?php ehe($dir); ?>"> </th>
64  <th><?php __("Username"); ?></th>
65  </tr>
66 <?php
67 for($i=0;$i<count($r);$i++){ ?>
68  <tr class="lst">
69  <td align="center"><input type="checkbox" class="inc" name="d[]" value="<?php ehe($r[$i]); ?>" /></td>
70  <td>
71  <div class="ina"><a href="hta_edituser.php?user=<?php eue($r[$i]); ?>&amp;dir=<?php eue($dir); ?>"><img src="icon/encrypted.png" alt="<?php __("Change this user's password"); ?>" /><?php __("Change this user's password"); ?></a></div>
72  </td>
73  <td><?php ehe($r[$i]); ?></td>
74  </tr>
75 <?php
76 } // for $i
77 ?>
78 </table>
79 
80 <br />
81 <input type="submit" class="inb" name="submit" value="<?php __("Delete the checked users"); ?>" />
82 </form>
83 
84 <?php } // else !count $r ?>
85 <p>
86 <span class="inb"><a href="bro_main.php?R=<?php eue($dir); ?>"><?php __("Show this folder's content in the File Browser"); ?></a></span>
87 </p>
88 
89 <p>&nbsp;</p>
90 
91 <fieldset>
92  <legend><h3><?php __("Adding an authorized user"); ?></h3></legend>
93 
94  <form method="post" action="hta_doadduser.php" name="main" id="main" autocomplete="off">
95  <?php csrf_get(); ?>
96 <!-- honeypot fields -->
97 <input type="text" style="display: none" id="fakeUsername" name="fakeUsername" value="" />
98 <input type="password" style="display: none" id="fakePassword" name="fakePassword" value="" />
99 
100  <table class="tedit">
101  <tr>
102  <th><input type="hidden" name="dir" value="<?php ehe($dir); ?>" /><?php __("Folder"); ?></th>
103  <td><?php echo '<a href="bro_main.php?R='.eue($dir,false).'">'.ehe($dir,false).'</a>'; ?></td>
104  </tr>
105  <tr>
106  <th><label for="user"><?php __("Username"); ?></label></th>
107  <td><input type="text" class="int" name="user" id="user" value="" size="20" maxlength="64" /></td>
108  </tr>
109  <tr>
110  <th><label for="password"><?php __("Password"); ?></label></th>
111  <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>
112  </tr>
113  <tr>
114  <th><label for="passwordconf"><?php __("Confirm password"); ?></label></th>
115  <td><input type="password" class="int" name="passwordconf" autocomplete="off" id="passwordconf" value="" size="20" maxlength="64" /></td>
116  </tr>
117  </table>
118 
119  <br />
120  <input type="submit" class="inb ok" value="<?php __("Add this user"); ?>" />
121  <input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='hta_list.php';"/>
122  </form>
123 </fieldset>
124 
125 <script type="text/javascript">
126  document.forms['main'].user.focus();
127 </script>
128 
129 <?php include_once("foot.php"); ?>
$msg
Definition: bootstrap.php:75
$r
Definition: aws_add.php:75
$fields
Definition: aws_add.php:27
__($str)
Definition: functions.php:404
eue($str, $display=TRUE)
Echo the URLENCODED version of a value.
Definition: functions.php:670
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
$c
Definition: hta_edit.php:44
$passwd_classcount
Definition: hta_edit.php:45
$i
if($error) $is_include
Definition: ssl_donew.php:55