salted_login_generator 1.0.7 → 1.0.8

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/templates/README CHANGED
@@ -8,7 +8,8 @@ this:
8
8
 
9
9
  class ApplicationController < ActionController::Base
10
10
  include <%= class_name %>System
11
- helper: <%= singular_name %>
11
+ helper :<%= singular_name %>
12
+ model :<%= singular_name %>
12
13
  before_filter :login_required
13
14
 
14
15
  After you have done the modifications the the ApplicationController and its
@@ -23,7 +24,27 @@ file:
23
24
  require 'environments/<%= singular_name %>_environment'
24
25
 
25
26
  Under the 'enviroments' subdirectory, you'll find <%= singular_name %>_environment.rb.
26
- Edit this file as necessary...
27
+ Edit this file as necessary.
28
+
29
+ Also, you must properly configure ActionMailer for your mail settings. For
30
+ example, I have the following in config/environments/development.rb (for a
31
+ .Mac account, and without my username and password, obviously):
32
+
33
+ ActionMailer::Base.server_settings = {
34
+ :address => "smtp.mac.com",
35
+ :port => 25,
36
+ :domain => "smtp.mac.com",
37
+ :user_name => "<your user name here>",
38
+ :password => "<your password here>",
39
+ :authentication => :login
40
+ }
41
+
42
+ You'll need to configure it properly so that email can be sent. One of the
43
+ easiest ways to test your configuration is to temporarily reraise exceptions
44
+ from the signup method (so that you get the actual mailer exception string).
45
+ In the rescue statement, put a single "raise" statement in. Once you've
46
+ debugged any setting problems, remove that statement to get the proper flash
47
+ error handling back.
27
48
 
28
49
  == Requirements
29
50
 
@@ -35,8 +56,8 @@ You need a database table corresponding to the <%= class_name %> model.
35
56
  login VARCHAR(80) NOT NULL,
36
57
  password VARCHAR(40) NOT NULL,
37
58
  email VARCHAR(60) NOT NULL,
38
- firstname VARCHAR(40) NOT NULL,
39
- lastname VARCHAR(40) NOT NULL,
59
+ firstname VARCHAR(40),
60
+ lastname VARCHAR(40),
40
61
  salt CHAR(40) NOT NULL,
41
62
  verified INT default 0,
42
63
  role VARCHAR(40) default NULL,
@@ -50,8 +71,8 @@ You need a database table corresponding to the <%= class_name %> model.
50
71
  login VARCHAR(80) NOT NULL,
51
72
  password VARCHAR(40) NOT NULL,
52
73
  email VARCHAR(60) NOT NULL,
53
- firstname VARCHAR(40) NOT NULL,
54
- lastname VARCHAR(40) NOT NULL,
74
+ firstname VARCHAR(40),
75
+ lastname VARCHAR(40),
55
76
  salt CHAR(40) NOT NULL,
56
77
  verified INT default 0,
57
78
  role VARCHAR(40) default NULL,
@@ -65,8 +86,8 @@ You need a database table corresponding to the <%= class_name %> model.
65
86
  login VARCHAR(80) NOT NULL,
66
87
  password VARCHAR(40) NOT NULL,
67
88
  email VARCHAR(60) NOT NULL,
68
- firstname VARCHAR(40) NOT NULL,
69
- lastname VARCHAR(40) NOT NULL,
89
+ firstname VARCHAR(40),
90
+ lastname VARCHAR(40),
70
91
  salt CHAR(40) NOT NULL,
71
92
  verified INT default 0,
72
93
  role VARCHAR(40) default NULL,
@@ -75,7 +96,14 @@ You need a database table corresponding to the <%= class_name %> model.
75
96
  );
76
97
 
77
98
  Of course your <%= singular_name %> model can have any amount of extra fields.
78
- This is just a starting point
99
+ This is just a starting point.
100
+
101
+ Supplied with the generator is a .erbsql schema file. If you download the
102
+ db_structure gem, you can run script/create_db to automatically create all of
103
+ your databases and tables based on this file. ** BEWARE ** This script
104
+ drops and recreates all tables in test, production and development databases.
105
+ The supplied file has been tested with MySQL, though others have reported
106
+ success with SQLite and PostgreSQL.
79
107
 
80
108
  == How to use it
81
109
 
@@ -127,11 +155,28 @@ How do I...
127
155
  send the user to the login form.
128
156
  After he logs in he will be send back to /articles/show/1
129
157
 
130
-
131
158
  You can find more help at http://wiki.rubyonrails.com/rails/show/SaltedLoginGenerator
132
159
 
160
+ == Troubleshooting
161
+
162
+ One of the more common problems people have seen is that after verifying an
163
+ account by following the emailed URL, they are unable to login via the
164
+ normal login method since the verified field is not properly set in the
165
+ <%= singular_name %> model's row in the DB.
166
+
167
+ The most common cause of this problem is that the DB and session get out of
168
+ sync. In particular, it always happens for me after recreating the DB if I
169
+ have run the server previously. To fix the problem, remove the /tmp/ruby*
170
+ session files (from whereever they are for your installation) while the server
171
+ is stopped, and then restart. This usually is the cause of the problem.
172
+
173
+ A forthcoming release will probably fix this via a well placed reset_session
174
+ call (or requirement to add it after running the generator) so that it is done
175
+ automatically on startup.
176
+
133
177
  == Changelog
134
178
 
179
+ 1.0.8 Generator/schema fixes and some README fixes/improvements
135
180
  1.0.7 Fixed bad bug with missing attr_accessor :new_password in user class
136
181
  1.0.6 Proper delete support and bug fixes
137
182
  1.0.5 Lots of fixes and changes (see rubyforge.org/salted-login)
@@ -67,7 +67,7 @@ class <%= class_name %>Controller < ApplicationController
67
67
  case @request.method
68
68
  # Render on :get
69
69
  when :get
70
- @user = User.new
70
+ @<%= singular_name %> = <%= class_name %>.new
71
71
  render
72
72
  end
73
73
 
@@ -151,8 +151,8 @@ class <%= class_name %>Controller < ApplicationController
151
151
  end
152
152
 
153
153
  protected
154
-
155
- def destroy(user)
154
+
155
+ def destroy(<%= singular_name %>)
156
156
  <%= class_name %>Notify.deliver_delete(<%= singular_name %>)
157
157
  flash['notice'] = l(:<%= singular_name %>_delete_finished, "#{<%= singular_name %>['login']}")
158
158
  <%= singular_name %>.destroy()
@@ -3,8 +3,8 @@ CREATE TABLE users (
3
3
  login VARCHAR(80) NOT NULL,
4
4
  salted_password VARCHAR(40) NOT NULL,
5
5
  email VARCHAR(60) NOT NULL,
6
- firstname VARCHAR(40) NOT NULL,
7
- lastname VARCHAR(40) NOT NULL,
6
+ firstname VARCHAR(40) default NULL,
7
+ lastname VARCHAR(40) default NULL,
8
8
  salt CHAR(40) NOT NULL,
9
9
  verified INT default 0,
10
10
  role VARCHAR(40) default NULL,
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.8
3
3
  specification_version: 1
4
4
  name: salted_login_generator
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.7
7
- date: 2005-05-08
6
+ version: 1.0.8
7
+ date: 2005-05-11
8
8
  summary: "[Rails] Login generator with salted passwords."
9
9
  require_paths:
10
10
  - "."