@ -14,22 +14,22 @@ class ApplicationController < BaseController
def capture_page_info
def capture_page_info
# capture request info in case an error occurs
# capture request info in case an error occurs
if request . method == " GET " && ( params [ :controller ] != 'application' || params [ :action ] != 'contact' )
# if request.method == "GET" && (params[:controller] != 'application' || params[:action] != 'contact' )
session [ :last_request ]
# session[:last_request ]
request_info = {
# request_info = {
'params' = > params ,
# 'params' => params ,
'request' = > {
# 'request' => {
'remote_ip' = > request . remote_ip ,
# 'remote_ip' => request.remote_ip ,
'uuid' = > request . uuid ,
# 'uuid' => request.uuid ,
'original_url' = > request . original_url ,
# 'original_url' => request.original_url ,
'env' = > Hash . new
# 'env' => Hash. new
}
# }
}
# }
request . env . each do | key , value |
# request.env.each do |key, value |
request_info [ 'request' ] [ 'env' ] [ key . to_s ] = value . to_s
# request_info['request']['env'][key.to_s] = value. to_s
end
# end
session [ 'request_info' ] = request_info
# # session['request_info'] = request_info
end
# end
# get the current conferences and set them globally
# get the current conferences and set them globally
status_hierarchy = {
status_hierarchy = {
@ -96,14 +96,14 @@ class ApplicationController < BaseController
logger . info " A JavaScript error has occurred on #{ params [ :location ] } : #{ params [ :lineNumber ] } : #{ params [ :message ] } "
logger . info " A JavaScript error has occurred on #{ params [ :location ] } : #{ params [ :lineNumber ] } : #{ params [ :message ] } "
if Rails . env . preview? || Rails . env . production?
if Rails . env . preview? || Rails . env . production?
requestHash = {
request_info = {
'remote_ip' = > arg . remote_ip ,
'remote_ip' = > arg . remote_ip ,
'uuid' = > arg . uuid ,
'uuid' = > arg . uuid ,
'original_url' = > arg . original_url ,
'original_url' = > arg . original_url ,
'env' = > Hash . new
'env' = > Hash . new
}
}
request . env . each do | key , value |
request . env . each do | key , value |
requestHash [ 'env' ] [ key . to_s ] = value . to_s
request_info [ 'env' ] [ key . to_s ] = value . to_s
end
end
send_mail ( :error_report ,
send_mail ( :error_report ,
@ -111,7 +111,7 @@ class ApplicationController < BaseController
report ,
report ,
params [ :message ] ,
params [ :message ] ,
nil ,
nil ,
requestHash ,
request_info ,
params ,
params ,
current_user ,
current_user ,
Time . now . strftime ( " %d/%m/%Y %H:%M " )
Time . now . strftime ( " %d/%m/%Y %H:%M " )
@ -172,21 +172,21 @@ class ApplicationController < BaseController
# send and email if this is production
# send and email if this is production
if Rails . env . preview? || Rails . env . production?
if Rails . env . preview? || Rails . env . production?
suppress ( Exception ) do
suppress ( Exception ) do
requestHash = {
request_info = {
'remote_ip' = > arg . remote_ip ,
'remote_ip' = > arg . remote_ip ,
'uuid' = > arg . uuid ,
'uuid' = > arg . uuid ,
'original_url' = > arg . original_url ,
'original_url' = > arg . original_url ,
'env' = > Hash . new
'env' = > Hash . new
}
}
request . env . each do | key , value |
request . env . each do | key , value |
requestHash [ 'env' ] [ key . to_s ] = value . to_s
request_info [ 'env' ] [ key . to_s ] = value . to_s
end
end
send_mail ( :error_report ,
send_mail ( :error_report ,
" An error has occurred in #{ Rails . env } " ,
" An error has occurred in #{ Rails . env } " ,
nil ,
nil ,
exception . to_s ,
exception . to_s ,
exception . backtrace . join ( " \n " ) ,
exception . backtrace . join ( " \n " ) ,
requestHash ,
request_info ,
params ,
params ,
current_user ,
current_user ,
Time . now . strftime ( " %d/%m/%Y %H:%M " )
Time . now . strftime ( " %d/%m/%Y %H:%M " )
@ -222,6 +222,16 @@ class ApplicationController < BaseController
end
end
end
end
request_info = {
'remote_ip' = > request . remote_ip ,
'uuid' = > request . uuid ,
'original_url' = > request . original_url ,
'env' = > Hash . new
}
request . env . each do | key , value |
request_info [ 'env' ] [ key . to_s ] = value . to_s
end
send_mail ( :contact ,
send_mail ( :contact ,
current_user || params [ :email ] ,
current_user || params [ :email ] ,
params [ :subject ] ,
params [ :subject ] ,
@ -229,13 +239,12 @@ class ApplicationController < BaseController
email_list
email_list
)
)
request_info = session [ 'request_info' ] || { 'request' = > request , 'params' = > params }
send_mail ( :contact_details ,
send_mail ( :contact_details ,
current_user || params [ :email ] ,
current_user || params [ :email ] ,
params [ :subject ] ,
params [ :subject ] ,
params [ :message ] ,
params [ :message ] ,
request_info [ 'request' ] ,
request_info ,
request_info [ ' params' ]
params
)
)
redirect_to contact_sent_path
redirect_to contact_sent_path
@ -339,21 +348,21 @@ class ApplicationController < BaseController
# send an email if this is production
# send an email if this is production
if Rails . env . preview? || Rails . env . production?
if Rails . env . preview? || Rails . env . production?
begin
begin
requestHash = {
request_info = {
'remote_ip' = > arg . remote_ip ,
'remote_ip' = > arg . remote_ip ,
'uuid' = > arg . uuid ,
'uuid' = > arg . uuid ,
'original_url' = > arg . original_url ,
'original_url' = > arg . original_url ,
'env' = > Hash . new
'env' = > Hash . new
}
}
request . env . each do | key , value |
request . env . each do | key , value |
requestHash [ 'env' ] [ key . to_s ] = value . to_s
request_info [ 'env' ] [ key . to_s ] = value . to_s
end
end
send_mail ( :error_report ,
send_mail ( :error_report ,
" A missing translation found in #{ Rails . env } " ,
" A missing translation found in #{ Rails . env } " ,
" <p>A translation for <code> #{ key } </code> in <code> #{ locale . to_s } </code> was found. The text that was rendered to the user was:</p><blockquote> #{ str || 'nil' } </blockquote> " ,
" <p>A translation for <code> #{ key } </code> in <code> #{ locale . to_s } </code> was found. The text that was rendered to the user was:</p><blockquote> #{ str || 'nil' } </blockquote> " ,
exception . to_s ,
exception . to_s ,
nil ,
nil ,
requestHash ,
request_info ,
params ,
params ,
current_user . id ,
current_user . id ,
Time . now . strftime ( " %d/%m/%Y %H:%M " )
Time . now . strftime ( " %d/%m/%Y %H:%M " )