75 Commits

Author SHA1 Message Date
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
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
Jerome Mouneyrac
bc81eadb19 MDL-27547 When deleting a local plugin containing a built-in service, the built-in service is not deleted 2012-04-11 14:49:14 +08:00
Aparup Banerjee
1469dee12f MDL-31711 Documentation : changed usages of @property to @var for non-magic variables. 2012-03-27 16:01:14 +08:00
Sam Hemelryk
92fe97f922 Merged branch 'MDL-29277' of git://github.com/mouneyrac/moodle.git with improvements 2011-10-17 13:18:30 +13:00
Jerome Mouneyrac
9360256937 MDL-29277 when validate externallib function parameters or return values, build the path to the error into the debuginfo. This patch also revert the exception to the original invalid_parameter_exception and invalid_response_exception 2011-10-07 16:06:19 +08:00
Tim Hunt
048f3d32d6 MDL-28218 allow testclient.php to find the necessary form for services defined in plugins. 2011-07-25 20:04:19 +02:00
jerome mouneyrac
ceb1bad4ad webservice MDL-25444 indicate which field are unexpected in case of web service error 2010-11-30 01:55:17 +00:00
Petr Skoda
365a594107 MDL-24321 switching to stdClass in /lib/ 2010-09-21 08:07:44 +00:00
jerome mouneyrac
143c0abef2 webservice MDL-23536 return information when clean response throw an exception 2010-07-27 09:13:27 +00:00
Petr Skoda
78bfb562a0 MDL-21249 improved php docs and adding direct access prevention in core libs 2010-07-25 13:35:05 +00:00
jerome mouneyrac
476c0e82d3 webservice MDL-12886 exception more explicit when clean response value fail 2010-07-14 07:33:26 +00:00
jerome mouneyrac
774b1b0ff0 webservice MDL-23144 support VALUE_DEFAULT empty array for single and multiple structure 2010-07-07 08:15:26 +00:00
Petr Skoda
df997f841f MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
    MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
    MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
    MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
    MOV [enrolenddate,core],[enrolenddate,enrol_self]
    CPY [welcometocourse,core],[welcometocourse,enrol_self]
    CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
    MOV [notenrollable,core],[notenrollable,core_enrol]
    MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
    MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
    MOV [coursemanager,core_admin],[coursecontact,core_admin]
    MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
    MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
    MOV [enrolme,core],[enrolme,core_enrol]
    MOV [unenrol,core],[unenrol,core_enrol]
    MOV [unenrolme,core],[unenrolme,core_enrol]
    MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
    MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
    MOV [enrolments,core],[enrolments,core_enrol]
    MOV [enrolperiod,core],[enrolperiod,core_enrol]
    MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
Petr Skoda
23e7b7cce1 more comment typos 2010-05-22 19:06:34 +00:00
Jamie Pratt
2d0acbd5f9 MDL-21579 "Implement session token for embedded application" implemented a second type of session token linked to a session for use in applications embedded in web pages. 2010-04-28 13:16:58 +00:00
jerome mouneyrac
203fda8a4d web service MDL-21351 add a bit more information to the exception message when function implementation is missing 2010-04-22 01:51:24 +00:00
Petr Skoda
98da60215e MDL-22033 groupings now enabled unconditionally, groupmembersonly kept as experimental - this simplifies groups code logic a bit, user interface changes should not be significant because the groupings are not visible much until at least one created; hopefully the new description of groupmembersonly will have to preventsome gradebook complaints 2010-04-07 07:37:12 +00:00
Petr Skoda
4f0c2d0009 MDL-21655 big scary enrolment and roles improvements - see tacker for list of changes, includes other minor fixes too 2010-03-31 07:41:31 +00:00