fanforce 0.2.9 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fanforce/utils.rb +11 -0
- data/lib/fanforce/version.rb +1 -1
- metadata +1 -1
data/lib/fanforce/utils.rb
CHANGED
@@ -13,6 +13,17 @@ module Fanforce::Utils
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def valid_request?(params)
|
16
|
+
return false if !valid_fanforce_js_request?(params) and !valid_fanforce_request?(params) and !valid_install_request?(params) and !valid_uninstall_request?(params)
|
17
|
+
return true
|
18
|
+
end
|
19
|
+
|
20
|
+
def valid_fanforce_js_request?(params)
|
21
|
+
return false if !params.is_a?(Hash)
|
22
|
+
return false if is_blank?(params[:fanforce_id]) or is_blank?(params[:api_key])
|
23
|
+
return true
|
24
|
+
end
|
25
|
+
|
26
|
+
def valid_fanforce_request?(params)
|
16
27
|
return false if !params.is_a?(Hash)
|
17
28
|
return false if is_blank?(params[:fanforce_id])
|
18
29
|
return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_id]) and is_blank?(params[:module_id]) and is_blank?(params[:widget_id])
|
data/lib/fanforce/version.rb
CHANGED