<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>features/step_definitions/users_steps.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -102,8 +102,8 @@
 &lt;p class=&quot;p7&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;FORUM PERMISSIONS&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
 &lt;p class=&quot;p12&quot;&gt;&lt;span class=&quot;s5&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&#8226;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Limit forum access (control over who can post, reply, and view forums)&lt;/span&gt;&lt;/p&gt;
 &lt;p class=&quot;p10&quot;&gt;&lt;span class=&quot;s5&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&#9702;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Forum access is controlled on a user group basis and&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;also on a forum basis&lt;/span&gt;&lt;/p&gt;
-&lt;p class=&quot;p8&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&#8226;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;Moderator levels (control which moderation tasks moderators have access to)&lt;/span&gt;&lt;/p&gt;
-&lt;p class=&quot;p8&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&#8226;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;User groups (used for moderation levels, and also forum access&#8212;user groups can be based on post count, length of membership, automatic (i.e., all new members are added), or custom (i.e., mods/admins must place users in groups manually)&lt;/span&gt;&lt;/p&gt;
+&lt;p class=&quot;p13&quot;&gt;&lt;span class=&quot;s5&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&#8226;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Moderator levels (control which moderation tasks moderators have access to)&lt;/span&gt;&lt;/p&gt;
+&lt;p class=&quot;p13&quot;&gt;&lt;span class=&quot;s5&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&#8226;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;User groups (used for moderation levels, and also forum access&#8212;user groups can be based on post count, length of membership, automatic (i.e., all new members are added), or custom (i.e., mods/admins must place users in groups manually)&lt;/span&gt;&lt;/p&gt;
 &lt;p class=&quot;p8&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&#8226;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Forum function permissions&lt;/span&gt;&lt;/p&gt;
 &lt;p class=&quot;p9&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&#9702;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Signatures (control over number of lines/characters, what bbcode is allowed (i.e., to disallow image code))&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt; (Though it would be VERY nice to forbit IMG tags in sigs somehow&#8212;image sigatures really make a forum hard to read)&lt;/span&gt;&lt;/p&gt;
 &lt;p class=&quot;p9&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&#9702;&lt;span class=&quot;Apple-tab-span&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Avatars (size, dimensions, filetype)&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt; (Only necessary if we have avatars!)&lt;/span&gt;&lt;/p&gt;</diff>
      <filename>TODO.html</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ class ForumsController &lt; ApplicationController
   def index
     if @category
       @forums = @category.forums.without_parent
-      @forums = @forums.regardless_of_active if current_user.can?(:see_inactive_forums)
+      @forums = @forums.active if !current_user.can?(:see_inactive_forums)
       
     else
       # TODO: I encourage allcomers to find a better way.
@@ -40,7 +40,7 @@ class ForumsController &lt; ApplicationController
   
   private
     def find_forum
-      @forums = current_user.can?(:see_inactive_forums) ? Forum.regardless_of_active : Forum
+      @forums = current_user.can?(:see_inactive_forums) ? Forum : Forum.active
       @forum = @forums.find(params[:id], :include =&gt; [{ :topics =&gt; :posts }, :moderations, :permissions])
       if !current_user.can?(:see_forum, @forum)
         flash[:notice] = t(:forum_permission_denied)
@@ -48,6 +48,7 @@ class ForumsController &lt; ApplicationController
       end
     rescue ActiveRecord::RecordNotFound
       flash[:notice] = t(:forum_not_found_or_inactive)
+      redirect_to forums_path
     end
     
     def find_category</diff>
      <filename>app/controllers/forums_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,19 @@
 class Forum &lt; ActiveRecord::Base
-  default_scope :order =&gt; &quot;title asc&quot;, :conditions =&gt; { :active =&gt; true }
+  default_scope :order =&gt; &quot;title asc&quot;
   
   acts_as_list :scope =&gt; :parent_id
   acts_as_tree :order =&gt; :position
   
   named_scope :without_category, :conditions =&gt; { :category_id =&gt; nil }, :include =&gt; :permissions, :order =&gt; &quot;position&quot;
   named_scope :without_parent, :conditions =&gt; { :parent_id =&gt; nil }, :include =&gt; :permissions, :order =&gt; &quot;position&quot; 
