Commit Graph

45 Commits

Author SHA1 Message Date
Juan Leyva
26e778d1b7 MDL-60680 file: Support any user id when creating tokens for files.
$includetoken parameter type has been changed. Now supports:
   boolean: False indicates to not include the token, true indicates to generate a token for the current user ($USER).
   integer: Indicates to generate a token for the user whose id is the integer value.
2019-04-23 13:16:15 +02:00
Juan Leyva
e0695f8764 MDL-64658 files: Support constant to avoid file merging
... in file_save_draft_area_files
2019-03-25 14:57:18 +01:00
Andrew Nicols
91f1f28233 MDL-36754 core_files: Support tokens when rewriting text
Support use of a token for access to pluginfile.php when rewriting text
content.

This is primarily intended for notifications where the user is unlikely
to be logged into Moodle when receiving the notification.
2018-08-14 06:57:32 +08:00
Jun Pataleta
c353ad20c3 MDL-45170 core: Integration review fixes
* Pass $forcehttps parameter to call extract_draft_file_urls_from_text()
 call in \core_weblib_testcase::test_extract_draft_file_urls_from_text()
* Style fixes
2018-08-08 16:17:32 +08:00
Charles Fulton
7d7d3b1731 MDL-45170 files: check other draftfile areas when processing 2018-08-08 16:15:23 +08:00
Adrian Greeve
f38766e166 MDL-62849 files lib: Add method to return all files.
Added a function which returns all the files from all directories
in the draftarea.
2018-07-17 10:25:11 +08:00
Eloy Lafuente (stronk7)
6663f615ed Merge branch 'wip-MDL-60161-master-test' of git://github.com/abgreeve/moodle 2017-12-18 16:09:51 +01:00
Adrian Greeve
c86189ae02 MDL-52100 filelib: Update to unit tests for maxbytes. 2017-12-18 13:12:22 +08:00
Adrian Greeve
01957f1a69 MDL-60161 filelib: Unit test for duplicate curl headers. 2017-12-13 11:07:58 +08:00
Matt Clarkson
b1eb6dd7f2 MDL-33174 lib/filestorage: Add filename to curl request
While the lack of the filename in curl POST does not
directly affect Moodle, some external API's expect to get
the filename of the original file, which affects plugins
using the CURL class.
2017-10-02 09:27:51 +13:00
Jake Dallimore
f3c2afd0e8 MDL-36985 core_files: added option to remove draft files on save
text areas can now specify $options['removeorphaneddrafts'] when saving
their data using file_postupdate_standard_editor(). If set to true,
this option clears all user drafts which are not referenced in the text
2017-08-22 13:15:30 +08:00
Juan Leyva
bef201c7e0 MDL-58712 core_user: Do not count the root directory 2017-06-22 16:09:58 +02:00
Juan Leyva
f74ac6e704 MDL-58712 core_user: New WS core_user_get_private_files_info 2017-06-15 09:40:30 +01:00
Juan Leyva
0237571004 MDL-58712 core_user: New function for retrieving file area info 2017-06-13 11:22:33 +01:00
Frederic Massart
e37c128686 MDL-57101 filter: Always set-up the page for filters 2016-11-29 12:36:28 +08:00
Jake Dallimore
605bab84ce MDL-48498 core_files: Add security helper to curl class
Allow injection of security_helper objects into curl, but default
to a core helper tied to http security settings values.
2016-11-08 15:11:15 +08:00
Rajesh Taneja
ce78e33a84 MDL-55174 core_tests: Use proper itemid while creating file 2016-07-18 10:29:23 +08:00
Juan Leyva
460897052e MDL-54869 files: Create new required functions
This was a complex change requiring three new functions:
file_merge_files_from_draft_area_into_filearea - To just add files from a draft area into a real one (just adding or updating, not deleting)
file_merge_draft_area_into_draft_area - To merge files from two draft areas, used by the latest for creating a draft area with all the original files plus the new ones.
file_overwrite_existing_draftfile - Required to update existing files not losing metadata or references.

The whole process is the following:

    User uploads a file (upload.php)
    Client gets a new draftid A containing the file only (return of upload.php)
    Client requests to merge that draftid in the user's private files (core_user_add_user_private_files)
    Server prepares a new UNUSED draftid B from existing area
    Server merges A into B
    Server saves the draft B into the final area
2016-07-05 09:01:34 +01:00
Juan Leyva
296ab1e253 MDL-53175 file: Allow file_rewrite_pluginfile_urls to reverse 2016-03-30 09:37:32 +01:00
Jun Pataleta
0c4c3b9aed MDL-44828 filelib: Fix open error for force-downloaded files in mobile
Allow guessing of file's MIME type by default. Fallback to
application/octet-stream if MIME type cannot be determined.
2015-08-14 09:54:20 +08:00
Eloy Lafuente (stronk7)
9a1adda585 MDL-49497 curl: keep api private and test it using reflection.
While strictly we should not be testing private APIs, in order
to get this backported to stables without changing visibility
we use reflection to access to such private properties and methods.

