Skip to content

Commit

Permalink
Merge pull request #3083 from gmo/bugfix/dashboard-redirect
Browse files Browse the repository at this point in the history
[2.1] Fix redirect for backend trailing slash redirect (/bolt -> /bolt/).
  • Loading branch information
bobdenotter committed Mar 11, 2015
2 parents bc0c951 + 0f91c23 commit 5fd9789
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Controllers/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function record(Silex\Application $app, $contenttypeslug, $slug = '')
// There's one special edge-case we check for: if the request is for the backend, without trailing
// slash and it is intercepted by custom routing, we forward the client to that location.
if ($slug == trim($app['config']->get('general/branding/path'), '/')) {
Lib::simpleredirect($app['config']->get('general/branding/path') . '/');
return Lib::redirect('dashboard');
}
$app->abort(404, "Page $contenttypeslug/$slug not found.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static function redirect($path, $param = array(), $add = '')
$app = ResourceManager::getApp();

// If the user doesn't have access to the backend, redirect them to the frontend
if ($path === 'dashboard' && !$app['users']->isAllowed('dashboard')) {
if ($path === 'dashboard' && $app['users']->isValidSession() && !$app['users']->isAllowed('dashboard')) {
$app['session']->getFlashBag()->clear();
$path = 'homepage';
}
Expand Down

0 comments on commit 5fd9789

Please sign in to comment.