116 Commits

Author SHA1 Message Date
Thom Rawson
acf94de6d5 MDL-54551 core: AJAX call redirects to login page when session expired 2018-07-18 18:07:16 +08:00
David Mudrák
4b82c15cdb MDL-60940 weblib: Introduce an ability to force cleaning of all content
The new configuration flag $CFG->forceclean overrides the noclean
option when calling format_text() so that the text is always
and unconditionally cleaned.
2018-04-11 10:23:45 +02:00
Juan Leyva
bb14a48851 MDL-60736 tool_mobile: Support session lang in WS 2018-03-21 17:27:33 +01:00
Ryan Wyllie
0377e78e36 MDL-60966 external: contexts can be passed to external format funcs 2017-12-22 13:10:39 +08:00
Andrew Nicols
d3e69bee38 Merge branch 'MDL-56751-master' of git://github.com/jleyva/moodle 2017-07-25 10:44:05 +08:00
Juan Leyva
993e817576 MDL-56751 admin: New setting to set user created tokens duration
We were using a hardcoded value for 12 months.
With this change, administrators can change the duration time via a
security setting.
2017-07-14 10:24:53 +01:00
Damyon Wiese
a60e8ba51e MDL-59365 enrol_manual: Rewrite the yui enrolment popup in amd
The add/roles thing was only converted to bootstrap 2/4 markup and the yui left in place.

The modal for adding users to a course was unsavable so I rewrote it with an mform in a popup, still calling
the same (barely) modified ajax script.

The webservice for searching cohorts was taken from admin/tool/lp and moved into /cohort. I added a generic "cohort"
mform element at the same time.

The webservice for searching for users was taken from the original ajax script.
2017-07-11 13:47:26 +01:00
Ankit Agarwal
9743b2d4a9 MDL-58701 phpunit: Add tests for external_settings 2017-04-27 09:37:53 +05:30
Ankit Agarwal
1d772481dd MDL-58701 libraries: Use pluginfile.php as rewrite url for web req. 2017-04-27 09:37:53 +05:30
Ankit Agarwal
34773ccf70 MDL-58691 exporter: Filters should always apply for web pages
The variables AJAX_SCIRPT, CLI_SCRIPT, WS_SERVER are always defined (and set to false)
when webpages are rendered, hence the check of 'defined' is invalid
2017-04-24 13:43:11 +05:30
Juan Leyva
1104a9fa44 MDL-58399 webservice: Return additional file fields for repositories
We should be detecting when we are treating files that are linked to
external repositories.
For doing that we'd need to return some additional fields via Web
Services:
- isexternalfile
- mimetype (google docs files use an special one)
- repositorytype (the repository plugin name)
2017-03-28 20:23:16 +02:00
Damyon Wiese
b9b409cfc3 MDL-40759 icons: Peer review fixes (all minor) 2017-03-17 15:52:46 +08:00
Damyon Wiese
95b06c13c6 MDL-40759 icons: Refactor icon system to be extensible. 2017-03-17 15:51:29 +08:00
Juan Leyva
44acbb815f MDL-57914 mod_data: Allow to export properties for external_files 2017-03-02 22:57:04 +01:00
Juan Leyva
1e17258b66 MDL-56268 webservice: Format backtrace to avoid display private data 2016-11-10 16:15:31 +08:00
Andrew Nicols
3e85e02a98 Merge branch 'MDL-55992-master' of git://github.com/jleyva/moodle 2016-11-08 13:41:22 +08:00
Andrew Nicols
11361f35be MDL-56737 externallib: Fetch token after inserting 2016-11-08 12:45:57 +08:00
Andrew Nicols
a2c0528802 Merge branch 'MDL-56737-master' of git://github.com/jleyva/moodle 2016-11-07 13:25:41 +08:00
Juan Leyva
a947ecd634 MDL-56737 tool_mobile: Support private tokens in launch.php 2016-11-04 15:37:42 +00:00
Dan Poltawski
ab64cd40b0 Merge branch 'MDL-56372_static_bind_clean_return_val' of https://github.com/BenKelada/moodle 2016-11-02 15:14:46 +00:00
Juan Leyva
56c8413712 MDL-55992 webservice: Fix debugging notice when creating token
This patch also avoid to propagate to logs the private token as is done
in login/token.php
2016-11-01 21:26:40 +00:00
Ben Kelada
d96030ce07 MDL-56372 lib: use static binding to allow overrides in api 2016-10-18 11:23:49 +11:00
Juan Leyva
69cbe35943 MDL-45639 webservice: Support private tokens
Private tokens are generated at the same time that the token.
They must be stored safely by the ws client, and they must be transmitted only via  https.
2016-10-14 12:32:30 +01:00
Damyon Wiese
14968ca9ac MDL-55567 messages: Use FORMAT_MOODLE as default for sending messages
This is like plain text, but it preserves new-lines and has some
other special features.
2016-10-07 16:26:40 +08:00
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