diff --git a/admin_settings.php b/admin_settings.php index 4c0cf6c3..e20ac722 100644 --- a/admin_settings.php +++ b/admin_settings.php @@ -150,17 +150,9 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') { $log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "updated resource-counters"); $updatecounters = \Froxlor\User::updateCounters(true); - $customers = ''; - foreach ($updatecounters['customers'] as $customerid => $customer) { - eval("\$customers.=\"" . \Froxlor\UI\Template::getTemplate("settings/updatecounters_row_customer") . "\";"); - } - - $admins = ''; - foreach ($updatecounters['admins'] as $adminid => $admin) { - eval("\$admins.=\"" . \Froxlor\UI\Template::getTemplate("settings/updatecounters_row_admin") . "\";"); - } - - eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/updatecounters") . "\";"); + UI::view('user/resource-counter.html.twig', [ + 'counters' => $updatecounters + ]); } else { \Froxlor\UI\HTML::askYesNo('admin_counters_reallyupdate', $filename, array( 'page' => $page diff --git a/templates/Froxlor/user/resource_counter.html.twig b/templates/Froxlor/user/resource_counter.html.twig new file mode 100644 index 00000000..062000fa --- /dev/null +++ b/templates/Froxlor/user/resource_counter.html.twig @@ -0,0 +1,163 @@ +{% extends "Froxlor/userarea.html.twig" %} + +{% block heading %} +
+ + {{ lng('admin.updatecounters') }} +
+{% endblock %} + +{% block content %} + + {% for usersection,data in counters|reverse(true) %} +
+ + + + + + + + {% for user in data %} + + {% if usersection == 'customers' %} + + + + {% else %} + + + + {% endif %} + + {% endfor %} + +
{{ lng('admin.' ~ usersection) }}
+ {{ call_static('\\Froxlor\\User', 'getCorrectUserSalutation', [user]) }} + ({{ user.loginname }}) + + {{ lng('customer.subdomains') }}: + + {{ user.subdomains_used }} + -> + {{ user.subdomains_used_new }} +
+ {{ lng('customer.mysqls') }}: + + {{ user.mysqls_used }} + -> + {{ user.mysqls_used_new }} +
+ {{ lng('customer.ftps') }}: + + {{ user.ftps_used }} + -> + {{ user.ftps_used_new }} + +
+ {{ lng('customer.emails') }}: + + {{ user.emails_used }} + -> + {{ user.emails_used_new }} +
+ {{ lng('customer.accounts') }}: + + {{ user.email_accounts_used }} + -> + {{ user.email_accounts_used_new }} +
+ {{ lng('customer.forwarders') }}: + + {{ user.email_forwarders_used }} + -> + {{ user.email_forwarders_used_new }} + + {% if get_setting('system.mail_quota_enabled') == 1 %} +
{{ lng('customer.email_quota') }}: + + {{ user.email_quota_used }} + -> + {{ user.email_quota_used_new }} + + {% endif %} +
+ {{ user.name }} + {% if user.adminid != call_static('\\Froxlor\\CurrentUser', 'getField', ['adminid']) %} + ({{ user.loginname }}) + {% endif %} + + {{ lng('admin.customers') }}: + + {{ user.customers_used }} + -> + {{ user.customers_used_new }} +
+ {{ lng('customer.domains') }}: + + {{ user.domains_used }} + -> + {{ user.domains_used_new }} +
+ {{ lng('customer.subdomains') }}: + + {{ user.subdomains_used }} + -> + {{ user.subdomains_used_new }} +
+ {{ lng('customer.diskspace') }}: + + {{ user.diskspace_used|formatBytes }} + -> + {{ user.diskspace_used_new|formatBytes }} +
+ {{ lng('customer.traffic') }}: + + {{ user.traffic_used|formatBytes }} + -> + {{ user.traffic_used_new|formatBytes }} + +
+ {{ lng('customer.mysqls') }}: + + {{ user.mysqls_used }} + -> + {{ user.mysqls_used_new }} +
+ {{ lng('customer.ftps') }}: + + {{ user.ftps_used }} + -> + {{ user.ftps_used_new }} +
+ {{ lng('customer.emails') }}: + + {{ user.emails_used }} + -> + {{ user.emails_used_new }} +
+ {{ lng('customer.accounts') }}: + + {{ user.email_accounts_used }} + -> + {{ user.email_accounts_used_new }} +
+ {{ lng('customer.forwarders') }}: + + {{ user.email_forwarders_used }} + -> + {{ user.email_forwarders_used_new }} + + {% if get_setting('system.mail_quota_enabled') == 1 %} +
{{ lng('customer.email_quota') }}: + + {{ user.email_quota_used }} + -> + {{ user.email_quota_used_new }} + + {% endif %} +
+
+ {% endfor %} + +{% endblock %}