tonkapark-clearance 0.6.9.2 → 0.6.9.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.textile CHANGED
@@ -1,3 +1,8 @@
1
+ h2. 0.6.9.3 (7/21/09)
2
+
3
+ * added admin to users.
4
+ * invitation listing for admins only
5
+
1
6
  h2. 0.6.9.2 (7/21/09)
2
7
 
3
8
  * forked and added invitations and clearance.yml (Matt Anderson[http://tonkapark.com])
data/README.textile CHANGED
@@ -18,7 +18,7 @@ In config/environment.rb:
18
18
  config.gem "tonkapark-clearance",
19
19
  :lib => 'clearance',
20
20
  :source => 'http://gems.github.com',
21
- :version => '0.6.9.2'
21
+ :version => '0.6.9.3'
22
22
  </pre>
23
23
 
24
24
  Vendor the gem:
data/Rakefile CHANGED
@@ -53,7 +53,7 @@ task :default => ['test:all', 'test:features']
53
53
 
54
54
  gem_spec = Gem::Specification.new do |gem_spec|
55
55
  gem_spec.name = "clearance"
56
- gem_spec.version = "0.6.9.2"
56
+ gem_spec.version = "0.6.9.3"
57
57
  gem_spec.summary = "Rails authentication with email & password and invitations."
58
58
  gem_spec.email = "matt@tonkapark.com"
59
59
  gem_spec.homepage = "http://github.com/tonkapark/clearance"
data/TODO.textile CHANGED
@@ -1,6 +1,5 @@
1
- h1. To-do
2
1
 
3
- * Make insertion of Clearance::User into User model automatic from the generator.
4
- * Change generated README to include instruction about running the migration.
5
- * DO_NOT_REPLY, HOST refactoring.
2
+ h1. Tonka Park FORK TODO
6
3
 
4
+ * Allow users to invite users
5
+ * Resend invitation
@@ -2,6 +2,12 @@ class Clearance::InvitationsController < ApplicationController
2
2
  unloadable
3
3
 
4
4
  before_filter :redirect_to_root, :only => [:new, :create], :if => :signed_in?
5
+ before_filter :admin_only, :only => [:index]
6
+
7
+ def index
8
+ @invitations = ::Invitation.all
9
+ render :template => 'invitations/index'
10
+ end
5
11
 
6
12
  def new
7
13
  @invitation = ::Invitation.new(params[:invitation])
@@ -25,4 +31,10 @@ class Clearance::InvitationsController < ApplicationController
25
31
  end
26
32
  end
27
33
 
34
+ private
35
+ def admin_only
36
+ unless current_user.admin?
37
+ redirect_to root_url
38
+ end
39
+ end
28
40
  end
@@ -3,7 +3,6 @@
3
3
  <table>
4
4
  <tr>
5
5
  <th>Recipient</th>
6
- <th>Invited By</th>
7
6
  <th>Invited At</th>
8
7
  <th>Redeemed At</th>
9
8
  <th></th>
data/clearance.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clearance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.9.2
4
+ version: 0.6.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Croak
@@ -19,7 +19,7 @@ ActionController::Routing::Routes.draw do |map|
19
19
 
20
20
  map.resources :invitations,
21
21
  :controller => 'clearance/invitations',
22
- :only => [:new, :create]
22
+ :only => [:index, :new, :create]
23
23
 
24
24
  map.recover_password '/recover_password', :controller =>'clearance/passwords', :action => 'new'
25
25
 
@@ -7,6 +7,7 @@ class ClearanceCreateUsers < ActiveRecord::Migration
7
7
  t.string :token, :limit => 128
8
8
  t.datetime :token_expires_at
9
9
  t.boolean :email_confirmed, :default => false, :null => false
10
+ t.boolean :admin, :default => false, :null => false
10
11
  t.integer :invitation_id
11
12
  t.integer :invitation_limit
12
13
  t.timestamps
@@ -9,6 +9,7 @@ class ClearanceUpdateUsers < ActiveRecord::Migration
9
9
  [:token, 't.string :token, :limit => 128'],
10
10
  [:token_expires_at, 't.datetime :token_expires_at'],
11
11
  [:email_confirmed, 't.boolean :email_confirmed, :default => false, :null => false'],
12
+ [:admin, 't.boolean :admin, :default => false, :null => false'],
12
13
  [:invitation_id, 't.integer :invitation_id'],
13
14
  [:invitation_limit, 't.integer :invitation_limit']
14
15
  ].delete_if {|c| existing_columns.include?(c.first.to_s)}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tonkapark-clearance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.9.2
4
+ version: 0.6.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Croak