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 else
{ {
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']); $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") . "\";"); eval("echo \"" . getTemplate("extras/htpasswds_add") . "\";");
} }
} }
@@ -220,6 +227,13 @@ elseif($page == 'htpasswds')
} }
$result = htmlentities_array($result); $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") . "\";"); eval("echo \"" . getTemplate("extras/htpasswds_edit") . "\";");
} }
} }

View File

@@ -1,41 +1,20 @@
$header $header
<article> <article>
<header> <header>
<h2> <h2>
<img src="images/Froxlor/icons/add_htpasswd.png" alt="{$lng['extras']['directoryprotection_add']}" />&nbsp; <img src="images/Froxlor/{$image}" alt="{$title}" />&nbsp;
{$lng['extras']['directoryprotection_add']} {$title}
</h2> </h2>
</header> </header>
<section class="fullform bradiusodd"> <section class="fullform bradiusodd">
<form action="$filename" method="post" enctype="application/x-www-form-urlencoded"> <form action="$filename" method="post" enctype="application/x-www-form-urlencoded">
<fieldset> <fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$lng['extras']['directoryprotection_add']}</legend> <legend>Froxlor&nbsp;-&nbsp;{$title}</legend>
<table class="formtable"> <table class="formtable">
<tr> {$htpasswd_add_form}
<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>
</table> </table>
<p style="display: none;"> <p style="display: none;">
@@ -46,6 +25,8 @@ $header
</p> </p>
</fieldset> </fieldset>
</form> </form>
</section>
</article> </section>
</article>
$footer $footer

View File

@@ -1,48 +1,33 @@
$header $header
<article> <article>
<header> <header>
<h2> <h2>
<img src="images/Froxlor/icons/edit_htpasswd.png" alt="{$lng['extras']['directoryprotection_edit']}" />&nbsp; <img src="images/Froxlor/{$image}" alt="{$title}" />&nbsp;
{$lng['extras']['directoryprotection_edit']} {$title}
</h2> </h2>
</header> </header>
<section class="fullform bradiusodd"> <section class="fullform bradiusodd">
<form action="$filename" method="post" enctype="application/x-www-form-urlencoded"> <form action="$filename" method="post" enctype="application/x-www-form-urlencoded">
<fieldset> <fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$lng['extras']['directoryprotection_edit']}</legend> <legend>Froxlor&nbsp;-&nbsp;{$title}</legend>
<table class="formtable"> <table class="formtable">
<tr> {$htpasswd_edit_form}
<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>
</table> </table>
<p style="display: none;"> <p style="display: none;">
<input type="hidden" name="s" value="$s" /> <input type="hidden" name="s" value="$s" />
<input type="hidden" name="page" value="$page" /> <input type="hidden" name="page" value="$page" />
<input type="hidden" name="action" value="$action" /> <input type="hidden" name="action" value="$action" />
<input type="hidden" name="id" value="$id" />
<input type="hidden" name="send" value="send" /> <input type="hidden" name="send" value="send" />
</p> </p>
</fieldset> </fieldset>
</form> </form>
</section>
</article> </section>
</article>
$footer $footer