radiant-reader_group-extension 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
@@ -25,9 +25,8 @@ class Admin::GroupInvitationsController < ApplicationController
25
25
  import_counter = 0
26
26
  imports.each do |i|
27
27
  r = params["reader_#{i}".to_sym]
28
- r[:password] = r[:password_confirmation] = generate_password
29
28
  reader = Reader.new(r)
30
- reader.clear_password = r[:password]
29
+ reader.create_password!
31
30
  if reader.save!
32
31
  reader.groups << @group
33
32
  reader.send_group_invitation_message(@group)
@@ -59,9 +58,9 @@ private
59
58
  csv = line.collect {|value| value ? value.gsub(/^ */, '').chomp : ''}
60
59
  input = {}
61
60
  input[:honorific] = csv.shift if Radiant::Config['reader.use_honorifics?']
62
- input[:password] = input[:password_confirmation] = generate_password
63
61
  [:name, :email, :login, :phone].each {|field| input[field] = csv.shift}
64
62
  r = Reader.find_by_email(input[:email]) || Reader.new(input)
63
+ r.create_password! #only for validation purposes: not saved not passed through
65
64
  r.login = generate_login(input[:name]) if r.login.blank?
66
65
  r.valid? # so that errors can be shown on the confirmation form
67
66
  readers << r
@@ -76,9 +75,4 @@ private
76
75
  initials.push(names.last).join('_').downcase
77
76
  end
78
77
 
79
- def generate_password(length=12)
80
- chars = ("a".."z").to_a + ("A".."Z").to_a + ("1".."9").to_a
81
- Array.new(length, '').collect{chars[rand(chars.size)]}.join
82
- end
83
-
84
78
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-reader_group-extension}
8
- s.version = "1.1.1"
8
+ s.version = "1.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["spanner"]
12
- s.date = %q{2011-02-02}
12
+ s.date = %q{2011-02-11}
13
13
  s.description = %q{Adds group-based page access control to radiant.}
14
14
  s.email = %q{will@spanner.org}
15
15
  s.extra_rdoc_files = [
@@ -10,7 +10,7 @@ module ReaderGroup
10
10
  end
11
11
 
12
12
  class ReaderGroupExtension < Radiant::Extension
13
- version "1.1.1"
13
+ version "1.1.2"
14
14
  description "Page (and other) access control for site readers and groups"
15
15
  url "http://spanner.org/radiant/reader_group"
16
16
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-reader_group-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 1
10
- version: 1.1.1
9
+ - 2
10
+ version: 1.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - spanner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-02 00:00:00 +00:00
18
+ date: 2011-02-11 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency