<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,6 +4,10 @@ It does not matter how slowly you go as long as you do not stop.
 First they ignore you, then they laugh at you, then they fight you,
 then you win. &#8211;- Mahatma Gandhi
 
+Sat, Aug 21, 2009
+---------------------------------------------------------------------
+- Implemented :needs_approval setting for user signups.
+
 Fri, Aug 20, 2009
 ---------------------------------------------------------------------
 - Added new :user_signup setting (see config/settings.yml).</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -32,7 +32,7 @@ class AuthenticationsController &lt; ApplicationController
     if @authentication.save &amp;&amp; !@authentication.user.suspended?
       flash[:notice] = &quot;Welcome to Fat Free CRM!&quot;
       if @authentication.user.login_count &gt; 1 &amp;&amp; @authentication.user.last_login_at?
-        flash[:notice] &lt;&lt; &quot; Your last login was on &quot; &lt;&lt; @authentication.user.last_login_at.strftime(&quot;%A, %B %e at %I:%M %p.&quot;)
+        flash[:notice] &lt;&lt; &quot; Your last login was on &quot; &lt;&lt; @authentication.user.last_login_at.to_s(:mmddhhss)
       end
       redirect_back_or_default root_url
     else</diff>
      <filename>app/controllers/authentications_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,8 @@ module Admin::UsersHelper
 
   #----------------------------------------------------------------------------
   def link_to_reactivate(user)
-    link_to_remote(&quot;Reactivate!&quot;, :method =&gt; :put, :url =&gt; reactivate_admin_user_path(user))
+    name = user.awaits_approval? ? &quot;Approve!&quot; : &quot;Reactivate!&quot;
+    link_to_remote(name, :method =&gt; :put, :url =&gt; reactivate_admin_user_path(user))
   end
 
   #----------------------------------------------------------------------------</diff>
      <filename>app/helpers/admin/users_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -43,7 +43,7 @@ class Authentication &lt; Authlogic::Session::Base # NOTE: This is not ActiveRecord
     end
   end
 
-  # Override Authologic instance method in order to keep :login_counter,
+  # Override Authologic instance method in order to keep :login_count,
   # :last_login_at, and :last_login_ip intact if the user is suspended.
   # See vendor/plugin/authlogin/lib/authlogic/session/magic_columns.rb.
   #----------------------------------------------------------------------------</diff>
      <filename>app/models/authentication.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 %li[user]{ highlightable(dom_id(user, :tools)) }
 
-  - if user.suspended?
+  - if user.awaits_approval?
+    .strip{:class =&gt; &quot;signed_up&quot;} Signed Up
+  - elsif user.suspended?
     .strip{:class =&gt; &quot;suspended&quot;} Suspended
   - elsif user.admin?
     .strip{:class =&gt; &quot;admin&quot;} Admin
@@ -34,7 +36,9 @@
       = pluralize(user.login_count, &quot;login&quot;)
       %span.black= &quot;|&quot;
 
-    - if user.last_request_at
+    - if user.awaits_approval?
+      %b.cool awaits your approval
+    - elsif user.last_request_at
       %span.cool last seen #{time_ago_in_words(user.last_request_at)} ago
     - else
       %span.warn hasn't yet logged in
@@ -42,7 +46,10 @@
     = link_to(user.email, &quot;mailto:&quot; &lt;&lt; user.email.to_s) &lt;&lt; &quot; | &quot;
     = &quot;phone: &lt;b&gt;&quot; + user.phone &lt;&lt; &quot;&lt;/b&gt; | &quot; if user.phone?
     = &quot;mobile: &lt;b&gt;&quot; + user.mobile &lt;&lt; &quot;&lt;/b&gt; | &quot; if user.mobile?
-    - unless user.suspended?
-      user since #{user.created_at.to_date.to_s(:mmddyy)}
+
+    - if !user.suspended?
+      %span user since #{user.created_at.to_date.to_s(:mmddyy)}
+    - elsif user.awaits_approval?
+      %b.cool signed up on #{user.created_at.to_s(:mmddhhss)}
     - else
-      %span.warn suspended on #{user.suspended_at.to_date.to_s(:mmddyy)}
+      %span.warn suspended on #{user.created_at.to_date.to_s(:mmddyy)}</diff>
      <filename>app/views/admin/users/_user.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -25,3 +25,4 @@
     li.user .admin     { background: lightblue; }
     li.user .suspended { background: gainsboro; }
     li.user .active    { background: lightgreen; }
+    li.user .signed_up { background: lightsalmon; }</diff>
      <filename>app/views/common/_inline_styles.html.haml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b9a746a8c51b92db03ffc264a3c2dbbf87f85067</id>
    </parent>
  </parents>
  <author>
    <name>Mike Dvorkin</name>
    <email>mike@dvorkin.net</email>
  </author>
  <url>http://github.com/enderson/fat_free_crm/commit/030a796f61c77a4483dac0bc0afd7b7b0b38f4a0</url>
  <id>030a796f61c77a4483dac0bc0afd7b7b0b38f4a0</id>
  <committed-date>2009-08-24T21:12:18-07:00</committed-date>
  <authored-date>2009-08-24T21:12:18-07:00</authored-date>
  <message>Added user approval to the Admin interface
[#29 state:resolved]</message>
  <tree>b066c028d6f070b1e7aa5ab5df66eaf3cfd8e2ca</tree>
  <committer>
    <name>Mike Dvorkin</name>
    <email>mike@dvorkin.net</email>
  </committer>
</commit>
