Makes sure that the correct file extension is attributed when importing
a file using the Google Drive repository based on the set configuration
values for the default import format settings.
Request additional offline access, allowing the repository to sign in
automatically each time, including across different user sessions, until
either the refresh token is invalidated or the user logs out of the
repository.
When files are copied into the system account's drive, they are put into
folders respecting the structure of contexts. Folder names were based on
context names only and so were likely to collide (such as with users
with the same name).
The patch ads context instance identifiers to the name so that they can
be identified more reliably.
We cannot use redirect() because is not compatible with
webservice/pluginfile.php
This script is defined as an AJAX_SCRIPT so redirections are not
allowed by redirect() function.
We need to ensure we use the correct oauth client to download files. This change
is the same as the one made to the onedrive repository where a usesystem flag
is added to the file reference if the file has been copied to the system account.
This introduces a new "controlled link" file type where the file is not
stored in Moodle - but Moodle will control the access permissions on the file.
Plugins can "freeze" a filearea which means Moodle will take ownership of all the remote
files of this type.
When accessing a file, if the "filebrowser" infomation indicates the current user can write to the file, they
will be granted temporary write access.
Part of MDL-58220
When linking - add the moodle account to the file and
organise it on the moodle side. Also allow read access with link,
but don't make any other changes to the perm/ownership.
Part of MDL-58220
Update core (repository & portfolio) to use autoload facilities,
getting rid of not-needed-anymore requires.
Clarify a bit the readme_moodle information and expected use.
Updated the various plugins to use OAuth 2.0 for authentication
against google apis. Google are phasing out AuthSub and pushing OAuth as
the replacement.
This changes repository_googledocs, repository_picasa,
portfolio_googledocs and portfolio_picasa
The token for requests is now stored in session rather than a user
prefence and it persists less but doesn't bother the user more than
necessary.
The google docs portfolio plugin is converted to use resumable upload
API as this appears to be what Google have replaced this with.
Unfortunately unlike authsub OAuth will require some setup by admins,
this is linked as a docs page.
1. Added tracker issue number in comment
2. Fixed stored_file::delete_reference()
3. repository::send_file() will throw exception if not implemented by subclass
4. Fixed renaming unit test, added one unit test for deleting original file
5. Fixed copyright statement for googledoc and picasa repository plugin
6. Implemented stored_file::set_filesize()