24 Commits

Author SHA1 Message Date
Juan Leyva
e348f6a541 MDL-60302 webservice: Allow CORS requests in webservice/upload.php
This will allow to upload files via Web Services using AJAX from
different domains, browser plugins, web apps, etc…
2017-10-04 12:39:51 +02:00
Andrew Nicols
71f81adce9 Merge branch 'MDL-54869-master' of git://github.com/jleyva/moodle 2016-07-07 10:30:17 +08:00
Eloy Lafuente (stronk7)
4b7ac6023c Merge branch 'MDL-54867-master' of git://github.com/jleyva/moodle 2016-07-05 20:25:54 +02: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
ff092320a7 MDL-54867 webservice: Document webservice/upload.php deprecation
The 'private' file area is not supported anymore, only 'draft' is
supported right now.
2016-07-01 13:13:54 +01:00
Juan Leyva
7a8744dba7 MDL-55049 webservice: Scan for viruses in webservice/upload.php 2016-06-28 16:14:16 +01:00
Russell Smith
1fcf0ca8a5 MDL-35628 performance: Remove dirname() where possible.
dirname() is a slow function compared with __DIR__ and using
'/../'.  Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code.  This allows those required includes to perform as
best as possible in this situation.
2016-06-10 08:06:49 +10:00
Cameron Ball
f23e9b6ba4 MDL-49414 webservices: Remove deprecated functions 2016-04-27 15:54:38 +08:00
Juan Leyva
f7b443c2f0 MDL-49426 webservices: Allow upload to draft area always 2015-04-10 10:21:01 +02:00
Petr Skoda
76ae1f6068 MDL-47868 ws: verify upload areas 2014-11-04 01:48:17 +01:00
Damyon Wiese
1495f2893e MDL-22236 webservice : Remove filearea restrictions on user draft areas.
It does not make sense to apply restrictions to the size of a users draft areas
so this is only checked if uploading direct to user private files.
2013-08-08 12:18:20 +08:00
Damyon Wiese
106c55fb9c MDL-22236 Webservice file upload - Allow webservice file uploads direct to a draft filearea.
Via post to /webservice/upload.php
2013-08-08 09:57:57 +08:00
Dan Poltawski
0e35ba6ffc MDL-36357 cleanup - remove double semicolons 2012-11-15 09:51:26 +08:00
Frederic Massart
4373103084 MDL-34460 Librairies: Replaced deprecated get_context_instance() 2012-07-26 13:23:28 +08:00
Jerome Mouneyrac
a0a07014c2 MDL-30994 webservice API, check and update DocBlock 2012-03-02 09:49:41 +08:00
Jerome Mouneyrac
3b40f3b1a7 MDL-30496 fix upload max size issue when server limit is set + return some kind of json error object for filenameexists and oversizedfile errors 2011-12-01 15:13:52 +08:00
Jerome Mouneyrac
264764e222 MDL-30459 when one filename already exist we bypass the execution and continue. We just return the error into the json string 2011-12-01 15:56:15 +13:00
Sam Hemelryk
bba1338a60 Merged branch 'MDL-30459' of git://github.com/mouneyrac/moodle.git with whitespace fixes 2011-12-01 14:43:39 +13:00
Jerome Mouneyrac
f25aee3251 MDL-30459 better error message when file already exist 2011-11-30 15:15:59 +08:00
Jerome Mouneyrac
07cc3d11e2 MDL-28646 add missing authentication web service checks. Merge download/upload script checks in the same lib functions. Make the download scrit return json error message. Add missing webservice lang. Minor unit test doc improvement. 2011-11-29 11:18:36 +08:00
Dongsheng Cai
ec0d6ea2a9 MDL-28646 Web service: core_course_get_contents()
1. Implement core_course_get_contents web service
2. Implement callbacks in folder, resource, page and url modules
3. Implement download script for web service
2011-11-28 16:22:38 +08:00
Petr Skoda
e922fe23b6 MDL-29602 accesslib improvements
Refactoring and improvements of the accesslib.php library including prevention of access for not-logged-in users when forcelogin enabled, improved context caching, OOP refactoring of contexts, fixed context loading, deduplication of role definitions in user sessions, installation improvements, decoupling of enrolment checking from capability loading, added detection of deleted and non-existent users in has_capability(), new function accesslib test, auth and enrol upgrade notes.

More details are available in tracker subtasks.
2011-10-16 14:05:18 +02:00
Dongsheng Cai
7515e1bac4 MDL-29036 WEBSERVICE : webservice upload script should respect maxbytes and userquota settings 2011-09-19 15:31:34 +08:00
Dongsheng Cai
42b2809ff3 MDL-27497, using webservice token to upload files 2011-06-13 16:06:18 +08:00