appoxy_rails 0.0.33 → 0.0.34
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sessions/sessions_controller.rb +30 -0
- metadata +4 -26
@@ -63,6 +63,8 @@ module Appoxy
|
|
63
63
|
if user && user.authenticate(params[:password])
|
64
64
|
self.current_user = user
|
65
65
|
user.last_login = Time.now
|
66
|
+
user.set_remember
|
67
|
+
cookies.permanent[:rme] = user.remember_token
|
66
68
|
user.save(:dirty=>true)
|
67
69
|
flash[:info] = "Logged in successfully."
|
68
70
|
after_create
|
@@ -505,6 +507,34 @@ module Appoxy
|
|
505
507
|
end
|
506
508
|
|
507
509
|
|
510
|
+
# options:
|
511
|
+
# :scope => See: http://code.google.com/apis/gdata/faq.html #AuthScopes . Multiple scopes can be used, separted by space.
|
512
|
+
def google_consumer(options={})
|
513
|
+
session[:oauth] ||= {}
|
514
|
+
|
515
|
+
consumer_key = "anonymous"
|
516
|
+
consumer_secret = "anonymous"
|
517
|
+
|
518
|
+
scope = options[:scope]
|
519
|
+
|
520
|
+
@consumer ||= OAuth::Consumer.new(consumer_key, consumer_secret,
|
521
|
+
:site => "https://www.google.com",
|
522
|
+
:request_token_path => "/accounts/OAuthGetRequestToken?scope=#{scope}",
|
523
|
+
:access_token_path => '/accounts/OAuthGetAccessToken',
|
524
|
+
:authorize_path => '/accounts/OAuthAuthorizeToken'
|
525
|
+
)
|
526
|
+
|
527
|
+
if !session[:oauth][:request_token].nil? && !session[:oauth][:request_token_secret].nil?
|
528
|
+
@request_token = OAuth::RequestToken.new(@consumer, session[:oauth][:request_token], session[:oauth][:request_token_secret])
|
529
|
+
end
|
530
|
+
|
531
|
+
if !session[:oauth][:access_token].nil? && !session[:oauth][:access_token_secret].nil?
|
532
|
+
@access_token = OAuth::AccessToken.new(@consumer, session[:oauth][:access_token], session[:oauth][:access_token_secret])
|
533
|
+
end
|
534
|
+
|
535
|
+
end
|
536
|
+
|
537
|
+
|
508
538
|
end
|
509
539
|
end
|
510
540
|
end
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appoxy_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 33
|
9
|
-
version: 0.0.33
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.34
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Travis Reeder
|
@@ -14,8 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
18
|
-
default_executable:
|
13
|
+
date: 2011-07-16 00:00:00 Z
|
19
14
|
dependencies:
|
20
15
|
- !ruby/object:Gem::Dependency
|
21
16
|
name: rest-client
|
@@ -25,8 +20,6 @@ dependencies:
|
|
25
20
|
requirements:
|
26
21
|
- - ">="
|
27
22
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 0
|
30
23
|
version: "0"
|
31
24
|
type: :runtime
|
32
25
|
version_requirements: *id001
|
@@ -38,8 +31,6 @@ dependencies:
|
|
38
31
|
requirements:
|
39
32
|
- - ">="
|
40
33
|
- !ruby/object:Gem::Version
|
41
|
-
segments:
|
42
|
-
- 0
|
43
34
|
version: "0"
|
44
35
|
type: :runtime
|
45
36
|
version_requirements: *id002
|
@@ -51,8 +42,6 @@ dependencies:
|
|
51
42
|
requirements:
|
52
43
|
- - ">="
|
53
44
|
- !ruby/object:Gem::Version
|
54
|
-
segments:
|
55
|
-
- 0
|
56
45
|
version: "0"
|
57
46
|
type: :runtime
|
58
47
|
version_requirements: *id003
|
@@ -64,8 +53,6 @@ dependencies:
|
|
64
53
|
requirements:
|
65
54
|
- - ">="
|
66
55
|
- !ruby/object:Gem::Version
|
67
|
-
segments:
|
68
|
-
- 0
|
69
56
|
version: "0"
|
70
57
|
type: :runtime
|
71
58
|
version_requirements: *id004
|
@@ -77,8 +64,6 @@ dependencies:
|
|
77
64
|
requirements:
|
78
65
|
- - ">="
|
79
66
|
- !ruby/object:Gem::Version
|
80
|
-
segments:
|
81
|
-
- 0
|
82
67
|
version: "0"
|
83
68
|
type: :runtime
|
84
69
|
version_requirements: *id005
|
@@ -90,8 +75,6 @@ dependencies:
|
|
90
75
|
requirements:
|
91
76
|
- - ">="
|
92
77
|
- !ruby/object:Gem::Version
|
93
|
-
segments:
|
94
|
-
- 0
|
95
78
|
version: "0"
|
96
79
|
type: :runtime
|
97
80
|
version_requirements: *id006
|
@@ -124,7 +107,6 @@ files:
|
|
124
107
|
- lib/ui/visualizations.rb
|
125
108
|
- lib/utils.rb
|
126
109
|
- README.markdown
|
127
|
-
has_rdoc: true
|
128
110
|
homepage: http://www.appoxy.com
|
129
111
|
licenses: []
|
130
112
|
|
@@ -138,21 +120,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
120
|
requirements:
|
139
121
|
- - ">="
|
140
122
|
- !ruby/object:Gem::Version
|
141
|
-
segments:
|
142
|
-
- 0
|
143
123
|
version: "0"
|
144
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
125
|
none: false
|
146
126
|
requirements:
|
147
127
|
- - ">="
|
148
128
|
- !ruby/object:Gem::Version
|
149
|
-
segments:
|
150
|
-
- 0
|
151
129
|
version: "0"
|
152
130
|
requirements: []
|
153
131
|
|
154
132
|
rubyforge_project:
|
155
|
-
rubygems_version: 1.
|
133
|
+
rubygems_version: 1.8.5
|
156
134
|
signing_key:
|
157
135
|
specification_version: 3
|
158
136
|
summary: Appoxy Rails Helper gem
|