Commit Graph

2322 Commits

Author SHA1 Message Date
Jake Dallimore
612b210d76 MDL-66147 core: add get_time_interval_string()
Returns a formatted string representation of the difference between two
timestamps, defaulting to 'Xd Xh Xm' format, but supporting custom
format strings containing any chars from:
https://www.php.net/manual/en/dateinterval.format.php.
2019-08-12 09:35:51 +08:00
Amaia Anabitarte
c7f88457cd MDL-61649 email: Send plain/html format emails based on user preference 2019-08-07 11:20:02 +08:00
[Peter Burnett]
ad9c96e531 MDL-66123 core: check_password_policy takes $user argument 2019-07-29 14:37:50 +10:00
Andrew Madden
907be50c42 MDL-65926 moodlelib: Convert username to lowercase prior to SQL query
Within a very large project, it was found that searching for a user with their username in the user table using a case insensitive
search was inefficient. Instead it is proposed that the username input is made to be lowercase prior to executing a database query
as the username for each user in the database must be lowercase. This allows for a case sensitive query to find the user data.
Essentially we are moving a case insensitive search for a user from SQL into PHP to increase performance.
2019-07-05 09:02:56 +10:00
Dan Marsden
22dfa6d31d MDL-60347 core: debugsmtp should be a developer only setting. 2019-07-01 12:15:05 +02:00
Nicolas Roeser
76a3cf95b7 MDL-64975 moodlelib: fix float formatting if decsep is ~ (tilde)
Commit 637da99edb has introduced changes
for removing trailing zeroes from the output of function format_float.
Due to a small omission, the function causes a PHP warning when the
string decsep is set to a tilde character ('~'). This is rarely the
case.

The bug lies in using PHP function preg_replace with a string that
contains external input (in this case, including decsep), but without
escaping it for PCRE processing.

This commit fixes the function to also support a tilde character in
string decsep. It also adds tests for having tilde as decimal separator.

Thanks-To:  Jake Dallimore <jake@moodle.com>
2019-06-14 13:05:39 +02:00
Brendan Heywood
1fc0c4bd4e MDL-58439 admin: Ignore guest logins for all admin pages 2019-06-11 13:44:58 +10:00
Andrew Nicols
ea00cdc79f Merge branch 'MDL-64394-accesslog' of https://github.com/brendanheywood/moodle 2019-05-03 08:49:33 +08:00
Jake Dallimore
3fd575b9f8 Merge branch 'MDL-64439-master' of https://github.com/ilya-catalyst/moodle 2019-05-02 14:47:39 +08:00
Adrian Greeve
f9da72b63e Merge branch 'MDL-65149-master' of git://github.com/damyon/moodle 2019-05-01 14:58:21 +08:00
Jake Dallimore
1ba1bb79e8 Merge branch 'MDL-65236-master' of git://github.com/marinaglancy/moodle 2019-05-01 14:23:16 +08:00
Shamim Rezaie
13230ed7f3 MDL-53140 core: Introduced PARAM_LOCALISEDFLOAT 2019-04-29 23:43:11 +10:00
Adrian Greeve
48fa567da2 Merge branch 'MDL-29318-master' of git://github.com/junpataleta/moodle 2019-04-18 13:48:33 +08:00
Marina Glancy
41653114b5 MDL-65236 core: allow to alias languages in the lang selector 2019-04-08 14:14:23 +02:00
Eloy Lafuente (stronk7)
40df718398 Merge branch 'MDL-65094-master' of git://github.com/rezaies/moodle 2019-04-04 22:32:52 +02:00
Sara Arjona
86c3df962f Merge branch 'MDL-64506' of git://github.com/Chocolate-lightning/moodle 2019-04-03 19:30:28 +02:00
Mathew May
5cac5fa428 MDL-64506 templates: BS2 m-x-x to BS4 mx-x 2019-04-03 19:47:11 +08:00
Paul Damiani
9ffbb78668 MDL-63569 email: New setting to prefix the subject of outgoing emails 2019-04-02 11:02:03 +11:00
Ilya Tregubov
5ebbe1c3ee MDL-64439 auth: Refresh $cm in require_login after pre_loginpage_hook. 2019-04-02 10:20:20 +11:00
Brendan Heywood
b940ca995a MDL-64394 core: Fixed bug when using access log with pre_loginpage_hook 2019-04-01 16:48:22 +11:00
Jun Pataleta
b858b16130 MDL-29318 core: Fixes for get_complete_user_data()
* Added email in the list of case-insensitive fields.
* New optional parameter $throwexception for \get_complete_user_data().
  If true, an exception will be thrown when there's no matching record
  found or when there are multiple records found for the given field
  value. If false, it will simply return false.
  Defaults to false when not set. This ensures that
  get_complete_user_data() fetches the correct user data.