Also added one exttest to verify user agent is properly sent.

Finally, fix some wrong whitespace and changed the helper class name
to better alternative.
2015-06-23 17:20:20 +02:00
Dave Cooper
cbb7c6a905 MDL-49497 curl: Add configurable User-Agent unit tests. 2015-06-23 15:59:59 +02:00
Dan Poltawski
c67c00a6fe Merge branch 'MDL-42616-master' of https://github.com/sammarshallou/moodle 2014-12-22 12:13:31 +00:00
sam marshall
91fed57a4e MDL-42616 filelib: Use config value for custom MIME types (1/2)
Uses a new optional config variable to define custom MIME types
in JSON format. Includes new API for accessing and modifying
this data.
2014-12-19 14:48:59 +00:00
Frederic Massart
38a73bf4ae MDL-48495 curl: Limit usage of curl to HTTP and HTTPS protocols 2014-12-16 10:08:33 +00:00
Tim Hunt
90048c7cfa MDL-47646 CURL redirect unit test: handle broken servers 2014-10-13 15:52:04 +01:00
Frederic Massart
218d751d07 MDL-45132 curl: Unit Tests for file uploads 2014-04-16 17:29:22 +08:00
Dan Poltawski
7d374cdf4a Merge branch 'w01_MDL-43510_m27_test404' of https://github.com/skodak/moodle 2014-01-07 17:28:15 +08:00
Petr Škoda
b1652d6b85 MDL-43510 fix 404 unit test server incompatibility 2013-12-29 15:28:14 +08:00
Matteo Scaramuccia
c3a3f54053 MDL-40379 Files Prevent mobile network providers from modifying content. 2013-12-28 13:56:19 +01:00
Frederic Massart
74c4405b8a MDL-42951 curl: Re-organise Unit Tests in smaller chunks 2013-11-28 12:14:13 +08:00
Frederic Massart
102230b23c MDL-42951 curl: Always keep the last headers of a request 2013-11-28 12:00:42 +08:00
Frederic Massart
ba72e295c2 MDL-42985 curl: Correctly apply rule proxybypass 2013-11-21 09:56:54 +08:00
Petr Škoda
a9d2f1b414 MDL-41707 allow custom location of external test files used from unit tests 2013-09-27 10:47:56 +02:00
Petr Škoda
1d987cb7d8 MDL-39915 cleanup core_filelib_testcase 2013-07-27 18:26:32 +02:00
Dan Poltawski
846f6fbe00 MDL-33955 filelib: accept any HTTP 1.0 in tests
This is common with proxies like squid which don't support http
pipelining.
2013-06-19 14:55:35 +08:00
Petr Škoda
35ea5db031 MDL-33955 add file download and curl unit tests 2013-06-14 08:03:50 +02:00
sam marshall
85cb4b65b1 MDL-38170 SimplePie: Cannot read https feeds through proxy 2013-03-01 10:36:51 +00:00
Dan Poltawski
ac29403e39 MDL-33172 - filestorage: Add unit test for breaking oracle functions 2012-05-25 11:17:56 +12:00
Dongsheng Cai
291a3d1fb6 MDL-33149 stored_file::repository should be private 2012-05-22 15:00:49 +08:00
Dongsheng Cai
61506a0af9 MDL-33032 Fixed issues for file integration
1. Added tracker issue number in comment
2. Fixed stored_file::delete_reference()
3. repository::send_file() will throw exception if not implemented by subclass
4. Fixed renaming unit test, added one unit test for deleting original file
5. Fixed copyright statement for googledoc and picasa repository plugin
6. Implemented stored_file::set_filesize()
2012-05-21 11:57:56 +08:00
Dongsheng Cai
7051415cca MDL-28666 Files API and db changes
1. Fix db regression
2. Unit tests for is_external_file() and rename exception
3. Searching reference method exclude draft files
2012-05-21 11:57:54 +08:00
Dongsheng Cai
6723372514 MDL-28666 Extends repository to support references
1. Allow repository to create references to external contents
2. Extends files API to handle file references
3. Generic file caching
4. Backup/restore file references
5. Download external contents if repository uninstalled
6. Allow filepicker to display iframe
7. PHPUnit test suits
2012-05-21 11:57:51 +08:00
Petr Skoda
4b02743182 MDL-32149 improve testcase naming and list in config file 2012-04-03 22:30:57 +02:00
Petr Skoda
a3d5830a0a MDL-32149 PHPUnit test support - part 2
Includes:
* constants refactoring
* reworked db table init
* support for $CFG->debug = -1
* functional DB tests
* fixed $DB->get_indexes() to not throw exceptions when table does not exist
* fix handling of user passwords in test db
* add debug info to exception messages
* removed unnecessary PHP debug errors from mathslib
* fixed @error suppression in get_string
* fixed PHPUnit error handler setup
* added timezone info to default install
2012-04-03 22:30:53 +02:00