Commit Graph

2532 Commits

Author SHA1 Message Date
Andrew Nicols ffc51ab3fd MDL-81525 core_user: Move after_complete_login to correct NS 2024-04-15 08:53:35 +08:00
Juan Leyva 7cec5c9b71 MDL-80332 login: New hooks for complete login and passed MFA 2024-03-25 15:56:01 +01:00
Paul Holden b6a66ef378 MDL-78311 core: fix host parameter type cleaning by IPv4 address. 2024-01-25 23:39:38 +00:00
Santosh Nagargoje a1cf1082b7 MDL-80333 Authentication: Fixed new login notification adhoc task 2024-01-10 15:28:44 +05:30
Jun Pataleta 38ed732727 Merge branch 'MDL-79761-403' of https://github.com/marinaglancy/moodle into MOODLE_403_STABLE 2023-12-07 08:54:00 +08:00
Marina Glancy d79ad5de6a MDL-79761 navigation: fix default setting during web installation 2023-12-04 13:06:06 +00:00
Meirza c2e8975523 MDL-76109 core: Don't check password policy for guest user
Besides adding the is_guest() check in the check_password_policy() condition,
I also changed the temporary user ID because the temporary user and
the guest must not share the same ID. Otherwise, it will raise an error.

Co-authored-by: Andrei Bautu <abautu@gmail.com>
2023-11-30 10:35:38 +07:00
Paul Holden dbc285e49e MDL-79996 communication: valid instance checks during user deletion. 2023-11-03 12:55:55 +00:00
Andrew Nicols 99c1543aa8 MDL-79581 communication: Context is a mandatory field
The API was incorrectly assuming that all uses of the API were for a
course, and that the instanceid of the communication instance was a
course id. These assumptions are both entirely wrong.

The API is intended to support a range of uses including use at the
site, user, and activity levels.

Furthermore, if a group were to be used, then the instanceid should be
of that group's id, and therefore the contextid would need to be fetched
or that group's course instead.

The only solution here is to add a new contextid field to the table, and
implement it all parts of the API.
2023-10-04 20:37:57 +08:00
Sara Arjona 89eae3a811 Merge branch 'MDL-79350-master' of https://github.com/daledavies/moodle 2023-09-28 07:47:55 +02:00
Sara Arjona cc9430929d MDL-77708 docs: Update references from docs.moodle.org/dev 2023-09-26 10:30:19 +02:00
Dale Davies 06a9b91e17 MDL-79350 core: Do not store lang in session when readonly 2023-09-18 14:30:14 +01:00
sam marshall 0f8577784d MDL-78467 core_cache: Improve cache locking API
* Makes it possible to safely call acquire_lock so that it throws an
  exception instead of returning false if it can't get a lock (which
  most existing uses assumed it already does).
* Fix some omissions from the requirelockingbeforewrite option (it
  now checks on delete).
* Modinfo uses a versioned cache, so it is not necessary to delete
  items, only increase the version. (Provided we keep track of
  cacherev carefully...)
2023-09-14 09:28:10 +01:00
Stevani Andolo dbf83c72c7 MDL-70371 core: Defined password length
1. Modified the password related forms
2. Added a new constant in moodlelib.php called MAX_PASSWORD_CHARACTERS
3. Added a new method in moodlelib.php called exeeds_password_length
4. Updated the upgrade.text
2023-09-07 12:29:10 +08:00
Matt Porritt 1560be7b7e MDL-67774 Authentication: Specify password peppers in config.php
Add a pepper to the users supplied password.
The pepper is stored in CFG and user to add extra security to
the password hash. By effectively breaking the information to
create the hashed password into two and storing it in more
than one place.
2023-09-06 13:47:51 +10:00
Jun Pataleta 2e7b5475a7 Merge branch 'MDL-79017' of https://github.com/paulholden/moodle 2023-08-31 20:32:17 +08:00
Andrew Nicols fa05f66052 Merge branch 'MDL-74810-master' of https://github.com/junpataleta/moodle 2023-08-29 11:12:35 +08:00
Huong Nguyen 59bed31f53 Merge branch 'master_MDL-67390' of https://github.com/mattporritt/moodle 2023-08-28 16:21:35 +07:00
Jun Pataleta ec90b342da MDL-74810 core: get_time_interval_string() improvements
* Add parameter to drop zero time units. So a time interval like
  "3d 0h 0s" will be returned as "3d" only.
