150 Commits

Author SHA1 Message Date
Mihail Geshoski
540a9e35f2 MDL-74424 repository_googledocs: Update phpunit tests 2022-04-06 01:42:09 +08:00
Mihail Geshoski
63be4ed49f MDL-74424 repository_googledocs: Respect default import formats
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.
2022-04-06 01:23:51 +08:00
Eloy Lafuente (stronk7)
deb0e76eee MDL-73278 phpunit: Rename already namespaced classes to match file name
These are the only cases 100% safe to apply the renaming of the
testcase class names to match the file names.

All other cases are not safe, because they are missing namespace
and may enter into name conflicts. Adding namespaces is not as
simple as imagined because it implies to, also, add a good number
of modifications to core. See the issue for more details.
2021-12-07 23:54:29 +01:00
Paul Holden
8b2423c7a1 MDL-73054 repository_googledocs: avoid $OUTPUT use in data provider. 2021-11-22 22:29:12 +00:00
Mihail Geshoski
49ce037665 MDL-71470 repository_googledocs: Update unit tests 2021-04-28 16:30:27 +08:00
Mihail Geshoski
0ce519591b MDL-71470 repository_googledocs: Use file name in the source attribute
Instead of using the file title when generating the source attribute,
we should be using only the name of the Google Drive file in order to
avoid having the original extension within the filename after the file
is imported and added into Moodle.
2021-04-28 16:30:27 +08:00
Marina Glancy
0152fdbdff MDL-71017 oauth2: configure some oauth2 services for login only 2021-04-20 10:50:40 +02:00
Mihail Geshoski
5f4bdefc54 MDL-61768 repository_googledocs: Deprecate unused methods
Deprecates methods from the repository_googledocs class which are
no longer used.
2021-04-15 12:40:32 +08:00
Mihail Geshoski
6528181e72 MDL-61768 repository_googledocs: Add unit tests
Adds unit tests for the newly introduced methods related to the content
browsing and searching functionallity across drives.
2021-04-15 12:40:32 +08:00
Mihail Geshoski
54a850640d MDL-61768 repository_googledocs: Support shared drives
Enables the Google Drive repository to support browsing and searching
for content from the existing shared drives.
2021-04-15 12:40:32 +08:00
Mihail Geshoski
241e778ca7 MDL-61768 repository_googledocs: Rest API function to list shared drives
Adds a new rest API function in the googledocs repository which would
return the existing shared drives.
2021-04-15 11:06:11 +08:00
Eloy Lafuente (stronk7)
77342b96fc MDL-69308 upgrade: remove all the < 3.6.0 upgrade steps
This just deletes all the upgrade steps previous to 3.6.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2018120300 (v3.6.0) as anti-cheating measure.

Note that in this case, there wasn't any case of upgradelib
functions being used, hence we haven't to deprecate/remove
anything in codebase. When there is such a need, that is done
in separate commits (one for each function) and documented here.

See MDL-65809 commits for an example removing/deprecating a
good number of functions.
2021-01-13 19:11:19 +01:00
Jake Dallimore
255a910c92 MDL-59510 core_oauth2: autorefresh google drive, nextcloud and onedrive
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.
2020-10-05 09:19:29 +08:00
Eloy Lafuente (stronk7)
fbb0767536 MDL-69475 versions: bump all versions and requires in master
version = 2021052500 release version
requires= 2021052500 same than version

Why 20210525? (25th May 2021) ?

Because master is going to be Moodle 4.0, to be released
on November 2021. And, until then, we are going to have
a couple of "intermediate" releases:

- Moodle 3.10 to be released 9th November 2020. (2020110900)

  This version will be using versions from today to 2020110900
  (once it's released the YYYYMMDD part stops advancing).

- Moodle 3.11 to be released 10th May 2021. (2021051000)

  This version will be using versions from 3.10 release to 2021051000
  (once it's released the YYYYMMDD part stops advancing).

That means that all versions from today to 2021051000 are going
to be used by those 2 "intermediate" releases (3.10 and 3.11).

And we cannot use them in master, because it's forbidden to have
any overlapping of versions between branches (or different upgrade
paths will fail).

So, get that 2021051000, let's add it a couple of weeks to cover
the on-sync period (or a 2 weeks delay max!) and, the first version
that master can "own" in exclusive (without any overlap) is, exactly,
25th May 2021, hence our 20210525.
2020-08-18 00:47:15 +02:00
Eloy Lafuente (stronk7)
b764343e5a MDL-69044 upgrade: add 3.9.0 separation line to all upgrade scripts 2020-06-14 13:08:09 +02:00
Eloy Lafuente (stronk7)
115cc0214f MDL-68973 versions: bump all versions and requires near release
version = 2020061500 release version
requires= 2020060900 current rc1 (week7roll1) version
2020-06-09 16:23:09 +02:00
Sara Arjona
a26cfe71d3 MDL-65809 upgrade: clean < 3.5.0 upgrade steps
This just deletes all the upgrade steps previous to 3.5.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2018051700 (v3.5.0) as anti-cheating measure.

Previous commits have removed/deprecated all the upgradelib functions
not used anymore in codebase. Deletion has been documented in corresponding
upgrade.txt files:

- upgrade_fix_block_instance_configuration()
- upgrade_theme_is_from_family(), upgrade_find_theme_location()
and linkcoursesectionsupgradescriptwasrun setting
- upgrade_block_positions
- upgrade_fix_config_auth_plugin_names()
 and upgrade_fix_config_auth_plugin_defaults()
- format_xxx_upgrade_remove_numsections(), format_xxx_upgrade_hide_extra_sections()
and format_xxx_upgrade_add_empty_sections()
- filter_mathjaxloader_upgrade_cdn_cloudflare()
and filter_mathjaxloader_upgrade_mathjaxconfig_equal()
- get_assignments_with_rescaled_null_grades()

These have been kept because continue being used by restore:

- \core\task\refresh_mod_calendar_events_task
2019-12-20 12:20:43 +01:00
Eloy Lafuente (stronk7)
492d047d11 MDL-67284 upgrade: add 3.8.0 separation line to all upgrade scripts 2019-11-17 11:40:19 +01:00
Eloy Lafuente (stronk7)
d5be859063 MDL-67199 versions: bump all versions and requires near release
version = 2019111800 release version
requires= 2019111200 current beta (week7roll1) version
2019-11-12 17:57:08 +01:00
cescobedo
959457c392 MDL-57618 general: Remove strings deprecated in 3.3 2019-08-02 11:06:32 +02:00
Eloy Lafuente (stronk7)
3572a25cc3 MDL-65644 upgrade: add 3.7.0 separation line to all upgrade scripts 2019-05-20 19:35:05 +02:00
Eloy Lafuente (stronk7)
c9a1a6341c MDL-65571 versions: bump all versions and requires near release
version = 2019052000 release version
requires= 2019051100 current beta (week6roll2) version
2019-05-12 23:46:34 +02:00
Eloy Lafuente (stronk7)
a12207be25 MDL-63276 upgrade: clean < 3.2.0 upgrade steps
3.7 (min PHP 7.1) requires 3.2 (first version supporting PHP 7.1)

This just deletes all the upgrade steps previous to 3.2.0. Some
small adjustments, like adding missing MOODLE_INTERNAL or tweaking
globals can also be applied when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2016120500 (v3.2.0) as anti-cheating measure.

Next commit will get rid of/deprecate all the upgradelib functions
not used anymore in codebase. (note there isn't any this time).
2019-01-03 01:17:17 +01:00
Eloy Lafuente (stronk7)
f47c8f3525 MDL-64300 upgrade: add 3.6.0 separation line to all upgrade scripts 2018-12-02 18:36:40 +01:00
Eloy Lafuente (stronk7)
085353b315 MDL-64282 versions: bump all versions and requires near release
version = 2018120300 release version
requires= 2018112800 current rc2 (week7roll1) version
2018-11-29 18:24:08 +01:00
Tobias Reischmann
3e3e120d3a MDL-58943 oauth2: Added nextcloud to standard issuers
* New button allows to create standard issuer for nextcloud
* Since the endpoints url has to be https and nextcloud relys on the
baseurl to create the endpoints, the baseurl of issuers has now to be
https as well (or empty).
* Google's baseurl was changed to https (there was no reason not to),
whereas Facebook and Microsoft baseurls remain empty.
* In case of the creation of a nextcloud issuer, the baseurl is
required.
* Nextcloud requires the baseurl, therefore a parameter is added to
create_standard_issuer($type, $baseurl = false). That parameter not
required (or used) for anything but Nextcloud.
2018-10-31 10:42:58 +08:00
Michael Hawkins
580d1449d7 MDL-63538 repository_googledocs: Support removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-22 12:48:38 +02:00
Eloy Lafuente (stronk7)
00977e984e MDL-62478 upgrade: add 3.5.0 separation line to all upgrade scripts 2018-05-28 13:15:48 +02:00
Eloy Lafuente (stronk7)
57ea6753d3 MDL-62361 versions: bump all versions and requires near release
version = 2018051400 release version
requires= 2018050800 current beta+ (week4roll1) version
2018-05-09 02:46:30 +02:00
Zig Tan
b9118a7481 MDL-61568 repository_googledocs: Implement privacy providers 2018-04-18 13:40:34 +08:00
Eloy Lafuente (stronk7)
e4eba4c346 MDL-59159 upgrade: clean < 3.1.0 upgrade steps
LTS (3.5) requires previous LTS (3.1)

This just deletes all the upgrade steps previous to 3.1.0. Some
small adjustments, like adding missing MOODLE_INTERNAL or tweaking
globals can also be applied when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2016052300 (v3.1.0) as anti-cheating measure.

Next commit will get rid of/deprecate all the upgradelib functions
not used anymore in codebase.
2017-12-04 01:18:57 +01:00
Eloy Lafuente (stronk7)
6499085f36 MDL-60784 upgrade: add 3.4.0 separation line to all upgrade scripts 2017-11-12 18:43:30 +01:00
Eloy Lafuente (stronk7)
ba854606e6 MDL-60764 versions: bump all versions and requires near release
version = 2017111300 release version
requires= 2017110800 current rc2 version
2017-11-10 02:52:53 +01:00
David Mudrák
e0a903243b MDL-59505 oauth2: Fix storage of access controlled links
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.
2017-09-21 22:17:03 +02:00
Eloy Lafuente (stronk7)
29af7b0b4c MDL-57432 upgrade: clean < 3.0.0 upgrade steps
This just deletes all the upgrade steps previous to 3.0.0. Some
small adjustments, like adding missing MOODLE_INTERNAL or tweaking
globals can also be applied when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2015111600 (v3.0.0) as anti-cheating measure.

Next commit will get rid of/deprecate all the upgradelib functions
not used anymore in codebase.
2017-07-10 09:16:55 +01:00
Simey Lameze
fd8790d5cf MDL-59008 repository_googledocs: add method to serve login on a popup
This commit also add a new string logintoaccount to make the login
button more clear.
2017-07-03 13:41:58 +08:00
Eloy Lafuente (stronk7)
5e27228335 MDL-58933 upgrade: add 3.3.0 separation line to all upgrade scripts 2017-05-19 19:22:07 +02:00
Eloy Lafuente (stronk7)
d989ee1e03 MDL-58853 versions: bump all versions and requires near release
version = 2017051500 release version
requires= 2017050500 current rc1 version
2017-05-09 02:58:28 +02:00
Dan Poltawski
e18cd34bbb Merge branch 'MDL-58765-master' of git://github.com/damyon/moodle 2017-05-08 10:31:59 +01:00
Damyon Wiese
6a7552fe70 MDL-58765 repository: controlled links fix
If a file is selected as a controlled link, only copy it to the system account the first time
the form is saved.
2017-05-08 10:53:58 +08:00
Andrew Nicols
7167d25f5f Merge branch 'MDL-58823-master' of git://github.com/jleyva/moodle 2017-05-08 09:32:58 +08:00
Juan Leyva
fcdd7730bd MDL-58823 repository: Fix redirections to external files
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.
2017-05-05 10:04:51 +02:00
Dan Poltawski
bf39e7c7aa Merge branch 'MDL-58800-master' of git://github.com/damyon/moodle 2017-05-04 10:00:37 +01:00
Damyon Wiese
00879eca66 MDL-58800 repository_googledocs: Switch oauth clients
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.
2017-05-04 12:57:23 +08:00
Helen Foster
06d0aa4432 MDL-58749 lang: Merge English strings from the en_fix language pack
Significant string changes:

* errorinvalidbyhour,core_calendar - correcting number from 59 to 23
* cron_help,core_admin - updated recommendation to run cron every minute
* tour1_content_end, tour1_content_welcome, tour2_content_end,
  tour2_content_welcome all in tool_usertours - removing reference to
  3.2
* invalidsesskey,core_error and invalidsesskey,mod_wiki - more
  understandable error message
* pluginname_help and pluginnamesummary in qtype_essay - explaining that
  the question type can be used for file uploads
* formatnoinline, mustattach and mustrequire in qtype_essay - changing
  the word 'inline' to 'online'
2017-05-03 22:05:51 +02:00
Damyon Wiese
aa89bf2e6c MDL-58220 repo: Dont expect file info for any file
Some plugins do not implement the file info callback so expect and handle null in this case.
2017-04-03 13:43:27 +08:00
Damyon Wiese
33536fb2b7 MDL-58220 repositories: missing/disabled issuer
This makes the code checking for a missing / disabled issuer a bit cleaner.
2017-04-03 13:43:26 +08:00
Dan Poltawski
5afb4f0e50 MDL-58220 repository: prevent repo breaking when issuer doesn't exist 2017-04-03 13:43:26 +08:00
Damyon Wiese
eb47ad4a6e MDL-58220 repository: More docs / comments
More docs / comments for the reference_file_selected function used by controlled links.
2017-04-03 13:43:26 +08:00
Damyon Wiese
d5bb9f1ffc MDL-58334 repositories: Offline downloads
Support an optional param for offline downloads for repositories supporting external links (googledrive and skydrive).

Part of MDL-58220
2017-04-03 13:43:25 +08:00