diff --git a/src/mibew/.htaccess b/src/mibew/.htaccess
index dc803fcb..a37136a0 100644
--- a/src/mibew/.htaccess
+++ b/src/mibew/.htaccess
@@ -24,13 +24,18 @@ Options +FollowSymLinks
php_flag session.auto_start off
+# Do not allow apache to automatically add trailing slashes for existing
+# directories. They should be processed by the application.
+
+ DirectorySlash Off
+
+
# Redirect requests to the front controller
RewriteEngine On
- # Alter only requests for files and directories that do not exist
+ # Alter only requests for files that do not exist
RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all requests to front controller
RewriteRule ^(.*)$ app.php [QSA,L]
diff --git a/src/mibew/index.php b/src/mibew/index.php
deleted file mode 100644
index 99526a3c..00000000
--- a/src/mibew/index.php
+++ /dev/null
@@ -1,18 +0,0 @@
-redirect($this->generateUrl('home_operator'));
+ }
+
+ /**
+ * Renders operator's home page.
+ *
+ * @param Request $request Incoming request
+ * @return string Rendered page content.
+ */
+ public function dashboardAction(Request $request)
+ {
+ $operator = $this->getOperator();
+ $base_url = $request->getBaseUrl();
+
+ $is_online = is_operator_online($operator['operatorid']);
+
+ $page = array(
+ 'version' => MIBEW_VERSION,
+ 'localeLinks' => get_locale_links(),
+ 'needUpdate' => Settings::get('dbversion') != DB_VERSION,
+ 'needChangePassword' => check_password_hash($operator['vclogin'], '', $operator['vcpassword']),
+ 'profilePage' => $base_url . '/operator/operator/' . $operator['operatorid'] . '/edit',
+ 'updateWizard' => $base_url . '/install/',
+ 'newFeatures' => Settings::get('featuresversion') != FEATURES_VERSION,
+ 'featuresPage' => $base_url . '/operator/settings/features',
+ 'isOnline' => $is_online,
+ 'warnOffline' => true,
+ 'title' => getlocal('topMenu.admin'),
+ 'menuid' => 'main',
+ );
+
+ $page = array_merge($page, prepare_menu($operator));
+
+ return $this->render('index', $page);
+ }
+}
diff --git a/src/mibew/libs/classes/Mibew/Controller/Operator/ProfileController.php b/src/mibew/libs/classes/Mibew/Controller/Operator/ProfileController.php
index 9e5e1308..00b7f23f 100644
--- a/src/mibew/libs/classes/Mibew/Controller/Operator/ProfileController.php
+++ b/src/mibew/libs/classes/Mibew/Controller/Operator/ProfileController.php
@@ -218,7 +218,7 @@ class ProfileController extends AbstractController
// Redirect the admin to the home page if needed.
if ($to_dashboard) {
- return $this->redirect($request->getBasePath() . '/operator/index.php');
+ return $this->redirect($this->generateUrl('home_operator'));
}
}
diff --git a/src/mibew/libs/routing.yml b/src/mibew/libs/routing.yml
index f93fdcae..80511ce5 100644
--- a/src/mibew/libs/routing.yml
+++ b/src/mibew/libs/routing.yml
@@ -304,6 +304,18 @@ history_user_track:
_controller: Mibew\Controller\HistoryController::userTrackAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
+## Home
+home:
+ path: /
+ defaults:
+ _controller: Mibew\Controller\HomeController::redirectAction
+
+home_operator:
+ path: /operator
+ defaults:
+ _controller: Mibew\Controller\HomeController::dashboardAction
+ _access_check: Mibew\AccessControl\Check\LoggedInCheck
+
## Invitations
invite:
path: /operator/invite
diff --git a/src/mibew/operator/index.php b/src/mibew/operator/index.php
deleted file mode 100644
index e4c4867a..00000000
--- a/src/mibew/operator/index.php
+++ /dev/null
@@ -1,48 +0,0 @@
- MIBEW_VERSION,
- 'localeLinks' => get_locale_links(),
- 'needUpdate' => Settings::get('dbversion') != DB_VERSION,
- 'needChangePassword' => check_password_hash($operator['vclogin'], '', $operator['vcpassword']),
- 'profilePage' => MIBEW_WEB_ROOT . "/operator/operator/" . $operator['operatorid'] . '/edit',
- 'updateWizard' => MIBEW_WEB_ROOT . "/install/",
- 'newFeatures' => Settings::get('featuresversion') != FEATURES_VERSION,
- 'featuresPage' => MIBEW_WEB_ROOT . "/operator/settings/features",
- 'isOnline' => $is_online,
- 'warnOffline' => true,
- 'title' => getlocal("topMenu.admin"),
- 'menuid' => "main",
-);
-
-$page = array_merge($page, prepare_menu($operator));
-
-$page_style = new PageStyle(PageStyle::getCurrentStyle());
-$page_style->render('index', $page);
diff --git a/src/mibew/styles/pages/default/templates_src/server_side/_menu.handlebars b/src/mibew/styles/pages/default/templates_src/server_side/_menu.handlebars
index 1d7a397d..3bdc4b7e 100644
--- a/src/mibew/styles/pages/default/templates_src/server_side/_menu.handlebars
+++ b/src/mibew/styles/pages/default/templates_src/server_side/_menu.handlebars
@@ -12,7 +12,7 @@
{{l10n "right.main"}}