* Add parameter to display full format for time units. E.g. Instead of
  "3d 2h", it will be returned as "3 days 2 hours"
* Deprecate unused dateintervaldayshoursmins langconfig string.
2023-08-28 16:40:36 +08:00
Matt Porritt 07af783b9a MDL-67390 Authentication: Update password hashing to SHA-512
Replace the bcrypt password hashing algorithm with SHA-512.
Existing bcrypt hashes will be updated to SHA-512 when a user
logs in next. Support for old md5 hashes has been removed.
Any reamining md5 hashes are replaced with SHA-512 hashes
from strong random passwords.
2023-08-25 11:53:54 +10:00
Jun Pataleta 29ec472284 Merge branch 'MDL-53368-master-3' of https://github.com/HuongNV13/moodle 2023-08-24 22:51:26 +08:00
Huong Nguyen 0cd29afb6f MDL-53368 core_auth: Implement reCaptcha on login page 2023-08-24 15:18:31 +07:00
Ilya Tregubov e4a1ca2f34 Merge branch 'MDL-78630-master' of https://github.com/cameron1729/moodle 2023-08-24 09:46:47 +08:00
Paul Holden ae57526ed0 MDL-79017 core: re-factor method to unserialize array.
We can use the existing helper for object unserialization as the
base for this method, rather than manual string parsing.
2023-08-21 20:29:36 +01:00
Ilya Tregubov d7461c9eff Merge branch 'master_MDL-78698' of https://github.com/mattporritt/moodle 2023-08-17 09:13:18 +02:00
Cameron Ball 230fcddd62 MDL-78630 auth: Display lock/unlock messages 2023-08-15 10:59:09 +08:00
raortegar 058b830b07 MDL-74289 lib: Improve the proxy bypass matching 2023-08-10 18:31:44 +07:00
Matt Porritt 2772b2b9dc MDL-78698 Libraries: Deprecate random_bytes_emulate function
Since PHP 7.0 the random_bytes() is nativley available and Moodle
LMS requires greater than PHP 7, the native PHP funciton can be
used exclusively. Deprecating random_bytes_emulate.
2023-08-08 12:35:00 +10:00
Petr Skoda 48df84a4a3 MDL-78525 core: fix word and character counting 2023-07-14 08:44:41 +02:00
Jun Pataleta 14d37a274e Merge branch 'MDL-74893-master-fix_auto_login_guest' of https://github.com/praxisdigital/moodle 2023-07-06 09:14:29 +08:00
Petr Skoda 3c25ccdcd1 MDL-78552 core: tidy up MDL_PERF constants
* all constans usable in ABORT_AFTER_CONFIG should be always defined
* MDL_PERFDB and $PERF->logwrites not used after legacy log removal
* MDL_PERF_TEST should be documented in codebase
* deprecated warnings in shutdowb manager
2023-06-25 08:39:09 +02:00
Anders Rasmussen 0c188eefc8 MDL-74893 authentication: Fix auto-login guest
Fixed auto-login as guest, when Guest login button is hidden
2023-06-19 07:52:03 +02:00
Andrew Nicols 7de0cb32d1 Merge branch 'MDL-76838' of https://github.com/paulholden/moodle 2023-06-08 11:54:05 +08:00
Stevani Andolo 429c403c3f MDL-78215 core: support checking if 0.0.0.0 is in subnet 2023-06-08 09:36:00 +08:00
Sara Arjona 1d2e8bcc33 Merge branch 'MDL-76936' of https://github.com/HirotoKagotani/moodle 2023-06-06 11:22:08 +02:00
Jun Pataleta ac0767cac4 Merge branch 'MDL-77353_Master' of https://github.com/catalyst/moodle-MDL-76126 2023-05-24 20:18:59 +08:00
Nathan Nguyen f897ecd627 MDL-77353 core_user: new functions
New functions:
    * `core_user::get_profile_picture` for retrieving user picture.
    * `core_user::get_profile_url` for retrieving profile url.
    * `core_user::get_fullname` for retrieving user full name.

