
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
-
Raphaela November 2nd, 2009 @ 04:33 PM
Site.find_by_host! can be used instead of Site.find_or_initialize_by_host in the before_filter protect_single_site_mode in the admin/sites_controller.rb, but when no Site exists, yet, a Routing Error will be raised, too (???)
-
Raphaela November 3rd, 2009 @ 11:34 AM
- State changed from new to resolved
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.
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>