-  named_scope :regardless_of_active, :conditions =&gt; [&quot;active = ? OR active = ?&quot;, true, false]
+  named_scope :active, :conditions =&gt; { :active =&gt; true }
+  
+  
   has_many :moderations
   has_many :posts, :through =&gt; :topics, :source =&gt; :posts, :order =&gt; &quot;posts.created_at desc&quot;
   has_many :topics, :order =&gt; &quot;topics.created_at desc&quot;, :dependent =&gt; :destroy 
   has_many :permissions
   has_many :groups, :through =&gt; :permissions
-
   
   belongs_to :category
   belongs_to :last_post, :class_name =&gt; &quot;Post&quot;</diff>
      <filename>app/models/forum.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,25 +1,30 @@
-&lt;tbody&gt;
-  &lt;tr&gt;
-    &lt;td&gt;&lt;%= f.label :title, t(:Title) %&gt;&lt;/td&gt;
-    &lt;td&gt;&lt;%= f.text_field &quot;title&quot; %&gt;&lt;/td&gt;
-  &lt;/tr&gt;
-  
-  &lt;tr&gt;
-    &lt;td valign='top'&gt;&lt;%= f.label :description, t(:Description) %&gt;&lt;/td&gt;
-    &lt;td&gt;&lt;%= f.text_area &quot;description&quot;, :cols =&gt; 40, :rows =&gt; 5 %&gt;&lt;/td&gt;
-  &lt;/tr&gt;
-  
-  &lt;% unless @forums.empty? %&gt;
-    &lt;tr&gt;
-      &lt;td&gt;&lt;%= f.label :parent_id, t(:Child_of) %&gt;&lt;/td&gt;
-      &lt;td&gt;&lt;%= f.select &quot;parent_id&quot;, @forums.map { |forum| [select_display(forum),forum.id] }, :include_blank =&gt; true %&gt;&lt;/td&gt;
-    &lt;/tr&gt;
-  &lt;% end %&gt;
-  
-  &lt;% unless @category %&gt;
-    &lt;tr&gt;
-      &lt;td&gt;&lt;%= f.label :category_id, t(:Category) %&gt;&lt;/td&gt;
-      &lt;td&gt;&lt;%= f.select &quot;category_id&quot;, @categories.map { |category| [select_display(category, 'name'), category.id] }, :include_blank =&gt; true %&gt;&lt;/td&gt;
-    &lt;/tr&gt;
-  &lt;% end %&gt;
+&lt;tbody&gt;
+  &lt;tr&gt;
+    &lt;td&gt;&lt;%= f.label :title, t(:Title) %&gt;&lt;/td&gt;
+    &lt;td&gt;&lt;%= f.text_field &quot;title&quot; %&gt;&lt;/td&gt;
+  &lt;/tr&gt;
+  
+  &lt;tr&gt;
+    &lt;td valign='top'&gt;&lt;%= f.label :description, t(:Description) %&gt;&lt;/td&gt;
+    &lt;td&gt;&lt;%= f.text_area &quot;description&quot;, :cols =&gt; 40, :rows =&gt; 5 %&gt;&lt;/td&gt;
+  &lt;/tr&gt;
+  
+  &lt;% unless @forums.empty? %&gt;
+    &lt;tr&gt;
+      &lt;td&gt;&lt;%= f.label :parent_id, t(:Child_of) %&gt;&lt;/td&gt;
+      &lt;td&gt;&lt;%= f.select &quot;parent_id&quot;, @forums.map { |forum| [select_display(forum),forum.id] }, :include_blank =&gt; true %&gt;&lt;/td&gt;
+    &lt;/tr&gt;
+  &lt;% end %&gt;
+  
+  &lt;% unless @category %&gt;
+    &lt;tr&gt;
+      &lt;td&gt;&lt;%= f.label :category_id, t(:Category) %&gt;&lt;/td&gt;
+      &lt;td&gt;&lt;%= f.select &quot;category_id&quot;, @categories.map { |category| [select_display(category, 'name'), category.id] }, :include_blank =&gt; true %&gt;&lt;/td&gt;
+    &lt;/tr&gt;
+  &lt;% end %&gt;
+  
+  &lt;tr&gt;
+    &lt;td&gt;&lt;%= f.label :active, t(:Active) %&gt;&lt;/td&gt;
+    &lt;td&gt;&lt;%= f.check_box :active %&gt;&lt;/td&gt;
+  &lt;/tr&gt;
 &lt;/tbody&gt;
