Alternc  latest
Alternc logiel libre pour l'hébergement
hta_list.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  * List the folders having password-protection in the account's home
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 ($r=$hta->ListDir()) {
30  reset($r);
31 }
32 
33 ?>
34 <h3><?php __("Protected folders list"); ?></h3>
35 <hr id="topbar"/>
36 <br />
37 <?php
38 echo $msg->msg_html_all();
39 
40 if (!is_array($r)) {
41  echo "<p><span class=\"ina\"><a href=\"hta_add.php\">"._("Protect a folder")."</a></span><br />";
42  $mem->show_help("hta_list");
43  echo "</p>";
44  include_once("foot.php");
45  exit();
46 }
47 
48 ?>
49 
50 <p>
51 <?php
52 __("You can set passwords to protect some of your folders.<br/>This will create .htaccess and .htpasswd files that restrict access to these directory and to any sub-elements.");
53 // __("help_hta_list");
54 $mem->show_help("hta_list2");
55 ?>
56 </p>
57 
58 <form method="post" action="hta_del.php">
59  <?php csrf_get(); ?>
60 <table class="tlist">
61  <tr><th colspan="2"> </th><th><?php __("Folder"); ?></th></tr>
62 <?php
63 
64 
65 for($i=0;$i<count($r);$i++){
66 ?>
67  <tr class="lst">
68  <td align="center"><input type="checkbox" class="inc" name="del_<?php ehe($r[$i]); ?>" value="<?php ehe($r[$i]); ?>" /></td>
69  <td>
70 <div class="ina lock"><a href="hta_edit.php?dir=<?php eue($r[$i]); ?>"><?php __("Edit login and passwords"); ?></a></div>
71 </td>
72  <td><?php echo '<a href="bro_main.php?R='.ehe($r[$i],false).'">'.ehe($r[$i],false).'</a>'; ?></td>
73  </tr>
74  <?php
75  }
76 ?>
77 </table>
78 <br />
79 <input type="submit" class="ina unlock" name="submit" value="<?php __("Unprotect the checked folders"); ?>" />
80  <span class="ina add"><a href="hta_add.php"><?php __("Protect a folder"); ?></a></span>
81 </form>
82 
83 <p>
84 <?php $mem->show_help("hta_list"); ?>
85 </p>
86 <?php include_once("foot.php"); ?>
exit
Definition: adm_doadd.php:70
$mem
Definition: bootstrap.php:71
$msg
Definition: bootstrap.php:75
$r
Definition: aws_add.php:75
ehe($str, $display=TRUE)
Echo the HTMLSpecialChars version of a value.
Definition: functions.php:647
__($str)
Definition: functions.php:404
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
$i