Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-tool_lifecycle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-tool_lifecycle
Commits
22e57579
Commit
22e57579
authored
5 years ago
by
Justus Dieckmann
Committed by
Tobias Reischmann
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Rebase onto 2nd-level-namespace
parent
91cb8680
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
classes/privacy/provider.php
+9
-8
9 additions, 8 deletions
classes/privacy/provider.php
tests/privacy_test.php
+5
-8
5 additions, 8 deletions
tests/privacy_test.php
with
14 additions
and
16 deletions
classes/privacy/provider.php
+
9
−
8
View file @
22e57579
...
...
@@ -24,14 +24,15 @@
namespace
tool_lifecycle\privacy
;
use
context
;
use
context_system
;
use
core_privacy
\local\metadata\collection
;
use
core_privacy\local\request\approved_contextlist
;
use
core_privacy\local\request\approved_userlist
;
use
core_privacy
\local\request\context
;
use
core_privacy
\local\request\contextlist
;
use
core_privacy
\local\request\userlist
;
use
core_privacy
\local\request\writer
;
use
tool_lifecycle\manager\step_manager
;
use
tool_lifecycle\
local\
manager\step_manager
;
defined
(
'MOODLE_INTERNAL'
)
||
die
();
...
...
@@ -95,7 +96,7 @@ class provider implements
public
static
function
export_user_data
(
approved_contextlist
$contextlist
)
{
global
$DB
;
foreach
(
$contextlist
->
get_contexts
()
as
$context
)
{
if
(
$context
instanceof
\
context_system
)
{
if
(
$context
instanceof
context_system
)
{
$records
=
$DB
->
get_records
(
'tool_lifecycle_action_log'
,
array
(
'userid'
=>
$contextlist
->
get_user
()
->
id
));
$writer
=
writer
::
with_context
(
$contextlist
->
current
());
foreach
(
$records
as
$record
)
{
...
...
@@ -114,9 +115,9 @@ class provider implements
*
* @param context $context The specific context to delete data for.
*/
public
static
function
delete_data_for_all_users_in_context
(
\
context
$context
)
{
public
static
function
delete_data_for_all_users_in_context
(
context
$context
)
{
global
$DB
;
if
(
$context
instanceof
\
context_system
)
{
if
(
$context
instanceof
context_system
)
{
$sql
=
"UPDATE
{
tool_lifecycle_action_log
}
SET userid = -1"
;
$DB
->
execute
(
$sql
);
...
...
@@ -131,7 +132,7 @@ class provider implements
public
static
function
delete_data_for_user
(
approved_contextlist
$contextlist
)
{
global
$DB
;
foreach
(
$contextlist
->
get_contexts
()
as
$context
)
{
if
(
$context
instanceof
\
context_system
)
{
if
(
$context
instanceof
context_system
)
{
$sql
=
"UPDATE
{
tool_lifecycle_action_log
}
SET userid = -1
WHERE userid = :userid"
;
...
...
@@ -147,7 +148,7 @@ class provider implements
*/
public
static
function
get_users_in_context
(
userlist
$userlist
)
{
$context
=
$userlist
->
get_context
();
if
(
$context
instanceof
\
context_system
)
{
if
(
$context
instanceof
context_system
)
{
$sql
=
"SELECT userid
FROM
{
tool_lifecycle_action_log
}
"
;
$userlist
->
add_from_sql
(
'userid'
,
$sql
,
array
());
...
...
@@ -162,7 +163,7 @@ class provider implements
public
static
function
delete_data_for_users
(
approved_userlist
$userlist
)
{
global
$DB
;
$context
=
$userlist
->
get_context
();
if
(
$context
instanceof
\
context_system
)
{
if
(
$context
instanceof
context_system
)
{
list
(
$insql
,
$params
)
=
$DB
->
get_in_or_equal
(
$userlist
->
get_userids
());
$sql
=
"UPDATE
{
tool_lifecycle_action_log
}
SET userid = -1
...
...
This diff is collapsed.
Click to expand it.
tests/privacy_test.php
+
5
−
8
View file @
22e57579
...
...
@@ -27,21 +27,18 @@ defined('MOODLE_INTERNAL') || die();
global
$CFG
;
use
core_privacy\local\request\approved_userlist
;
use
core_privacy\local\request\content_writer
;
use
core_privacy
\local\request\userlist
;
use
core_privacy
\local\request\writer
;
use
core_privacy\tests\provider_testcase
;
use
core_privacy\tests\request\approved_contextlist
;
use
tool_lifecycle
\action
;
use
tool_lifecycle\entity\step_subplugin
;
use
tool_lifecycle
\entity\workflow
;
use
tool_lifecycle\manager\interaction_manager
;
use
tool_lifecycle\manager\process_manager
;
use
tool_lifecycle\manager\step_manager
;
use
tool_lifecycle\manager\workflow_manager
;
use
tool_lifecycle\local\entity\step_subplugin
;
use
tool_lifecycle
\local\entity\workflow
;
use
tool_lifecycle\local\manager\interaction_manager
;
use
tool_lifecycle\local\manager\step_manager
;
use
tool_lifecycle\local\manager\workflow_manager
;
use
tool_lifecycle
\privacy\provider
;
use
tool_lifecycle
\processor
;
use
tool_lifecycle\task\lifecycle_task
;
/**
* Tests Privacy Implementation
...
...
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