<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -72,15 +72,21 @@ protected
   def protect_controller_if_no_dashboard
     redirect_to clean_dashboard_url if dashboard_subdomain.nil?
   end
+  
+  def account_domain
+    account_domain = &quot;&quot;
+    account_domain &lt;&lt; request.subdomains[1..-1].join(&quot;.&quot;) + &quot;.&quot; if request.subdomains.size &gt; 1
+    account_domain &lt;&lt; request.domain + request.port_string
+  end  
 
-  def clean_dashboard_url(user=nil)
+  def clean_dashboard_url(permalink=nil)
     home_permalink = request.subdomains.empty? ? current_user.home.permalink : request.subdomains.first
-    home_permalink = (user.is_a?(User) ? user.home.permalink : user ) unless user.nil? # overwrite fu
-    &quot;#{protocol}#{home_permalink}.#{request.host}#{request.port_string}&quot;
+    home_permalink = permalink unless permalink.nil? # overwrite fu
+    &quot;#{protocol}#{home_permalink}.#{account_domain}&quot;
   end
 
   def clean_root_url
-    &quot;#{protocol}#{request.domain}#{request.host}#{request.port_string}&quot;
+    &quot;#{protocol}#{account_domain}&quot;
   end
   
   def protocol</diff>
      <filename>dashboard_location/lib/dashboard_location.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>32543ff255fac310ecc75a76a9dbd8df862a4ad5</id>
    </parent>
  </parents>
  <author>
    <name>Zach Inglis</name>
    <email>zach@lt3media.com</email>
  </author>
  <url>http://github.com/zachinglis/rails-plugins/commit/1cf0f32954830d17be93651852570da898d563b7</url>
  <id>1cf0f32954830d17be93651852570da898d563b7</id>
  <committed-date>2008-03-04T12:45:10-08:00</committed-date>
  <authored-date>2008-03-04T12:45:10-08:00</authored-date>
  <message>After some issues, I am reputting some of DHH's magic back into this.

Need to work on tests, and yes, I know, I should have done them before the plugin :)</message>
  <tree>cb1d37cab69efaeaa06460360d12315c6842693e</tree>
  <committer>
    <name>Zach Inglis</name>
    <email>zach@lt3media.com</email>
  </committer>
</commit>
