1067 Commits

Author SHA1 Message Date
Jun Pataleta
0e01f68e3c Merge branch 'MDL-58899-master' of https://github.com/snake/moodle 2017-05-12 12:00:52 +08:00
Jake Dallimore
5ffe41b6c5 MDL-58899 auth: improve lang strings for confirmation failures in oauth 2017-05-12 11:45:36 +08:00
Andrew Nicols
95dd5e3bd6 MDL-58774 auth_oauth2: Only check unexpired accounts for same issuer
It shoudl be possible to link multiple OAuth2 sources which have the
same e-mail address to an account.

This patch makes the check for an existing linked account stricter so
that it only checks for linked account records which match the same
issuer, and which do not have expired confirmation tokens.
2017-05-12 09:44:48 +08:00
Dan Poltawski
e838654b4e Merge branch 'MDL-58877-master-enfix' of git://github.com/mudrd8mz/moodle 2017-05-10 12:01:08 +01:00
Helen Foster
0d86195e8d MDL-58877 lang: Merge English strings from the en_fix language pack
Significant string changes:

* loginerror_cannotcreateaccounts in auth_oauth2 - more understandable
  error message
* config_keep_groups_and_groupings and config_keep_roles_and_enrolments
  in core_backup - switch fix
2017-05-10 12:24:36 +02:00
Dan Poltawski
fd8d1648a7 Merge branch 'MDL-58836-master' of git://github.com/damyon/moodle 2017-05-10 06:56:42 +01:00
David Monllao
396ae85082 Merge branch 'MDL-58774-master' of git://github.com/damyon/moodle 2017-05-10 10:43:58 +08:00
Damyon Wiese
4f705f5d0d MDL-58774 auth_oauth2: Prevent duplicate linked logins 2017-05-10 10:17:56 +08: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
David Mudrák
2b948c204a MDL-58793 auth: Do not report migrated settings as new ones on upgrade
As a result of fixing the auth plugins config storage in MDL-12689, many
settings would be falsely reported as new ones by
admin/upgradesettings.php. We do not want to confuse admins so we try to
reduce the bewilderment by pre-populating the config_plugins table with
default values. This should be done only for disabled auth methods. The
enabled methods have their settings already stored, so reporting actual
new settings for them is valid.
2017-05-08 11:51:55 +02:00
David Mudrák
9f29e45e15 MDL-58793 auth: Fix invalid access to $this in settings.php files
It has never been guaranteed that settings.php would always be included
from inside the core\plugininfo\auth::load_settings() scope only.
Alternative fix would be to use $plugininfo->name but I think it is
better to be explicit here (same as we are explicit with setting names,
strings etc).
2017-05-08 11:47:29 +02:00
Damyon Wiese
406b92c6fd MDL-58836 auth: Improve backwards compatibility
Auth plugins with custom signup forms may not be using renderables / renderers - or
even if they are they may return a renderable that can only be rendered with the renderer from the auth
plugin.

This change checks if the signup form is a renderable - if so try the plugin renderer or fall back on the general renderer.
Otherwise call display() from the mform which is the previous way of rendering an mform.
2017-05-08 16:14:01 +08:00
Damyon Wiese
e0abc2e405 MDL-58774 auth_oauth2: Cleanup on user delete. 2017-05-08 14:26:44 +08:00
Jun Pataleta
1e324a4a88 Merge branch 'MDL-58749-master-enfix' of git://github.com/mudrd8mz/moodle 2017-05-04 14:45:08 +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
David Mudrák
31bd102316 MDL-58692 auth: Improve the migration of auth setting names
Some auth plugins used to have a mix of the legacy style of plugin names
in config_plugins table (such as 'auth/mnet') and the new correct
style (such as 'auth_mnet'). Attempting to rename the setting plugin via
low level SQL UPDATE could lead to duplicate key violation.

The patch introduces a new helper function to safely migrate the old
settings to the new ones, eventually informing the admin about the
values mismatch.
2017-05-03 12:02:43 +02:00
David Mudrák
1cb5c7b31f MDL-58631 auth: Clarify documentation of changes in loginpage_idp_list()
This should clarify the new 'iconurl' key returned by the auth plugin's
loginpage_idp_list() method.
2017-04-18 17:00:40 +02:00
David Monllao
bb17eafab0 Merge branch 'MDL-58478-master' of git://github.com/damyon/moodle 2017-04-17 14:44:39 +02:00
Martin Gauk
8abec10d55 MDL-58244 shibboleth: handle users who are logged out
If the user is (already) logged out, do not access $USER->auth and redirect him to the return URL.
2017-04-13 10:05:39 +00:00
Jun Pataleta
627ea5b10e MDL-58400 auth: New helper methods for identity providers
* get_identity_providers(): Retrieves available auth identity providers
* prepare_identity_providers_for_output(): Prepares auth identity
    provider data for output (e.g. to templates, WS, etc)
