Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e7532fc7
authored
Dec 08, 2014
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
luetaan sitä koodia
1 parent
739bbb2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
19 deletions
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/shop/InviteAcceptView.java
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/shop/InviteAcceptView.java
View file @
e7532fc
...
@@ -104,9 +104,9 @@ public class InviteAcceptView extends GenericCDIView {
...
@@ -104,9 +104,9 @@ public class InviteAcceptView extends GenericCDIView {
super
.
addFaceMessage
(
"invite.userCreateSuccessfull"
);
super
.
addFaceMessage
(
"invite.userCreateSuccessfull"
);
if
(
isPlaceGroupMembership
())
if
(
isPlaceGroupMembership
())
return
"/place/myGroups
.jsf
"
;
return
"/place/myGroups"
;
else
else
return
"/index
.jsf
"
;
return
"/index"
;
}
}
this
.
username
=
null
;
this
.
username
=
null
;
this
.
password
=
null
;
this
.
password
=
null
;
...
@@ -117,27 +117,21 @@ public class InviteAcceptView extends GenericCDIView {
...
@@ -117,27 +117,21 @@ public class InviteAcceptView extends GenericCDIView {
private
void
login
(
String
usr
,
String
pwd
)
{
private
void
login
(
String
usr
,
String
pwd
)
{
HttpServletRequest
req
=
getRequest
();
HttpServletRequest
req
=
getRequest
();
String
existingUsername
=
null
;
if
(
req
.
getUserPrincipal
()
!=
null
)
{
if
(
req
.
getUserPrincipal
()
!=
null
)
{
if
(
req
.
getUserPrincipal
()
!=
null
)
{
try
{
req
.
logout
();
}
catch
(
ServletException
e
)
{
logger
.
warn
(
"Logging out previous user failed!"
,
e
);
}
}
else
{
existingUsername
=
req
.
getUserPrincipal
().
getName
();
}
}
if
(
existingUsername
==
null
)
{
try
{
try
{
req
.
log
in
(
usr
.
trim
().
toLowerCase
(),
pwd
);
req
.
log
out
(
);
}
catch
(
ServletException
e
)
{
}
catch
(
ServletException
e
)
{
logger
.
warn
(
"Log
in failed for invite user "
+
usr
,
e
);
logger
.
warn
(
"Log
ging out previous user failed!"
,
e
);
}
}
}
}
try
{
req
.
login
(
usr
.
trim
().
toLowerCase
(),
pwd
);
}
catch
(
ServletException
e
)
{
logger
.
warn
(
"Login failed for invite user "
+
usr
,
e
);
}
}
}
public
String
createUser
()
{
public
String
createUser
()
{
...
@@ -151,9 +145,9 @@ public class InviteAcceptView extends GenericCDIView {
...
@@ -151,9 +145,9 @@ public class InviteAcceptView extends GenericCDIView {
user
=
null
;
user
=
null
;
if
(
isPlaceGroupMembership
())
if
(
isPlaceGroupMembership
())
return
"/place/myGroups
.jsf
"
;
return
"/place/myGroups"
;
else
else
return
"/index
.jsf
"
;
return
"/index"
;
}
}
super
.
addFaceMessage
(
"invite.userCreateSuccessfull"
);
super
.
addFaceMessage
(
"invite.userCreateSuccessfull"
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment