<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -25,13 +25,39 @@ It's understandable that you may want to require authentication.  Add this to yo
   config.after_initialize do
     require 'application' unless Object.const_defined?(:ApplicationController)
     LoggedExceptionsController.class_eval do
+      # set the same session key as the app
+      session :session_key =&gt; '_beast_session_id'
+      
+      # include any custom auth modules you need
+      include AuthenticationSystem
+      
       before_filter :login_required
+      
+      # optional, sets the application name for the rss feeds
+      self.application_name = &quot;Beast&quot;
+      
       protected
         # only allow admins
         # this obviously depends on how your auth system works
         def authorized?
           current_user.is_a?(Admin)
         end
+        
+        # assume app's login required doesn't use http basic
+        def login_required_with_basic
+          respond_to do |accepts|
+            # alias_method_chain will alias the app's login_required to login_required_without_basic
+            accepts.html { login_required_without_basic }
+            
+            # access_denied_with_basic_auth is defined in LoggedExceptionsController
+            # get_auth_data returns back the user/password pair
+            accepts.rss do
+              access_denied_with_basic_auth unless self.current_user = User.authenticate(*get_auth_data)
+            end
+          end
+        end
+        
+        alias_method_chain :login_required, :basic
     end
   end
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -301,3 +301,7 @@ ul.tabs li.selected a
   opacity:.8;
   font-size: 11px;
 }
+
+#feed {
+  margin-top: 15px;
+}</diff>
      <filename>assets/style.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 class LoggedExceptionsController &lt; ActionController::Base
+  cattr_accessor :application_name
   layout nil
 
   def index
@@ -10,6 +11,10 @@ class LoggedExceptionsController &lt; ActionController::Base
   def query
     conditions = []
     parameters = []
+    unless params[:id].blank?
+      conditions &lt;&lt; 'id = ?'
+      parameters &lt;&lt; params[:id]
+    end
     unless params[:query].blank?
       conditions &lt;&lt; 'message LIKE ?'
       parameters &lt;&lt; &quot;%#{params[:query]}%&quot;
@@ -28,6 +33,12 @@ class LoggedExceptionsController &lt; ActionController::Base
     end
     @exception_pages, @exceptions = paginate :logged_exceptions, :order =&gt; 'created_at desc', :per_page =&gt; 30, 
       :conditions =&gt; conditions.empty? ? nil : parameters.unshift(conditions * ' and ')
+    
+    respond_to do |format|
+      format.html { redirect_to :action =&gt; 'index' unless action_name == 'index' }
+      format.js
+      format.rss  { render :action =&gt; 'query.rxml' }
+    end
   end
   
   def show
@@ -42,4 +53,30 @@ class LoggedExceptionsController &lt; ActionController::Base
     LoggedException.delete_all ['id in (?)', params[:ids]] unless params[:ids].blank?
     query
   end
+
+  private
+    def access_denied_with_basic_auth
+      headers[&quot;Status&quot;]           = &quot;Unauthorized&quot;
+      headers[&quot;WWW-Authenticate&quot;] = %(Basic realm=&quot;Web Password&quot;)
+      render :text =&gt; &quot;Could't authenticate you&quot;, :status =&gt; '401 Unauthorized'
+    end
+
+    # gets BASIC auth info
+    def get_auth_data
+      user, pass = '', '' 
+      # extract authorisation credentials 
+      if request.env.has_key? 'X-HTTP_AUTHORIZATION' 
+        # try to get it where mod_rewrite might have put it 
+        authdata = request.env['X-HTTP_AUTHORIZATION'].to_s.split 
+      elsif request.env.has_key? 'HTTP_AUTHORIZATION' 
+        # this is the regular location 
+        authdata = request.env['HTTP_AUTHORIZATION'].to_s.split  
+      end 
+       
+      # at the moment we only support basic authentication 
+      if authdata &amp;&amp; authdata[0] == 'Basic' 
+        user, pass = Base64.decode64(authdata[1]).split(':')[0..1] 
+      end 
+      return [user, pass] 
+    end
 end
\ No newline at end of file</diff>
      <filename>lib/logged_exceptions_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 &lt;div id=&quot;exceptions&quot;&gt;
-
+&lt;%= session[:user_id] ; controller.reset_session %&gt;
 &lt;div class=&quot;pages&quot;&gt;
   &lt;%= link_to_remote 'Delete Visible', :url =&gt; { :action =&gt; 'destroy_all' }, :with =&gt; &quot;ExceptionLogger.deleteAll()&quot; %&gt;
 &lt;% if @exception_pages.page_count &gt; 1 %&gt;
@@ -15,11 +15,6 @@
     &lt;tr&gt;
       &lt;th&gt;Exception&lt;/th&gt;
       &lt;th&gt;Date&lt;/th&gt;
