Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository 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
die_coolen_jungs
our_own_cloud_project
Commits
f021dad2
Commit
f021dad2
authored
11 years ago
by
Björn Schießle
Browse files
Options
Downloads
Patches
Plain Diff
remove user from cache if he was deleted successfully
parent
b0b76fe0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/user.php
+16
-9
16 additions, 9 deletions
lib/private/user.php
lib/private/user/manager.php
+14
-0
14 additions, 0 deletions
lib/private/user/manager.php
with
30 additions
and
9 deletions
lib/private/user.php
+
16
−
9
View file @
f021dad2
...
...
@@ -187,18 +187,25 @@ class OC_User {
public
static
function
deleteUser
(
$uid
)
{
$user
=
self
::
getManager
()
->
get
(
$uid
);
if
(
$user
)
{
$user
->
delete
();
$result
=
$user
->
delete
();
// We have to delete the user from all groups
foreach
(
OC_Group
::
getUserGroups
(
$uid
)
as
$i
)
{
OC_Group
::
removeFromGroup
(
$uid
,
$i
);
// if delete was successful we clean-up the rest
if
(
$result
)
{
// We have to delete the user from all groups
foreach
(
OC_Group
::
getUserGroups
(
$uid
)
as
$i
)
{
OC_Group
::
removeFromGroup
(
$uid
,
$i
);
}
// Delete the user's keys in preferences
OC_Preferences
::
deleteUser
(
$uid
);
// Delete user files in /data/
OC_Helper
::
rmdirr
(
OC_Config
::
getValue
(
'datadirectory'
,
OC
::
$SERVERROOT
.
'/data'
)
.
'/'
.
$uid
.
'/'
);
// Remove it from the Cache
self
::
getManager
()
->
delete
(
$uid
);
}
// Delete the user's keys in preferences
OC_Preferences
::
deleteUser
(
$uid
);
// Delete user files in /data/
OC_Helper
::
rmdirr
(
OC_Config
::
getValue
(
'datadirectory'
,
OC
::
$SERVERROOT
.
'/data'
)
.
'/'
.
$uid
.
'/'
);
return
true
;
}
else
{
return
false
;
...
...
This diff is collapsed.
Click to expand it.
lib/private/user/manager.php
+
14
−
0
View file @
f021dad2
...
...
@@ -118,6 +118,20 @@ class Manager extends PublicEmitter {
return
(
$user
!==
null
);
}
/**
* remove deleted user from cache
*
* @param string $uid
* @return bool
*/
public
function
delete
(
$uid
)
{
if
(
isset
(
$this
->
cachedUsers
[
$uid
]))
{
unset
(
$this
->
cachedUsers
[
$uid
]);
return
true
;
}
return
false
;
}
/**
* Check if the password is valid for the user
*
...
...
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