Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
ab83396c
Commit
ab83396c
authored
Jan 09, 2018
by
Robert Lyon
Committed by
Gerrit Code Review
Jan 09, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1734186: remove the username and email when deleting user"
parents
07f73600
31a5ceb2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
+12
-3
htdocs/lib/db/upgrade.php
htdocs/lib/db/upgrade.php
+8
-0
htdocs/lib/user.php
htdocs/lib/user.php
+3
-2
htdocs/lib/version.php
htdocs/lib/version.php
+1
-1
No files found.
htdocs/lib/db/upgrade.php
View file @
ab83396c
...
...
@@ -5553,5 +5553,13 @@ function xmldb_core_upgrade($oldversion=0) {
reload_html_filters
();
}
if
(
$oldversion
<
2018010300
)
{
$sql
=
"UPDATE
{
usr
}
SET username = CONCAT(MD5(username), 1000000 + id),
email = CONCAT(MD5(email), 1000000 + id)
WHERE deleted = 1 "
;
execute_sql
(
$sql
);
}
return
$status
;
}
htdocs/lib/user.php
View file @
ab83396c
...
...
@@ -1514,7 +1514,8 @@ function delete_user($userid) {
$deleterec
->
deleted
=
1
;
foreach
(
$fieldstomunge
as
$field
)
{
if
(
!
preg_match
(
'/\.deleted\.\d+$/'
,
$user
->
$field
))
{
$deleterec
->
$field
=
$user
->
$field
.
$datasuffix
;
$hash
=
md5
(
$user
->
$field
.
$datasuffix
)
.
(
1000000
+
$userid
);
$deleterec
->
$field
=
$hash
;
}
}
...
...
@@ -1622,7 +1623,7 @@ function delete_user($userid) {
/**
* Undeletes a user
*
* NOTE: changing their email addresses to re
mov
e the .deleted.timestamp part
* NOTE: changing their email addresses to re
plac
e the
field
.deleted.timestamp part
* has not been implemented yet! This function is not actually used anywhere in
* Mahara, so hasn't really been tested because of this. It's a simple enough
* job for the first person who gets there - see how delete_user works to see
...
...
htdocs/lib/version.php
View file @
ab83396c
...
...
@@ -16,7 +16,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/wiki/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config
->
version
=
201
71
10
6
00
;
$config
->
version
=
201
80
10
3
00
;
$config
->
series
=
'18.04'
;
$config
->
release
=
'18.04dev'
;
$config
->
minupgradefrom
=
2015030409
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment