iab-InsuranceBizLogic 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bizLogic/xquery2 +1 -1
- data/lib/processengine/engine.rb +12 -5
- metadata +1 -1
data/lib/bizLogic/xquery2
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
declare namespace xupdate="http://www.xmldb.org/xupdate";
|
2
2
|
for $result in collection("quotes.dbxml")/Telenexus
|
3
|
-
where $result//Profile/PersonalDetails/
|
3
|
+
where $result//Profile/PersonalDetails/Client/Contact/Email = "EMAIL"
|
4
4
|
return
|
5
5
|
$result
|
data/lib/processengine/engine.rb
CHANGED
@@ -132,11 +132,18 @@ class PEngine
|
|
132
132
|
prepareModels(session[:product],xml)
|
133
133
|
|
134
134
|
when "Authenticate"
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
135
|
+
begin
|
136
|
+
session[:user_email] = params[:User][:User] if params[:User] and params[:User][:User]
|
137
|
+
eval(deriveActiveRecordDefinitionOfProduct(session[:product]))
|
138
|
+
open("#{File.dirname(__FILE__)}/../bizLogic/xquery2") {|f| @query = f.read }
|
139
|
+
results = persist.find(@query.gsub('EMAIL',session[:user_email]))
|
140
|
+
prepareModels(session[:product],results[0]) if results and results[0]
|
141
|
+
rescue
|
142
|
+
if !session[:user_email]
|
143
|
+
raise "Credentials missing - you have not logged in"
|
144
|
+
end
|
145
|
+
raise "An error occurred during the authentication process"
|
146
|
+
end
|
140
147
|
|
141
148
|
when "SectionRating"
|
142
149
|
"1553.25"
|