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
53f460fe
Commit
53f460fe
authored
10 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
no-jira: hardened user import against misconfigured user properties handler
parent
0a821e63
No related branches found
No related tags found
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/imp/ImportStep00.java
+14
-3
14 additions, 3 deletions
src/main/java/org/olat/admin/user/imp/ImportStep00.java
with
14 additions
and
3 deletions
src/main/java/org/olat/admin/user/imp/ImportStep00.java
+
14
−
3
View file @
53f460fe
...
...
@@ -305,15 +305,26 @@ class ImportStep00 extends BasicStep {
}
boolean
isMandatoryField
=
um
.
isMandatoryUserProperty
(
usageIdentifyer
,
userPropertyHandler
);
if
(
isMandatoryField
&&
!
StringHelper
.
containsNonWhitespace
(
thisValue
))
{
textAreaElement
.
setErrorKey
(
"error.mandatory"
,
new
String
[]
{
String
.
valueOf
(
i
+
1
),
translate
(
userPropertyHandler
.
i18nFormElementLabelKey
())
});
String
label
=
""
;
if
(
userPropertyHandler
.
i18nFormElementLabelKey
()
!=
null
)
{
label
=
translate
(
userPropertyHandler
.
i18nFormElementLabelKey
());
}
textAreaElement
.
setErrorKey
(
"error.mandatory"
,
new
String
[]
{
String
.
valueOf
(
i
+
1
),
label
});
importDataError
=
true
;
break
;
}
// used for call-back value depending on PropertyHandler
ValidationError
validationError
=
new
ValidationError
();
if
(!
userPropertyHandler
.
isValidValue
(
null
,
thisValue
,
validationError
,
getLocale
()))
{
textAreaElement
.
setErrorKey
(
"error.lengthorformat"
,
new
String
[]
{
String
.
valueOf
(
i
+
1
),
translate
(
userPropertyHandler
.
i18nFormElementLabelKey
()),
translate
(
validationError
.
getErrorKey
(),
validationError
.
getArgs
())
});
String
error
=
"unkown"
;
String
label
=
""
;
if
(
userPropertyHandler
.
i18nFormElementLabelKey
()
!=
null
)
{
label
=
translate
(
userPropertyHandler
.
i18nFormElementLabelKey
());
}
if
(
validationError
.
getErrorKey
()
!=
null
)
{
error
=
translate
(
validationError
.
getErrorKey
(),
validationError
.
getArgs
());
}
textAreaElement
.
setErrorKey
(
"error.lengthorformat"
,
new
String
[]
{
String
.
valueOf
(
i
+
1
),
label
,
error
});
importDataError
=
true
;
break
;
}
...
...
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