use htpasswd-formfields

This commit is contained in:
Michael Kaufmann (d00p)
2011-02-12 16:47:07 +01:00
parent 44febee357
commit 3e83ae8a6e
3 changed files with 45 additions and 65 deletions

View File

@@ -161,6 +161,13 @@ elseif($page == 'htpasswds')
else
{
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
$htpasswd_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/extras/formfield.htpasswd_add.php';
$htpasswd_add_form = htmlform::genHTMLForm($htpasswd_add_data);
$title = $htpasswd_add_data['htpasswd_add']['title'];
$image = $htpasswd_add_data['htpasswd_add']['image'];
eval("echo \"" . getTemplate("extras/htpasswds_add") . "\";");
}
}
@@ -220,6 +227,13 @@ elseif($page == 'htpasswds')
}
$result = htmlentities_array($result);
$htpasswd_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/extras/formfield.htpasswd_edit.php';
$htpasswd_edit_form = htmlform::genHTMLForm($htpasswd_edit_data);
$title = $htpasswd_edit_data['htpasswd_edit']['title'];
$image = $htpasswd_edit_data['htpasswd_edit']['image'];
eval("echo \"" . getTemplate("extras/htpasswds_edit") . "\";");
}
}

View File

@@ -1,41 +1,20 @@
$header
<article>
<header>
<h2>
<img src="images/Froxlor/icons/add_htpasswd.png" alt="{$lng['extras']['directoryprotection_add']}" />&nbsp;
{$lng['extras']['directoryprotection_add']}
</h2>
</header>
<section class="fullform bradiusodd">
<article>
<header>
<h2>
<img src="images/Froxlor/{$image}" alt="{$title}" />&nbsp;
{$title}
</h2>
</header>
<section class="fullform bradiusodd">
<form action="$filename" method="post" enctype="application/x-www-form-urlencoded">
<fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$lng['extras']['directoryprotection_add']}</legend>
<legend>Froxlor&nbsp;-&nbsp;{$title}</legend>
<table class="formtable">
<tr>
<td>
<b>{$lng['panel']['path']}:</b><br />
<if $settings['panel']['pathedit'] != 'Dropdown'><small>{$lng['panel']['pathDescription']}</small></if>
</td>
<td>{$pathSelect}</td>
</tr>
<tr>
<td>{$lng['login']['username']}:</td>
<td><input type="text" name="username" /></td>
</tr>
<tr>
<td>{$lng['login']['password']}:</td>
<td><input type="password" name="directory_password" /></td>
</tr>
<tr>
<td>{$lng['extras']['htpasswdauthname']}:</td>
<td><input type="text" name="directory_authname" /></td>
</tr>
<tr>
<td colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" value="{$lng['extras']['directoryprotection_add']}" /></td>
</tr>
{$htpasswd_add_form}
</table>
<p style="display: none;">
@@ -46,6 +25,8 @@ $header
</p>
</fieldset>
</form>
</section>
</article>
</section>
</article>
$footer

View File

@@ -1,48 +1,33 @@
$header
<article>
<header>
<h2>
<img src="images/Froxlor/icons/edit_htpasswd.png" alt="{$lng['extras']['directoryprotection_edit']}" />&nbsp;
{$lng['extras']['directoryprotection_edit']}
</h2>
</header>
<section class="fullform bradiusodd">
<article>
<header>
<h2>
<img src="images/Froxlor/{$image}" alt="{$title}" />&nbsp;
{$title}
</h2>
</header>
<section class="fullform bradiusodd">
<form action="$filename" method="post" enctype="application/x-www-form-urlencoded">
<fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$lng['extras']['directoryprotection_edit']}</legend>
<legend>Froxlor&nbsp;-&nbsp;{$title}</legend>
<table class="formtable">
<tr>
<td>{$lng['panel']['path']}:</td>
<td>{$result['path']}</td>
</tr>
<tr>
<td>{$lng['login']['username']}:</td>
<td>{$result['username']}</td>
</tr>
<tr>
<td>{$lng['login']['password']}:</td>
<td><input type="password" name="directory_password" /></td>
</tr>
<tr>
<td>{$lng['extras']['htpasswdauthname']}:</td>
<td><input type="text" name="directory_authname" value="{$result['authname']}" /></td>
</tr>
<tr>
<td colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" value="{$lng['extras']['directoryprotection_edit']}" /></td>
</tr>
{$htpasswd_edit_form}
</table>
<p style="display: none;">
<input type="hidden" name="s" value="$s" />
<input type="hidden" name="page" value="$page" />
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="id" value="$id" />
<input type="hidden" name="send" value="send" />
</p>
</fieldset>
</form>
</section>
</article>
</section>
</article>
$footer