92 Commits

Author SHA1 Message Date
Juan Leyva
0a90f6247d MDL-53777 tool_mobile: New script for launching the mobile app 2016-10-03 10:02:33 +01:00
Juan Leyva
e200200938 MDL-55415 webservice: Allow validate_courses to return contexts 2016-09-05 15:42:45 +01:00
Eloy Lafuente (stronk7)
af8b948e2b Merge branch 'MDL-54629-master' of git://github.com/jleyva/moodle 2016-07-12 21:01:02 +02:00
Dan Poltawski
83ecbbc0b1 Merge branch 'MDL-55137-master' of git://github.com/cameron1729/moodle 2016-07-11 14:37:56 +01:00
Cameron Ball
977804ed9d MDL-55137: Update PHPDoc for external_format_text 2016-07-06 17:48:07 +08:00
Juan Leyva
ae584b3b5e MDL-54951 webservice: Utility methods for generating a list of files
It includes a new external_files structure and a get_area_files method
in external_util
2016-07-04 09:24:27 +01:00
Juan Leyva
833be5e410 MDL-54629 webservice: Change required parameters in external_format_text
component, filearea and itemid are now optional parameters.
In some contexts those parameteres are not necessary because is not
required to do a file rewrite via file_rewrite_pluginfile_urls
2016-06-21 12:16:25 +01:00
Frederic Massart
1d0140757a MDL-54034 ajax: Apply filters in ajax requests
This also clarified that developers can decide to force filters
to be ignored when using external_format_text, though they cannot
force filters to be turned on as the clients should be able to
opt-out from filtering should they want to.
2016-05-06 17:59:41 +08:00
Damyon Wiese
11c16f5fc8 MDL-53772 externallib: Deprecate external_function_info() 2016-04-14 15:07:41 +08:00
Damyon Wiese
e02e7f5a01 MDL-53772 libraries: More context fixes
1. Improve upgrade note
2. Don't abuse $PAGE to get the current course/cm
3. Use validate_context, never $PAGE->set_context()
4. Reset current coursemodule in validate_context().
5. Respect moodlepageclass when calling an external function.
2016-04-14 15:02:41 +08:00
David Monllao
3dd89357d4 Merge branch 'MDL-53772-master' of git://github.com/damyon/moodle
Conflicts:
	lib/upgrade.txt
2016-04-14 14:01:16 +08:00
Damyon Wiese
56fa860ead MDL-53772 externallib: Fix busted webservices context handling
Fix:
$PAGE->context must be reset when calling validate_context

Improve:
Provide wrapper for calling an external function

The wrapper correctly checks the function parameters and return type against
the description of the external function, and stores the PAGE and COURSE global
state variables, restoring them before the function returns.

Fix: buggy unit tests.

These tests are expecting debugging from a bug that was fixed, and calling web
service functions with no user or session.
2016-04-14 13:58:23 +08:00
Pau Ferrer Ocaña
b1a9804a9b MDL-52263 libraries: Add test cases to external_format_text options 2016-04-12 15:05:46 +02:00
Pau Ferrer Ocaña
19a131edff MDL-52263 libraries: Add options to external_format_text 2016-04-12 14:39:23 +02:00
Dan Poltawski
b80ede13a6 MDL-51664 externalib: clarify crucial comment 2015-12-03 11:16:32 +01:00
Dan Poltawski
50901a53bc Merge branch 'MDL-51664-master' of git://github.com/FMCorz/moodle 2015-12-03 11:16:30 +01:00
Damyon Wiese
1dc4dc989d MDL-51756 externallib: Show debugging when optional params are wrong
Optional params are not allowed as the top level value for external_function_parameters.
This is because stricter protocols (xmlrpc and soap) cannot handle optional parameters, only
optional properties in a structure.
2015-10-15 14:19:07 +08:00
Frederic Massart
4b11af9607 MDL-51664 external: Validate courses does not refetch prefetched courses 2015-10-12 12:01:15 +08:00
David Monllao
3bc0824e46 Merge branch 'MDL-51213-master' of git://github.com/damyon/moodle 2015-09-15 17:28:34 +08:00
Andrew Nicols
ac43dc23e4 Merge branch 'MDL-50783-master' of git://github.com/damyon/moodle 2015-09-14 15:52:42 +08:00
Damyon Wiese
88982b71b2 MDL-50783 ajax: Properly deprecate the is_allowed_from_ajax() methods. 2015-09-14 15:10:40 +08:00
Damyon Wiese
ba224fb42c MDL-50783 Ajax: Configure how to call a webservice through db/service.php
Now the db/service.php array can contain these extra keys to provide information
on how a webservice may be called:

    'ajax' => true (Default is false)

Replaces the xx_is_allowed_from_ajax callback.

    'loginrequired' => false (Default is true)

Means that this webservice can be called through lib/ajax/service-nosession.php
which sets NO_MOODLE_COOKIES to true (faster). This is only safe for webservices returning
static public data (e.g. get_string).
2015-09-14 15:10:21 +08:00
Andrew Nicols
9608bed133 Merge branch 'MDL-50782-master' of git://github.com/damyon/moodle 2015-09-14 14:00:52 +08:00
Damyon Wiese
08bda175de MDL-51213 weblib: Allow filter=false option for format_string
And pass this from external_format_string correctly.
2015-09-10 12:55:52 +08:00
Juan Leyva
82f0f5e32c MDL-50537 core_webservice: New external functions utility class 2015-09-09 14:08:01 +02:00
Damyon Wiese
5d8c198711 MDL-50782 Ajax: No require_login for all ajax webservice calls
Some webservice functions need to be available without a login, e.g.
fetching strings and templates.

