Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
cc3af3c7
Commit
cc3af3c7
authored
Feb 22, 2018
by
Cecilia Vela Gurovic
Committed by
Gerrit Code Review
Feb 22, 2018
Browse files
Merge "Bug 1733963: Remove users from groups if added after group deleted"
parents
63f9875d
55d17eec
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/db/upgrade.php
View file @
cc3af3c7
...
@@ -5717,5 +5717,18 @@ function xmldb_core_upgrade($oldversion=0) {
...
@@ -5717,5 +5717,18 @@ function xmldb_core_upgrade($oldversion=0) {
execute_sql
(
"DELETE FROM
{
config
}
WHERE field = ?"
,
array
(
'alwaysallowselfdelete'
));
execute_sql
(
"DELETE FROM
{
config
}
WHERE field = ?"
,
array
(
'alwaysallowselfdelete'
));
}
}
if
(
$oldversion
<
2018021601
)
{
log_debug
(
'Remove auto-added users from deleted groups if added post deletion'
);
if
(
$records
=
get_records_sql_array
(
"SELECT id, SUBSTR(name, POSITION('.deleted.' IN name) + LENGTH('.deleted.')) AS deltime
FROM
{
group
}
WHERE deleted = 1"
))
{
foreach
(
$records
as
$key
=>
$record
)
{
if
(
is_numeric
(
$record
->
deltime
))
{
$timestamp
=
date
(
'Y-m-d H:i:s'
,
$record
->
deltime
);
delete_records_sql
(
'DELETE FROM {group_member} WHERE "group" = ? AND ctime >= ?'
,
array
(
$record
->
id
,
$timestamp
));
}
}
}
}
return
$status
;
return
$status
;
}
}
htdocs/lib/version.php
View file @
cc3af3c7
...
@@ -16,7 +16,7 @@ $config = new stdClass();
...
@@ -16,7 +16,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/wiki/Developer_Area/Version_Numbering_Policy
// 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.
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config
->
version
=
201802160
0
;
$config
->
version
=
201802160
1
;
$config
->
series
=
'18.04'
;
$config
->
series
=
'18.04'
;
$config
->
release
=
'18.04dev'
;
$config
->
release
=
'18.04dev'
;
$config
->
minupgradefrom
=
2015030409
;
$config
->
minupgradefrom
=
2015030409
;
...
...
Write
Preview
Supports
Markdown
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