lot of formfield corrections; form-adjustments; implementing of add/edit for most customer_* pages
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -22,6 +22,7 @@ require __DIR__ . '/lib/init.php';
|
||||
use Froxlor\Api\Commands\Ftps as Ftps;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
|
||||
// redirect if this customer page is hidden via settings
|
||||
@@ -71,7 +72,7 @@ if ($page == 'overview') {
|
||||
$row['documentroot'] = \Froxlor\FileDir::makeCorrectDir($row['documentroot']);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate('ftp/accounts_account') . "\";");
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('ftp/accounts') . "\";");
|
||||
@@ -122,9 +123,7 @@ if ($page == 'overview') {
|
||||
$pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], '/');
|
||||
|
||||
if (Settings::Get('customer.ftpatdomain') == '1') {
|
||||
$domainlist = array();
|
||||
$domains = '';
|
||||
|
||||
$domainlist = [];
|
||||
$result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid`= :customerid");
|
||||
Database::pexecute($result_domains_stmt, array(
|
||||
@@ -132,39 +131,27 @@ if ($page == 'overview') {
|
||||
));
|
||||
|
||||
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domainlist[] = $row_domain['domain'];
|
||||
$domainlist[$row_domain['domain']] = $idna_convert->decode($row_domain['domain']);
|
||||
}
|
||||
|
||||
sort($domainlist);
|
||||
|
||||
if (isset($domainlist[0]) && $domainlist[0] != '') {
|
||||
foreach ($domainlist as $dom) {
|
||||
$domains .= \Froxlor\UI\HTML::makeoption($idna_convert->decode($dom), $dom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings::Get('system.allow_customer_shell') == '1') {
|
||||
$shells = \Froxlor\UI\HTML::makeoption("/bin/false", "/bin/false", "/bin/false");
|
||||
$shells['/bin/false'] = "/bin/false";
|
||||
$shells_avail = Settings::Get('system.available_shells');
|
||||
if (! empty($shells_avail)) {
|
||||
if (!empty($shells_avail)) {
|
||||
$shells_avail = explode(",", $shells_avail);
|
||||
$shells_avail = array_map("trim", $shells_avail);
|
||||
foreach ($shells_avail as $_shell) {
|
||||
$shells .= \Froxlor\UI\HTML::makeoption($_shell, $_shell, "/bin/false");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// $sendinfomail = \Froxlor\UI\HTML::makeyesno('sendinfomail', '1', '0', '0');
|
||||
|
||||
$ftp_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/ftp/formfield.ftp_add.php';
|
||||
$ftp_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($ftp_add_data);
|
||||
|
||||
$title = $ftp_add_data['ftp_add']['title'];
|
||||
$image = $ftp_add_data['ftp_add']['image'];
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('ftp/accounts_add') . "\";");
|
||||
UI::twigBuffer('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(array('section' => 'ftp')),
|
||||
'formdata' => $ftp_add_data['ftp_add']
|
||||
]);
|
||||
UI::twigOutputBuffer();
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
@@ -198,39 +185,22 @@ if ($page == 'overview') {
|
||||
|
||||
$pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $homedir);
|
||||
|
||||
if (Settings::Get('customer.ftpatdomain') == '1') {
|
||||
$domains = '';
|
||||
|
||||
$result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid` = :customerid");
|
||||
Database::pexecute($result_domains_stmt, array(
|
||||
"customerid" => $userinfo['customerid']
|
||||
));
|
||||
|
||||
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domains .= \Froxlor\UI\HTML::makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']);
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings::Get('system.allow_customer_shell') == '1') {
|
||||
$shells = \Froxlor\UI\HTML::makeoption("/bin/false", "/bin/false", $result['shell']);
|
||||
$shells['/bin/false'] = "/bin/false";
|
||||
$shells_avail = Settings::Get('system.available_shells');
|
||||
if (! empty($shells_avail)) {
|
||||
if (!empty($shells_avail)) {
|
||||
$shells_avail = explode(",", $shells_avail);
|
||||
$shells_avail = array_map("trim", $shells_avail);
|
||||
foreach ($shells_avail as $_shell) {
|
||||
$shells .= \Froxlor\UI\HTML::makeoption($_shell, $_shell, $result['shell']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ftp_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/ftp/formfield.ftp_edit.php';
|
||||
$ftp_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($ftp_edit_data);
|
||||
|
||||
$title = $ftp_edit_data['ftp_edit']['title'];
|
||||
$image = $ftp_edit_data['ftp_edit']['image'];
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('ftp/accounts_edit') . "\";");
|
||||
UI::twigBuffer('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(array('section' => 'ftp', 'id' => $id)),
|
||||
'formdata' => $ftp_edit_data['ftp_edit']
|
||||
]);
|
||||
UI::twigOutputBuffer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user