21 Commits

Author SHA1 Message Date
hieuvu
a3da58a9cb MDL-78312 core_user: add an 'exact match only' option 2023-09-13 20:22:22 +07:00
stevando
3f81b85e7d MDL-75283 admin: Update admin user fetching to use sort helper 2022-09-07 13:16:17 +08:00
Eloy Lafuente (stronk7)
4003e31983 MDL-73785 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- When belonging to other components and being valid api:
  - analytics related tests have been moved to tests/analytics subdir.
  - backup & restore related tests have been moved to tests/backup subdir.
  - events related tests have been moved to tests/event subdir.
  - privacy related tests have been moved to tests/privacy.
  - task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
  needed now that they are namespaced):
  - some xxxlib_test.php have been renamed lib_test.php
    (when they where testing the corresponding lib.php).
  - cache stores tests have been all renamed store_test, originally
    each one had its own name (file_test, apcu_test, redis_test...)
  - assign feedback tests have been all renamed feedback_test, originally
    each one had its own name (file_test, editpdf_test...)
2022-03-03 12:19:30 +01:00
Michael Hawkins
6d26ba77f3 MDL-72096 core: Add safe ORDER BY helpers for db sorting from user input
The new get_safe_orderby() and get_safe_orderby_multiple() methods
provide a centralised safe way for user submitted sorting values to be
incorporated into SQL ORDER BY. They do this by removing the need for
user submitted data to pass in any SQL and not allowing arbitrary
column values, instead using string keys which map to a predefined
list of allowed sortable columns.
2021-11-15 12:42:43 +08:00
Bas Brands
f9e1c2587a MDL-28452 core_user: migrate social profile fields
Create a new profile field type, move all existing content of the fields
'icq', 'skype', 'aim', 'yahoo', 'msn' and 'url' in the mdl_user table to
theses new profile fields if needed.

AMOS BEGIN
MOV [aimid,core],[aimid,courseimage,profilefield_social]
MOV [yahooid,core],[yahooid,profilefield_social]
MOV [skypeid,core],[skypeid,profilefield_social]
MOV [icqnumber,core],[icqnumber,profilefield_social]
MOV [msnid,core],[msnid,profilefield_social]
MOV [webpage,core],[webpage,profilefield_social]
AMOS END
2021-04-21 11:22:25 +02:00
Katie Ransom
d916cd77ca MDL-71186 core_user: show custom user fields in group management screens 2021-04-15 15:28:17 +01:00
Paul Holden
584f874e50 MDL-70924 course: ensure required fields present when getting courses. 2021-03-15 12:46:27 +00:00
sam marshall
dbc09f74e9 MDL-45242 Admin: User list supports custom profile fields 2021-03-10 10:57:11 +00:00
Nathan Nguyen
10db3a0b0a MDL-69573 core_course: Make MAX_COURSES_IN_CATEGORY configurable 2020-09-30 16:02:39 +10:00
Simey Lameze
ac9768fc1b MDL-52781 core_user: replace direct PARAM_ usages.
This commit replace as much as possible of clean_param and PARAM_ usages related to user object.
Also few unit tests has been changed to match the new validation
2016-04-21 15:24:36 +08:00
Rajesh Taneja
0fe86bbdbb MDL-49799 behat: replaced asd.com with example.com
asd.com is a valid domain, we should use reserved domain names for testing
2015-04-20 11:21:20 +08:00
Petr Skoda
b6f299bb69 MDL-43918 add more validation to $modulename parameter when fetching cms 2014-08-25 12:09:54 +12:00
Petr Škoda
c1b8ec42dd MDL-42414 cleanup and fix increment_revision_number() unit test 2013-10-18 14:47:31 +02:00
Petr Škoda
307124bed8 MDL-42199 fix course revision test 2013-10-08 09:57:09 +02:00
Petr Škoda
d82993dc7f MDL-41436 implement new increment_revision_number() function
This is intended as a revision counter for local modinfo caching. It should be a lot more reliable and faster than doing it in PHP. Please note you need to invalidate all course caches after using this.
2013-09-10 14:11:44 +10:00
Petr Škoda
5c94af1496 MDL-39915 cleanup core_datalib_testcase 2013-07-27 18:00:15 +02:00
sam marshall
a260245739 MDL-39723 Remove unnecessary queries for COURSE, SITE 2013-05-28 13:14:55 +01:00
sam marshall
b2ec866fc7 MDL-26956 (1) Library: Move search SQL function to datalib
This function used to be in the user selector, but it is useful in
other areas where we want to search for users as it handles a number
of search options (including extra fields, etc.) and returns SQL
which can be included in a joined query.

A unit test has been added to check the results of these searches.
2013-03-28 10:45:12 +00:00
Petr Škoda
3ed5751685 MDL-35904 improve caching in get_admin() and fix order of records from get_admins() 2012-10-13 09:52:39 +02:00
Eloy Lafuente (stronk7)
5e6f26bdbe MDL-34657 tests: amend tests to verify lower() is used 2012-10-05 02:46:49 +02:00
Tim Hunt
9f82ddd66f MDL-34657 datalib: function to generate user sort sql.
The purpose of this method is to ensure that when we display lists of
users in different places, the default sort order is consistent.

Having this code centralised in one place them makes it possible to
improve things accross the board, and there is an example of that here.
There is logic so that if we are searching for particular string, then
users with an exact match are sorted first.
2012-09-27 12:41:41 +01:00