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 0b8de71d
authored
Jan 15, 2015
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor findbugs stuff
1 parent
ba2d0e50
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
7 deletions
.gitignore
code/moya-beans/ejbModule/fi/codecrew/moya/beans/PlaceBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/QueueBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/RestBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beanutil/LdapUserHandler.java
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/user/ImportView.java
.gitignore
View file @
0b8de71
...
@@ -13,3 +13,4 @@
...
@@ -13,3 +13,4 @@
/code/*/target/
/code/*/target/
/code/*/test-output/
/code/*/test-output/
moya-git.properties
moya-git.properties
*/*/bin
code/moya-beans/ejbModule/fi/codecrew/moya/beans/PlaceBean.java
View file @
0b8de71
...
@@ -248,8 +248,8 @@ public class PlaceBean implements PlaceBeanLocal {
...
@@ -248,8 +248,8 @@ public class PlaceBean implements PlaceBeanLocal {
}
}
}
else
{
}
else
{
List
<
PlaceSlot
>
slots
=
placeSlotFacade
.
findFreePlaceSlotsForProduct
(
user
,
place
.
getProduct
());
List
<
PlaceSlot
>
slots
=
placeSlotFacade
.
findFreePlaceSlotsForProduct
(
user
,
place
.
getProduct
());
logger
.
info
(
"Found free slots {} for user {}"
,
Arrays
.
asList
(
slots
.
toArray
()),
user
);
if
(
slots
!=
null
&&
!
slots
.
isEmpty
())
{
if
(
slots
!=
null
&&
!
slots
.
isEmpty
())
{
logger
.
info
(
"Found free slots {} for user {}"
,
Arrays
.
asList
(
slots
.
toArray
()),
user
);
PlaceSlot
slot
=
slots
.
get
(
0
);
PlaceSlot
slot
=
slots
.
get
(
0
);
logger
.
warn
(
"Reserving place {} with placeslot {}"
,
place
,
slot
);
logger
.
warn
(
"Reserving place {} with placeslot {}"
,
place
,
slot
);
slot
.
setPlace
(
place
);
slot
.
setPlace
(
place
);
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/QueueBean.java
View file @
0b8de71
...
@@ -251,9 +251,9 @@ public class QueueBean implements QueueBeanLocal {
...
@@ -251,9 +251,9 @@ public class QueueBean implements QueueBeanLocal {
if
(!
permbean
.
isCurrentUser
(
user
)
&&
!
permbean
.
hasPermission
(
MapPermission
.
MANAGE_OTHERS
))
if
(!
permbean
.
isCurrentUser
(
user
)
&&
!
permbean
.
hasPermission
(
MapPermission
.
MANAGE_OTHERS
))
throw
new
RuntimeException
(
"Use "
+
permbean
.
getCurrentUser
()
+
"tried to enter to queue in behalf of another user: "
+
user
);
throw
new
RuntimeException
(
"Use "
+
permbean
.
getCurrentUser
()
+
"tried to enter to queue in behalf of another user: "
+
user
);
if
(
map
==
null
||
user
==
null
)
if
(
map
==
null
||
user
==
null
)
{
{
logger
.
warn
(
"Can not check map {}, user {}"
,
map
,
user
);
logger
.
warn
(
"Can not check map {}, user {}"
,
map
,
user
);
return
false
;
}
}
boolean
ret
=
getMapque
(
map
).
isReserving
(
user
);
boolean
ret
=
getMapque
(
map
).
isReserving
(
user
);
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/RestBean.java
View file @
0b8de71
...
@@ -107,6 +107,8 @@ public class RestBean implements RestBeanLocal {
...
@@ -107,6 +107,8 @@ public class RestBean implements RestBeanLocal {
if
(!
userRestAuths
.
containsKey
(
username
))
{
if
(!
userRestAuths
.
containsKey
(
username
))
{
userAuthMap
=
Collections
.
synchronizedMap
(
new
HashMap
<
String
,
Long
>());
userAuthMap
=
Collections
.
synchronizedMap
(
new
HashMap
<
String
,
Long
>());
userRestAuths
.
put
(
username
,
userAuthMap
);
userRestAuths
.
put
(
username
,
userAuthMap
);
}
else
{
userRestAuths
.
get
(
username
);
}
}
}
}
}
}
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beanutil/LdapUserHandler.java
View file @
0b8de71
...
@@ -167,9 +167,9 @@ public class LdapUserHandler {
...
@@ -167,9 +167,9 @@ public class LdapUserHandler {
while
(
searchAttrs
.
hasMore
())
{
while
(
searchAttrs
.
hasMore
())
{
Attribute
next
=
searchAttrs
.
next
();
Attribute
next
=
searchAttrs
.
next
();
logger
.
info
(
"Got {}, {}, {}"
,
new
Object
[]
{
next
.
getID
(),
next
.
get
(),
searchAttrs
.
hasMore
()
});
if
(
next
==
null
||
next
.
get
()
==
null
)
if
(
next
==
null
||
next
.
get
()
==
null
)
continue
;
continue
;
logger
.
info
(
"Got {}, {}, {}"
,
new
Object
[]
{
next
.
getID
(),
next
.
get
(),
searchAttrs
.
hasMore
()
});
List
<
String
>
resultList
=
resultAttrs
.
get
(
next
.
getID
());
List
<
String
>
resultList
=
resultAttrs
.
get
(
next
.
getID
());
if
(
resultList
==
null
)
{
if
(
resultList
==
null
)
{
...
@@ -326,11 +326,13 @@ public class LdapUserHandler {
...
@@ -326,11 +326,13 @@ public class LdapUserHandler {
}
}
public
boolean
authenticate
(
String
username
,
char
[]
passwd
)
{
public
boolean
authenticate
(
String
username
,
char
[]
passwd
)
{
if
(
username
==
null
||
passwd
==
null
||
username
.
isEmpty
())
{
return
false
;
}
String
pwd
=
new
String
(
passwd
);
String
pwd
=
new
String
(
passwd
);
if
(
username
==
null
||
passwd
==
null
||
username
.
isEmpty
()
||
pwd
.
isEmpty
())
{
if
(
pwd
.
isEmpty
())
{
return
false
;
return
false
;
}
}
InitialLdapContext
userCtx
=
null
;
InitialLdapContext
userCtx
=
null
;
try
{
try
{
String
userDn
=
buildUserRdn
(
username
);
String
userDn
=
buildUserRdn
(
username
);
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/user/ImportView.java
View file @
0b8de71
...
@@ -57,7 +57,7 @@ public class ImportView extends GenericCDIView {
...
@@ -57,7 +57,7 @@ public class ImportView extends GenericCDIView {
//
//
private
UploadedFile
file
;
private
UploadedFile
file
;
private
ArrayList
<
ImportWrapper
>
users
;
private
ArrayList
<
ImportWrapper
>
users
;
private
Charset
UTF8
=
Charset
.
forName
(
"UTF8"
);
private
static
final
Charset
UTF8
=
Charset
.
forName
(
"UTF8"
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ImportView
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ImportView
.
class
);
//
//
...
...
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