2019-03-29 13:31:44 +08:00
Shamim Rezaie
0b23fad474 MDL-65094 registration: don't encourage registration if on localhost 2019-03-26 16:54:19 +11:00
Damyon Wiese
f65a888901 MDL-65149 emoticons: Do not show all emoticons
Allow some emoticons to still work, but not be selectable from the text editor plugins.
2019-03-22 10:05:25 +08:00
Julien Boulen
b1d1369dff MDL-46803 course: Prevent unenrol users with multiple roles during reset 2019-03-18 11:20:08 +01:00
Eloy Lafuente (stronk7)
f79881b8d0 Merge branch 'MDL-59298-master' of git://github.com/rezaies/moodle 2019-04-15 23:53:58 +02:00
Brendan Heywood
bf9f255523 MDL-60470 core: New hook 'after_require_login'
This adds a hook towards the end of the require_login function.
2019-04-16 03:39:20 +10:00
Marina Glancy
beff3806d6 MDL-10965 courses: capability to browse course list 2019-04-10 12:35:28 +02:00
Shamim Rezaie
4c00766e2a MDL-59298 auth_nologin: override get_password_change_info
Let the auth_nologin class to take care of its exceptional behaviour.
2019-04-08 18:53:06 +10:00
Shamim Rezaie
206ec32890 MDL-59298 auth: Added get_password_change_info to auth plugins 2019-04-08 18:43:22 +10:00
Andrew Nicols
a6a5685999 Merge branch 'MDL-64950-master-2' of git://github.com/junpataleta/moodle 2019-03-06 13:42:24 +08:00
Jun Pataleta
313f2be603 MDL-64950 core: Handle username in a case-insensitive fashion 2019-03-06 12:45:27 +08:00
Ryan Wyllie
93dda3bfd3 MDL-63786 core: set $CFG->forceclean for logged in as sessions
Turn on the forceclean config setting when a user is logged in as a
different user. This is a precautionary measure, which forces all
user submitted content to be cleaned of JavaScript before rendering
it to the logged in as user.
2019-03-05 04:24:53 +01:00
Julien Boulen
1a549472fa MDL-62728 lang: display a warning when missing some locales on server 2019-02-15 09:53:00 +01:00
Eloy Lafuente (stronk7)
fdb3de8a05 Merge branch 'MDL-64385-master' of git://github.com/aanabit/moodle 2019-02-11 12:35:26 +01:00
David Matamoros
7a0162f17a MDL-57898 core_course: add custom fields support to courses
This commit is part of work on Custom fields API,
to minimize commit history in moodle core the work of a team of developers was split
into several commits with different authors but the authorship of individual
lines of code may be different from the commit author.
2019-01-18 14:28:18 +01:00
Amaia Anabitarte
696bdd636d MDL-64385 user: Case insensitive comparison for email domains 2019-01-18 10:06:27 +01:00
Andrew Nicols
4b71596fc9 MDL-49399 task: Add task logging API 2019-01-16 12:14:25 +08:00
Damyon Wiese
fd25c7d5f8 MDL-64004 webservice: Do not update accesstime
Do not update the automatically update the course access time when a
course is accessed via a webservice or ajax.
2018-12-18 09:06:07 +08:00
Andrew Nicols
8cba8d1a58 MDL-64049 core: Cache prefs for current user
We were already caching these preferences when a user object is provided
to get_user_preferences, or when $USER is provided.

