diff --git a/admin_domains.php b/admin_domains.php index 653dfbd8..c105e6c6 100644 --- a/admin_domains.php +++ b/admin_domains.php @@ -53,11 +53,11 @@ if ($page == 'domains' || $page == 'overview') { $log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_domains"); try { + $customerCollection = (new Collection(Customers::class, $userinfo)); $domain_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.domains.php'; $collection = (new Collection(Domains::class, $userinfo)) ->has('customer', Customers::class, 'customerid', 'customerid') ->withPagination($domain_list_data['domain_list']['columns']); - $customerCollection = (new Collection(Customers::class, $userinfo)); } catch (Exception $e) { Response::dynamicError($e->getMessage()); } diff --git a/admin_plans.php b/admin_plans.php index d308454c..995ad75a 100644 --- a/admin_plans.php +++ b/admin_plans.php @@ -27,6 +27,7 @@ const AREA = 'admin'; require __DIR__ . '/lib/init.php'; use Froxlor\Api\Commands\HostingPlans; +use Froxlor\Api\Commands\MysqlServer; use Froxlor\Database\Database; use Froxlor\FroxlorLogger; use Froxlor\PhpHelper; @@ -105,6 +106,20 @@ if ($page == '' || $page == 'overview') { 'page' => $page ]); } else { + $mysql_servers = []; + try { + $result_json = MysqlServer::getLocal($userinfo)->listing(); + $result_decoded = json_decode($result_json, true)['data']['list']; + foreach ($result_decoded as $dbserver => $dbdata) { + $mysql_servers[] = [ + 'label' => $dbdata['caption'], + 'value' => $dbserver + ]; + } + } catch (Exception $e) { + /* just none */ + } + $phpconfigs = []; $configs = Database::query(" SELECT c.*, fc.description as interpreter @@ -128,8 +143,8 @@ if ($page == '' || $page == 'overview') { // dummy to avoid unknown variables $hosting_plans = null; - $plans_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/plans/formfield.plans_add.php'; - $cust_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_add.php'; + $plans_add_data = include_once __DIR__ . '/lib/formfields/admin/plans/formfield.plans_add.php'; + $cust_add_data = include_once __DIR__ . '/lib/formfields/admin/customer/formfield.customer_add.php'; // unset unneeded stuff unset($cust_add_data['customer_add']['sections']['section_a']); unset($cust_add_data['customer_add']['sections']['section_b']); @@ -171,6 +186,20 @@ if ($page == '' || $page == 'overview') { 'page' => $page ]); } else { + $mysql_servers = []; + try { + $result_json = MysqlServer::getLocal($userinfo)->listing(); + $result_decoded = json_decode($result_json, true)['data']['list']; + foreach ($result_decoded as $dbserver => $dbdata) { + $mysql_servers[] = [ + 'label' => $dbdata['caption'], + 'value' => $dbserver + ]; + } + } catch (Exception $e) { + /* just none */ + } + $phpconfigs = []; $configs = Database::query(" SELECT c.*, fc.description as interpreter @@ -216,8 +245,8 @@ if ($page == '' || $page == 'overview') { $hosting_plans = null; $admin_select = []; - $plans_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/plans/formfield.plans_edit.php'; - $cust_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_edit.php'; + $plans_edit_data = include_once __DIR__ . '/lib/formfields/admin/plans/formfield.plans_edit.php'; + $cust_edit_data = include_once __DIR__ . '/lib/formfields/admin/customer/formfield.customer_edit.php'; // unset unneeded stuff unset($cust_edit_data['customer_edit']['sections']['section_a']); unset($cust_edit_data['customer_edit']['sections']['section_b']); diff --git a/customer_email.php b/customer_email.php index 863bf412..27244dd2 100644 --- a/customer_email.php +++ b/customer_email.php @@ -176,6 +176,11 @@ if ($page == 'overview' || $page == 'emails') { $result = json_decode($json_result, true)['data']; if (isset($result['email']) && $result['email'] != '') { + if (isset($_POST['send']) && $_POST['send'] == 'send') { + Response::redirectTo($filename, [ + 'page' => $page + ]); + } $result['email'] = $idna_convert->decode($result['email']); $result['email_full'] = $idna_convert->decode($result['email_full']); $result['destination'] = explode(' ', $result['destination']); diff --git a/install/updatesql.php b/install/updatesql.php index 22cf2ad3..17237e9f 100644 --- a/install/updatesql.php +++ b/install/updatesql.php @@ -70,6 +70,9 @@ if (Froxlor::isFroxlor()) { Update::lastStepStatus(0); } + // reset cached version check + Settings::Set('system.updatecheck_data', ''); + $filelog->logAction(FroxlorLogger::ADM_ACTION, LOG_WARNING, '--------------- END LOG ---------------'); unset($filelog); } diff --git a/lib/formfields/admin/customer/formfield.customer_add.php b/lib/formfields/admin/customer/formfield.customer_add.php index b4d94023..4fca6eaf 100644 --- a/lib/formfields/admin/customer/formfield.customer_add.php +++ b/lib/formfields/admin/customer/formfield.customer_add.php @@ -40,7 +40,7 @@ return [ 'new_loginname' => [ 'label' => lng('login.username'), 'type' => 'text', - 'placeholder' => 'Leave empty for autogenerated value' + 'placeholder' => lng('admin.username_default_msg') ], 'createstdsubdomain' => [ 'label' => lng('admin.stdsubdomain_add') . '?', @@ -58,6 +58,7 @@ return [ 'label' => lng('login.password'), 'type' => 'password', 'autocomplete' => 'off', + 'placeholder' => lng('admin.username_default_msg'), 'next_to' => [ 'new_customer_password_suggestion' => [ 'next_to_prefix' => lng('customer.generated_pwd') . ':', diff --git a/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php b/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php index 6bac5ac9..02cd8f5f 100644 --- a/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php +++ b/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php @@ -35,7 +35,7 @@ return [ 'title' => lng('menue.main.changepassword'), 'image' => 'icons/email_edit.png', 'fields' => [ - 'email_full' => [ + 'emailaddr' => [ 'label' => lng('emails.emailaddress'), 'type' => 'label', 'value' => $result['email_full'] diff --git a/lib/formfields/customer/email/formfield.emails_accountchangequota.php b/lib/formfields/customer/email/formfield.emails_accountchangequota.php index 040f0a1e..186f7ceb 100644 --- a/lib/formfields/customer/email/formfield.emails_accountchangequota.php +++ b/lib/formfields/customer/email/formfield.emails_accountchangequota.php @@ -32,7 +32,7 @@ return [ 'title' => lng('emails.quota_edit'), 'image' => 'icons/email_edit.png', 'fields' => [ - 'email_full' => [ + 'emailaddr' => [ 'label' => lng('emails.emailaddress'), 'type' => 'label', 'value' => $result['email_full'] diff --git a/lib/formfields/customer/email/formfield.emails_addaccount.php b/lib/formfields/customer/email/formfield.emails_addaccount.php index 0d7a6fc5..01c871dd 100644 --- a/lib/formfields/customer/email/formfield.emails_addaccount.php +++ b/lib/formfields/customer/email/formfield.emails_addaccount.php @@ -44,6 +44,7 @@ return [ 'label' => lng('login.password'), 'type' => 'password', 'autocomplete' => 'off', + 'mandatory' => true, 'next_to' => [ 'admin_password_suggestion' => [ 'next_to_prefix' => lng('customer.generated_pwd') . ':', diff --git a/lib/formfields/customer/email/formfield.emails_addforwarder.php b/lib/formfields/customer/email/formfield.emails_addforwarder.php index 5e1f4b63..20994bfa 100644 --- a/lib/formfields/customer/email/formfield.emails_addforwarder.php +++ b/lib/formfields/customer/email/formfield.emails_addforwarder.php @@ -39,7 +39,8 @@ return [ ], 'destination' => [ 'label' => lng('emails.to'), - 'type' => 'email' + 'type' => 'email', + 'mandatory' => true ] ] ] diff --git a/lib/formfields/customer/email/formfield.emails_edit.php b/lib/formfields/customer/email/formfield.emails_edit.php index 86646949..56f01019 100644 --- a/lib/formfields/customer/email/formfield.emails_edit.php +++ b/lib/formfields/customer/email/formfield.emails_edit.php @@ -118,6 +118,11 @@ return [ ] ] ] + ], + 'buttons' => [ + [ + 'label' => lng('panel.backtooverview') + ] ] ] ]; diff --git a/lib/formfields/customer/extras/formfield.htaccess_add.php b/lib/formfields/customer/extras/formfield.htaccess_add.php index 3ce9dcae..ec85d4e1 100644 --- a/lib/formfields/customer/extras/formfield.htaccess_add.php +++ b/lib/formfields/customer/extras/formfield.htaccess_add.php @@ -42,6 +42,7 @@ return [ 'select_var' => $pathSelect['select_var'] ?? '', 'value' => $pathSelect['value'], 'note' => $pathSelect['note'] ?? '', + 'mandatory' => true ], 'options_indexes' => [ 'label' => lng('extras.directory_browsing'), diff --git a/lib/formfields/customer/extras/formfield.htpasswd_add.php b/lib/formfields/customer/extras/formfield.htpasswd_add.php index 48c29e67..58c6ba2c 100644 --- a/lib/formfields/customer/extras/formfield.htpasswd_add.php +++ b/lib/formfields/customer/extras/formfield.htpasswd_add.php @@ -43,15 +43,18 @@ return [ 'select_var' => $pathSelect['select_var'] ?? '', 'value' => $pathSelect['value'], 'note' => $pathSelect['note'] ?? '', + 'mandatory' => true ], 'username' => [ 'label' => lng('login.username'), - 'type' => 'text' + 'type' => 'text', + 'mandatory' => true ], 'directory_password' => [ 'label' => lng('login.password'), 'type' => 'password', - 'autocomplete' => 'off' + 'autocomplete' => 'off', + 'mandatory' => true ], 'directory_password_suggestion' => [ 'label' => lng('customer.generated_pwd'), @@ -61,7 +64,8 @@ return [ ], 'directory_authname' => [ 'label' => lng('extras.htpasswdauthname'), - 'type' => 'text' + 'type' => 'text', + 'mandatory' => true ] ] ] diff --git a/lib/formfields/customer/extras/formfield.htpasswd_edit.php b/lib/formfields/customer/extras/formfield.htpasswd_edit.php index e62a565e..da339d40 100644 --- a/lib/formfields/customer/extras/formfield.htpasswd_edit.php +++ b/lib/formfields/customer/extras/formfield.htpasswd_edit.php @@ -60,7 +60,8 @@ return [ 'directory_authname' => [ 'label' => lng('extras.htpasswdauthname'), 'type' => 'text', - 'value' => $result['authname'] + 'value' => $result['authname'], + 'mandatory' => true ] ] ] diff --git a/lib/formfields/customer/ftp/formfield.ftp_add.php b/lib/formfields/customer/ftp/formfield.ftp_add.php index d10e2868..01d4702d 100644 --- a/lib/formfields/customer/ftp/formfield.ftp_add.php +++ b/lib/formfields/customer/ftp/formfield.ftp_add.php @@ -52,11 +52,13 @@ return [ 'select_var' => $pathSelect['select_var'] ?? '', 'value' => $pathSelect['value'], 'note' => $pathSelect['note'] ?? '', + 'mandatory' => true ], 'ftp_password' => [ 'label' => lng('login.password'), 'type' => 'password', - 'autocomplete' => 'off' + 'autocomplete' => 'off', + 'mandatory' => true ], 'ftp_password_suggestion' => [ 'label' => lng('customer.generated_pwd'), diff --git a/lib/formfields/customer/mysql/formfield.mysql_add.php b/lib/formfields/customer/mysql/formfield.mysql_add.php index a0bb6f39..9fbe706a 100644 --- a/lib/formfields/customer/mysql/formfield.mysql_add.php +++ b/lib/formfields/customer/mysql/formfield.mysql_add.php @@ -45,7 +45,8 @@ return [ 'mysql_password' => [ 'label' => lng('login.password'), 'type' => 'password', - 'autocomplete' => 'off' + 'autocomplete' => 'off', + 'mandatory' => true ], 'mysql_password_suggestion' => [ 'label' => lng('customer.generated_pwd'), diff --git a/lib/tablelisting/admin/tablelisting.customers.php b/lib/tablelisting/admin/tablelisting.customers.php index c314a67b..f60c5a19 100644 --- a/lib/tablelisting/admin/tablelisting.customers.php +++ b/lib/tablelisting/admin/tablelisting.customers.php @@ -33,7 +33,7 @@ use Froxlor\UI\Listing; return [ 'customer_list' => [ 'title' => lng('admin.customers'), - 'description' => 'Manage your customers', + 'description' => lng('admin.customers_list_desc'), 'icon' => 'fa-solid fa-user', 'self_overview' => ['section' => 'customers', 'page' => 'customers'], 'columns' => [ diff --git a/lib/tablelisting/admin/tablelisting.domains.php b/lib/tablelisting/admin/tablelisting.domains.php index b5ecda83..6f6b7fed 100644 --- a/lib/tablelisting/admin/tablelisting.domains.php +++ b/lib/tablelisting/admin/tablelisting.domains.php @@ -33,7 +33,7 @@ return [ 'domain_list' => [ 'title' => lng('admin.domains'), 'icon' => 'fa-solid fa-globe', - 'empty_msg' => lng('admin.domain_nocustomeraddingavailable'), + 'empty_msg' => $customerCollection->count() == 0 ? lng('admin.domain_nocustomeraddingavailable') : '', 'self_overview' => ['section' => 'domains', 'page' => 'domains'], 'columns' => [ 'd.id' => [ diff --git a/lng/en.lng.php b/lng/en.lng.php index eb8ea114..47e2a06b 100644 --- a/lng/en.lng.php +++ b/lng/en.lng.php @@ -1240,7 +1240,7 @@ return [ 'errordocument401path' => 'ErrorDocument 401', 'execute_perl' => 'Execute perl/CGI', 'htpasswdauthname' => 'Authentication reason (AuthName)', - 'directoryprotection_edit' => 'edit directory protection', + 'directoryprotection_edit' => 'Edit directory protection', 'backup' => 'Create backup', 'backup_web' => 'Backup web-data', 'backup_mail' => 'Backup mail-data', diff --git a/templates/Froxlor/form/formfields.html.twig b/templates/Froxlor/form/formfields.html.twig index 4151475e..7e9561c5 100644 --- a/templates/Froxlor/form/formfields.html.twig +++ b/templates/Froxlor/form/formfields.html.twig @@ -3,7 +3,7 @@ {% if norow == false and field.type != 'hidden' %}