Alternc  latest
Alternc logiel libre pour l'hébergement
hta_add.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  * Form to protect a 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 if (!isset($is_include)) {
30  $fields = array (
31  "dir" => array ("request", "string", ""),
32  );
34 }
35 
36 ?>
37 <h3><?php __("Protect a folder"); ?></h3>
38 <hr id="topbar"/>
39 <br/>
40 <p>
41 <?php __("Enter the name of the folder you want to protect. It must already exists."); ?>
42 </p>
43 <?php
44 echo $msg->msg_html_all();
45 ?>
46 
47 <form method="post" action="hta_doadd.php" name="main" id="main">
48  <?php csrf_get(); ?>
49  <table border="1" cellspacing="0" cellpadding="4" class='tedit'>
50  <tr>
51  <th><label for="dir"><?php __("Folder"); ?></label></th>
52  <td>
53  <input type="text" class="int" name="dir" id="dir" value="<?php (isset($dir)) ? : $dir="";ehe($dir); ?>" maxlength="255" />
54  <?php display_browser($dir, "dir" ); ?>
55  </td>
56  </tr>
57  </table>
58  <br />
59  <input type="submit" class="inb lock" value="<?php __("Protect this folder"); ?>" onClick="return false_if_empty('dir', '<?php echo addslashes(_("Can't have empty directory."));?>');" />
60 </form>
61 
62 <script type="text/javascript">
63  document.forms['main'].dir.focus();
64 </script>
65 
66 <?php include_once("foot.php"); ?>
$msg
Definition: bootstrap.php:75
$fields
Definition: aws_add.php:27
__($str)
Definition: functions.php:404
display_browser($dir="", $caller="main.dir", $width=350, $height=450)
Show a button to select a folder on the server.
Definition: functions.php:941
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
if($error) $is_include
Definition: ssl_donew.php:55