* Use these helpers for the login renderer
2017-04-10 11:12:03 +08:00
Jun Pataleta
7e4a4d30df NOBUG: Fixed file access permissions 2017-04-07 12:45:45 +08:00
David Monllao
2a69ffd212 MDL-12689 auth_shibboleth: No remote updates 2017-04-06 15:51:27 +02:00
David Monllao
6ef63c5920 MDL-12689 auth_cas: Default to English 2017-04-06 11:20:22 +02:00
Damyon Wiese
340659cc29 MDL-58220 auth_oauth2: Linked logins only 4U
You can only manage your own linked logins - never anyone elses.
2017-04-06 16:06:12 +08:00
Damyon Wiese
427fa27cf4 MDL-58220 auth_oauth2: Fix login domains
The login domains were checking the email of the moodle account, not the returned
email from oauth. Also after a failure, it was not killing the oauth session, which
prevents you trying again with a different account.
2017-04-06 11:35:02 +08:00
Damyon Wiese
0eb4c06645 MDL-58220 oauth2: Fix account linking
The username passed to the confirm account link request is the oauth username,
which may be different to the moodle username so can't be used to look up the user record.
2017-04-06 10:41:46 +08:00
Damyon Wiese
f331513347 MDL-58220 auth_oauth2: Fix for login via linked login
This was broken by the refactoring to always link logins. Some of the static
variables could also be removed but I'll do that in a later issue to keep this patch small.
2017-04-05 15:55:53 +08:00
Damyon Wiese
a647e7d762 MDL-58220 oauth2: missing param confirmtokenexpires 2017-04-05 14:42:22 +08:00
Damyon Wiese
6cee96c8af MDL-58220 oauth2: obey $CFG->authpreventaccountcreation 2017-04-05 12:52:32 +08:00
Dan Poltawski
5eff54929d Merge branch 'MDL-12689-master-fix1' of http://github.com/damyon/moodle 2017-04-04 07:51:05 +01:00
Damyon Wiese
46d5582ec9 MDL-58478 oauth2: Use real admin settings
This is an upgrade to real admin settings to comply with MDL-12689
2017-04-04 14:37:13 +08:00
Andrew Nicols
930cab683d Merge branch 'master' of https://github.com/koennys/moodle 2017-04-04 11:48:50 +08:00
Damyon Wiese
3615842625 MDL-12689 auth: No settings if ldap missing 2017-04-04 11:15:29 +08:00
David Monllao
b1e8f8bf37 MDL-12689 mod_data: Remove trailing whitespaces 2017-04-04 00:14:35 +02:00
David Monllao
fcada374ac Merge branch 'MDL-12689_m33v4' of https://github.com/sbourget/moodle 2017-04-04 00:08:50 +02:00
Stephen Bourget
037273d87e MDL-12689: convert auth plugins to use settings.php 2017-04-03 10:50:09 -04:00
Damyon Wiese
7b9f5b9986 MDL-58220 oauth2: Cleanup on user delete
Delete the linked logins for this user account when it is deleted.
2017-04-03 13:43:27 +08:00
Damyon Wiese
512e681a3b MDL-58220 oauth2: Don't login as deleted users
Also prevent sesskey error on first page of new logins.
2017-04-03 13:43:27 +08:00
Damyon Wiese
7f15866006 MDL-58220 oauth2: Use email as default username
And give better error messages.
2017-04-03 13:43:27 +08:00
Damyon Wiese
e25362a7db MDL-58220 auth: $OUTPUT -> $output
Don't use global $OUTPUT when there is a more specific renderer.
2017-04-03 13:43:26 +08:00
Damyon Wiese
c45d4b6a73 MDL-58220 oauth2: Change $OUTPUT to $this 2017-04-03 13:43:26 +08:00
Damyon Wiese
5b0b35c096 MDL-58220 oauth2: Add is_configured to issuer
Saves repeated checks for clientid and clientsecret.
2017-04-03 13:43:25 +08:00
Damyon Wiese
5aa0f0ae48 MDl-58220 auth_oauth2: Skip upgrade for new plugin 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
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
13b449f4a5 MDL-58220 oauth2: cibot cleanups 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
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