refinerycms-authentication 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,11 +38,10 @@ module Refinery
38
38
  redirect_to refinery.new_refinery_user_session_path,
39
39
  :notice => t('email_reset_sent', :scope => 'refinery.users.forgot')
40
40
  else
41
- @refinery_user = User.new(params[:refinery_user])
42
- flash.now[:error] = if @refinery_user.email.blank?
41
+ flash.now[:error] = if (email = params[:refinery_user][:email]).blank?
43
42
  t('blank_email', :scope => 'refinery.users.forgot')
44
43
  else
45
- t('email_not_associated_with_account_html', :email => @refinery_user.email, :scope => 'refinery.users.forgot')
44
+ t('email_not_associated_with_account_html', :email => ERB::Util.html_escape(email), :scope => 'refinery.users.forgot').html_safe
46
45
  end
47
46
  render :new
48
47
  end
@@ -0,0 +1,9 @@
1
+ module Refinery
2
+ class AuthenticationGenerator < Rails::Generators::Base
3
+ source_root File.expand_path("../templates", __FILE__)
4
+
5
+ def generate_authentication_initializer
6
+ template "config/initializers/refinery/authentication.rb.erb", File.join(destination_root, "config", "initializers", "refinery", "authentication.rb")
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ Refinery::Authentication.configure do |config|
2
+ # Configure whether to allow superuser to assign roles
3
+ # config.superuser_can_assign_roles = <%= Refinery::Authentication.superuser_can_assign_roles.inspect %>
4
+ end
@@ -3,6 +3,7 @@ require 'devise'
3
3
  require 'friendly_id'
4
4
 
5
5
  module Refinery
6
+ autoload :AuthenticationGenerator, 'generators/refinery/authentication/authentication_generator'
6
7
  autoload :AuthenticatedSystem, 'refinery/authenticated_system'
7
8
 
8
9
  class << self
@@ -19,8 +19,7 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.files = `git ls-files`.split("\n")
21
21
  s.test_files = `git ls-files -- spec/*`.split("\n")
22
- s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
23
22
 
24
- s.add_dependency 'devise', '~> 2.0.0'
25
23
  s.add_dependency 'refinerycms-core', version
24
+ s.add_dependency 'devise', '~> 2.0.0'
26
25
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-authentication
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 1
10
- version: 2.0.1
9
+ - 2
10
+ version: 2.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Philip Arndt
@@ -18,39 +18,39 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2012-03-06 00:00:00 Z
21
+ date: 2012-03-15 00:00:00 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  prerelease: false
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
- - - ~>
28
+ - - "="
29
29
  - !ruby/object:Gem::Version
30
- hash: 15
30
+ hash: 11
31
31
  segments:
32
32
  - 2
33
33
  - 0
34
- - 0
35
- version: 2.0.0
34
+ - 2
35
+ version: 2.0.2
36
36
  version_requirements: *id001
37
- name: devise
37
+ name: refinerycms-core
38
38
  type: :runtime
39
39
  - !ruby/object:Gem::Dependency
40
40
  prerelease: false
41
41
  requirement: &id002 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
- - - "="
44
+ - - ~>
45
45
  - !ruby/object:Gem::Version
46
- hash: 13
46
+ hash: 15
47
47
  segments:
48
48
  - 2
49
49
  - 0
50
- - 1
51
- version: 2.0.1
50
+ - 0
51
+ version: 2.0.0
52
52
  version_requirements: *id002
53
- name: refinerycms-core
53
+ name: devise
54
54
  type: :runtime
55
55
  description: The default authentication extension for Refinery CMS
56
56
  email: info@refinerycms.com
@@ -115,6 +115,8 @@ files:
115
115
  - config/locales/zh-TW.yml
116
116
  - config/routes.rb
117
117
  - db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
118
+ - lib/generators/refinery/authentication/authentication_generator.rb
119
+ - lib/generators/refinery/authentication/templates/config/initializers/refinery/authentication.rb.erb
118
120
  - lib/refinery/authenticated_system.rb
119
121
  - lib/refinery/authentication.rb
120
122
  - lib/refinery/authentication/configuration.rb