Commit graph

127 commits

Author SHA1 Message Date
David Mudrák
6808227b1f MDL-59847 core: Fix display of hidden identity fields in user lists
Places that display list of users (such as course participants page)
with additional identifier fields now respect the user's permission to
view other users' hidden profile fields.
2018-07-27 09:55:22 +02:00
Sara Arjona
7a3707797d MDL-62240 privacy: Avoid error when path is higher than allowed
A new method shorten_filenames has been added to moodlelib.
2018-05-03 09:16:13 +02:00
Andrew Nicols
76cb5a56ea MDL-62240 file: Add includehash to shorten_filename + unit tests 2018-05-03 08:27:12 +02:00
Mihail Geshoski
d609207c3e MDL-61724 resource: Unable to view or download file resource 2018-03-26 11:14:46 +08:00
Andrew Nicols
d7ff2fc28b Merge branch 'MDL-60398-master' of git://github.com/mihailges/moodle 2018-03-14 10:33:03 +08:00
Andrew Nicols
431a3bb674 MDL-61307 core: Add component_class_callback functionality 2018-03-09 10:01:18 +08:00
Mihail Geshoski
757a889b24 MDL-60398 resource: Unable to download folder resource 2018-02-26 16:49:21 +08:00
Eloy Lafuente (stronk7)
801a372dad MDL-60611 phpunit: switch to namespaced phunit classes 2017-11-02 23:45:34 +01:00
John Okely
b58764ff99 MDL-42834 admin: Remove loginhttps 2017-10-23 12:25:35 +08:00
Ruslan Kabalin
e5ece45e84 MDL-59273 core: Remove mailto links support in clean_param. 2017-07-24 16:51:55 +01:00
Ruslan Kabalin
362be64a2b MDL-59255 core: Extend test_clean_param_url.
Add rtmp:// test and some more URL validity tests since we made changes in
validateUrlSyntax function.
2017-07-18 10:29:07 +01:00
David Monllao
ac0553aa64 Merge branch 'MDL-54901' of git://github.com/stronk7/moodle 2017-04-19 11:30:03 +08:00
Eloy Lafuente (stronk7)
55946a892a MDL-54901 phpunit: Change phpunit wwwroot to HTTPS and fix tests
This includes:

- Changing PHPUnit's bootstrap to use https://www...
- Modify all existing expectations to the new wwwroot.
- Amend some tests now with different defaults because of is_https()
- Added a note to main upgrade.php about the change.
2017-04-18 03:40:17 +02:00
Tim Hunt
2524990d09 MDL-58486 user_prefs: always update $USER cache when applicable
set_user_preference and unset_user_preference let you pass the user to
set preferences for as an id. Previously, if you passed $USER->id there,
those methods did not update the Cache in $USER, which was surprising,
and not easy to debug.

Now, we always update the preference cache in $USER if the preference is
being changed for the current user.
2017-04-04 16:20:26 +01:00
Jake Dallimore
62b482938b MDL-58121 email: ensure support user is defined in email_to_user 2017-03-17 09:08:45 +08:00
Marina Glancy
6e65554ea1 MDL-58010 user: allow to update only whitelisted user preferences 2017-03-10 18:04:47 +00:00
Jake Dallimore
9e44cec27f MDL-58038 email: make sure all allowedemaildomain entries are respected
Fixes a bug with exploding the config var, in which trailing carriage
returns were causing string matches to fail.
2017-02-28 12:17:52 +08:00
David Mudrák
7620746f67 MDL-57531 mail: Make validate_email return actual boolean as expected
It was discovered by unit tests that the return value is not a real
boolean as was intuitively expected and documented. To avoid potential
issues with the truthyness in the future, we explicitly cast the return
value to boolean now.
2017-01-04 13:16:07 +01:00
David Mudrák
61367eb639 MDL-57531 mail: Validate the sender's email address
The patch adds validation for the noreplyaddress setting variable, for
the explicit $replyto parameter and for the sender's email. In case of
misconfigured noreplyaddress setting, it falls back to the default
noreply address value. In case of invalid email in the user's record,
the email is not sent.

The patch also adds unit test for the value returned by the function
generate_email_processing_address() so that it can be considered as a
valid email, too.

This is supposed to significantly minimise the risk of exploiting the
vulnerability in PHPMailer's Sender field.
2017-01-04 12:35:19 +01:00
John Okely
a6db4a68e2 MDL-57278 signup: Unit tests covering confirmation link generation 2016-12-08 10:16:29 +08:00
Andrew Nicols
ea10a0319b MDL-56602 core: Lock themerev during upgrade
This also changes install to use a fixed themerev.
2016-11-11 14:15:00 +08:00
Andrew Nicols
9d75a519f3 MDL-56602 themes: Use version number as base themerev 2016-11-10 08:02:31 +08:00
Adrian Greeve
e0789335ee MDL-44467 lib: Unit test updates. 2016-10-28 13:27:00 +08:00
Eloy Lafuente (stronk7)
8dcc999d96 Merge branch 'wip-MDL-55827-master' of git://github.com/marinaglancy/moodle 2016-09-20 01:02:06 +02:00
Dan Poltawski
054da30ba9 MDL-48766 moodlelib: introduce ip_is_public()
For determining if an IP is publicly addressable
2016-09-15 14:53:14 +01:00
Marina Glancy
308ce5b46f MDL-55827 tests: @ does not suppress wrong number of arguments in php7.1 2016-09-06 15:37:30 +08:00
Russell Smith
6a3acc84de MDL-55272 lib: Improve test course create performance
Use core functions that are faster for test file creation.
To support large requests for hashes, the core hash function
must support large hashes without recursion.  PHP has a default
recursion depth of 100 and long hashes don't support this.

