This commit is contained in:
Alan Garcia 2014-02-28 15:11:45 +00:00
parent 8fde9a58a2
commit 4108189f4f
2 changed files with 27 additions and 18 deletions

View File

@ -38,30 +38,33 @@ getFields($fields);
?> ?>
<h3><?php __("Protect a folder"); ?></h3> <h3><?php __("Protect a folder"); ?></h3>
<hr id="topbar"/> <hr id="topbar"/>
<br /> <br/>
<p> <p>
<?php __("Enter the name of the folder you want to protect. It must already exists."); ?> <?php __("Enter the name of the folder you want to protect. It must already exists."); ?>
</p> </p>
<?php <?php
if (isset($error) && $error) { if (isset($error) && $error) {
echo "<p class=\"alert alert-danger\">$error</p>"; echo "<p class=\"alert alert-danger\">$error</p>";
include_once("foot.php"); include_once("foot.php");
exit; exit;
} } ?>
?>
<form method="post" action="hta_doadd.php" name="main" id="main"> <form method="post" action="hta_doadd.php" name="main" id="main">
<table border="1" cellspacing="0" cellpadding="4" class='tedit'> <table border="1" cellspacing="0" cellpadding="4" class='tedit'>
<tr> <tr>
<th><label for="dir"><?php __("Folder"); ?></label></th> <th><label for="dir"><?php __("Folder"); ?></label></th>
<td><input type="text" class="int" name="dir" id="dir" value="<?php (isset($dir)) ? : $dir="";ehe($dir); ?>" maxlength="255" /> <td>
<input type="text" class="int" name="dir" id="dir" value="<?php (isset($dir)) ? : $dir="";ehe($dir); ?>" maxlength="255" />
<?php display_browser( ehe($dir,0) , "main.dir" ); ?> <?php display_browser( ehe($dir,0) , "main.dir" ); ?>
</td> </td>
</tr> </tr>
</table> </table>
<br /> <br />
<input type="submit" class="inb lock" value="<?php __("Protect this folder"); ?>" /> <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."));?>');" />
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
document.forms['main'].dir.focus(); document.forms['main'].dir.focus();
</script> </script>
<?php include_once("foot.php"); ?> <?php include_once("foot.php"); ?>

View File

@ -35,6 +35,12 @@ $fields = array (
); );
getFields($fields); getFields($fields);
if(empty($dir)) {
$error=_("No directory specified");
include("hta_list.php");
exit();
}
if(!$hta->CreateDir($dir)) { if(!$hta->CreateDir($dir)) {
$error=$err->errstr(); $error=$err->errstr();
include("hta_add.php"); include("hta_add.php");