-&lt;!--
-			&lt;th&gt;&lt;/th&gt;
-
-			&lt;th&gt;&lt;%= link_to_function &quot;All&quot;, &quot;$$('#exceptions table input').each(function(a){a.checked= (a.checked ? '' : 'checked'); });&quot; %&gt;&lt;/th&gt;
---&gt;
     &lt;/tr&gt;
   &lt;/thead&gt;
 
@@ -34,9 +29,6 @@
 
 &lt;/td&gt;
       &lt;td nowrap=nowrap class=&quot;time&quot;&gt;
-&lt;!--
-
---&gt;
 &lt;% 
 if Date.today == exc.created_at.to_date 
 	if exc.created_at &gt; Time.now - 4.hours
@@ -49,28 +41,15 @@ if Date.today == exc.created_at.to_date
 &lt;%= exc.created_at.strftime(&quot;%b %d, %Y&quot;) %&gt;
 &lt;% end %&gt;
 &lt;/td&gt;
-
-
-&lt;!--
-			&lt;td style=&quot;padding-right:0;&quot;&gt;
-				&lt;input type=&quot;checkbox&quot; /&gt;
-				&lt;/td&gt;
---&gt;
       &lt;td&gt;&lt;%= link_to_remote 'Delete', {:url =&gt; { :action =&gt; 'destroy', :id =&gt; exc }} , :class =&gt; &quot;util&quot; %&gt;&lt;/td&gt;
 
-
     &lt;/tr&gt;
   &lt;% end -%&gt;
   &lt;/tbody&gt;
 
 &lt;/table&gt;
 
-&lt;!--
-&lt;%= submit_tag &quot;Delete&quot;, :style =&gt; &quot;float:right;&quot;%&gt;
-&lt;br /&gt;
---&gt;
-
-&lt;% if @exception_pages.page_count&gt;1 %&gt;
+&lt;% if @exception_pages.page_count &gt; 1 %&gt;
 &lt;div class=&quot;pages pages-bottom&quot;&gt;
 Pages: &lt;strong&gt;&lt;%= pagination_remote_links @exception_pages, :params =&gt; { :action =&gt; :index } %&gt;&lt;/strong&gt;
 &lt;/div&gt;</diff>
      <filename>views/logged_exceptions/_exceptions.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,10 @@
 
 &lt;h3&gt;Filters&lt;/h3&gt;
 
+&lt;ul id=&quot;all_exceptions&quot; class=&quot;filters&quot;&gt;
+  &lt;li&gt;&lt;%= link_to 'Latest Exceptions', :action =&gt; 'index', :id =&gt; nil %&gt;&lt;/li&gt;
+&lt;/ul&gt;
+
 &lt;h4&gt;Exception&lt;/h4&gt;
 
 &lt;ul id=&quot;exception_names&quot; class=&quot;filters&quot;&gt;
@@ -60,6 +64,7 @@
   &lt;/form&gt;
 &lt;/div&gt;
 
+&lt;%= render :partial =&gt; 'feed' %&gt;
 
 &lt;/div&gt; &lt;!-- right --&gt;
 </diff>
      <filename>views/logged_exceptions/index.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,3 @@
 page[:exceptions].replace :partial =&gt; &quot;exceptions&quot;
-page[:showpage].hide
\ No newline at end of file
+page[:showpage].hide
+page[:feed].replace :partial =&gt; 'feed'
\ No newline at end of file</diff>
      <filename>views/logged_exceptions/query.rjs</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>89fee3e9213d3fc6e100e7e9ef435d9dc6ed7d6d</id>
    </parent>
  </parents>
  <author>
    <name>technoweenie</name>
    <email>technoweenie@567b1171-46fb-0310-a4c9-b4bef9110e78</email>
  </author>
  <url>http://github.com/lawrencepit/exception_logger/commit/e2d703cdf6d96bbb2b21eeb4a3bedcd1cfc65be5</url>
  <id>e2d703cdf6d96bbb2b21eeb4a3bedcd1cfc65be5</id>
  <committed-date>2006-09-03T20:57:56-07:00</committed-date>
  <authored-date>2006-09-03T20:57:56-07:00</authored-date>
  <message>add RSS feed support

git-svn-id: http://svn.techno-weenie.net/projects/plugins/exception_logger@2038 567b1171-46fb-0310-a4c9-b4bef9110e78</message>
  <tree>05c0ee2d42230f31af80a36f3dcfd55e5b48c127</tree>
  <committer>
    <name>technoweenie</name>
    <email>technoweenie@567b1171-46fb-0310-a4c9-b4bef9110e78</email>
  </committer>
</commit>
