Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
ofbiz-directcontrolservlet
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
a9fc2c01
authored
2014-09-09 15:29:23 -0500
by
Ean Schuessler
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'BF-3980' of /home/git/repositories/brainfood/ofbiz-directcontrolservlet
2 parents
0f8e94b0
965b5d26
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
src/com/brainfood/ofbiz/DirectControlServlet.java
src/com/brainfood/ofbiz/DirectControlServlet.java
View file @
a9fc2c0
...
...
@@ -41,7 +41,7 @@ import org.ofbiz.base.util.UtilHttp;
import
org.ofbiz.base.util.UtilMisc
;
import
org.ofbiz.base.util.UtilProperties
;
import
org.ofbiz.base.util.UtilIO
;
import
org.ofbiz.base.util.UtilValidate
;
import
org.ofbiz.entity.Delegator
;
import
org.ofbiz.entity.DelegatorFactory
;
import
org.ofbiz.entity.GenericValue
;
...
...
@@ -53,16 +53,18 @@ import org.ofbiz.service.ServiceContainer;
import
groovy.lang.GroovyClassLoader
;
import
groovy.lang.Script
;
import
org.codehaus.groovy.runtime.InvokerHelper
;
import
org.codehaus.groovy.runtime.InvokerHelper
;
import
org.ofbiz.base.json.JSON
;
import
org.ofbiz.base.json.ParseException
;
import
net.sf.json.JSONObject
;
public
class
DirectControlServlet
extends
HttpServlet
{
public
static
final
String
module
=
DirectControlServlet
.
class
.
getName
();
public
static
final
Map
<
String
,
String
>
serviceURLMappings
=
new
HashMap
<
String
,
String
>();
private
String
sessionTokenName
=
"_AUTHTOKEN"
;
private
String
checkSessionService
;
public
void
init
(
ServletConfig
config
)
throws
ServletException
{
// get the mapping file for this webapp
...
...
@@ -89,6 +91,9 @@ public class DirectControlServlet extends HttpServlet {
throw
new
ServletException
(
"Could not read mapping file "
+
mappingFile
);
}
}
checkSessionService
=
context
.
getInitParameter
(
"checkSessionService"
);
Debug
.
logInfo
(
"Checking session with service: "
+
checkSessionService
,
module
);
}
public
void
service
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
...
...
@@ -179,7 +184,7 @@ public class DirectControlServlet extends HttpServlet {
delegator
.
findList
(
"Visit"
,
EntityCondition
.
makeCondition
(
"cookie"
,
EntityOperator
.
EQUALS
,
authToken
),
null
,
null
,
null
,
tru
e
)
null
,
null
,
null
,
fals
e
)
)
);
...
...
@@ -194,6 +199,11 @@ public class DirectControlServlet extends HttpServlet {
if
(
userLogin
!=
null
)
{
context
.
put
(
"userLogin"
,
userLogin
);
}
// prolong the session
if
(
UtilValidate
.
isNotEmpty
(
checkSessionService
))
{
dispatcher
.
runSync
(
checkSessionService
,
UtilMisc
.<
String
,
Object
>
toMap
(
"authSessionId"
,
authToken
,
"userLogin"
,
userLogin
));
}
}
}
...
...
Please
register
or
sign in
to post a comment