check mobile user
This commit is contained in:
@@ -38,15 +38,14 @@ class BaseOrigamiController < ActionController::Base
|
|||||||
#check webview
|
#check webview
|
||||||
def check_mobile
|
def check_mobile
|
||||||
status = false
|
status = false
|
||||||
token_status = false
|
|
||||||
authenticate_with_http_token do |token, options|
|
authenticate_with_http_token do |token, options|
|
||||||
if token
|
if token
|
||||||
token_status = true
|
session[:webview] = true
|
||||||
end
|
end
|
||||||
session[:session_token] = token
|
session[:session_token] = token
|
||||||
end
|
end
|
||||||
|
|
||||||
if token_status && request.user_agent =~ /android|blackberry|iphone|ipad|ipod|iemobile|mobile|webos/i
|
if session[:webview] && request.user_agent =~ /android|blackberry|iphone|ipad|ipod|iemobile|mobile|webos/i
|
||||||
status = true
|
status = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user