<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,94 +1,4 @@
-# Filters added to this controller apply to all controllers in the application.
-# Likewise, all the methods added will be available for all controllers.
-
-class ApplicationController &lt; ActionController::Base
-  before_filter :instantiate_controller_and_action_names
-  filter_parameter_logging :password, :password_confirmation
-  helper_method :current_user_session, :current_user
-
-  # Pick a unique cookie name to distinguish our session data from others'
-  session_options['session_key'] = '_spree_session_id'
-
-  protect_from_forgery # See ActionController::RequestForgeryProtection for details
-
-  #include AuthenticatedSystem
-  include RoleRequirementSystem
-  include EasyRoleRequirementSystem
-  include SslRequirement
-  
-  def admin_created?
-    User.first(:include =&gt; :roles, :conditions =&gt; [&quot;roles.name = 'admin'&quot;])
-  end
-  
-  private  
-  def current_user_session
-    return @current_user_session if defined?(@current_user_session)
-    @current_user_session = UserSession.find
-  end
-
-  def current_user
-    return @current_user if defined?(@current_user)
-    @current_user = current_user_session &amp;&amp; current_user_session.user
-  end
-
-  def require_user
-    unless current_user
-      store_location
-      flash[:notice] = I18n.t(&quot;page_only_viewable_when_logged_in&quot;)
-      redirect_to new_user_session_url
-      return false
-    end
-  end
-
-  def require_no_user
-    if current_user
-      store_location
-      flash[:notice] = I18n.t(&quot;page_only_viewable_when_logged_out&quot;)
-      redirect_to root_url
-      return false
-    end
-  end
-
-  def store_location
-    session[:return_to] = request.request_uri
-  end
-
-  def redirect_back_or_default(default)
-    redirect_to(session[:return_to] || default)
-    session[:return_to] = nil
-  end
-
-  # Redirect as appropriate when an access request fails.
-  #
-  # The default action is to redirect to the login screen.
-  #
-  # Override this method in your controllers if you want to have special
-  # behavior in case the user is not authorized
-  # to access the requested action.  For example, a popup window might
-  # simply close itself.
-  def access_denied
-    respond_to do |format|
-      format.html do    
-        if current_user
-          flash[:error] = t(&quot;authorization_failure&quot;)
-          redirect_to '/user_sessions/authorization_failure'
-          next
-        else
-          store_location
-          redirect_to login_path   
-          next
-        end
-      end
-      format.xml do
-        request_http_basic_authentication 'Web Password'
-      end
-    end
-  end
-
-  def instantiate_controller_and_action_names
-    @current_action = action_name
-    @current_controller = controller_name
-  
-    @taxonomies = Taxonomy.find(:all, :include =&gt; {:root =&gt; :children})
-  end
+class ApplicationController &lt; Spree::BaseController
+  # This class is intentionally blank.  Keeping this class empty makes it easier to integrate Spree
+  # with an existing Rails application 
 end</diff>
      <filename>app/controllers/application_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,21 @@
-class Spree::BaseController &lt; ApplicationController
-  filter_parameter_logging :password, :number, :verification_value
-  helper_method :title, :set_title
+class Spree::BaseController &lt; ActionController::Base
+  layout 'application'
+  helper :application
+  before_filter :instantiate_controller_and_action_names
+  filter_parameter_logging :password, :password_confirmation, :number, :verification_value
+  helper_method :current_user_session, :current_user, :title, :set_title
+
+  # Pick a unique cookie name to distinguish our session data from others'
+  session_options['session_key'] = '_spree_session_id'
+  protect_from_forgery # See ActionController::RequestForgeryProtection for details
+
+  include RoleRequirementSystem
+  include EasyRoleRequirementSystem
+  include SslRequirement
+
+  def admin_created?
+    User.first(:include =&gt; :roles, :conditions =&gt; [&quot;roles.name = 'admin'&quot;])
+  end
 
   # retrieve the order_id from the session and then load from the database (or return a new order if no 
   # such id exists in the session)
@@ -68,4 +83,77 @@ class Spree::BaseController &lt; ApplicationController
       type.all  { render :nothing =&gt; true,                            :status =&gt; &quot;404 Not Found&quot; }
     end
   end
+  
+  private  
+  def current_user_session
+    return @current_user_session if defined?(@current_user_session)
+    @current_user_session = UserSession.find
+  end
+
+  def current_user
+    return @current_user if defined?(@current_user)
+    @current_user = current_user_session &amp;&amp; current_user_session.user
+  end
+
+  def require_user
+    unless current_user
+      store_location
+      flash[:notice] = I18n.t(&quot;page_only_viewable_when_logged_in&quot;)
+      redirect_to new_user_session_url
+      return false
+    end
+  end
+
+  def require_no_user
+    if current_user
+      store_location
+      flash[:notice] = I18n.t(&quot;page_only_viewable_when_logged_out&quot;)
+      redirect_to root_url
+      return false
+    end
+  end
+
+  def store_location
+    session[:return_to] = request.request_uri
+  end
+
+  def redirect_back_or_default(default)
+    redirect_to(session[:return_to] || default)
+    session[:return_to] = nil
+  end
+
+  # Redirect as appropriate when an access request fails.
+  #
+  # The default action is to redirect to the login screen.
+  #
+  # Override this method in your controllers if you want to have special
+  # behavior in case the user is not authorized
+  # to access the requested action.  For example, a popup window might
+  # simply close itself.
+  def access_denied
+    respond_to do |format|
+      format.html do    
+        if current_user
+          flash[:error] = t(&quot;authorization_failure&quot;)
+          redirect_to '/user_sessions/authorization_failure'
+          next
+        else
+          store_location
+          redirect_to login_path   
+          next
+        end
+      end
+      format.xml do
+        request_http_basic_authentication 'Web Password'
+      end
+    end
+  end
+
+  def instantiate_controller_and_action_names
+    @current_action = action_name
+    @current_controller = controller_name
+  
+    @taxonomies = Taxonomy.find(:all, :include =&gt; {:root =&gt; :children})
+  end
+  
 end</diff>
      <filename>app/controllers/spree/base_controller.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4d188745784728e4f72d17132c7c4902a0401b3b</id>
    </parent>
  </parents>
  <author>
    <name>Sean Schofield</name>
    <email>sean@railsdog.com</email>
  </author>
  <url>http://github.com/schof/spree/commit/dba69433c3677f25a1c4bc68bc927d1cf8ecef2b</url>
  <id>dba69433c3677f25a1c4bc68bc927d1cf8ecef2b</id>
  <committed-date>2009-09-22T08:26:09-07:00</committed-date>
  <authored-date>2009-09-22T08:26:09-07:00</authored-date>
  <message>Consolidated common controller logic into Spree::BaseController

[#769 state:resolved]</message>
  <tree>9c8a21894cd06231e87c9a60aba25655cc7e41d9</tree>
  <committer>
    <name>Sean Schofield</name>
    <email>sean@railsdog.com</email>
  </committer>
</commit>
