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
2b9216a5
Commit
2b9216a5
authored
12 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-351: fix user deletion doesn't complete if a course is corrupt
parent
3d1d8051
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/delete/service/UserFileDeletionManager.java
+24
-15
24 additions, 15 deletions
...at/admin/user/delete/service/UserFileDeletionManager.java
with
24 additions
and
15 deletions
src/main/java/org/olat/admin/user/delete/service/UserFileDeletionManager.java
+
24
−
15
View file @
2b9216a5
...
...
@@ -164,24 +164,31 @@ public class UserFileDeletionManager extends BasicManager implements UserDataDel
if
(
isLogDebugEnabled
())
logDebug
(
"process dir="
+
nodeDirs
[
nodeIndex
].
getAbsolutePath
());
String
currentNodeId
=
nodeDirs
[
nodeIndex
].
getName
();
if
(
isLogDebugEnabled
())
logDebug
(
"currentNodeId="
+
currentNodeId
);
ICourse
currentCourse
=
CourseFactory
.
loadCourse
(
Long
.
parseLong
(
currentCourseId
));
if
(
isTaskNode
(
currentCourse
,
currentNodeId
))
{
if
(
isLogDebugEnabled
())
logDebug
(
"found TACourseNode path="
+
nodeDirs
[
nodeIndex
].
getAbsolutePath
());
deleteUserDirectory
(
identity
,
nodeDirs
[
nodeIndex
]);
}
else
if
(
isProjectBrokerNode
(
currentCourse
,
currentNodeId
))
{
if
(
isLogDebugEnabled
())
logDebug
(
"found ProjectBrokerCourseNode path="
+
nodeDirs
[
nodeIndex
].
getAbsolutePath
());
// addional loop over project-id
File
[]
projectDirs
=
nodeDirs
[
nodeIndex
].
listFiles
();
for
(
int
projectIndex
=
0
;
projectIndex
<
projectDirs
.
length
;
projectIndex
++)
{
deleteUserDirectory
(
identity
,
projectDirs
[
projectIndex
]);
ICourse
currentCourse
=
null
;
try
{
currentCourse
=
CourseFactory
.
loadCourse
(
Long
.
parseLong
(
currentCourseId
));
}
catch
(
Exception
e
)
{
logError
(
"could not load course with resid="
+
currentCourseId
,
e
);
}
if
(
currentCourse
!=
null
)
{
if
(
isTaskNode
(
currentCourse
,
currentNodeId
))
{
if
(
isLogDebugEnabled
())
logDebug
(
"found TACourseNode path="
+
nodeDirs
[
nodeIndex
].
getAbsolutePath
());
deleteUserDirectory
(
identity
,
nodeDirs
[
nodeIndex
]);
}
else
if
(
isProjectBrokerNode
(
currentCourse
,
currentNodeId
))
{
if
(
isLogDebugEnabled
())
logDebug
(
"found ProjectBrokerCourseNode path="
+
nodeDirs
[
nodeIndex
].
getAbsolutePath
());
// addional loop over project-id
File
[]
projectDirs
=
nodeDirs
[
nodeIndex
].
listFiles
();
for
(
int
projectIndex
=
0
;
projectIndex
<
projectDirs
.
length
;
projectIndex
++)
{
deleteUserDirectory
(
identity
,
projectDirs
[
projectIndex
]);
}
}
else
{
logWarn
(
"found dropbox or returnbox and node-type is NO Task- or ProjectBroker-Type courseId="
+
currentCourseId
+
" nodeId="
+
currentNodeId
,
null
);
}
}
else
{
logWarn
(
"found dropbox or returnbox and node-type is NO Task- or ProjectBroker-Type courseId="
+
currentCourseId
+
" nodeId="
+
currentNodeId
,
null
);
}
}
}
}
}
}
}
private
boolean
isProjectBrokerNode
(
ICourse
currentCourse
,
String
currentNodeId
)
{
...
...
@@ -205,7 +212,8 @@ public class UserFileDeletionManager extends BasicManager implements UserDataDel
}
private
static
FilenameFilter
dropboxReturnboxFilter
=
new
FilenameFilter
()
{
public
boolean
accept
(
@SuppressWarnings
(
"unused"
)
File
dir
,
String
name
)
{
@Override
public
boolean
accept
(
File
dir
,
String
name
)
{
// don't add overlayLocales as selectable availableLanguages
// (LocaleStrings_de__VENDOR.properties)
if
(
name
.
equals
(
ReturnboxController
.
RETURNBOX_DIR_NAME
)
...
...
@@ -236,7 +244,8 @@ class UserFileFilter implements FilenameFilter {
this
.
username
=
username
;
}
public
boolean
accept
(
@SuppressWarnings
(
"unused"
)
File
dir
,
String
name
)
{
@Override
public
boolean
accept
(
File
dir
,
String
name
)
{
// don't add overlayLocales as selectable availableLanguages
// (LocaleStrings_de__VENDOR.properties)
if
(
name
.
equals
(
username
)
)
{
...
...
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