Note: the context is not used as this stage. It will be used by "User Disguises" plugin, which will be implemented later.
2023-05-24 13:05:02 +10:00
Paul Holden 3bfb7f759a MDL-76838 backup: remove invalid utf8 code sequences writing XML.
The surrogate blocks FFFE and FFFF are non-characters, specifically
disallowed in the character range for XML documents.
2023-05-22 21:04:02 +01:00
Petr Skoda 99a7a7c782 MDL-74954 core: add Hooks based on PSR-14 2023-05-20 11:03:46 +02:00
Safat ab3c78e873 MDL-77576 core_user: Update room membership on user update
This commit implements the communication api updates
when a user is updated. It handles the room membership
when a user is suspended and deleted.

Originally implemented as MDL-76703.

Co-authored-by: David Woloszyn <david.woloszyn@moodle.com>
Co-Authored-By: Safat Shahin <safat.shahin@moodle.com>
2023-05-11 13:35:16 +10:00
Safat ad5c10016a MDL-77576 core_course: Implement communication api
This commit implements the core communication api in the
core course to create or update matrix roomand its members
according to course settings. This commit will add the
communicaiton room in the course so that users can access
communication room from course.

Originally implemented as MDL-76702, MDL-76705 and MDL-76703.

Co-Authored-By: David Woloszyn <david.woloszyn@moodle.com>
Co-Authored-By: Safat Shahin <safat.shahin@moodle.com>
2023-05-11 13:35:16 +10:00
Marina Glancy 8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Peter Burnett 027c770eab MDL-65471 upgrade: framework to reduce maintenance mode 2023-04-06 11:38:26 +10:00
fcbsd e2d138f250 MDL-77365 count_words: Make span> an inline tag 2023-03-06 10:59:44 +00:00
Andrew Nicols 43962ec9ce Merge branch 'MDL-72559-master' of https://github.com/keevan/moodle 2023-02-09 10:17:12 +08:00
Hiroto Kagotani dcc8d93533 MDL-76936 course: purge course cache on resetting start date 2023-01-19 00:37:29 +09:00
Kevin Pham 0072559aa7 MDL-72559 cache: core/plugin_functions cache can be local
Co-Authored-By: Tim Hunt <T.J.Hunt@open.ac.uk>
2023-01-16 16:29:48 +11:00
Eloy Lafuente (stronk7) 7827edc78d MDL-76537 core: Fix date_format_string() to work with php-intl
With Moodle 4.1 and up, we have stopped to work with strftime(),
because it's deprecated for PHP 8.1 and up and, instead we are
using core_date::strftime() that performs the conversions using
the php-intl extension.

The original strftime() had a lot of OS-specific dependencies,
both about locale names and charsets used to provide the information.

Instead, the php-intl gets rid of all those OS-specific nightmares
and only uses ICU/Unicode locales and UTF-8.

Because of that, the old utf-8 => windows charset => utf-8
conversions aren't needed anymore. Hence, removing them.
2023-01-13 09:57:28 +01:00
Tim Hunt 192f993906 MDL-76649 quiz statistics task: output more useful trace info
At the moment, quiz_statistics\task\recalculate gives no useful
information about what it is doing, which makes it hard to investigate
if the task fails. This commit makes it more usefully verbose.

Also, following this change, one instance of this task will not
run for more than one hour at a time.

As part of this commit, I have added a new helper mtrace_exception.
to consistently log exceptions in scheduled tasks. It is sad to
add a new function to moodlelib.php, but that seemed the logical place.
Looking at other tasks, this method is badly needed. Many are just
logging the ->getMessage() which is normaly insufficient for proper
debugging. However, swiching all existing tasks to use the new function
will need to wait for a future MDL.
2023-01-09 13:26:41 +00:00
Noemie Ariste 60d3823bec MDL-60038 moodlelib: ignore site policy if user auth type = 'webservice' 2022-12-23 10:11:11 +13:00