fboauth2 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Fboauth2.gemspec +4 -2
- data/VERSION +1 -1
- data/app/controller/facebookoauth_controller.rb +26 -18
- data/lib/Fboauth2.rb +2 -2
- data/pkg/fboauth2-0.1.1.gem +0 -0
- data/pkg/fboauth2-0.1.2.gem +0 -0
- metadata +6 -4
data/Fboauth2.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fboauth2}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.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 = ["Hugo Rincon"]
|
12
|
-
s.date = %q{2011-07-
|
12
|
+
s.date = %q{2011-07-07}
|
13
13
|
s.description = %q{}
|
14
14
|
s.email = %q{hugo@bakedweb.net}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -30,6 +30,8 @@ Gem::Specification.new do |s|
|
|
30
30
|
"config/routes.rb",
|
31
31
|
"lib/Fboauth2.rb",
|
32
32
|
"pkg/Fboauth2-0.1.0.gem",
|
33
|
+
"pkg/fboauth2-0.1.1.gem",
|
34
|
+
"pkg/fboauth2-0.1.2.gem",
|
33
35
|
"spec/fboauth2_spec.rb",
|
34
36
|
"test/helper.rb",
|
35
37
|
"test/test_Fboauth2.rb"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -12,29 +12,37 @@ class FacebookoauthController < ApplicationController
|
|
12
12
|
|
13
13
|
conf_data = Fboauth2::Newfbclient.get_conf_data
|
14
14
|
|
15
|
-
if !conf_data[params[:config]].nil? && conf_data[params[:config]] != ""
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
if !conf_data[params[:config]].nil? && conf_data[params[:config]] != ""
|
16
|
+
if !params[:code].nil? && params[:code] != ""
|
17
|
+
|
18
|
+
|
19
|
+
#toma los datos del usuario de facebook y los coloca en fb_user despues del auth
|
20
|
+
client = Fboauth2::Newfbclient.auth_callback(params[:code], Fboauth2::Newfbclient.get_url(request.env["HTTP_HOST"]))
|
21
|
+
fb_user = client.selection.me.info!
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
#crea un nuevo registro en la db
|
24
|
+
if conf_data[params[:config]]["hmodel"] == "t"
|
25
|
+
Fboauth2::Newfbclient.crate_new_m(conf_data, params, fb_user)
|
26
|
+
end
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
redirect_to Fboauth2::Newfbclient.get_redirect_path(params)
|
28
|
+
#Publica mensaje en facebook
|
29
|
+
if conf_data[params[:config]]["hfbmsg"] == "t"
|
30
|
+
Fboauth2::Newfbclient.send_fb_msg(params[:config], fb_user)
|
31
|
+
end
|
32
32
|
|
33
|
+
redirect_to Fboauth2::Newfbclient.get_path('redirect', params)
|
34
|
+
else
|
35
|
+
puts "-"*50
|
36
|
+
puts "**** Fboauth2 ERROR: Facebook User not allow permission to app****"
|
37
|
+
puts "-"*50
|
38
|
+
|
39
|
+
redirect_to Fboauth2::Newfbclient.get_path('notallow', params)
|
40
|
+
end
|
33
41
|
else
|
34
|
-
|
35
|
-
puts "**** Fboauth2 ERROR: config parameter is required
|
42
|
+
puts "-"*50
|
43
|
+
puts "**** Fboauth2 ERROR: config parameter is required ****"
|
44
|
+
puts "-"*50
|
36
45
|
redirect_to "/"
|
37
|
-
|
38
46
|
end
|
39
47
|
end
|
40
48
|
|
data/lib/Fboauth2.rb
CHANGED
@@ -98,9 +98,9 @@ module Fboauth2
|
|
98
98
|
puts "-> Facebook Message, successfully published..."
|
99
99
|
end
|
100
100
|
|
101
|
-
def self.
|
101
|
+
def self.get_path(type, params)
|
102
102
|
@fb_data = Newfbclient.get_conf_data
|
103
|
-
url = @fb_data[params[:config]][
|
103
|
+
url = @fb_data[params[:config]][type].split(" ")
|
104
104
|
url_f = ""
|
105
105
|
url.each do |value|
|
106
106
|
aux = value.split("_")
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fboauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Hugo Rincon
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-07-
|
18
|
+
date: 2011-07-07 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -162,6 +162,8 @@ files:
|
|
162
162
|
- config/routes.rb
|
163
163
|
- lib/Fboauth2.rb
|
164
164
|
- pkg/Fboauth2-0.1.0.gem
|
165
|
+
- pkg/fboauth2-0.1.1.gem
|
166
|
+
- pkg/fboauth2-0.1.2.gem
|
165
167
|
- spec/fboauth2_spec.rb
|
166
168
|
- test/helper.rb
|
167
169
|
- test/test_Fboauth2.rb
|