diff --git a/admin_index.php b/admin_index.php
index cb9aa922..8bcdadea 100644
--- a/admin_index.php
+++ b/admin_index.php
@@ -185,7 +185,8 @@ if ($page == 'overview') {
}
// @fixme add all the overview/dashboard data from above
- UI::TwigBuffer('admin/index.html.twig');
+ UI::Twig()->addGlobal('userinfo', $userinfo);
+ UI::TwigBuffer('user/index.html.twig');
UI::TwigOutputBuffer();
} elseif ($page == 'change_password') {
diff --git a/customer_index.php b/customer_index.php
index 56a9afc7..a636f373 100644
--- a/customer_index.php
+++ b/customer_index.php
@@ -22,6 +22,7 @@ require './lib/init.php';
use Froxlor\Database\Database;
use Froxlor\Settings;
use Froxlor\Api\Commands\Customers as Customers;
+use Froxlor\UI\Panel\UI;
if ($action == 'logout') {
$log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, 'logged out');
@@ -58,15 +59,11 @@ if ($page == 'overview') {
"standardsubdomain" => $userinfo['standardsubdomain']
));
- $domains = '';
$domainArray = array();
-
while ($row = $domain_stmt->fetch(PDO::FETCH_ASSOC)) {
$domainArray[] = $idna_convert->decode($row['domain']);
}
-
natsort($domainArray);
- $domains = implode(',
', $domainArray);
// standard-subdomain
$stdsubdomain = '';
@@ -120,21 +117,13 @@ if ($page == 'overview') {
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
- $services_enabled = "";
- $se = array();
- if ($userinfo['imap'] == '1')
- $se[] = "IMAP";
- if ($userinfo['pop3'] == '1')
- $se[] = "POP3";
- if ($userinfo['phpenabled'] == '1')
- $se[] = "PHP";
- if ($userinfo['perlenabled'] == '1')
- $se[] = "Perl/CGI";
- if ($userinfo['api_allowed'] == '1')
- $se[] = 'API';
- $services_enabled = implode(", ", $se);
+ UI::Twig()->addGlobal('userinfo', $userinfo);
+ UI::TwigBuffer('user/index.html.twig', [
+ 'domains' => $domainArray,
+ 'stdsubdomain' => $stdsubdomain
+ ]);
+ UI::TwigOutputBuffer();
- eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/index') . "\";");
} elseif ($page == 'change_password') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
diff --git a/lib/init.php b/lib/init.php
index 135c0e98..86eb6f60 100644
--- a/lib/init.php
+++ b/lib/init.php
@@ -436,19 +436,20 @@ if (AREA == 'admin' || AREA == 'customer') {
UI::Twig()->addGlobal('nav_entries', $navigation);
$js = "";
-if (is_array($_themeoptions) && array_key_exists('js', $_themeoptions['variants'][$themevariant]) && is_array($_themeoptions['variants'][$themevariant]['js'])) {
- foreach ($_themeoptions['variants'][$themevariant]['js'] as $jsfile) {
- if (file_exists('templates/' . $theme . '/assets/js/' . $jsfile)) {
- $js .= '' . "\n";
+$css = "";
+if (is_array($_themeoptions) && array_key_exists('js', $_themeoptions['variants'][$themevariant])) {
+ if (is_array($_themeoptions['variants'][$themevariant]['js'])) {
+ foreach ($_themeoptions['variants'][$themevariant]['js'] as $jsfile) {
+ if (file_exists('templates/' . $theme . '/assets/js/' . $jsfile)) {
+ $js .= '' . "\n";
+ }
}
}
-}
-
-$css = "";
-if (is_array($_themeoptions) && array_key_exists('css', $_themeoptions['variants'][$themevariant]) && is_array($_themeoptions['variants'][$themevariant]['css'])) {
- foreach ($_themeoptions['variants'][$themevariant]['css'] as $cssfile) {
- if (file_exists('templates/' . $theme . '/assets/css/' . $cssfile)) {
- $css .= '' . "\n";
+ if (is_array($_themeoptions['variants'][$themevariant]['css'])) {
+ foreach ($_themeoptions['variants'][$themevariant]['css'] as $cssfile) {
+ if (file_exists('templates/' . $theme . '/assets/css/' . $cssfile)) {
+ $css .= '' . "\n";
+ }
}
}
}
diff --git a/templates/Froxlor/admin/index.html.twig b/templates/Froxlor/admin/index.html.twig
deleted file mode 100644
index b28d30b2..00000000
--- a/templates/Froxlor/admin/index.html.twig
+++ /dev/null
@@ -1,20 +0,0 @@
-{% extends "Froxlor/userarea.html.twig" %}
-
-{% block content %}
- {% if get_setting('panel.is_configured') == 0 and userinfo.adminsession == 1 and userinfo.change_serversettings == 1 %}
-
Damit Froxlor mit dem Backend vernünftig kommunizieren kann, musst du dieses noch Konfigurieren.
- Jetzt konfigurieren - -Test
-Damit Froxlor mit dem Backend vernünftig kommunizieren kann, musst du dieses noch Konfigurieren.
+ Jetzt konfigurieren + +Test
+