MDL-62413 tool_dataprivacy: Let users cancel data request made for them
authorJun Pataleta <jun@moodle.com>
Sat, 12 May 2018 01:38:26 +0000 (09:38 +0800)
committerJun Pataleta <jun@moodle.com>
Sat, 12 May 2018 02:18:38 +0000 (10:18 +0800)
admin/tool/dataprivacy/classes/external.php

index 63f8ecb..6587c40 100644 (file)
@@ -96,8 +96,8 @@ class external extends external_api {
         self::validate_context($context);
 
         // Ensure the request exists.
-        $select = 'id = :id AND requestedby = :requestedby';
-        $params = ['id' => $requestid, 'requestedby' => $USER->id];
+        $select = 'id = :id AND (userid = :userid OR requestedby = :requestedby)';
+        $params = ['id' => $requestid, 'userid' => $USER->id, 'requestedby' => $USER->id];
         $requestexists = data_request::record_exists_select($select, $params);
 
         $result = false;