This changee swaps get_user_preferences to use the global USER object
when the USER->id matches the userid supplied to the function.
2018-11-19 11:23:59 +08:00
Damyon Wiese
160e77f9d0 MDL-63716 course: less user_accesstime_log() calls
We should only call this function when a user actually views a course. It is not called
automatically when a course context is validated from a webservice. It is called directly
from the core_course_view_course webservice.
2018-11-12 16:11:15 +08:00
Damyon Wiese
6dfe428363 MDL-63183 auth: Login protection
CSRF protection for the login form. The authenticate_user_login function was
extended to validate the token (in \core\session\manager) but by default it
does not perform the extra validation. Existing uses of this function from
auth plugins and features like "change password" will continue to work without
changes. New config value $CFG->disablelogintoken can bypass this check.
2018-11-07 00:14:48 +01:00
Amaia Anabitarte
5e4aaa886c MDL-62920 user: Uploading deleted user and adding to a cohort 2018-10-11 16:27:07 +02:00
Eloy Lafuente (stronk7)
19456c3956 Merge branch 'MDL-62891-master-callable_name' of git://github.com/mudrd8mz/moodle 2018-10-10 23:29:40 +02:00
Eloy Lafuente (stronk7)
bf0072e6c3 Merge branch 'MDL-63401-master' of git://github.com/andrewnicols/moodle 2018-10-09 11:35:29 +02:00
Damyon Wiese
1bf3a76a59 MDL-61378 forum: Standardize HTML output for posts
Improve the format of the HTML representing a forum post.

1. Use <article> tag to mark it correctly.
2. Use <time> tag to include the real datetime information.
3. Use <address> tag to specify who and when the post came from.
4. Use heading level tags to mark the subject of each post.
5. Properly nest reply posts within their parent <article>
6. Use a header tab for each article to split the metadata from the content.
7. Use CSS to separate links, not text content.

Because posts are now nested properly, the heading for each one refers to it's own article
and we don't need to generate arbitrary heading level tags depending on how deep the post
is nested.
2018-10-09 09:34:57 +08:00
Andrew Nicols
204abd3c97 MDL-63401 core: Do not delete the user context
As long as we have a user record, we should not delete the context which
relates to it.
2018-10-08 20:49:17 +08:00
David Mudrák
905d02f458 MDL-62891 core: Introduce new get_callable_name() function 2018-10-05 09:10:16 +02:00
Jonathan Champ
34dd57053d MDL-54035 accesslib: only modify role_capabilities in accesslib
Whenever the role_capabilities table is changed, we need to remember
to clear the cache for the role(s) being modified. This is far simpler
when all of those changes happen in a single file, i.e. accesslib.php,
allowing other parts of the application to use the public functions
without requiring knowledge of the cache internals.
2018-09-21 09:17:43 -04:00
Jonathan Champ
b2f349a433 MDL-54035 accesslib: separate role definition cache clear
Thanks to MDL-49398, we can separate the combined user session and role
definition cache clearing function into two separate functions. At the
same time, we want to identify and remove mark_dirty() calls that were
added for role definition changes but were incorrectly left behind.

Change highlights:
 - Remove unnecessary mark_dirty() calls performed after
   assign_capability(), unassign_capability(), delete_role(),
   deleted contexts, brand new contexts
 - Move role definition cache clear from the user-centric
   accesslib_clear_all_caches() to the newly created,
   role-dedicated accesslib_reset_role_cache()
2018-09-21 09:17:42 -04:00
Marina Glancy
442f12f81a MDL-62742 core: rename coursecat->core_course_category
Also rename course_in_list -> core_course_list_element
Deprecate class coursecat_sortable_records
2018-08-28 11:36:23 +02:00