Remove transactions as they create performance problems for larger
courses and doesn't introduce significant benefit for developers.

Performance changes meant the times were much faster, a reasonable
guess was taken on performance of an average machine.
2016-08-16 12:00:21 +10:00
Frederic Massart
048f8073d1
Revert "Merge branch 'MDL-54110_master' of https://github.com/marxjohnson/moodle"
This reverts commit 016e0abfbc, reversing
changes made to 58a2f0ac40.
2016-06-23 11:51:44 +08:00
Frederic Massart
796f86f753
Revert "MDL-54110 repositories: Whitespace, Typo + unit test fixes"
This reverts commit 7e4d43e1a2.
2016-06-23 11:51:44 +08:00
Andrew Nicols
7e4d43e1a2 MDL-54110 repositories: Whitespace, Typo + unit test fixes 2016-05-11 10:39:40 +08:00
Andrew Nicols
016e0abfbc Merge branch 'MDL-54110_master' of https://github.com/marxjohnson/moodle 2016-05-11 10:10:57 +08:00
Mark Johnson
121b67411f MDL-54110 repositories: Allow repositories to ignore post_max_size
Repositories can now override usespost() if they don't upload using POST
requests. This restores the ability of users with
moodle/course:ignorefilesizelimits to upload files of unlimited size
lost in MDL-44626.
2016-05-10 16:10:24 +01:00
Frederic Massart
88474db22f MDL-50704 date: Fix invalid timezone mapping for +14
The value Etc/GMT-14 was added to the list of known timezones,
and Etc/GMT+13 & Etc/GMT+14 were removed as they are not valid.

Tests were added to ensure that legacy user timezones are mapped
to known timezones. Other tests were changed to reflect the changes
with regards to Etc/GMT+13 and +-14.
2016-05-09 17:28:38 +08:00
Brendan Heywood
344178035d MDL-53102 tests: corrected phpdocs in email diversion tests
(Introduced by previous patch MDL-52818)
2016-03-14 14:20:10 +11:00
Brendan Heywood
54dceeed88 MDL-53102 email: Ensure all emails generate consistent Message-ID URLs 2016-03-14 14:20:10 +11:00
Brendan Heywood
eca8cf67dc MDL-52818 core: Added CFG->divertallemailsexcept config option
When $CFG->divertallemailsto is specified, this allows a list of email
or domain exceptions to be whitelisted enabling easier testing by groups
of testers who don't share a single email address.
2016-02-09 09:59:20 +00:00
Eloy Lafuente (stronk7)
6e38f41d8e MDL-52567 Core: amend existing test to new counting rules 2016-01-29 10:15:24 +08:00
jinhofer
4ebdd15487 MDL-51483 lib/moodlelib.php: Added conditional checks to shorten_text 2015-12-03 10:00:08 -06:00
Petr Skoda
e4ac3879c2 MDL-50860 core: improve creation of random strings 2015-09-08 01:07:37 +02:00
Frederic Massart
a180d06cb8 MDL-46232 user: Handle bulk delete of users without email addresses 2015-07-27 15:47:39 +08:00
Eloy Lafuente (stronk7)
0339f2c4c1 MDL-50688 lib: small cleanup + http/https coverage. 2015-06-29 17:12:55 +02:00
Frederic Massart
d031c2dcb9 MDL-49401 moodlelib: PARAM_LOCALURL supports loginhttps 2015-05-05 18:31:13 +08:00
Rajesh Taneja
b6e98dc8bd MDL-49974 unit_test: Use datetime format supported by different os
%k is not supported by windows, so using %H
2015-04-24 13:01:01 +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
Andrew Nicols
f3cd1624c3 MDL-49828 timezones: Correct typo in unit tests 2015-04-13 11:08:38 +08:00
Petr Skoda
980a3a12ce MDL-49828 timezones: add tests for DST switching 2015-04-12 15:23:08 +12: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
Andrew Nicols
fc05c1b8e5 MDL-48197 testing: Normalise uses of noemailever and phpmailer sink 2014-11-19 09:09:50 +08:00
John Okely
c2a9bb3a9d MDL-43987 core: Remove port numbers in cleanremoteaddr 2014-11-17 09:48:26 +08:00
Adrian Greeve
e622b1a14b MDL-46921 lib: Update get_all_user_name_fields() plus unit tests. 2014-10-09 08:07:44 +08:00