<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -94,11 +94,15 @@ class AdmController &lt; ApplicationController
   end
 
   def authorized?
-    current_user.admin?
+    logged_in? &amp;&amp; current_user.admin?
   end
 
   def access_denied
-    # XXX:  Should probably find a good place for this document.
-    render :template =&gt; 'report/access_denied'
+    if logged_in?
+      # XXX:  Should probably find a good place for this document.
+      render :template =&gt; 'report/access_denied'
+    else
+      redirect_to login_path
+    end
   end
 end</diff>
      <filename>app/controllers/adm_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,6 +56,12 @@ class AdmControllerTest &lt; Test::Unit::TestCase
     assert User.authenticate('quentin', 'test'), 'Password changed!'
   end
 
+  def test_reset_not_logged_in
+    post :reset_password, :user =&gt; 'quentin'
+    assert_redirected_to login_path
+    assert User.authenticate('quentin', 'test'), 'Password changed!'
+  end
+
   def test_rjs_delete
     login_as :quentin
     assert_difference 'MoneyTransaction.count', -1 do</diff>
      <filename>test/functional/adm_controller_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f9d995f39b80f4c8023e12f29f9f1c461d81e16b</id>
    </parent>
  </parents>
  <author>
    <name>Dustin Sallings</name>
    <email>dustin@spy.net</email>
  </author>
  <url>http://github.com/dustin/money/commit/c2b201d3b18eb7354faec1f57b8309ab2994b058</url>
  <id>c2b201d3b18eb7354faec1f57b8309ab2994b058</id>
  <committed-date>2008-05-26T18:52:27-07:00</committed-date>
  <authored-date>2008-05-26T18:52:27-07:00</authored-date>
  <message>Don't error on unauthenticated admin page views, either.</message>
  <tree>5bbab08a36b6466bb1804aa7276314766da68a41</tree>
  <committer>
    <name>Dustin Sallings</name>
    <email>dustin@spy.net</email>
  </committer>
</commit>
