dougui_users 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/dougui_users/application_controller.rb +0 -16
- data/lib/dougui_users.rb +14 -2
- data/lib/dougui_users/version.rb +1 -1
- metadata +27 -27
@@ -1,22 +1,6 @@
|
|
1
1
|
module DouguiUsers
|
2
2
|
class ApplicationController < ActionController::Base
|
3
3
|
|
4
|
-
def current_user_session
|
5
|
-
return @current_user_session if defined?(@current_user_session)
|
6
|
-
@current_user_session = UserSession.find
|
7
|
-
end
|
8
|
-
|
9
|
-
def current_user
|
10
|
-
return @current_user if defined?(@current_user)
|
11
|
-
@current_user = current_user_session && current_user_session.record
|
12
|
-
end
|
13
|
-
|
14
|
-
def restrict_access
|
15
|
-
unless current_user
|
16
|
-
redirect_to login_path, :notice => t('access_denied', :scope => 'application_controller')
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
4
|
def load_user_using_perishable_token
|
21
5
|
@user = User.find_by_perishable_token(params[:id])
|
22
6
|
unless @user
|
data/lib/dougui_users.rb
CHANGED
@@ -1,7 +1,19 @@
|
|
1
1
|
require "dougui_users/engine"
|
2
2
|
|
3
3
|
module DouguiUsers
|
4
|
-
|
5
|
-
|
4
|
+
def current_user_session
|
5
|
+
return @current_user_session if defined?(@current_user_session)
|
6
|
+
@current_user_session = UserSession.find
|
7
|
+
end
|
8
|
+
|
9
|
+
def current_user
|
10
|
+
return @current_user if defined?(@current_user)
|
11
|
+
@current_user = current_user_session && current_user_session.record
|
12
|
+
end
|
13
|
+
|
14
|
+
def restrict_access
|
15
|
+
unless current_user
|
16
|
+
redirect_to login_path, :notice => t('access_denied', :scope => 'application_controller')
|
17
|
+
end
|
6
18
|
end
|
7
19
|
end
|
data/lib/dougui_users/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dougui_users
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-09-18 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &81368920 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *81368920
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: authlogic
|
27
|
-
requirement: &
|
27
|
+
requirement: &81368670 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - =
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.0.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *81368670
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dynamic_form
|
38
|
-
requirement: &
|
38
|
+
requirement: &81368440 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - =
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.1.4
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *81368440
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: cucumber-rails
|
49
|
-
requirement: &
|
49
|
+
requirement: &81368210 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - =
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.0.5
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *81368210
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec-rails
|
60
|
-
requirement: &
|
60
|
+
requirement: &81367980 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - =
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 2.6.1
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *81367980
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: database_cleaner
|
71
|
-
requirement: &
|
71
|
+
requirement: &81367750 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - =
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 0.6.7
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *81367750
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: spork
|
82
|
-
requirement: &
|
82
|
+
requirement: &81367520 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - =
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 0.8.5
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *81367520
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: factory_girl
|
93
|
-
requirement: &
|
93
|
+
requirement: &81367290 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - =
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 2.1.0
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *81367290
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: autotest-rails
|
104
|
-
requirement: &
|
104
|
+
requirement: &81367060 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - =
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: 4.1.1
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *81367060
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: capybara
|
115
|
-
requirement: &
|
115
|
+
requirement: &81366830 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - =
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: 1.1.1
|
121
121
|
type: :runtime
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *81366830
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: launchy
|
126
|
-
requirement: &
|
126
|
+
requirement: &81366600 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - =
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: 2.0.5
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *81366600
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: email_spec
|
137
|
-
requirement: &
|
137
|
+
requirement: &81366370 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - =
|
@@ -142,10 +142,10 @@ dependencies:
|
|
142
142
|
version: 1.2.1
|
143
143
|
type: :runtime
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *81366370
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: sqlite3
|
148
|
-
requirement: &
|
148
|
+
requirement: &81366180 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ! '>='
|
@@ -153,7 +153,7 @@ dependencies:
|
|
153
153
|
version: '0'
|
154
154
|
type: :development
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
156
|
+
version_requirements: *81366180
|
157
157
|
description: A gem for users.
|
158
158
|
email:
|
159
159
|
- guirec.corbel@gmail.com
|