652 Commits

Author SHA1 Message Date
Marina Glancy
ef1759da74 MDL-80820 various: fix incorrect phpdocs 2024-04-08 10:13:10 +01:00
Mikel Martín
a198884333 MDL-80259 theme_boost: Refactor badge helper classes for Bootstrap 5 2024-01-23 08:27:23 +01:00
hieuvu
a3da58a9cb MDL-78312 core_user: add an 'exact match only' option 2023-09-13 20:22:22 +07:00
sam marshall
93edfc5729 MDL-32278 core: print_object - handle recursion, improve formatting
A new implementation for print_object automatically prevents infinite
recursion, and allows users to choose which classes to expand. When
in web view, it defaults to a pretty-printed output using Bootstrap
classes.
2023-08-09 15:07:48 +01:00
Dan Marsden
a81c5593a5 MDL-75010 core: Prevent user last access update on user key login 2022-10-31 14:18:31 +13:00
Jun Pataleta
5e3707417d MDL-75283 core: Fetch proper column mapping for sort
Calling \core_user\fields::get_sql() incerements a static uniqueid
variable. This should be called only once and not make a separate call
for the sort mapping data as it doing so will result to an incorrect
table alias for the sort mapping data.
2022-09-07 17:07:32 +04:00
stevando
3f81b85e7d MDL-75283 admin: Update admin user fetching to use sort helper 2022-09-07 13:16:17 +08:00
Tim Hunt
8babdbd396 MDL-74608 activities: a new option to force the activity language
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.

The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
2022-08-15 22:15:52 +01:00
Tim Hunt
e1b28a7fc6 MDL-73140 grade history: fix badly formatted lists 2021-11-22 23:48:19 +00: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
Katie Ransom
d916cd77ca MDL-71186 core_user: show custom user fields in group management screens 2021-04-15 15:28:17 +01:00
sam marshall
611e2569aa MDL-71215 core_user: User fields - remaining deprecated functions
This change removes references in code and comments to a few
deprecated functions that were accidentally missed in the larger
change.

The code changes only affect service_users.php. I made it support
custom user profile fields in this query, because it was easy
enough, rather than adding another TODO to fix later.
2021-03-31 11:12:16 +01:00
sam marshall
5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00: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
sam marshall
558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
Nathan Nguyen
10db3a0b0a MDL-69573 core_course: Make MAX_COURSES_IN_CATEGORY configurable 2020-09-30 16:02:39 +10:00
Andrew Nicols
27b26d7035 MDL-66833 core: Make print_object play nice with WS 2020-01-03 08:23:12 +08:00
Eloy Lafuente (stronk7)
89fbc3ec9a Merge branch 'MDL-65179-master' of https://github.com/sammarshallou/moodle 2019-04-16 22:37:23 +02:00
Marina Glancy
76f2d89471 MDL-10965 course: search only courses with completion
it is quite often when we need to have an autocomplete element that searches courses that
have completion enabled. This commit adds an option for the 'course' form element, and also
changes two places where we search for courses with completion. This should fix MDL-58989
2019-04-10 12:35:29 +02:00
Marina Glancy
88d2677e43 MDL-10965 core: deprecate function get_courses_page 2019-04-10 12:35:28 +02:00
Marina Glancy
beff3806d6 MDL-10965 courses: capability to browse course list 2019-04-10 12:35:28 +02:00
sam marshall
bb044f5394 MDL-65179 Web service: Token last access is updated too frequently 2019-03-28 17:11:33 +00:00
Jake Dallimore
7e93539cf6 MDL-36255 core_grade: fix to ensure correct context used for filters
Some grade object (outcomes,scales) can be created at site or course
context, so this patch just makes sure we use the respective context
when applying format_string to the name in the get_name() function.
2018-08-22 17:55:50 +08:00
Luca Bösch
8ad225b431 MDL-36255 grades: allow multilang filters in grades 2018-08-20 08:29:36 +02:00
Damyon Wiese
f28c0c7245 MDL-59206 event: Add an event for a config_log
This is useful because config_logs are sent via logstores, and we may be interested to know how
many people change a particular admin setting across many sites (aggregated data).
2017-08-01 13:18:55 +08:00
Arnaud Trouve
ce4379973f MDL-58257 course: fix search containing a hyphen
In case a hyphen (-) was preceded and followed by spaces,
the pattern for the "not regex" was empty causing an empty response from the database.
2017-03-16 18:43:15 +01:00
Andrew Nicols
f0f4c1939c MDL-55175 course: Begin deprecation process for pring_log_* 2016-10-17 11:08:20 +08:00
Damyon Wiese
8de0b1ab7d MDL-52253 scales: Add new competence scale 2016-05-13 18:12:28 +08:00
Damyon Wiese
81967b54b6 MDL-52253 scales: Install the separate and connected scale 2016-05-13 18:11:30 +08:00
Damyon Wiese
235ef57a3d MDL-51324 forms: Add a new course selector
This is a squashed commit containing a number of changes:

This is an ajax driven course selector that has searching etc. It can select single, or multiple courses.
Make course selector accept a list of courses to exclude
courseselector - lookup coursename on setValue
Use the get_course_display_name_in_list function to generate the course names
Add a throttle to auto-complete to reduce spamming the server
Do a single query to fetch all the courses in the mform element when validation fails
Fix core course search function to return results when there are less than 2 chars in the query.
Handle setData with an empty array in new course selector
2016-03-09 13:30:18 +08:00
David Mudrák
cdc6938bf9 MDL-50509 datalib: Fix the typo in the variable name
The line is supposed to sanitize the function parameter.
2015-06-08 11:14:08 +02:00
Petr Skoda
d6e7a63d9a MDL-49684 timezones: rewrite timezone support
This patch replaces all homegrown timezone
stuff with standard PHP date/time code.

