#338 ✓resolved
Clemens Kofler

Fix admin access for single site mode

Reported by Clemens Kofler | November 2nd, 2009 @ 03:21 PM

When accessing the admin area in single site mode with the host not matching the stored site's host, one gets an error. In contrast, in the public area we always just use the first site in single site mode - this should be adapted for the admin area as well.

Relevant code bits (all in the adva_cms engine):
- app/controllers/base_controller.rb: before_filter set_site (using Site.find_by_host!) - app/models/site.rb: .find_by_host! method - app/controllers/admin/sites_controller.rb: before_filter protect_single_site_mode (incorrectly using find_or_initialize_by_host which doesn't make sense at all)

IMO the best thing would be to use the same behavior for the admin SitesController as seen in BaseController.

Please do also add a test that fails with the current implementation to make sure we don't run into that again.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<p>Cutting edge cms, blog, wiki, forum ... plattform.</p>

<p>Find the code on <a href="http://github.com/svenfuchs/adva_cms/tree/master">GitHub: adva cms</a></p>

<p>Part of the business application framework <a href="http://www.advabest.org/">adva best</a>.</p>

People watching this ticket