MDL-50783 Ajax: Configure how to call a webservice through db/service.php
authorDamyon Wiese <damyon@moodle.com>
Thu, 16 Jul 2015 06:14:33 +0000 (14:14 +0800)
committerDamyon Wiese <damyon@moodle.com>
Mon, 14 Sep 2015 07:10:21 +0000 (15:10 +0800)
commitba224fb42c41a5b14309adb6c609715c467116a3
treed4aec88175f9eee85331dec9c9f4480f746b64ad
parent5d8c198711d27f4a1170e76786793e8d3d62e0d5
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).
19 files changed:
admin/tool/templatelibrary/amd/build/display.min.js
admin/tool/templatelibrary/amd/build/search.min.js
admin/tool/templatelibrary/amd/src/display.js
admin/tool/templatelibrary/amd/src/search.js
admin/tool/templatelibrary/classes/external.php
admin/tool/templatelibrary/db/services.php
lib/ajax/service-nologin.php [new file with mode: 0644]
lib/ajax/service.php
lib/amd/build/ajax.min.js
lib/amd/build/str.min.js
lib/amd/build/templates.min.js
lib/amd/src/ajax.js
lib/amd/src/str.js
lib/amd/src/templates.js
lib/classes/output/external.php
lib/db/services.php
lib/external/externallib.php
lib/externallib.php
tag/classes/external.php