External functions must call validate_context if they require a valid login etc.

Added a new parameter to services.php: "loginrequired". Default is true.
2015-09-08 09:16:58 +08:00
Damyon Wiese
9764aab9da MDL-51213 externallib: external_format_text/external_format_string
API functions do not know if they are being called from a web page, or a
web-service. They need a single function to call to correctly apply
filters, strip tags etc that knows the correct way to do this based on
the way it was called (e.g. webservices allow parameters for skipping
filters etc).

So here we are fixing the default for the filter argument used in
external_format_text and adding a matching external_format_string.
2015-08-27 15:56:36 +08:00
Juan Leyva
c4a150219a MDL-49718 webservices: Fix forced format and force external text cleaning 2015-05-06 10:56:09 +08:00
Damyon Wiese
72f8324ec5 MDL-49163 Webservices, AJAX: Add support for a new ajax webservice handler.
This is a new script that can call any function in the built-in AJAX webservice. This is
a new system service that is added at install time (like the mobile webservice). It has no
protocols added to it, but it accessible by a new ajax script /lib/ajax/service.php.

Requests and responses to the script are required to be in json format, and multiple functions can
be called in a single request.
2015-03-12 15:07:08 +08:00
David Monllao
3c1aa6fdfb MDL-43535 webservices: Marking functions as deprecated
Also:
- We don't allow users to add deprecated functions to WS
- We show a debugging message when deprecated functions
  are already being used in web services.
2015-02-09 05:42:22 +08:00
Juan Leyva
eac1383edb MDL-46588 web services: Fixed system context instanceid eq 0 case 2014-09-12 11:25:16 +02:00
Juan Leyva
98dece220b MDL-46588 web services: Fixed invalid check of empty contextid in function get_context_from_params 2014-09-12 11:25:16 +02:00
Tim Hunt
5bcfd504df MDL-45618 Fix @since PHPdoc tags. 2014-05-19 17:03:04 +01:00
Petr Škoda
ed57d984a8 MDL-44603 add support for external service autoloading 2014-03-15 10:53:39 +08:00
sam marshall
3ef7279f26 MDL-42084 Core: Change set_time_limit to core_php_time_limit::raise everywhere
Exceptions (places where set_time_limit is still left) are:

Third-party libraries:
  ADODB
  PHPMailer

Moodle core:
  PHPUnit - not relevant (CLI mode)
2013-11-06 16:40:01 +00:00
Petr Škoda
b0d1d941c9 MDL-40220 use new core_component::get_component_directory() 2013-07-16 22:42:37 +02:00
Frederic Massart
8e8891b76b MDL-40403 libraries: Deprecate get_parent_contexts() 2013-07-09 13:34:44 +08:00
Ankit Agarwal
5b23d9adac MDL-39152 webservices: Rename external_api::get_context() to external_api::get_context_from_params() 2013-06-17 15:18:49 +08:00
Ankit Agarwal
aac70ffc18 MDL-39152 webservices: Abstract context fetching
Since many apis in future will need to provide alternative method to fetch context, I have abstracted this bit into the core external_api class
2013-06-14 15:47:48 +08:00
Jerome Mouneyrac
ea29059efa MDL-37552 external_format_text: missing require_once filelib.php (shared credits to Adam Fredericks for report and patch proposal) 2013-05-07 14:55:55 +08:00
Dan Poltawski
cc1521f57b Merge branch 'MDL-37355-master' of git://github.com/mouneyrac/moodle 2013-01-15 13:11:46 +08:00
Jerome Mouneyrac
9a4c2f50c9 MDL-37355 object are automatically cast into object by the return value 2013-01-07 11:12:32 +08:00
Jerome Mouneyrac
8118dbd02f MDL-37143 External_warnings: developer should be able to modify the item/itemid/errorcode description 2012-12-13 11:15:50 +08:00
Ankit Agarwal
d197ea4300 MDL-34549 libraries: Replace get_context_instance_by_id() by context::instance_by_id() 2012-08-24 11:30:10 +08:00
Adrian Greeve
b0c6dc1cac MDL-34465 - lib - Replacing get_context_instance with context_XXXX::instance (group 8) 2012-07-27 10:10:46 +08:00
Jerome Mouneyrac
55e168e3a3 MDL-32581 Web services : should force type of external_format_value structure 2012-06-06 14:29:45 +08:00
Jerome Mouneyrac
93ce0e8296 MDL-32581 support additional format field with all text field in extrnal lib function + new possible ws params to decide how format is returned (which are stored in a singleton) 2012-05-31 12:31:27 +08:00
Jerome Mouneyrac
50f9449faa MDL-32998 add warnings structure 2012-05-15 18:40:06 +08:00
Yang
03d38b9207 MDL-32998 add warnings structure 2012-05-15 13:40:58 +08:00
Jerome Mouneyrac
4615817d1c MDL-30986 external API, check and update DocBlock
Conflicts:

	group/externallib.php
2012-04-30 15:11:56 +08:00