backframe 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4cf68307b7e4daf0e68e92f0422863254c24505
|
4
|
+
data.tar.gz: eaf759579d793fde01b51a47098d601dde692644
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6a168a9ddb869906d7d59fb6cd46311a3dfc7eac766df01c020dc05a01658ce2f1aeacbc103ec7205521e79b2e1db53e943425d0fe9ffddee392a37cf80fd99
|
7
|
+
data.tar.gz: 604de21a7be658700f2024b92051b2f945da6c8046b1cb64b5bcfa1a6d8989218718e2bbd04f6208b6ae6c21d36a902dd3d22240138569524ff14b240f43c071
|
@@ -12,13 +12,15 @@ module Backframe
|
|
12
12
|
|
13
13
|
arguments = args[0]
|
14
14
|
|
15
|
+
activation = arguments[:activation] || 'Backframe::Activation'
|
16
|
+
|
15
17
|
class_eval <<-EOV
|
16
18
|
|
17
19
|
layout 'signin'
|
18
|
-
before_action :
|
20
|
+
before_action :load_user, :except => :show
|
19
21
|
|
20
22
|
def show
|
21
|
-
@activation =
|
23
|
+
@activation = #{activation}.find_by(:token => params[:token])
|
22
24
|
if @activation.nil?
|
23
25
|
flash[:error] = I18n.t(:activation_invalid)
|
24
26
|
redirect_to account_signin_path
|
@@ -50,8 +52,8 @@ module Backframe
|
|
50
52
|
|
51
53
|
private
|
52
54
|
|
53
|
-
def
|
54
|
-
@activation =
|
55
|
+
def load_user
|
56
|
+
@activation = #{activation}.find_by(:id => session[:activation_id])
|
55
57
|
@user = @activation.user
|
56
58
|
if @user.nil?
|
57
59
|
flash[:error] = I18n.t(:activation_invalid)
|
@@ -12,11 +12,13 @@ module Backframe
|
|
12
12
|
|
13
13
|
arguments = args[0]
|
14
14
|
|
15
|
+
reset = arguments[:reset] || 'Backframe::Reset'
|
16
|
+
|
15
17
|
class_eval <<-EOV
|
16
18
|
|
17
19
|
layout 'signin'
|
18
20
|
before_action :redirect_if_signed_in
|
19
|
-
before_action :
|
21
|
+
before_action :load_user, :except => [:new,:show]
|
20
22
|
|
21
23
|
def new
|
22
24
|
if request.post?
|
@@ -34,7 +36,7 @@ module Backframe
|
|
34
36
|
end
|
35
37
|
|
36
38
|
def show
|
37
|
-
@reset =
|
39
|
+
@reset = #{reset}.find_by(:token => params[:token])
|
38
40
|
if @reset.nil?
|
39
41
|
flash[:error] = I18n.t(:reset_invalid)
|
40
42
|
redirect_to '#{arguments[:prefix]}/signin'
|
@@ -43,7 +45,7 @@ module Backframe
|
|
43
45
|
redirect_to '#{arguments[:prefix]}/signin'
|
44
46
|
else
|
45
47
|
@reset.claim
|
46
|
-
session[:reset_id] = @reset.
|
48
|
+
session[:reset_id] = @reset.id
|
47
49
|
flash[:error] = I18n.t(:reset_password)
|
48
50
|
redirect_to '#{arguments[:prefix]}/reset/password'
|
49
51
|
end
|
@@ -66,8 +68,9 @@ module Backframe
|
|
66
68
|
|
67
69
|
private
|
68
70
|
|
69
|
-
def
|
70
|
-
@
|
71
|
+
def load_user
|
72
|
+
@reset = #{reset}.find_by(:id => session[:reset_id])
|
73
|
+
@user = @activation.user
|
71
74
|
if @user.nil?
|
72
75
|
flash[:error] = I18n.t(:reset_invalid)
|
73
76
|
redirect_to account_signin_path
|
data/lib/backframe/version.rb
CHANGED