The main change is the introduction of core_date
class that returns normalised user and server
timezones. From now on nobody should be using
$CFG->timezone or $user->timezone directly!

Other new features and fixes:
* admins are prompted for timezone during install
* editing of other users is finally fixed
* timezones are displayed in user profile
* new $this->setTimezone() in phpunit
* time locale is now automatically reset in phpunit
* timezone is now automatically reset in phpunit
* phpunit has Australia/Perth as default timezone
2015-04-06 13:53:51 +12:00
Russell Smith
1d293ca409 MDL-43421 logging: Ignore race condition in access update. 2015-01-03 20:40:12 +11:00
sam marshall
061e6b2864 MDL-44725 Availability: Replace groupmembersonly - upgrade, core (1)
* Upgrades existing data so that the groupmembersonly option is
  replaced with equivalent data for the new availability API.
* Removes the database field and admin setting used for
  groupmembersonly.
* Changes core modinfo library to remove/deprecate groupmembersonly
  data and functions.
* Changes other core library files to remove groupmembersonly
  references.

Includes deprecation of several functions, listed in lib/upgrade.txt.
2014-09-02 13:03:07 +01:00
Petr Skoda
b6f299bb69 MDL-43918 add more validation to $modulename parameter when fetching cms 2014-08-25 12:09:54 +12:00
sam marshall
8d1f33e122 MDL-44070 Conditional availability enhancements (6): core changes
Changes core code to use new API instead of the old one when
checking user access to activities and sections.

Includes changes to other libraries that are necessary after
adding the availability system and removing old conditional tables
etc.
2014-04-07 20:11:48 +01:00
Eloy Lafuente (stronk7)
6b8798dedb Merge branch 'wip-MDL-44720-master' of git://github.com/marinaglancy/moodle 2014-04-02 21:32:42 +02:00
Ankit Agarwal
52dc1de746 MDL-42891 administration: Re-implement incorrect login notification, without using the logtable. 2014-04-01 17:18:15 +08:00
Marina Glancy
92e2e85523 MDL-44720 modinfo: make it easier to use cm_info instead of get_coursemodule_from_id
by adding function cm_info::get_course_module_record()
2014-03-27 11:24:00 +08:00
Tim Hunt
c35cf42e55 MDL-44682 fix bug in decompose_update_into_safe_changes 2014-03-20 15:10:38 +00:00
Damyon Wiese
ca0361084b Merge branch 'w10_MDL-41266_m27_logging' of https://github.com/skodak/moodle 2014-03-04 13:32:43 +08:00
Tim Hunt
c185726964 MDL-44251 DB helper to update rows without violating a unique index. 2014-03-02 09:41:03 +01:00
Petr Škoda
7eaca5a810 MDL-37658 add new logging API with basic implemenation 2014-02-28 14:52:24 +08:00
Eloy Lafuente (stronk7)
1d453eff25 Merge branch 'MDL-41910_master' of git://github.com/dmonllao/moodle 2013-09-25 03:11:53 +02:00
David Monllao
0793389fd6 MDL-41910 user: Allowing LASTACCESS_UPDATE_SECS overwrite 2013-09-23 16:58:56 +08:00
Petr Škoda
d79d5ac276 MDL-31501 rework user session architecture
List of changes:
 * New OOP API using PHP namespace \core\session\.
 * All handlers now update the sessions table consistently.
 * Experimental DB session support in Oracle.
 * Full support for session file handler (filesystem locking required).
 * New option for alternative session directory.
 * Official memcached session handler support.
 * Workaround for memcached version with non-functional gc.
 * Improved security - forced session id regeneration.
 * Improved compatibility with recent PHP releases.
 * Fixed borked CSS during install in debug mode.
 * Switched to file based sessions in new installs.
 * DB session setting disappears if DB does not support sessions.
 * DB session setting disappears if session handler specified in config.php.
 * Fast purging of sessions used in request only.
 * No legacy distinction -  file, database and memcached support the same functionality.
 * Session handler name included in performance info.
 * Fixed user_loggedin and user_loggedout event triggering.
 * Other minor bugfixing and improvements.
 * Fixed database session segfault if MUC disposed before $DB.

Limitations:
 * Session access time is now updated right after session start.
 * Support for $CFG->sessionlockloggedinonly was removed.
 * First request does not update userid in sessions table.
 * The timeouts may break badly if server hosting forces PHP.ini session settings.
 * The session GC is a lot slower, we do not rely on external session timeouts.
 * There cannot be any hooks triggered at the session write time.
 * File and memcached handlers do not support session lock acquire timeouts.
 * Some low level PHP session functions can not be used directly in Moodle code.
2013-09-21 13:11:56 +02:00
Marina Glancy
4a3fb71c4f MDL-41436 Removing references to fields course.modinfo, sectioncache
Also add the field cacherev to the lists of default fields in course retrieval functions
2013-09-10 14:11:51 +10: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
Sam Hemelryk
487caf6b65 Revert "MDL-39876 update_course_record function to update global COURSE"
This reverts commit c290ac5510ca06b3eae557c2165c2f106dde46aa.

Conflicts:
	course/lib.php
2013-08-21 15:21:06 +12:00