Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6a4d2c23
authored
Jan 28, 2015
by
Juho Salli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'assykorjailuja' into 'master'
Assykorjailuja pikafixei See merge request !226
2 parents
25e294c8
9ce826bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
5 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/BarcodeBean.java
code/moya-web/WebContent/vip/viplist.xhtml
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/shop/InviteAcceptView.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/BarcodeBean.java
View file @
6a4d2c2
...
...
@@ -101,7 +101,16 @@ public class BarcodeBean implements BarcodeBeanLocal {
@Override
public
String
getUserLongTextCode
(
EventUser
user
)
{
return
getUserTextCode
(
user
,
38
,
16
);
String
textcode
=
getUserTextCode
(
user
,
38
,
16
);
EventUser
user2
=
getUserFromLongTextCode
(
textcode
);
if
(!
user
.
equals
(
user2
))
throw
new
RuntimeException
(
"Koodigenerointivirhe"
);
// TODO: use seculogger or something
return
textcode
;
}
@Override
...
...
@@ -112,12 +121,19 @@ public class BarcodeBean implements BarcodeBeanLocal {
textcode
=
textcode
.
substring
(
textcode
.
lastIndexOf
(
"="
)+
1
);
}
return
getUserFromTextCode
(
textcode
,
38
,
16
);
return
getUserFromTextCode
(
textcode
,
38
,
16
);
}
@Override
public
String
getUserTextCode
(
EventUser
user
)
{
return
getUserTextCode
(
user
,
12
,
5
);
String
textcode
=
getUserTextCode
(
user
,
12
,
5
);
EventUser
user2
=
getUserFromTextCode
(
textcode
);
if
(!
user
.
equals
(
user2
))
throw
new
RuntimeException
(
"Koodigenerointivirhe"
);
return
textcode
;
}
...
...
@@ -174,11 +190,15 @@ public class BarcodeBean implements BarcodeBeanLocal {
BigInteger
numbercode
=
textcodeToNumber
(
textcode
,
bytecount
);
String
barcode
=
numbercode
.
toString
();
// remove random prefix
int
barcodeLenght
=
12
;
if
(
lenght
<
barcodeLenght
)
barcodeLenght
=
lenght
;
while
(
barcode
.
length
()
<
lenght
)
{
barcode
=
"0"
+
barcode
;
}
// remove some random -stuff to start of string
for
(
int
i
=
lenght
-
barcodeLenght
;
i
>
0
;
--
i
)
{
...
...
code/moya-web/WebContent/vip/viplist.xhtml
View file @
6a4d2c2
<?xml version='1.0' encoding='UTF-8' ?>
gitla
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:p=
"http://primefaces.org/ui"
>
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/shop/InviteAcceptView.java
View file @
6a4d2c2
...
...
@@ -109,6 +109,15 @@ public class InviteAcceptView extends GenericCDIView {
public
String
loginWithExisting
()
{
// email-login also to this view, basicly authView does this, but this acceptInvite... does not
String
userlogin
=
userbean
.
findUsernameByEmailUsername
(
username
.
trim
());
if
(
userlogin
!=
null
)
{
username
=
userlogin
;
}
EventUser
eu
=
userbean
.
acceptInviteForExistingUser
(
username
,
password
,
token
);
if
(
eu
!=
null
)
{
...
...
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