Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
6aefcade
Commit
6aefcade
authored
9 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-1590: better check input of the javascript auto completer
parent
7f312f07
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/admin/user/UserSearchFlexiController.java
+17
-17
17 additions, 17 deletions
...n/java/org/olat/admin/user/UserSearchFlexiController.java
with
17 additions
and
17 deletions
src/main/java/org/olat/admin/user/UserSearchFlexiController.java
+
17
−
17
View file @
6aefcade
...
@@ -26,7 +26,7 @@ import java.util.List;
...
@@ -26,7 +26,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
import
org.olat.basesecurity.BaseSecurity
Manager
;
import
org.olat.basesecurity.BaseSecurity
;
import
org.olat.basesecurity.BaseSecurityModule
;
import
org.olat.basesecurity.BaseSecurityModule
;
import
org.olat.basesecurity.events.SingleIdentityChosenEvent
;
import
org.olat.basesecurity.events.SingleIdentityChosenEvent
;
import
org.olat.core.gui.UserRequest
;
import
org.olat.core.gui.UserRequest
;
...
@@ -112,6 +112,8 @@ public class UserSearchFlexiController extends FlexiAutoCompleterController {
...
@@ -112,6 +112,8 @@ public class UserSearchFlexiController extends FlexiAutoCompleterController {
@Autowired
@Autowired
private
UserManager
userManager
;
private
UserManager
userManager
;
@Autowired
@Autowired
private
BaseSecurity
securityManager
;
@Autowired
private
BaseSecurityModule
securityModule
;
private
BaseSecurityModule
securityModule
;
/**
/**
...
@@ -247,23 +249,21 @@ public class UserSearchFlexiController extends FlexiAutoCompleterController {
...
@@ -247,23 +249,21 @@ public class UserSearchFlexiController extends FlexiAutoCompleterController {
@Override
@Override
protected
void
doFireSelection
(
UserRequest
ureq
,
List
<
String
>
res
)
{
protected
void
doFireSelection
(
UserRequest
ureq
,
List
<
String
>
res
)
{
// if we get the event, we have a result or an incorrect selection see OLAT-5114 -> check for empty
String
mySel
=
res
.
isEmpty
()
?
null
:
res
.
get
(
0
);
String
mySel
=
res
.
isEmpty
()
?
null
:
res
.
get
(
0
);
if
((
mySel
==
null
)
||
mySel
.
trim
().
equals
(
""
))
{
if
(
StringHelper
.
containsNonWhitespace
(
mySel
)
&&
StringHelper
.
isLong
(
mySel
))
{
getWindowControl
().
setWarning
(
translate
(
"error.search.form.notempty"
));
try
{
return
;
Long
key
=
Long
.
valueOf
(
mySel
);
}
if
(
key
>
0
)
{
Long
key
=
-
1
l
;
// default not found
Identity
chosenIdent
=
securityManager
.
loadIdentityByKey
(
key
);
try
{
if
(
chosenIdent
!=
null
)
{
key
=
Long
.
valueOf
(
mySel
);
fireEvent
(
ureq
,
new
SingleIdentityChosenEvent
(
chosenIdent
));
if
(
key
>
0
)
{
}
Identity
chosenIdent
=
BaseSecurityManager
.
getInstance
().
loadIdentityByKey
(
key
);
}
// No need to check for null, exception is thrown when identity does not exist which really
}
catch
(
NumberFormatException
e
)
{
// should not happen at all. Tell that an identity has been chosen
getWindowControl
().
setWarning
(
translate
(
"error.no.user.found"
));
fireEvent
(
ureq
,
new
SingleIdentityChosenEvent
(
chosenIdent
));
}
}
}
catch
(
NumberFormatException
e
)
{
}
else
{
getWindowControl
().
setWarning
(
translate
(
"error.
no.user.found"
));
getWindowControl
().
setWarning
(
translate
(
"error.
search.form.notempty"
));
}
}
}
}
...
@@ -434,7 +434,7 @@ public class UserSearchFlexiController extends FlexiAutoCompleterController {
...
@@ -434,7 +434,7 @@ public class UserSearchFlexiController extends FlexiAutoCompleterController {
* @return
* @return
*/
*/
private
List
<
Identity
>
searchUsers
(
String
login
,
Map
<
String
,
String
>
userPropertiesSearch
,
boolean
userPropertiesAsIntersectionSearch
)
{
private
List
<
Identity
>
searchUsers
(
String
login
,
Map
<
String
,
String
>
userPropertiesSearch
,
boolean
userPropertiesAsIntersectionSearch
)
{
return
BaseS
ecurityManager
.
getInstance
().
getVisibleIdentitiesByPowerSearch
(
return
s
ecurityManager
.
getVisibleIdentitiesByPowerSearch
(
(
login
.
equals
(
""
)
?
null
:
login
),
(
login
.
equals
(
""
)
?
null
:
login
),
userPropertiesSearch
,
userPropertiesAsIntersectionSearch
,
// in normal search fields are intersected
userPropertiesSearch
,
userPropertiesAsIntersectionSearch
,
// in normal search fields are intersected
null
,
null
,
null
,
null
,
null
);
null
,
null
,
null
,
null
,
null
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment