83498 Commits

Author SHA1 Message Date
Damyon Wiese
5aa0f0ae48 MDl-58220 auth_oauth2: Skip upgrade for new plugin 2017-04-03 13:43:25 +08:00
Damyon Wiese
8d90d29460 MDL-58220 oauth2: Use iputils to check domain
Allows wild cards and more strict checking against spec.
2017-04-03 13:43:25 +08:00
Damyon Wiese
4ab80291e7 MDL-58220 tool_oauth2: forms cleanup
Remove extra field length attributes and fix type of action fields.
2017-04-03 13:43:25 +08:00
Damyon Wiese
ae596d4a54 MDL-58220 auth_oauth2: Remove allow linked logins
This was already removed - I just missed some spots.
2017-04-03 13:43:25 +08:00
Damyon Wiese
5b926a6a09 MDL-58220 oauth2: Move help icons to table header
In the Site Administration -> Server -> OAuth 2 Services page.
2017-04-03 13:43:25 +08:00
Damyon Wiese
818e789a00 MDL-58220 oauth2: Remove extra step
Show create google/facebook/office365 buttons on the main page instead
of hiding them behind a click.
2017-04-03 13:43:25 +08:00
Damyon Wiese
4a32445dc9 MDL-58220 oauth2: use PARAM_RAW_TRIMMED
Client ID and secret and copy/pasted from elsewhere so trim them.
2017-04-03 13:43:25 +08:00
Damyon Wiese
bfc60d386d MDL-58220 auth_oauth: return false for non-oauth
Always return false for non-oauth logins.
2017-04-03 13:43:25 +08:00
Damyon Wiese
f59d81f487 MDL-58220 block_login: Update icon rendering of idp list 2017-04-03 13:43:25 +08:00
Damyon Wiese
13b449f4a5 MDL-58220 oauth2: cibot cleanups 2017-04-03 13:43:25 +08:00
Damyon Wiese
99e3c347f9 MDL-58220 oauth2: Minor cleanups
Fixes spotted by Jun in peer review.
2017-04-03 13:43:25 +08:00
Damyon Wiese
28b592d5a6 MDL-58338 oauth2: Force email confirmation
New accounts and linking a login to an existing account MUST go through email verification.
We cannot trust the emails we get from oauth providers have been confirmed.

Part of MDL-58220
2017-04-03 13:43:25 +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
Damyon Wiese
fa78244d17 MDL-58220 oauth2: Fix unit tests and add more 2017-04-03 13:43:25 +08:00
Damyon Wiese
092304a3de MDL-58220 oauth2: Cibot fixes
Missing phpdocs.
2017-04-03 13:43:25 +08:00
Damyon Wiese
738c4a2a73 MDL-58220 oauth2: More help buttons
Add help for system account connections and discovery.
2017-04-03 13:43:25 +08:00
Damyon Wiese
c21a66e40a MDL-58220 auth_oauth2: Restrict logins to a set of domains
This is set on the issuer, so you can have different lists for each oauth2 provider.
2017-04-03 13:43:25 +08:00
Damyon Wiese
979d1f66dd MDL-58220 auth_oauth2: Fix new account creation
This was not allowing new accounts to be registered.
2017-04-03 13:41:19 +08:00
Damyon Wiese
eca128bf47 MDL-58220 oauth2: Global enable/disable for issuers. 2017-04-03 13:41:19 +08:00
Damyon Wiese
6e0d700de8 MDL-58220 assign: Only show write access to teachers
In filebrowser api - this is also used by repositories using controlled links.
2017-04-03 13:41:19 +08:00
Damyon Wiese
ffda3e395c MDL-58127 skydrive: Upgrades to new oauth2
Support for controlled links workflow.

Part of MDL-58220
2017-04-03 13:41:19 +08:00
Damyon Wiese
af28b22892 MDL-58219 googledocs: Use google file extensions
Only rename on export for download.

Part of MDL-58220
2017-04-03 13:41:19 +08:00
Damyon Wiese
72643dc688 MDL-58219 googledocs: Update to new model for controlledlinks
Part of MDL-58220
2017-04-03 13:41:19 +08:00
Damyon Wiese
141ee541ca MDL-58219 repository: Change how controlled links work
Files are copied to the system user as soon as they are uploaded. Write access is then controlled when
serving links to the file.

Part of MDL-58220
2017-04-03 13:41:19 +08:00
Damyon Wiese
72fd103add MDL-58219 cibot: Fixes
Fixes for cibot warnings.

Part of MDL-58220
2017-04-03 13:41:19 +08:00
Damyon Wiese
dece386586 MDL-58219 oauth2: Fix unit tests because we changed the model
We added 2 fields to the model and we needed to update the tests.

I also removed some error_log from the rest client (very useful while developing)

Part of MDL-58220
2017-04-03 13:41:18 +08:00
Damyon Wiese
ec504d94f6 MDL-58219 googledocs: Fix upgrade script nesting
Part of MDL-58220
2017-04-03 13:41:18 +08:00
Damyon Wiese
3739559644 MDL-58219 workshop: Fix unit tests
The bug is caused by the new code to freeze the files in the fileareas when switching phases.

Part of MDL-58220
2017-04-03 13:41:18 +08:00
Damyon Wiese
39f60f6c00 MDL-58219 googledocs: Use a cache
Speed up folder operations with a simple cache.

Part of MDL-58220
2017-04-03 13:41:18 +08:00
Damyon Wiese
6da1c55ba8 MDL-58219 googledocs: Keep original name on copy
Also - only add writers to files that have been "claimed" (prevent_changes_to_external_files)

Part of MDL-58220
2017-04-03 13:41:18 +08:00
Damyon Wiese
2fad141006 MDL-58219 oauth2: Fix token upgrade problem with incremental auth
Part of MDL-58220
2017-04-03 13:41:18 +08:00
Damyon Wiese
28dddbc129 MDL-58219 oauth2: Show connected system account info
Show the username and email of the connected system account (if it ever requires refreshing - this will help identity the account
to re-authorise).

Part of MDL-58220
2017-04-03 13:41:18 +08:00
Damyon Wiese
1a1a09d8f8 MDL-58142 calendar: Add an obvious link to the help docs
Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
5823a27e7e MDL-58131 googledocs: Add manage url -> drive
Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
5ffaf17dad MDL-58168 oauth2: Check for new access code before checking scopes
Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
1dca8d1a1d MDL-58168 auth_oauth2: Allow linking other accounts
Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
151b0f9409 MDL-58132 repositories: Controlled link file type
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
2017-04-03 13:40:13 +08:00
Damyon Wiese
8ece1d70d8 MDL-58128 googledocs: Don't copy files
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
2017-04-03 13:40:13 +08:00
Damyon Wiese
989e14fea0 MDL-58128 googledocs: Support reference files.
Add options so the admin can control the types of files this repository can support (and the default).

Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
6c9cd495a2 MDL-58128 googledocs: Upgrade repo config
Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
d247a63dfa MDL-58128 oauth2: Add a scheduled task for refresh
We need to make sure our refresh tokens do not expire. We run a scheduled
task to update the refresh token once per hour.

Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
0e59638bdb MDL-58126 googledocs: Re-implement the google docs repo
Use latest REST API (v3) - but avoid the google client libraries
(too big, too much to update, not integrated with auth).

Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
299112498b MDL-58090 oauth2: Coding style
Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
870a4a824e MDL-58090 oauth2: Improve help
Provide a link to the help for setting up an OAuth 2 service.

Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
722a6d0881 MDL-58090 oauth2: Remove wrong tests from branch
Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
931c023468 MDL-58090 oauth2: Add unit tests
Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
f9f243f93e MDL-58090 oauth2: Complete phpdocs
Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
2b09b2daa3 MDL-58090 oauth2: Load and resave the DB files
Edit the DB files with XMLDB to detect/fix errors.

Part of MDL-58220
2017-04-03 13:40:12 +08:00
Damyon Wiese
dc4b56852a MDL-58090 oauth2: Do not install services by default
Instead provide buttons to quickly create pre-configured
versions of any of the known OAuth 2 services.

Part of MDL-58220
2017-04-03 13:40:12 +08:00
Damyon Wiese
237fd80cd2 MDL-58090 oauth2: API to get a system client
Request an oauth client with an access token retrieved with the stored refresh token from the OAuth issuer.

Part of MDL-58220
2017-04-03 13:39:45 +08:00