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

View File

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