\ No newline at end of file</diff>
      <filename>app/views/admin/forums/_form.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,6 @@ Feature: Manage forums
     When I follow &quot;Public Forum&quot;
     Then I should see &quot;Viewing forum: Public Forum&quot;
     
-  
   Scenario: Registered users should be able to post new topics
     Given I am logged in as &quot;registered_user&quot;
     And I am on the forums page
@@ -25,11 +24,18 @@ Feature: Manage forums
     When I fill in &quot;Text&quot; with &quot;This is just a tribute&quot;
     When I press &quot;Create&quot;
     Then I should see &quot;rBoard -&gt; Public Forum -&gt; Tribute&quot;
+    
+  Scenario: Registered users should not be able to see hidden forums
+    Given I am logged in as &quot;registered_user&quot;
+    And there is an inactive forum
+    Then I should not see &quot;Hidden Forum&quot;
+    And I am on the forum page for &quot;Hidden Forum&quot;
+    Then I should see &quot;The forum you were looking for could not be found, or is inactive.&quot;
 
   Scenario: Logged in as a user who can see inactive forums
     Given I am logged in as &quot;registered_user&quot;
     And there is an inactive forum
     And I can see inactive forums
     And I am on the forums page
-    Then I should see &quot;Inactive Forum&quot;
+    Then I should see &quot;Hidden Forum&quot;
     
\ No newline at end of file</diff>
      <filename>features/forums.feature</filename>
    </modified>
    <modified>
      <diff>@@ -4,8 +4,8 @@ Given /^I am logged in as &quot;([^\&quot;]*)&quot;$/ do |user|
   When &quot;I fill in \&quot;password\&quot; with \&quot;password\&quot;&quot;
   When &quot;I press \&quot;Login\&quot;&quot;
   Then &quot;I should see \&quot;Logged in successfully.\&quot;&quot;
-  @user = assigns[:user]
-  puts @user.inspect
+  # To get the latest user
+  @user = User.first(:order =&gt; &quot;updated_at DESC&quot;)
 end
 
 Given /^there is the usual setup$/ do</diff>
      <filename>features/step_definitions/app_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -0,0 +1,3 @@
+Given /^there is an inactive forum$/ do
+  Forum.create(:title =&gt; &quot;Hidden Forum&quot;, :description =&gt; &quot;This is a hidden forum&quot;, :active =&gt; false)
+end
\ No newline at end of file</diff>
      <filename>features/step_definitions/forums_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,8 @@ module NavigationHelpers
       '/'
     when /the forums page/
       forums_path
+    when /the forum page for &quot;(.*?)&quot;/
+      forum_path(Forum.find_by_title($1))
     when /login page/
       login_path
     when /administrator's group page/</diff>
      <filename>features/support/paths.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ module Rboard::Login
       redirect_back_or_default(forums_path) and return false
     end
     return unless request.post?
-    self.current_user = User.authenticate(params[:login], params[:password])
+    self.current_user = @user = User.authenticate(params[:login], params[:password])
     if logged_in?    
       # #remember_me calls save internally, so don't bother saving it twice
       if params[:remember_me] == &quot;1&quot;</diff>
      <filename>lib/rboard/login.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a6ee64cdaba179b79f0ef776c6233532ea3e900c</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Bigg</name>
    <email>radarlistener@gmail.com</email>
  </author>
  <url>http://github.com/radar/rboard/commit/773439dde24215b4d5771be2eacb27c96d04c9b4</url>
  <id>773439dde24215b4d5771be2eacb27c96d04c9b4</id>
  <committed-date>2009-06-27T05:15:47-07:00</committed-date>
  <authored-date>2009-06-27T05:15:47-07:00</authored-date>
  <message>default_scope apparently doesn't like conditions</message>
  <tree>afb31566b55d4dff83b70a6ca38d859f124fdff7</tree>
  <committer>
    <name>Ryan Bigg</name>
    <email>radarlistener@gmail.com</email>
  </committer>
</commit>
