Skip to content

Commit

Permalink
MDL-54869 webservice: Fix core_user_add_user_private_files
Browse files Browse the repository at this point in the history
  • Loading branch information
jleyva committed Jul 5, 2016
1 parent 4608970 commit 6e7bf39
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions user/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -977,9 +977,9 @@ public static function add_user_private_files_parameters() {
* @since Moodle 2.6
*/
public static function add_user_private_files($draftid) {
global $CFG, $USER, $DB;
global $CFG, $USER;
require_once($CFG->libdir . "/filelib.php");

require_once($CFG->dirroot . "/user/lib.php");
$params = self::validate_parameters(self::add_user_private_files_parameters(), array('draftid' => $draftid));

if (isguestuser()) {
Expand All @@ -999,10 +999,9 @@ public static function add_user_private_files($draftid) {
$options = array('subdirs' => 1,
'maxbytes' => $maxbytes,
'maxfiles' => -1,
'accepted_types' => '*',
'areamaxbytes' => $maxareabytes);

file_save_draft_area_files($draftid, $context->id, 'user', 'private', 0, $options);
file_merge_files_from_draft_area_into_filearea($draftid, $context->id, 'user', 'private', 0, $options);

return null;
}
Expand Down

0 comments on commit 6e7bf39

Please sign in to comment.