Compare commits

..

1752 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 25c75f9b99 Moodle release 3.0.8 2017-01-08 11:04:22 +01:00
Eloy Lafuente (stronk7) 517cc1f9a7 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2017-01-08 11:04:18 +01:00
David Mudrák 00e928271b MDL-57580 mod_assign: Fix the incorrect type of some input parameters
The PARAM_TEXT has been misused in certain cases here. The 'action'
parameter seems to always be alphabetic, with values like
savesubmission, editsubmission and others as handled in assign::view().

Fixing the action handling fixes the reported XSS issue. While working
on it, I spotted two more places where PARAM_TEXT does not seem
appropriate. I include changes for them too, even if they are no
strictly related to the reported bug and there are no known ways to
abuse it.

* The 'plugin' looks like PARAM_PLUGIN and is even declared as such in
  some other parts of the assignment code (such as feedback forms).

* The 'workflowstate' is one of the ASSIGN_MARKING_WORKFLOW_STATE
  constants and is supposed to be alpha in external function input
  parameters handling, too.
2017-01-05 17:40:26 +01:00
Rajesh Taneja 824965d5dc MDL-57531 behat: Set noreplyaddress to valid address
noreplyaddress should be a valid address, else
it will not be saved. For behat we don't send
email, so set it to noreply@example.com, to
avoid failing validation on localhost
2017-01-05 06:53:23 +00:00
David Mudrák ae375cfcdc MDL-57531 mail: Validate the sender's email address
The patch adds validation for the noreplyaddress setting variable, for
the explicit $replyto parameter and for the sender's email. In case of
misconfigured noreplyaddress setting, it falls back to the default
noreply address value. In case of invalid email in the user's record,
the email is not sent.

The patch also adds unit test for the value returned by the function
generate_email_processing_address() so that it can be considered as a
valid email, too.

This is supposed to significantly minimise the risk of exploiting the
vulnerability in PHPMailer's Sender field.
2017-01-04 13:35:07 +00:00
David Mudrák 1c25f894ef MDL-57531 mail: Do not let admins set invalid email addresses
The noreply and support emails should always be valid.
2017-01-04 13:34:09 +00:00
David Mudrák ef7442df5b MDL-56225 mod_forum: Fix inability to edit attachments
The 'attachments' is not a real DB field here. It comes from the form's
filepicker and holds the id of the attachments filearea. The function
forum_add_attachment() expects it as a property of the first argument.

There were two possible approaches here. Either to pass the raw $newpost
to forum_add_attachment(), or add the attachments into the list
modifiable fields. The second approach is safer.
2017-01-04 10:36:40 +00:00
Andrew Nicols a1fadacb86 MDL-56225 mod_forum: Remove unnecessary attributes from update 2017-01-03 16:58:33 +00:00
AMOS bot 8f6cefd57d Automatically generated installer lang files 2016-12-08 00:05:43 +08:00
Dan Poltawski f7b04c388e weekly release 3.0.7+ 2016-12-02 15:18:06 +00:00
Dan Poltawski a6ec5b6ff6 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-12-02 15:18:05 +00:00
Eloy Lafuente (stronk7) 589c0fbd88 Merge branch 'MDL-57193-30-notest' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-12-02 11:41:25 +01:00
Frederic Massart fe5264217d MDL-57193 auth_db: Flip the array outside the loop for better perf
Also as the recent changes where affecting the whitespaces quite
a lot, I took the liberty of aligning a few lines which weren't.
2016-12-02 16:30:17 +08:00
John Okely fdaea8ad64 MDL-57193 auth_db: Use a recordset and array_key_exists 2016-12-02 16:30:17 +08:00
Josh Willcock 4f22f01fe4 MDL-57193 auth_db: Fixed bug suspends all users if external DB has > 10k 2016-12-02 16:30:17 +08:00
AMOS bot 842db4fd37 Automatically generated installer lang files 2016-12-01 00:06:02 +08:00
AMOS bot f2066cb88f Merge branch 'MOODLE_30_STABLE' into install_30_STABLE 2016-12-01 00:06:02 +08:00
AMOS bot 0ae9cfc1c2 Automatically generated installer lang files 2016-11-30 00:05:00 +08:00
Dan Poltawski 8dfbc3a822 weekly release 3.0.7+ 2016-11-29 13:32:27 +00:00
Dan Poltawski 6c0d5df3a2 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-11-29 13:32:25 +00:00
David Monllao fb92dba76f Merge branch 'MDL-57163-30' of https://github.com/vvzh/moodle into MOODLE_30_STABLE 2016-11-29 11:43:31 +08:00
Tim Lock b80b3d0237 MDL-57170 repository_dropbox: Ensure Dropbox Legacy continues to work 2016-11-28 10:31:31 +08:00
Vladimir Zhirov a0f554f012 MDL-57163 installation: fixed "Call to undefined function curl_version" 2016-11-27 12:13:53 +04:00
AMOS bot 44c7ab2121 Automatically generated installer lang files 2016-11-27 00:06:05 +08:00
AMOS bot 8690bb8068 Merge branch 'MOODLE_30_STABLE' into install_30_STABLE 2016-11-26 00:04:47 +08:00
David Monllao 60b566037a weekly release 3.0.7+ 2016-11-25 15:56:29 +08:00
Tony Butler 7d6c55bfc1 MDL-56948 mod_assign: Don't call get_grade_item() unless we have one 2016-11-24 15:58:44 +00:00
Damyon Wiese 1cf01e8add MDL-57100 JS: Exceptions give exceptions
Exceptions returned from ajax are not in the format expected by the JS, so
an error occurs and the exception popups are not appearing.

Conflicts:
	lib/amd/build/notification.min.js
	lib/amd/src/notification.js
2016-11-23 18:08:17 +00:00
AMOS bot dd9f8fae09 Automatically generated installer lang files 2016-11-23 00:05:30 +08:00
AMOS bot 2a3c0ef415 Automatically generated installer lang files 2016-11-18 00:07:02 +08:00
AMOS bot c6135d8d46 Automatically generated installer lang files 2016-11-17 00:04:55 +08:00
Eloy Lafuente (stronk7) ca86a178c8 Moodle release 3.0.7 2016-11-12 20:21:29 +01:00
AMOS bot 9b94006603 Automatically generated installer lang files 2016-11-12 00:29:19 +08:00
Dan Poltawski 65eb6bd459 weekly release 3.0.6+ 2016-11-11 12:05:49 +00:00
Andrew Nicols 8ae126d9b3 Merge branch 'MDL-55121-30' of git://github.com/lameze/moodle into MOODLE_30_STABLE 2016-11-11 15:13:52 +08:00
Andrew Nicols 9b6313b0b7 Merge branch 'MDL-55994_30' of https://github.com/bostelm/moodle into MOODLE_30_STABLE 2016-11-11 14:00:24 +08:00
Andrew Nicols 9381d3e9ca Merge branch 'MDL-56417_30' of https://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-11-11 12:00:23 +08:00
Andrew Nicols 747225192f Merge branch 'MDL-52216_30_STABLE' of https://github.com/eugeneventer/moodle-fixes into MOODLE_30_STABLE 2016-11-11 11:22:51 +08:00
Simey Lameze 9c802cf1d4 MDL-55121 environment: check for unsuported php version 7.1 2016-11-11 10:02:21 +08:00
Eugene Venter c29df134e7 MDL-52216 mod_lesson: prevent invalid view modes 2016-11-11 09:26:29 +13:00
Henning Bostelmann 0c8a667aa9 MDL-55994 blog: Resolve warning messages in RSS feed generation 2016-11-10 16:33:58 +00:00
Dan Poltawski 0d593bd003 Merge branch 'MDL-56623_30-messages-to-adressed-to-until' of git://github.com/lucaboesch/moodle into MOODLE_30_STABLE 2016-11-10 15:04:35 +00:00
Dan Poltawski 0dd5c403cb Merge branch 'MDL-55249_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-11-10 15:01:44 +00:00
Dan Poltawski a788beadce MDL-55777 version: bump 2016-11-10 13:48:16 +00:00
Dan Poltawski db7bb6eae5 Merge branch 'MDL-55777-30' of git://github.com/ankitagarwal/moodle into MOODLE_30_STABLE 2016-11-10 13:46:47 +00:00
Eloy Lafuente (stronk7) cda80862da Merge branch 'MDL-53481-30-uniqsqlparam' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-11-10 13:16:06 +01:00
Luca Bösch 6006cd746a MDL-56623 messages: To (addressed) and to (until) different
In some languages "to" having the meaning of "until" and "to" having the meaning of "addressed to" are different.
This should be taken care of by having two different translation terms.

AMOS BEGIN
  CPY [to,core],[addressedto,core]
AMOS END
2016-11-10 11:13:05 +01:00
David Mudrák 93ccd9a8ed MDL-53481 availability: Fix unit test to not execute the huge query
Some DBs have troubles to execute such a huge query as generated in this
test. We do not actually need to execute it. All we need is to make sure
that the parameter placeholders are enumerated correctly. So it is what
this new test does.
2016-11-10 09:55:59 +01:00
Nicholas Hoobin 5e1b84ae0e MDL-56417 session: Respect the return value of ignore_timeout_hook. 2016-11-10 14:25:55 +08:00
Ankit Agarwal 20a03b8085 MDL-55777 installation: Check libcurl version on install 2016-11-10 10:21:58 +05:30
Juan Leyva 388b48ebcd MDL-56268 webservice: Format backtrace to avoid display private datawq 2016-11-10 11:41:24 +08:00
Simey Lameze 317bcee9e4 MDL-51347 core_notes: check view notes capability by course context 2016-11-10 11:41:24 +08:00
Tim Hunt 75ed173bac MDL-53744 question file access: fix access checks 2016-11-10 11:41:24 +08:00
Juan Leyva 396f819ce7 MDL-56065 user: Fix update_users Web Service
Users won’t be updated if:
- They are admins and the user updating is not
- They are the guest user
- They are mnet users
- They are deleted users
2016-11-10 11:41:24 +08:00
David Monllao fc701cb3a2 Merge branch 'MDL-56753-30' of git://github.com/lameze/moodle into MOODLE_30_STABLE 2016-11-10 11:39:15 +08:00
Simey Lameze 50a9aa3202 MDL-56753 mod_assign: behat tests for groups and grouping counting 2016-11-10 11:18:18 +08:00
Simey Lameze 7733c75210 MDL-56753 mod_assign: fix groups and submitted counting on grading summary
This also fixes a coding error that was displayed when a group was not part of
assignment grouping.
2016-11-10 11:18:18 +08:00
Andrew Nicols 1d0df063a9 Merge branch 'MDL-55883_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-11-10 11:14:28 +08:00
Andrew Nicols 8faca311f1 Merge branch 'MDL-56755-m30' of https://github.com/micaherne/moodle into MOODLE_30_STABLE 2016-11-09 15:45:26 +08:00
Andrew Nicols fd8435ce92 Merge branch 'MDL-56726-30-cfgadmin' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-11-09 14:52:59 +08:00
David Monllao 4165507baf Merge branch 'MDL-56133-m30' of https://github.com/NeillM/moodle into MOODLE_30_STABLE 2016-11-09 14:24:21 +08:00
David Monllao e2d1844913 Merge branch 'MDL-53481-30-uniqsqlparam' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-11-09 12:50:20 +08:00
David Mudrák 688a698dc2 MDL-53481 availability: Fix uniqueness of SQL named param placeholders
Static variables do not behave the way you might expect when accessing
them through the classes inheritance. When accessing a method via self::
or static:: operators, even though the method is inherited, its variable
scope is not. So the method unique_sql_parameter() was using the scope
of the child class and each child class had its own sequence of usp1,
usp2, usp3, ... placeholders. This led to "Incorrect number of query
parameters" error when multiuple condition classes were contributing to
a single SQL query.

All credit should go to Adam Olley who debugged and described the
essence of the problem in the tracker.
2016-11-08 14:24:45 +01:00
Neill Magill 4152d926af MDL-56133 tool_langimport: Changes should be visible after import
Before this change if a language pack was updated by the
\tool_langimport\task\update_langpacks_task scheduled task, changes
would not be available to users until an admin manually cleared the
strings cache.

This change causes the cache to purged when a language pack it update,
this will cause it to rebuild so users will start seeing updates
automatically.
2016-11-08 10:55:48 +00:00
Dan Poltawski 218d1f0276 weekly release 3.0.6+ 2016-11-08 10:16:36 +00:00
Dan Poltawski 1b2ae4d7d3 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-11-08 10:16:35 +00:00
Michael Aherne 6ff83aa7e4 MDL-56755 assign: Improve documentation of assign::get_grade_item() 2016-11-08 09:04:25 +00:00
Andrew Nicols ab44e17338 Merge branch 'wip-MDL-56120-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-11-08 10:50:31 +08:00
David Monllao 8791b78091 Merge branch 'MDL-53718_30' of git://github.com/aolley/moodle into MOODLE_30_STABLE 2016-11-08 10:00:01 +08:00
Adrian Greeve a7f71822ff MDL-56120 calendar: Unit tests for getting events.
Added a unit test for checking that calendar_get_events
will only return events for activated activities.
2016-11-08 08:35:34 +08:00
Adrian Greeve 78303a974d MDL-56120 calendar: Fix disabled modules showing events.
calendar_get_events now checks for disabled activities
and only shows evetns for active modules.
2016-11-08 08:34:36 +08:00
Eloy Lafuente (stronk7) b9f81ce7cb Merge branch 'MDL-56765-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-11-08 01:27:58 +01:00
Russell Smith 12abdd7cbc MDL-54916 filestorage: Only write empty zip on change.
In some cases we may inspect an empty zip file. If we do open
an empty zip file, check that it changed before we attempt to write
it to disk.  It may be the case that we were reading the file from
a location that we don't have write access to.
2016-11-07 16:20:48 +01:00
Adam Olley a85576bf1a MDL-53718 badges: Dont display course badges when disabled 2016-11-07 15:58:23 +10:30
David Monllao eee689975a Merge branch 'MDL-56129-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-11-07 11:16:34 +08:00
David Monllao c641721530 Merge branch 'MDL-56731_30_STABLE' of https://github.com/tonynlin/moodle into MOODLE_30_STABLE 2016-11-07 10:45:22 +08:00
Jonathon Fowler 2688f5a4a9 MDL-56129 core: Change HTTP error code for iOS 10 video playback
This patch changes the effective response code from a 407 to a 403 when
erroring on iOS 10 and when a HTTP_X_PLAYBACK_SESSION_ID HTTP header is
found.

This causes the iOS Media framework to send the cookie with the request
which subsequently succeeds.
2016-11-07 10:01:45 +08:00
AMOS bot 4ccd9811d4 Automatically generated installer lang files 2016-11-07 00:05:02 +08:00
Juan Leyva f17db49ec6 MDL-56765 webservice: After a new session is started unset old preferences 2016-11-04 19:16:28 +00:00
Dan Poltawski 1642ba1ea3 Merge branch 'wip-MDL-54986-30' of https://github.com/Beedell/moodle into MOODLE_30_STABLE 2016-11-04 14:31:19 +00:00
Dan Poltawski fbbe6c88d6 Merge branch 'MDL-53945_30' of git://github.com/aolley/moodle into MOODLE_30_STABLE 2016-11-04 14:07:27 +00:00
Tony Lin 8d68bbd484 MDL-56731 groups: Fixes breadcrumb when returning to groups/index.php 2016-11-04 13:28:31 +00:00
Dan Poltawski 07f06046e3 weekly release 3.0.6+ 2016-11-04 11:17:55 +00:00
Dan Poltawski 32f556dda0 MDL-56673 tool_templatelibrary: fix externallib backwards compat
The function now matches the VALUE_DEFAULT option of the service.
2016-11-04 11:45:29 +01:00
Jun Pataleta efec93b8e8 MDL-46903 mod_scorm: Apply alias to compare text column 2016-11-04 14:24:07 +08:00
Andrew Nicols d556156427 Merge branch 'MDL-56673-30-fix1' of http://github.com/damyon/moodle into MOODLE_30_STABLE 2016-11-04 14:10:13 +08:00
Damyon Wiese 5644de2d37 MDL-56673 tool_templatelibrary: Don't show templates from other themes 2016-11-04 14:07:18 +08:00
David Monllao 3d9ed4ae61 Merge branch 'MDL-56748-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-11-04 13:45:49 +08:00
Andrew Nicols c5dd7b71da MDL-56748 cache: Removes cache definition instances in purge_store
Previously a purge_store was only purging caches but it was leaving a
reference to the store instance for the cache definition.

As a result, the cache was never cleared away correctly and, in cases
where the cache store makes a TCP connection to a backend system, the
number of open sockets was increasing for each store instance.

After a complete purge, as found in the unit test reset, the cache
definitions should be both purged and removed.

This change should also lead to a drop in memory consumption for unit
tests as there will no longer be references to unused definition stores.
2016-11-04 13:45:10 +08:00
David Monllao d8ff21935d Merge branch 'mdl30_MDL-46903' of https://github.com/danmarsden/moodle into MOODLE_30_STABLE 2016-11-04 08:25:04 +08:00
Adam Olley 1454c203a9 MDL-53945 mnet: Use moodle_url to provide string with url
Using moodle_url where possible is preferable to hardcoding uri's as
moodle_url is able to take care of alot of the formatting for us.

In this instance, it handles the $CFG->admin url path for us.
2016-11-04 09:13:24 +10:30
Adam Olley 3cc3a80a27 MDL-53945 mnet: replace hardcoded admin dir with cfg
Several places in admin/mnet pull in required files using a hardcoded
admin dir string, as this is configurable it needs to use $CFG->admin
instead.

Places where the url is passed through moodle_url don't need to be
updated as that already automatically translates the urls for us.
2016-11-04 09:13:23 +10:30
David Mudrák 820d389575 MDL-56726 admin: Fix hard-coded path to the admin directory 2016-11-03 10:18:45 +01:00
John Beedell 7c882f4389 MDL-54986 Quiz: Disable add button for quiz with attempts 2016-11-03 09:11:15 +00:00
Dan Marsden 7540ee5e5e MDL-46903 scorm: Fix db error in objectives report for oracle.
also improve 2004 report handling to help with testing.
2016-11-03 21:20:57 +13:00
Andrew Nicols dbda3be673 Merge branch 'MDL-56634-30' of git://github.com/ankitagarwal/moodle into MOODLE_30_STABLE 2016-11-02 14:05:28 +08:00
David Monllao 0b69e31402 Merge branch 'MDL-56323-30' of git://github.com/l-campbell/moodle into MOODLE_30_STABLE 2016-11-02 13:12:29 +08:00
Ankit Agarwal cd9927ac9f MDL-56634 webservices: clean api desc 2016-11-02 10:04:16 +05:30
David Monllao 9e4c960c39 Merge branch 'MDL-43796_30_blindmarking' of https://github.com/SWiT/moodle into MOODLE_30_STABLE 2016-11-02 12:29:14 +08:00
Andrew Nicols 8b2fb6720c Merge branch 'MDL-56673-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-11-02 12:16:28 +08:00
Stephen Bourget b25dab817e MDL-55883 mod_lesson: Missing include in lesson_update_events 2016-11-01 21:21:36 -04:00
Stephen Bourget 82907dc43b MDL-55249 mod_feedback: Associate status with current activity
The status screen in mod_feedback simply checks to see if there are any
attempts in progress to return the user status.  This check should be
limited to only include instances of the current feedback activity not
any feedback activity on the site.
2016-11-01 21:17:04 -04:00
Dan Poltawski 7c889e2f08 Merge branch 'MDL-54112-30' of https://github.com/hcpss-banderson/moodle into MOODLE_30_STABLE 2016-11-01 21:31:06 +00:00
Dan Poltawski 8976674370 Merge branch 'mdl30_MDL-47500' of git://github.com/danmarsden/moodle into MOODLE_30_STABLE 2016-11-01 21:29:34 +00:00
Dan Poltawski 99b8d0a69d Merge branch 'mdl55456-moodle30' of https://github.com/tlock/moodle into MOODLE_30_STABLE 2016-11-01 21:27:51 +00:00
Brian Barnes 468d2770c5 MDL-47500 scorm: improved height calculation 2016-11-02 08:45:43 +13:00
Eloy Lafuente (stronk7) 2ce1d2c71b weekly release 3.0.6+ 2016-11-01 19:48:05 +01:00
Dan Poltawski 3fe2093f3b MDL-56673 templatelibrary: return false when core template doesn't exist 2016-11-01 10:19:28 +00:00
Marina Glancy 9273b920e5 MDL-56615 portfolio_googledocs: add basic unittests 2016-10-31 20:35:20 +01:00
Marina Glancy 03e398154c MDL-56615 portfolio: fix php 7.0.9 warning 2016-10-31 20:34:45 +01:00
Dan Poltawski fdac7064c2 Merge branch 'MDL-56542-30-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-10-31 15:13:56 +00:00
Brendan Anderson b6ed8fdf5f MDL-54112 mod_assign: Add scale null grade filter 2016-10-27 10:09:03 -04:00
Dan Poltawski 84f1341162 weekly release 3.0.6+ 2016-10-27 12:19:32 +01:00
Dan Poltawski 6be87e8003 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-10-27 12:19:31 +01:00
Dan Poltawski 25f472d2a0 Revert "Merge branch 'MDL-56129-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE"
This reverts commit bff2510df9, reversing
changes made to e40c822a58.
2016-10-27 10:05:36 +01:00
Eloy Lafuente (stronk7) 232178eca2 Merge branch 'MDL-56354-30' of https://github.com/mr-russ/moodle into MOODLE_30_STABLE 2016-10-26 01:05:51 +02:00
Russell Smith ca99df58e2 MDL-56354 unittests: Put debug messages in the failure notice. 2016-10-26 09:27:01 +11:00
Dan Poltawski 26d01a4e56 Merge branch 'MDL-56136_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-10-25 20:44:36 +01:00
Eloy Lafuente (stronk7) 617528c5ae Merge branch 'MDL-56250-30-formvalidation' of https://github.com/roperto/moodle into MOODLE_30_STABLE 2016-10-25 20:30:47 +02:00
Helen Foster cba517e826 MDL-56542 lang: Merge English strings from the en_fix language pack 2016-10-25 20:28:40 +02:00
Eloy Lafuente (stronk7) 0fed28f9c9 Merge branch 'MOODLE_30_STABLE' of https://github.com/yuriy-os/moodle into MOODLE_30_STABLE 2016-10-25 20:00:28 +02:00
Dan Poltawski caf74fff01 Merge branch 'MDL-55143-30' of https://github.com/mr-russ/moodle into MOODLE_30_STABLE 2016-10-25 18:39:20 +01:00
AMOS bot 3e2295f008 Automatically generated installer lang files 2016-10-26 00:04:49 +08:00
David Monllao 9bfd78bafc Merge branch 'wip-mdl-56347-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-10-25 15:20:29 +08:00
Russell Smith 0dc04c49bd MDL-56347 caching: Better class variables for notices. 2016-10-25 09:53:49 +08:00
Rajesh Taneja dd705dd7ff MDL-56347 phpunit: Set class for alternative cache store
If alternative cache store is sued, then set the class
and warn user about this.
2016-10-25 09:53:28 +08:00
lazydaisy 91c9d79227 MDL-48350 theme_bootstrapbase: restyle action icons in docked blocks 2016-10-24 21:39:16 +02:00
Dan Poltawski e9f7b1bcc5 Merge branch 'wip-MDL-56439-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-10-24 14:34:11 +01:00
Lee Campbell 811856d064 MDL-56323 core_user: User profile field default value not on signup page
The default value of a configured text input user profile field is not rendering on signup page
2016-10-24 09:34:22 +01:00
David Monllao bff2510df9 Merge branch 'MDL-56129-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-10-24 12:01:19 +08:00
Andrew Nicols 638b683ac5 MDL-56129 core: Set a timeout on the session cookie
This is primarily because iOS has changed something under the hood which
means that only session cookies which have an expiry are passed around the
OS.

In order to make media playable outside of the browser (e.g. a video), we
must set a session cookie timeout.

Since the session timeout is configurable, this patch sets the cookie
timeout to the session timeout plus a period of one week.

This ensures that videos continue to work, and that the expired session
message is shown on the login page, but without requiring excessively long
session times.
2016-10-24 11:48:06 +08:00
Frédéric Massart e40c822a58 MDL-56341 mustache: JS engines handles strings wrapped in quote
Prior to the patch the strings wrapped as the following one
where not found and replaced when rendering the template via Javascript

{{#quote}}{{#str}}string,component{{/str}}{{/quote}}
2016-10-24 10:09:52 +08:00
Yuriy Osychenko b45bc1d389 MDL-53098 lib: Mark form as submitted in confirmation dialog.
If the quiz attempt use popup window with Javascript security it will
show to the user misleading message that he is going to lose entered
data.
To avoid this we should mark form as submitted to turn off browser`s
pop-up window when user confirms finishing attempt.
Also we need to check if core_formchangechecker is present on a page.
2016-10-24 00:43:27 +03:00
Daniel Thee Roperto 511b478297 MDL-56250 forms library: Changed form to validate once per object.
If two instances of moodleforms are validated in the same run, most
likely a phpunit test run, it would store the first validation result.
Now it stores the validation result per instance, not for all instances.
2016-10-21 10:38:47 +11:00
Eloy Lafuente (stronk7) 3d13576463 weekly release 3.0.6+ 2016-10-20 17:52:41 +02:00
Eloy Lafuente (stronk7) bf7e998500 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-10-20 17:52:37 +02:00
Andrew Nicols 6fdcba2544 Merge branch 'MDL-56328_30-fix-rtl' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-10-19 13:30:37 +08:00
David Monllao 7f5f314977 MDL-56328 theme: Remove RTL styles
They should only be applied while editing mode is on
2016-10-19 12:43:29 +08:00
Eloy Lafuente (stronk7) 8d6eaed3b7 Merge branch 'MDL-29774-30-by-sam-wilson' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-10-18 17:34:56 +02:00
Andrew Nicols e904f8c075 MDL-55858 mod_forum: Remove subscription links when not relevant
When a forum is force-subscribed or subscription is disabled, do not
include the subscription link in forum posts.
2016-10-18 17:01:13 +02:00
Dan Poltawski 9f4f53f699 Merge branch 'MDL-56131-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-10-18 13:44:41 +01:00
Dan Poltawski 02cba0b682 Merge branch 'MDL-56062-30' of https://github.com/lucisgit/moodle into MOODLE_30_STABLE 2016-10-18 12:06:59 +01:00
Eloy Lafuente (stronk7) f9d95d9ed9 Merge branch 'MDL-56275-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-10-18 12:13:25 +02:00
Dan Poltawski 26bf333277 MDL-56275 blog: do not display the 'choose a link' button
When registereing an external blog the choose a link button is
misleading, we don't have any repos which restrict to RSS feeds, so the
majority of results you get from the repo picker will be wrong.
2016-10-18 11:09:14 +01:00
David Monllao 48bc44477d Merge branch 'MDL-56328-M30' of git://github.com/lazydaisy/moodle into MOODLE_30_STABLE 2016-10-18 16:08:00 +08:00
Eloy Lafuente (stronk7) 959cb13aad Merge branch 'MDL-56345-30' of https://github.com/lucisgit/moodle into MOODLE_30_STABLE 2016-10-18 09:38:57 +02:00
Tim Lock 533e6018c6 MDL-55456 course: set context for category ajax requests 2016-10-18 12:51:54 +10:30
Sam Wilson 89b8a5c82f MDL-29774 core_user: Update group-membership summaries on AJAX calls 2016-10-18 09:36:09 +08:00
Eloy Lafuente (stronk7) b7108061a4 Merge branch 'wip-mdl-56348-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-10-18 01:10:41 +02:00
Russell Smith 49235cdd85 MDL-55143 unittests: Check the db rather than cache for version hash. 2016-10-18 09:53:38 +11:00
Eloy Lafuente (stronk7) a1e14a55db Merge branch 'MDL-56368-M30' of git://github.com/lazydaisy/moodle into MOODLE_30_STABLE 2016-10-18 00:38:59 +02:00
Michael Aherne 0822adfe49 MDL-56131 choice: Set maximum lifetime for lock 2016-10-17 13:51:22 +08:00
AMOS bot 4079f3ad90 Automatically generated installer lang files 2016-10-17 00:06:59 +08:00
Matthew Switlik b90aa9570a MDL-43796 assign: Reset revealidentities on restore
Set revealidentities to 0 when restoring, importing, or duplicating an
assignment activity with blindmarking on and no user data.
2016-10-14 14:22:33 -04:00
AMOS bot ea69caa2d6 Automatically generated installer lang files 2016-10-15 00:04:57 +08:00
lazydaisy c5b6b52432 MDL-56368 theme_bootstrapbase: Settings for Restrict Access not inline. 2016-10-14 15:55:12 +01:00
lazydaisy 3de493704b MDL-56328 theme_bootstrapbase: reduce activity indent when not editing 2016-10-14 15:27:05 +01:00
Marina Glancy e6885a4e71 MDL-56439 course: added missing require 2016-10-14 08:21:29 +08:00
Eloy Lafuente (stronk7) 3292e36a21 weekly release 3.0.6+ 2016-10-13 20:02:28 +02:00
Eloy Lafuente (stronk7) f330c27f67 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-10-13 20:02:25 +02:00
Eloy Lafuente (stronk7) 3ac6d35915 Merge branch 'MDL-56319-m30' of https://github.com/micaherne/moodle into MOODLE_30_STABLE 2016-10-13 19:47:02 +02:00
Tony Butler f83d4ceb24 MDL-56345 assignfeedback_editpdf: Use correct strings for tool alt text 2016-10-13 10:09:17 +01:00
Tony Butler 003699dba4 MDL-56062 mod_assign: Use $gradeitem->get_decimals() for grade display 2016-10-12 20:57:41 +01:00
AMOS bot 5ac7b30bd3 Automatically generated installer lang files 2016-10-12 00:05:16 +08:00
Paul Holden 6ce2b2b141 MDL-55345 user: correct userid when linking to iplookup from profile 2016-10-11 17:06:54 +02:00
Janek Lasocki-Biczysko 81c5d47c2a MDL-51401 enrol: ensures correct order of roles in UI components
Role sort order was not available in the UI (in JavaScript) due to
the use of PHP assoc arrays and JSON encoding/decoding. This patch
addresses this by sending the roles in a json array, rather than
json object.
2016-10-11 18:01:56 +08:00
David Monllao 6d9c397d37 Merge branch 'MDL-52051-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-10-11 17:11:58 +08:00
Dan Poltawski 61a12d418e Merge branch 'MDL-36611-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-10-11 08:53:49 +01:00
Rajesh Taneja 67a20af671 MDL-56348 cache: Removed second parameter
There is no second parameter in the api
and identifier should be set by set_identifiers
2016-10-11 12:51:58 +08:00
Andrew Nicols a107243c61 MDL-52051 repository_dropbox: Add the V2 API 2016-10-11 11:45:44 +08:00
Kirill Astashov aa8d361b83 MDL-36611 outcome: Set page context when editing outcome 2016-10-11 10:02:01 +08:00
Eloy Lafuente (stronk7) 46da0ff5a5 Merge branch 'MDL-56220-m30' of https://github.com/micaherne/moodle into MOODLE_30_STABLE 2016-10-11 01:18:50 +02:00
Eloy Lafuente (stronk7) 36eebecef6 Merge branch 'MDL-56316-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-10-10 18:18:41 +02:00
Eloy Lafuente (stronk7) bc6a3998b9 Merge branch 'MDL-51633_M30' of git://github.com/lazydaisy/moodle into MOODLE_30_STABLE 2016-10-10 17:49:10 +02:00
Simey Lameze 0fd4fe4fb3 MDL-56050 core: set missing context to maintenance mode 2016-10-10 23:15:28 +08:00
Andrew Nicols 015729e746 MDL-52051 repository_dropbox: Move v1 API aside 2016-10-10 20:34:13 +08:00
Andrew Nicols 72de799d7b MDL-52051 oauth: expires_in is optional 2016-10-10 20:34:13 +08:00
Dan Poltawski 30078d7b9d Merge branch 'MDL-51584-30' of https://github.com/mr-russ/moodle into MOODLE_30_STABLE 2016-10-10 13:27:05 +01:00
Dan Poltawski 5de9f1c0d3 Merge branch 'MDL-55597-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-10-10 11:33:15 +01:00
Michael Aherne ce4ef5bd79 MDL-56319 blocks: Observe empty default blocks setting 2016-10-10 09:55:21 +01:00
Russell Smith dbff7477aa MDL-51584 gradebook: use direct $CFG access for freeze.
get_config() is called a lot of times on freeze and is expensive,
using $CFG is much lower overhead.
2016-10-10 15:43:22 +11:00
AMOS bot c02fd57da7 Automatically generated installer lang files 2016-10-09 00:06:33 +08:00
lazydaisy 8a5e17b2e1 MDL-51633 theme_bootstrapbase: Restyled ADD BLOCK to remove max-width. 2016-10-07 18:58:18 +01:00
AMOS bot f608a42e09 Automatically generated installer lang files 2016-10-08 00:05:07 +08:00
Frédéric Massart 6da1369913 MDL-55597 tool_templatelibrary: Re-inforce logic to skip theme templates 2016-10-07 10:44:40 +02:00
Andrew Nicols ef8da7069e MDL-56316 tests: Ensure consistent assertion count 2016-10-07 14:46:30 +08:00
Eloy Lafuente (stronk7) 7223cd2518 weekly release 3.0.6+ 2016-10-06 22:31:34 +02:00
Dan Poltawski 4be702669b MDL-56303 quiz: lack of quiz filtering
Also, correctly feed completiongradeitemnumber with grade item numbers
and not with grade item ids.
2016-10-06 22:20:09 +02:00
Eloy Lafuente (stronk7) 98648c4242 weekly release 3.0.6+ 2016-10-06 11:51:37 +02:00
Eloy Lafuente (stronk7) cc59a3e2af Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-10-06 11:51:33 +02:00
Dan Poltawski 075f978ba2 Merge branch 'MDL-54802-30-fix-2' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-10-05 14:33:53 +01:00
Cameron Ball 331613ddb1 MDL-54802 mod_quiz: Improve validation when editing a quiz uusing require passing grade
When editing a quiz that is using the require passing grade completion method,
the grade to pass cannot be zero. Since the completion method is locked we
cannot recommend that the completion method is changed (as we do when the quiz
is being created). Instead we have to inform the user that the grade to pass
must not be zero.
2016-10-05 19:32:13 +08:00
Dan Poltawski 41d5e39323 Merge branch 'MDL-54802-30-fix' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-10-05 10:33:52 +01:00
Cameron Ball 7455f7d100 MDL-54802 mod_quiz: Move grade to pass error to require passing grade element
When using a passing grade of zero, with the required passing grade
option, an error was displayed on the "grade to pass" element.
This was confusing as the error message is referring to the
"Require passing grade" element. This patch moves the message to
the "Require passing grade" element.

Additionaly this patch fixes a small typo in a comment.
2016-10-05 17:17:56 +08:00
Rajesh Taneja 7d36214618 MDL-56210 behat: Pending and complete js is added by js_init_code 2016-10-05 15:46:51 +08:00
Eloy Lafuente (stronk7) a231d66dec Merge branch 'MDL-56231-30-flexible_table-construct-phpdoc' of https://github.com/roperto/moodle into MOODLE_30_STABLE 2016-10-05 01:49:18 +02:00
AMOS bot 21a20a0a65 Automatically generated installer lang files 2016-10-05 00:06:43 +08:00
Dan Poltawski 5885ba383a Merge branch 'MDL-55861_30_STABLE' of https://github.com/dj4452/moodle into MOODLE_30_STABLE 2016-10-04 15:44:06 +01:00
Eloy Lafuente (stronk7) 9416c59e47 Merge branch 'MDL-56069_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-10-04 16:37:50 +02:00
Michael Aherne 9fe421f29e MDL-56220 cache: Call static method correctly 2016-10-04 15:03:23 +01:00
Andrew Nicols 4e2770b175 Merge branch 'MDL-55886-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-10-04 11:22:40 +08:00
Dan Poltawski 620ca55842 Merge branch 'MDL-56181-30-czechia' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-10-03 16:43:57 +01:00
Dan Poltawski 754c41eb9f Merge branch 'MDL-52317-m30' of https://github.com/NeillM/moodle into MOODLE_30_STABLE 2016-10-03 16:09:46 +01:00
Dan Poltawski 8edc190aae MDL-54802 quiz: fix bad whitespace 2016-10-03 14:47:21 +01:00
Dan Poltawski df42740f33 Merge branch 'MDL-54802-30' of git://github.com/lameze/moodle into MOODLE_30_STABLE 2016-10-03 14:47:17 +01:00
Andrew Nicols 1b5cc6c463 Merge branch 'MDL-55421-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-10-03 19:49:43 +08:00
Dan Poltawski 3aebea76e0 Merge branch 'wip-MDL-55911-30' of https://github.com/Beedell/moodle into MOODLE_30_STABLE 2016-10-03 10:24:57 +01:00
David Monllao 223378c332 Merge branch 'wip-mdl-56210-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-10-03 13:53:55 +08:00
Daniel Thee Roperto 3320df92f5 MDL-56231 library: Fixed PhpDoc for flexible_table constructor.
The flexible_table::__construct($uniqueid) accepts a string, not an int
as previously noted in the PhpDoc.
2016-10-03 16:05:09 +11:00
Neill Magill 8e2d2046c1 MDL-52317 Atto: Large resized images may display scroll bars
When an image was added via Atto and it was set to resize automatically
if the alignment was set to Top, Middle or Bottom when it was made
smaller then a vertical scroll bar would be displayed.

This was caused by the interaction of the margin settings on the image
and the 100% width set via the img-responsive css class. The width of
an element only includes the content area and not any borders, padding
or margins.

This change stops atto hardcoding the styles for image alignment into
the images style tag, it instead adds a class that defines the alignment
the image should have.

This change has the benefit that themers will now be able to adjust
how atto image alignments work if they wish.

Images added before this patch will continue to have the issue
until they are edited by the plugin, at which time their legacy style
will be removed and the new alignment method will be added.

Thanks to Andrew Nicols who provided a refactor for the Alignment
and style detection code.
2016-09-30 08:51:31 +01:00
Rajesh Taneja 4e9f6420ff MDL-56210 behat: Ensure behat waits for dependancy manager 2016-09-30 10:33:30 +08:00
Dan Poltawski 71d9056aef MDL-55886 block_rss_client: fix oracle compatibility 2016-09-29 16:59:53 +01:00
Deepa Jayaprakash 411fdd46c5 MDL-55861 course: Click drag&drop icon, incorrect activities shown 2016-09-29 16:47:52 +01:00
Dan Poltawski 2a6ac3f844 MDL-55421 travis: check npm/grunt on multiple npm versions
This is a backport of the patch from MDL-55048

Check npm install and grunt execution on the higest and lowest node
versions. Included some minor tweaks along the way:

* Move the grunt execution into scripts part of the configuration (that way
  the grunt output is not collapsed and is easily visible in build output).

* Restructure the install section to be task based (thanks to Eloy for
  the suggestion) and as such, don't run composer install on the grunt
  task (speed up the build slightly).

* Switch around the grunt job to a matrix include so that every
  variation of grunt job doesn't need to be excluded.
  ( https://docs.travis-ci.com/user/customizing-the-build/#Explicity-Including-Jobs )
2016-09-29 16:43:27 +01:00
Dan Poltawski a30b21e86f MDL-55421 js: add some global ignores to js files
This is to prevent linting to be extremely noisy about rollup related
problems.

Should not affect built files.
2016-09-29 16:43:27 +01:00
Dan Poltawski 08f8ff9ffc MDL-55421 eslint: add config/package defintion
Partial backport of MDL-52127 to allow people to use eslint linting
in earlier branches than master.

This is an earlier version of eslint than in master beacuse of
node requirements being higer.
2016-09-29 16:43:27 +01:00
Eloy Lafuente (stronk7) 59fac4cf16 MDL-56127 forms: multiple select dependencies fixed
This is a fix for a regressions introduced by MDL-54778. It
seems that escaped all our tests because there isn't any case
of such a dependency in core, but Daniele Cordella was facing
it within his surveypro module.
2016-09-29 16:52:51 +02:00
Dan Poltawski 43f53ff0f5 weekly release 3.0.6+ 2016-09-29 12:42:58 +01:00
Dan Poltawski f9de835157 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-09-29 12:42:56 +01:00
David Mudrák daa9b4d3c2 MDL-56181 lang: Fix CI and CZ country short names to match ISO 3166 2016-09-29 11:53:11 +02:00
Eloy Lafuente (stronk7) 895b108ff1 Merge branch 'MDL-55804_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-09-29 01:14:49 +02:00
Eloy Lafuente (stronk7) 0de90550dc Merge branch 'MDL-56019-30' of git://github.com/dpalou/moodle into MOODLE_30_STABLE 2016-09-28 20:08:48 +02:00
Dan Poltawski d1b6cf4333 Merge branch 'MDL-56038-m30' of https://github.com/sammarshallou/moodle into MOODLE_30_STABLE 2016-09-28 14:42:49 +01:00
Eloy Lafuente (stronk7) 1c6999087f MDL-46946 user: Document user_not_fully_set_up() changes 2016-09-28 02:23:21 +02:00
Eloy Lafuente (stronk7) 527dc0ce02 Merge branch 'MDL-46946-30-reqcusfield' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-09-28 02:22:03 +02:00
Rajesh Taneja 20a8c2e9c2 MDL-55957 behat: Set some text before selecting in Atto 2016-09-28 01:42:25 +02:00
Eloy Lafuente (stronk7) e1043b0311 Merge branch 'MDL-55951-30' of git://github.com/crazyserver/moodle into MOODLE_30_STABLE 2016-09-28 00:11:43 +02:00
Tim Hunt ff085ba20b MDL-56136 restore: better error handling copying file at start 2016-09-27 18:10:13 +01:00
Tim Hunt 14f75eda28 MDL-56069 quiz: nav buttons don't scroll to the right question
When there is more than one question on a page, say questions 2, 3 & 4.
Then when you click the navigation button for Q4, then it should load
the next page scrolled down so that Q4 is visible. That was not working.
2016-09-27 17:57:51 +01:00
AMOS bot 5b99ccb9e3 Automatically generated installer lang files 2016-09-28 00:04:54 +08:00
Jean-Philippe Gaudreau cd9cf364a1 MDL-56040 behat: Fixing missing "|" in tables 2016-09-27 14:58:03 +01:00
Dan Poltawski 875ee59a5a Merge branch 'MDL-55987-30-grademem' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-09-27 11:23:48 +01:00
Dan Poltawski 96de3cf711 Merge branch 'MDL-55957-30-workshopfiles' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-09-27 10:37:29 +01:00
David Monllao 750a1815b1 MDL-55804 tool_uploadcourse: strftime only to user input
Default value already comes as a timestamp.
2016-09-27 08:12:16 +08:00
David Monllao aca1dc1b63 MDL-55804 forms: Return exported data through _prepareValue 2016-09-27 08:12:16 +08:00
AMOS bot 40b98690ed Automatically generated installer lang files 2016-09-24 00:04:52 +08:00
John Beedell 4296f2b9da MDL-55911 Quiz: Accessibility, Label blanks in DD questions 2016-09-23 13:46:39 +01:00
Eloy Lafuente (stronk7) 1de74443af weekly release 3.0.6+ 2016-09-23 10:01:39 +02:00
Eloy Lafuente (stronk7) 2073c4871b Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-09-23 10:01:35 +02:00
AMOS bot b0a3467e82 Automatically generated installer lang files 2016-09-23 00:04:56 +08:00
Simey Lameze 9283ca1850 MDL-54802 mod_quiz: Add validation to require passing grade greater than 0
This commit adds a form validation to prevent the creation of quizzes
using zero or null grade to pass when using require passing grade.
2016-09-22 08:57:48 +08:00
David Mudrák d0f7cefec6 MDL-46946 user: Make missing required custom fields trigger profile edit
If there is a required custom field that the user can fill by editing
their profile, and that field is missing, the user should be considered
as not fully set up. Instead, we want to redirect them to edit their
profile first.

There are some exceptions when we want to fall back to the previous
behaviour and check just the name and email fields. These exceptional
cases include checking remote user data in incoming MNet request (no
user id, no custom fields supported) and calls to require_login() with
redirecting disabled (typically ajax filepicker requests on profile
editing page itself).

Additional plugins that call the function user_not_fully_set_up()
themselves, should perform the strict check in most/typical cases. So
the strict mode is enabled by default even if it changes the behaviour
slightly. In improbable case of additional plugins relying on the
previous behaviour of the function, they can use the $strict parameter
and keep performing the lax check. However, I am sure the correct fix in
that case will likely be to stop abusing this function.

Note that custom fields are not currently transferred during the MNet
roaming. So having custom fields configured as required on MNet service
provider site (where users can't edit their profiles) is expected to
display an error (as the site is considered as misconfigured).
2016-09-21 18:05:06 +02:00
sam marshall 08e3be8806 MDL-56038 Web services: json_last_error_msg not in PHP 5.4 2016-09-20 14:53:46 +01:00
Andrew Nicols 93c60b87e4 Merge branch 'MDL-55876-30' of git://github.com/lameze/moodle into MOODLE_30_STABLE 2016-09-20 09:12:01 +08:00
Simey Lameze cdd3def5b6 MDL-55876 core_course: prevent changes on front page course 2016-09-20 08:52:14 +08:00
Ruslan Kabalin bfe06f7600 MDL-55776 enrol: Optimise enrolled users listing.
Here we optimise SQL queries for enrolled users list. Expensive subquery is
replaced with faster LEFT JOIN and the whole groups filtering component is
aded on demand.
2016-09-19 23:48:41 +02:00
Ruslan Kabalin 3df86df503 MDL-55776 enrol: Add unit tests for enrolment manager. 2016-09-19 23:48:35 +02:00
AMOS bot b733fa7055 Automatically generated installer lang files 2016-09-20 00:04:51 +08:00
Dan Poltawski d989883024 Merge branch 'MDL-55988_30_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_30_STABLE 2016-09-19 12:08:55 +01:00
Dan Poltawski 8c90381a31 Merge branch 'wip-mdl-55117-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-09-19 11:39:44 +01:00
Dan Poltawski fdd56d83e3 Merge branch 'm30_MDL-55820' of git://github.com/danmarsden/moodle into MOODLE_30_STABLE 2016-09-19 11:32:21 +01:00
Dan Poltawski e5c03946e7 Merge branch 'MDL-55944_30' of https://github.com/mr-russ/moodle into MOODLE_30_STABLE 2016-09-19 11:28:27 +01:00
Eloy Lafuente (stronk7) 350b6ce426 MDL-29332 versions: Force bump becuase patch ones were matching upstream 2016-09-19 12:03:49 +02:00
Eloy Lafuente (stronk7) b11daeca71 Merge branch 'wip-MDL-29332-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-09-19 12:02:46 +02:00
Dani Palou d6fd5d362f MDL-56019 ws: Use itemid null when getting modules intro 2016-09-19 11:48:20 +02:00
David Monllao 8a1a0bbbaf Merge branch 'MDL-42041-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-09-19 15:09:38 +08:00
AMOS bot ecc07981ad Automatically generated installer lang files 2016-09-17 00:04:59 +08:00
Russell Smith 115f9cc02a MDL-55602 session: Add redis handler with locking.
Backport of MDL-54606
2016-09-16 08:15:30 -07:00
Mark Johnson a4a2d1edd0 MDL-55988 Forms: Stop autocomplete triggering warning on unload
Prevents autocomplete fields marking a form "dirty" when initialised,
and allows them to honour the "ignoredirty" class.
2016-09-16 13:09:05 +01:00
David Mudrák 6ff87b25d4 MDL-55987 gradebook: Claim extra memory when updating final grades
As we experienced in a bigger moodle.org course (7500 users, 70 grade
items), the standard memory limit 256M may not be enough here. We were
not able to find any obvious memory leak in the processing. Requiring
extra memory helped in this particular case and it seems reasonable to
have it in the core.
2016-09-16 12:49:51 +02:00
AMOS bot 20c207639a Automatically generated installer lang files 2016-09-16 00:05:26 +08:00
Dan Poltawski cb3b8c222e weekly release 3.0.6+ 2016-09-15 11:15:01 +01:00
David Monllao be08c8a7de Merge branch 'MDL-55945-30' of https://github.com/snake/moodle into MOODLE_30_STABLE 2016-09-15 12:39:01 +08:00
Jake Dallimore fe096488fe MDL-55945 login: fix https support for forgot_password.php 2016-09-15 09:22:41 +08:00
David Mudrák 01ffc90d90 MDL-55957 workshop: Add behat tests for embedded images
This tests basic functionality of the images embedded into the
instructions and conclusion fields.
2016-09-14 14:38:04 +02:00
David Mudrák 3c215fa3d2 MDL-55957 workshop: Fix the embedded files serving
There was a bug with serving the files from the areas instructauthors,
instructreviewers and conclusion. These three areas should not use the
itemid in the plugininfo URLs. But they did use 0 as the itemid which
broke the file previews when browsing via server files repository.

The first part of the patch fixes all relevant calls to
file_rewrite_pluginfile_urls() so that null is now properly used instead
of zero.

The second part of the fix is that we no longer delete the first $args
element in the workshop_pluginfile() function - the itemid is not
supposed to appear there now.

The last part of the patch is that instead of repeating the same code
block copy&pasted for each file area in workshop_pluginfile(), we now
have a single block covering them all.
2016-09-14 12:43:24 +02:00
Rajesh Taneja d7c33a1392 MDL-55117 behat: Re-initialise to ensure modified config is not used
As behat cli process is 1 run for features
Any modification in  will be reflected
in later runs on cli. In this case
- disabling enablebadges in block_badges.feature
- reflected while running cron in award_badges.feature
2016-09-14 10:47:15 +08:00
Russell Smith 85efc6975a MDL-55944 testing: Reduce sleep usage.
Remove sleep() and replace with waiting for a second to roll over,
this results in a simpler call the guarantee time() has moved forward
2016-09-14 10:26:14 +10:00
Marina Glancy 789b0b62c3 MDL-55864 general: fix PHP7.1 strict warnings 2016-09-13 15:24:17 +01:00
Pau Ferrer Ocaña 078d007b87 MDL-55951 output: Add errorcode to fatal_error when available 2016-09-13 15:30:25 +02:00
Adrian Greeve 43e6d24c87 MDL-55505 mod_assign: Fix to feedback behat test. 2016-09-13 11:16:07 +08:00
Marina Glancy bc48debf36 MDL-29332 question: calculated variables may differ in case only 2016-09-13 10:15:26 +08:00
Eloy Lafuente (stronk7) 76b676b929 Merge branch 'wip-MDL-55505-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-09-12 19:26:36 +02:00
Eloy Lafuente (stronk7) 03eab92866 Merge branch 'wip-MDL-55654-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-09-12 19:16:08 +02:00
Eloy Lafuente (stronk7) 71bea77b6a Merge branch 'MDL-55632-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-09-12 19:03:37 +02:00
Eloy Lafuente (stronk7) d4b14d6298 Merge branch 'MDL-55874-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-09-12 18:32:45 +02:00
Dan Poltawski d357ee7039 Merge branch 'wip-mdl-55353-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-09-12 11:49:38 +01:00
Dan Poltawski be27606bf1 Merge branch 'wip-MDL-55862-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-09-12 11:11:28 +01:00
Dan Poltawski 5a9d8d48ca Merge branch 'wip-mdl-55610-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-09-12 10:18:20 +01:00
David Monllao 16c89550d8 Merge branch 'MDL-55626-M30' of git://github.com/lazydaisy/moodle into MOODLE_30_STABLE 2016-09-12 12:39:15 +08:00
David Monllao 1e95a37cf3 Merge branch 'MDL-53893-30' of git://github.com/lameze/moodle into MOODLE_30_STABLE 2016-09-12 10:29:43 +08:00
Eloy Lafuente (stronk7) b022c2cd1c Moodle release 3.0.6 2016-09-10 22:50:18 +02:00
lazydaisy be50133b45 MDL-55626 theme_clean: Fixed clean theme missing desktop-first-column 2016-09-10 01:24:12 +01:00
Marina Glancy 7416cc5d48 MDL-55654 user: apply format_string to field names 2016-09-09 14:31:51 +08:00
Rajesh Taneja 65c0e2b9b4 MDL-55353 behat: Ensure teacher edit activity at different time
Recent activity is showing activities which were
updated since user last logged in and first modification
done on the activity. So ensure update happens at different
time than activity created.
2016-09-09 10:17:18 +08:00
Simey Lameze 95c919d651 MDL-53893 core_badges: Behat for all selected roles award badges 2016-09-09 08:44:22 +08:00
Simey Lameze 8dcf12afdc MDL-53893 core_badges: Add strictness to manual badge criteria 2016-09-09 08:44:22 +08:00
Adrian Greeve 598e62100c MDL-55505 mod_assign: Editing previous attempt works correctly.
Editing a previous attempt keeps the current feedback and grades
as it should and does not override them.
2016-09-08 20:33:22 +08:00
Adrian Greeve e9bf5a3998 MDL-55862 mod_data: Use proper name function for display.
The old method for displaying the name of a field was being
used. This meant that it was not possible to show a plugin's
name in view.php

Thanks to David Herney Bernal for providing a solution.
2016-09-08 20:30:00 +08:00
Dan Poltawski be4e216e6b MDL-55874 report_particiption: fix invalid html
When messaging disabled.
2016-09-08 08:05:06 +01:00
David Monllao 04b0feca62 weekly release 3.0.5+ 2016-09-08 13:56:37 +08:00
Adrian Greeve 8b61a6a338 MDL-41174 course: Update calendar events.
Updates calendar events when the activity name is changed.
2016-09-07 14:17:05 +08:00
Jake Dallimore f9c8cef1a4 MDL-50803 login: Remove token from URL in forgot password process
Store the token value in the session and redirect to self, thus
removing the token from the URL and eliminating the problem where
the token is exposed via the http referer header.
2016-09-06 22:22:25 +08:00
Juan Leyva d80dbeb289 MDL-49026 webservice: Remove tokens on password change 2016-09-06 22:22:25 +08:00
Eloy Lafuente (stronk7) 5b33ea8f59 Merge branch 'MDL-55618-m30' of https://github.com/NeillM/moodle into MOODLE_30_STABLE 2016-09-06 16:20:51 +02:00
Eloy Lafuente (stronk7) f38037357a Merge branch 'wip-MDL-55844-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-09-06 16:08:31 +02:00
Dan Poltawski 03200f984e Merge branch 'MDL-42125_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-09-06 11:48:52 +01:00
Dan Poltawski e4a959503b Merge branch 'wip-mdl-55749-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-09-06 08:46:09 +01:00
Andrew Nicols aaf50eed5d MDL-42041 mod_book: Add Turn Editing On to page body 2016-09-06 15:39:44 +08:00
Rajesh Taneja b6c2b6e0f6 MDL-55749 badges: define global before using it 2016-09-06 10:29:03 +08:00
David Monllao 2e77fffa31 Merge branch 'MDL-55617-m30' of https://github.com/NeillM/moodle into MOODLE_30_STABLE 2016-09-06 10:18:25 +08:00
David Monllao ef8d67664b Merge branch 'MDL-55587-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-09-06 10:07:21 +08:00
Rajesh Taneja 9074566c1d MDL-55610 behat: Clear static file cache
php file cache might be out-of-sync
to ensure full directory is deleted
clear php file cache
2016-09-06 09:44:20 +08:00
Eloy Lafuente (stronk7) 9c238c8e25 Merge branch 'MDL-55663-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-09-05 18:07:27 +02:00
Eloy Lafuente (stronk7) d5e3b4879e Merge branch 'MDL-55724-m30' of https://github.com/sammarshallou/moodle into MOODLE_30_STABLE 2016-09-05 17:33:54 +02:00
Dan Poltawski 7b6f134c96 Merge branch 'MDL-55627_30' of https://github.com/bostelm/moodle into MOODLE_30_STABLE 2016-09-05 14:09:15 +01:00
Dan Poltawski b350178a7c Merge branch 'MDL-55742-30' of https://github.com/xow/moodle into MOODLE_30_STABLE 2016-09-05 10:50:47 +01:00
Henning Bostelmann dbf9bf0dab MDL-55627 filter_mathjaxloader: use correct string concatenation op 2016-09-05 11:43:16 +02:00
Dan Poltawski cab725229c Merge branch 'MDL-55771_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2016-09-05 10:18:52 +01:00
Dan Poltawski 2087df46f6 Merge branch 'MDL-55815_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-09-05 08:57:38 +01:00
Dan Poltawski bc82c260b8 Merge branch 'MDL-54113-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-09-05 07:53:07 +01:00
David Monllao 8902327ac9 Merge branch 'wip-MDL-41174-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-09-05 13:46:12 +08:00
Adrian Greeve 39aa2988b3 MDL-41174 course: Module name change updates calendar. 2016-09-05 08:59:02 +08:00
Marina Glancy f09f5a3c88 MDL-55844 profile: display formatted course name 2016-09-02 18:05:12 +08:00
John Okely ac8e288f11 MDL-55457 mod_lti: Support object icon_info in tool proxy 2016-09-02 09:46:40 +08:00
Tim Hunt 3ab94015bb MDL-42125 quiz stats: clearer message when manual grading required 2016-09-01 12:36:00 +01:00
Neill Magill 21fcfae6b7 MDL-55617 backup: Possible fatal errors in backup and restore
The unserialize() function will not always return an object
especially when as can happen the controller field of a
record in the backup_controllers table is empty.

This change ensures that in this case the script will
not cause a fatal error, but instead throw an error.
2016-09-01 08:50:16 +01:00
Neill Magill cb9594a285 MDL-55618 backup: Header should not be output twice
Before this patch if the pre-check failed during
the final stage of an import a request for the
page header to be output was made for a second
time, this caused a coding_error to occur.

This change removes the second request to
output the page header, which will allow the user
to see the reasons the pre-check failed.
2016-09-01 08:48:55 +01:00
John Okely 99f6caea55 MDL-55742 mod_lti: Remove support for get_magic_quotes_gpc
Thanks to Bishop Bettini for the original patch.
2016-09-01 15:00:05 +08:00
David Monllao 4846a96518 weekly release 3.0.5+ 2016-09-01 11:14:08 +08:00
David Monllao 258d8124ed Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-09-01 11:14:06 +08:00
Dan Marsden e46c306d8e MDL-55820 scorm: use correct displayattempt default options 2016-09-01 13:30:33 +12:00
Tim Hunt 9ad7051878 MDL-55815 quiz review: after close should beat immediately after
This only arises in specific situations: student submitted less than 2
mintues before time close, or when a teacher previews after the close
date. However, in those cases, the old behaviour was confusing. Now,
'After the quiz is closed' takes priority.
2016-08-31 13:00:25 +01:00
Tim Hunt 75ca17683b MDL-55815 quiz: convert attempt state tests to a data provider 2016-08-31 13:00:24 +01:00
Eloy Lafuente (stronk7) 4a59ad1168 Merge branch 'MDL-55237_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-08-30 12:55:03 +02:00
sam marshall 599e1a877b MDL-55724 Glossary: Prevent infinite loop in trusttext_strip 2016-08-30 10:32:00 +01:00
Mark Nelson e13382cd6b MDL-55771 core: added title attribute when using JS to render {{pix}} 2016-08-30 14:58:57 +08:00
Marina Glancy c6adb42063 MDL-55581 htmlpurifier: test for attributes in video tag 2016-08-30 13:49:57 +08:00
Frederic Massart df248aab58 MDL-55663 filter: Filters could be incorrectly reported as inactive 2016-08-30 11:23:18 +08:00
David Mudrák 302d9fea73 MDL-55660 tablelib: Fetch only a single row when auto defining columns
In a very rare cases where the columns are not declared explicitly, we
want to fetch single row only without a warning raised. This seems like
a valid use case for IGNORE_MULTIPLE flag.
2016-08-29 19:14:19 +02:00
AMOS bot 6721af2ec4 Automatically generated installer lang files 2016-08-30 00:05:12 +08:00
Eloy Lafuente (stronk7) 5096a6d39d Merge branch 'MDL-55667-30-participantslink' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-08-29 16:54:04 +02:00
Eloy Lafuente (stronk7) 5997c8775d Merge branch 'MDL-55741_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-08-29 14:08:54 +02:00
Cameron Ball a7085963b5 MDL-55587 core_media: Properly escape ampersand 2016-08-29 19:16:37 +08:00
David Mudrák 9dc0baedfa MDL-55667 navigation: Do not display site participants link to students
The problem here was that user/index.php checks the system level
capability moodle/site:viewparticipants when the user is on the front
page, and the moodle/course:viewparticipants on non-front pages.

But the navigation displayed the link by mistake even in situations,
when the user has the capability moodle/course:viewparticipants on the
front page (typically when the default role for the front page is set to
student).

Added behat tests for reproducing the bug and also for checking the
basic functionality of the feature.
2016-08-29 12:11:53 +02:00
David Monllao 12ed0259b6 Merge branch 'wip-MDL-55581-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-08-29 16:54:29 +08:00
David Monllao 092fecd7be Merge branch 'MDL-55661-30-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-08-29 14:40:50 +08:00
David Monllao 22a42d5093 Merge branch 'MDL-55312_load_timeout_for_amd_modules_30' of https://github.com/gthomas2/moodle into MOODLE_30_STABLE 2016-08-29 14:31:59 +08:00
Marina Glancy 4496863cfd MDL-55581 htmlpurifier: allow track tag in videos and audios 2016-08-29 13:26:24 +08:00
David Monllao f2a7331dca Merge branch 'wip-MDL-55708-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-08-29 11:19:15 +08:00
David Monllao 443dcc00c3 Merge branch 'MDL-55477_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-08-29 11:14:36 +08:00
David Monllao abac5252aa MDL-55237 mod_forum: Adding missing require as in 31 and master 2016-08-29 10:11:06 +08:00
Tim Hunt affe326f23 MDL-55741 phpunit: does not reset get_log_manager cache 2016-08-26 17:15:40 +01:00
AMOS bot f451db08d4 Automatically generated installer lang files 2016-08-27 00:05:01 +08:00
Helen Foster ab71d16bd8 MDL-55661 lang: Merge English strings from the en_fix language pack 2016-08-25 14:41:55 +02:00
Dan Poltawski b5f3ed32a6 weekly release 3.0.5+ 2016-08-25 12:09:41 +01:00
Dan Poltawski b9435d3688 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-08-25 12:09:40 +01:00
Marina Glancy 3ea2065563 MDL-55708 mod_assign: display formatted acitvity names 2016-08-25 09:53:59 +08:00
AMOS bot bca6ca7a2a Automatically generated installer lang files 2016-08-25 00:05:43 +08:00
Andrew Nicols ba175bc7ac MDL-54113 assign: Open files in new window
Open files in a new window when viewing to ensure that the form change
checker does not warn about the page reloading.
2016-08-24 11:34:27 +08:00
David Monllao 4e4040df85 Merge branch 'MDL-55604-30' of https://github.com/mr-russ/moodle into MOODLE_30_STABLE 2016-08-24 09:36:46 +08:00
Russell Smith d391b3472a MDL-55604 cache: Fix identifier and cacheable_object
When a cachable object is store in the static cache from
the backing store, it was incorrect serialised rather than
using the wake function.  This has been resolved and tests added.

During the investigation into cacheable_object, it was discovered
that set_identifiers never removes identifiers when you call it,
so set_identifiers(array('a')) and set_identifiers(array('b')) really
resulted in array('a','b') as the identifiers rather than 'b'.

The fix for this issue depends on the set_identifiers fix and
they have been coupled together as a result.
2016-08-24 08:28:50 +10:00
gthomas2 57a5be5490 MDL-55312 requirejs: Fix timeouts with infinite waitSeconds 2016-08-23 17:42:01 +01:00
Dan Poltawski f3c7517c85 Merge branch 'MDL-55628-m30' of https://github.com/sammarshallou/moodle into MOODLE_30_STABLE 2016-08-23 15:48:13 +01:00
Dan Poltawski 09c37aa4eb Merge branch 'wip-mdl-46514-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-08-23 08:59:40 +01:00
David Monllao 16ede7192d Merge branch 'MDL-46654-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-08-23 15:31:23 +08:00
Andrew Nicols 49b3391b98 MDL-46654 mod_forum: Hide digestoptions when no subscription
Daily digest options should not be generated if the user cannot subscribe
to anything in the first place.
2016-08-23 15:10:25 +08:00
David Monllao 893b75e690 Merge branch 'MDL-54838-30' of https://github.com/nashtechdev01/moodle into MOODLE_30_STABLE 2016-08-23 12:44:49 +08:00
sam marshall d34fa71df4 MDL-55628 Completion: Use simpledata for completion cache
The completion cache is currently not marked as simpledata. On the
course page it is frequently retrieved hundreds of times which results
in many calls to the slow unserialize function. By making a slight
change to the data format (using arrays instead of objects) we can
mark it as simpledata, which will avoid using unserialize.
2016-08-22 17:16:50 +01:00
Dan Poltawski bacf77c9d7 Merge branch 'MDL-55273-cookie-secure-default-MOODLE_30_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_30_STABLE 2016-08-22 15:25:40 +01:00
Jake Dallimore 88e7c13d9a MDL-55565 core_backup: Fix warning when restoring question categories
Fixed a call to get_records_sql, which was being used incorrectly in
restore_find_best_target_context to determine a unique contextid.
2016-08-22 14:23:21 +01:00
Dan Poltawski a2b3f5864b Merge branch 'MDL-55605-lesson-restore-bug-MOODLE_30_STABLE' of https://github.com/kenneth-hendricks/moodle into MOODLE_30_STABLE 2016-08-22 14:13:28 +01:00
Dan Poltawski 2dc70084d3 Merge branch 'MDL-55551_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-08-22 12:53:34 +01:00
Dan Poltawski 68ec7cb526 Merge branch 'MDL-55557_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-08-22 12:45:55 +01:00
Dan Poltawski a7a02f8cc0 Merge branch 'wip-MDL-22183-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-08-22 09:12:54 +01:00
Brendan Heywood 1a93f1de4a MDL-55273 admin: Change $CFG->cookiesecure default to on 2016-08-22 09:24:12 +10:00
Tim Hunt 85f7df7e06 MDL-55477 quiz reports: all user fields should have repeats suppressed 2016-08-19 18:05:15 +01:00
Rajesh Taneja d235685214 MDL-46514 behat: section should be set before switch-case 2016-08-19 14:13:03 +08:00
Andrew Nicols b509663e15 MDL-55632 mod_forum: Tidy up forum post messages 2016-08-19 09:58:50 +08:00
Kenneth Hendricks 251752740b MDL-55605 mod_lesson: Fix activitylinks restore bug 2016-08-18 16:39:38 +10:00
Adrian Greeve 66fc37ed7f MDL-22183 lib: More unit tests for next day start. 2016-08-18 10:25:18 +08:00
Adrian Greeve 5f46e36461 MDL-22183 lib: Cleanup of get_next functions. 2016-08-18 10:25:18 +08:00
Adrian Greeve 496be783b3 MDL-22183 lib: Time settings removed for stats cron.
Old settings that should be ignored have been removed from the
statistics cron code.
2016-08-18 10:25:18 +08:00
Dan Poltawski 490e8f97e6 weekly release 3.0.5+ 2016-08-17 14:47:14 +01:00
Dan Poltawski bc0fc18cec Merge branch 'MDL-36713_m30v2' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-08-16 12:05:23 +01:00
Andrew Nicols dec2a585a3 Merge branch 'MDL-55272-30' of https://github.com/mr-russ/moodle into MOODLE_30_STABLE 2016-08-16 15:11:39 +08:00
Russell Smith ffd94de398 MDL-55272 lib: Allow random_bytes() to return large values.
PHP has a recursion limit and random_bytes on PHP5.6 without openssl
will error if sent a large value.  Using a loop has lower overhead than
recursion as well.
2016-08-16 12:16:45 +10:00
Stephen Bourget 20fb475465 MDL-36713 Blog: Display accurate error when a guest views a user blog 2016-08-15 21:50:31 -04:00
Andrew Nicols cf9a76e739 Merge branch 'wip-MDL-50586-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-08-16 08:52:56 +08:00
Dan Poltawski 92ed7da4d1 Merge branch 'wip-MDL-55494-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-08-15 13:14:42 +01:00
Dan Poltawski 014237d27d MDL-52105 enrol_self: fix upgrade savepoint 2016-08-15 12:11:50 +01:00
Dan Poltawski 09dec86ebd Merge branch 'wip-MDL-55366-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-08-15 11:43:41 +01:00
Dan Poltawski 8f300a967c Merge branch 'wip-MDL-55397-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-08-15 11:35:39 +01:00
Dan Poltawski 37cee5e44a Merge branch 'MDL-52105-30' of git://github.com/lameze/moodle into MOODLE_30_STABLE 2016-08-15 11:14:06 +01:00
Simey Lameze 67bdccc036 MDL-52105 enrol_self: Behat test for key holder feature 2016-08-15 13:00:28 +08:00
Simey Lameze ed21b54c5a MDL-52105 enrol_self: Fix wrong holdkey cap restriction for manager
This commit add an upgrade step to remove wrong CAP_PROHIBIT on enrol/self:holdkey for manager role.
Also remove the restriction from the self enrolment access file.
2016-08-15 13:00:28 +08:00
Adrian Greeve 038cfaffcc MDL-55366 mod_lesson: Fix warning with TF page.
Having an image in the answer text would create a warning.
2016-08-15 10:22:21 +08:00
Stephen Bourget 31348f709e MDL-55557 mod_wiki: Add missing MOODLE_INTERNAL checks 2016-08-13 21:43:23 -04:00
Stephen Bourget 989dd5a826 MDL-55551 Blog: Add missing MOODLE_INTERNAL check. 2016-08-12 20:22:57 -04:00
Marina Glancy f7503bd6c2 MDL-55494 report_eventlist: ignore only logstore_legacy 2016-08-12 13:56:14 +08:00
Marina Glancy 23fb083903 MDL-55494 tool_monitor: ignore only tool_monitor and logstore_legacy
previously any plugin type ending with _monitor or _legacy would be ignored
2016-08-12 13:56:14 +08:00
Marina Glancy de9cd39715 MDL-50586 gradingform_rubric: warn about missing 0-points levels 2016-08-12 13:26:32 +08:00
Marina Glancy a52c83d83e MDL-55397 block_site_main_menu: eliminate CSS conflict
CSS for '.path-admin .buttons' defines padding, border and background that affected how main menu looks on admin pages
2016-08-11 15:43:41 +08:00
Andrew Nicols d418f42040 weekly release 3.0.5+ 2016-08-11 13:17:12 +08:00
Andrew Nicols 02d570966a Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-08-11 13:17:08 +08:00
AMOS bot 3ea6de7502 Automatically generated installer lang files 2016-08-10 00:05:07 +08:00
Dan Poltawski c6cb45fce7 Merge branch 'wip-MDL-55425-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-08-09 10:58:42 +01:00
Dan Poltawski 7502cdf6c6 MDL-51078 report_log: use simpler/faster str_split over preg_split 2016-08-09 09:09:15 +01:00
Stephen Bourget d1a50dce98 MDL-51078 report_log: Allow filtering by all changes 2016-08-09 09:09:09 +01:00
Andrew Nicols 95cc9d3b53 Merge branch 'wip-mdl-55329-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-08-09 14:28:19 +08:00
Andrew Nicols c8c910b1bd MDL-55274 mod_chat: Add unit tests for special commands 2016-08-09 10:49:53 +08:00
Andrew Nicols 6c0deebbd9 Merge branch 'MDL-55274-30' of git://github.com/lameze/moodle into MOODLE_30_STABLE 2016-08-09 10:49:47 +08:00
Dan Poltawski 771f142254 Merge branch 'MDL-55398_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-08-08 10:40:50 +01:00
Mark Nielsen 339ca4ca04 MDL-55453 core_lib: Fix usage of js_send_uncached 2016-08-08 09:54:22 +01:00
Russell Smith 42a4a52a4c MDL-55292 performance: Allow Tideways profiler extension.
PHP7 doesn't have any default XHProf support and all other
investigated forks don't have stable PHP7.  Tideways is under
active development and is easy to install.  The data format
is compatible with XHProf so it is a drop-in replacement in that way.
2016-08-08 15:26:42 +08:00
Nick Phillips 06c9734dc8 MDL-55274 mod_chat: regain beep and / command in mod_chat.
format_text cannot be called on the whole input text, but must be
called on user-supplied text that will be output into chats. This
means it cannot simply be called in one place, but must instead be
called on the relevant parts of text once commands have been matched.
2016-08-08 12:29:32 +08:00
Andrew Nicols 2cfeebee65 Merge branch 'MDL-55454_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-08-08 10:04:18 +08:00
AMOS bot 32a9efd6dc Automatically generated installer lang files 2016-08-06 00:05:20 +08:00
Marina Glancy 6ed74faf27 MDL-55425 user: allow to update another user editor pref 2016-08-05 09:39:36 +08:00
Andrew Nicols e7c8da0fb8 weekly release 3.0.5+ 2016-08-04 09:58:53 +08:00
Andrew Nicols 4c9af61327 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-08-04 09:58:50 +08:00
Rajesh Taneja 0944b1641a MDL-54656 behat: Skip test if db family is not mysql or postgres 2016-08-04 08:47:42 +08:00
Tim Hunt f19f239c98 MDL-55454 quiz: loses shufflequestion setting restoring old backups 2016-08-03 18:43:28 +01:00
Eloy Lafuente (stronk7) b7f6ea3578 Merge branch 'MDL-54656_m30v3' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-08-03 00:51:52 +02:00
Eloy Lafuente (stronk7) 95086f294b Merge branch 'MDL-55166-30-blocksettings' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-08-03 00:34:11 +02:00
Dan Poltawski a896f02f1f MDL-54847 tests: fix unused var 2016-08-02 20:16:45 +01:00
Cameron Ball 4f9a64b6ff MDL-54847 weblib: Test media attributes individually 2016-08-02 20:16:41 +01:00
Dan Poltawski 10ba40f1c3 Merge branch 'wip-MDL-33741-m30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-08-02 12:20:33 +01:00
Dan Poltawski 6e882379f4 Merge branch 'MDL-54847-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-08-02 10:59:55 +01:00
Cameron Ball d2d65178fa MDL-54847 weblib: Support basic HTML media tags 2016-08-02 15:55:39 +08:00
Andrew Nicols 500e6d4519 Merge branch 'MDL-55376-30-fix' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-08-02 12:06:29 +08:00
Cameron Ball 4847d73829 MDL-55376 mod_assign: Update behat test 2016-08-02 10:43:37 +08:00
Stephen Bourget 8ecd647160 MDL-55398 mod_feedback: prevent direct script access to lib files. 2016-08-01 20:56:14 -04:00
Dan Poltawski 79598473d2 Merge branch 'MDL-55360-30-workshopgradepass' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-08-01 18:57:22 +01:00
AMOS bot 8312bbfd7c Automatically generated installer lang files 2016-08-02 00:04:37 +08:00
Dan Poltawski 32949a75a7 MDL-55376 assign: trailing whitespace 2016-08-01 16:08:02 +01:00
Dan Poltawski 2e9332b85d Merge branch 'MDL-55376-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-08-01 16:06:58 +01:00
Dan Poltawski b907a57262 Merge branch 'MDL-53691-M30' of git://github.com/lazydaisy/moodle into MOODLE_30_STABLE 2016-08-01 11:47:44 +01:00
Andrew Nicols cc3126b724 Merge branch 'MDL-53152-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-08-01 15:08:14 +08:00
Jun Pataleta b5eaf7a60a MDL-53152 theme: Add parentheses to variable calculations 2016-08-01 13:43:30 +08:00
Marina Glancy 4fdeed4bec MDL-33741 file_info: show courses in hidden categories
This also has a couple of bugfixes:
- file_info_context_system::get_children() was looking for courses with parent=0, it is impossible, block removed;
- file_info_context_coursecat::get_area_coursecat_description() was checking the wrong capability to view files in description
2016-08-01 09:15:22 +08:00
Marina Glancy d9bea44f18 MDL-33741 file_info: check capability when serving file in coursecat description 2016-08-01 09:15:15 +08:00
Cameron Ball b61059dbd2 MDL-55376 mod_assign: Fix bug stopping admin from editing submissions 2016-07-29 19:09:07 +08:00
AMOS bot 306c38dfcd Automatically generated installer lang files 2016-07-29 00:06:01 +08:00
David Mudrák 4d5707a128 MDL-55360 workshop: Add tests for setting grades to pass via mod form
These scenarios should cover common cases of defining the grades to pass
pass via the workshop settings form. Note that behaviour of the fields
in terms of locale-specific decimals input (MDL-51806) is not covered
with these tests as I want to avoid installation of additional language
pack. Instead, I assume that functionality of unformat_float() is tested
separately in the core.
2016-07-28 09:54:46 +02:00
David Mudrák 2510fae394 MDL-55360 workshop: Emptying grades to pass should set them to zero
When editing existing workshop with a grade to pass defined, when the
field is emptied, it should be interpreted as setting it to zero. This
was not happening because unformat_float replaces the field with null,
therefore effectively unsetting it.

By casting to float, we interpret all empty values (including null) as
zeros. This behaviour is consistent with how gradebook setup UI works.
2016-07-28 09:54:46 +02:00
David Mudrák cd830f4e2c MDL-55360 workshop: Allow creating workshops with empty grades to pass
As a regression of MDL-55360, it was not possible to create new
workshops if the field "Submission grade to pass" or "Assessment grade
to pass" was left empty. The validation failed with "You must enter a
number here".

The fields submissiongradepass and gradinggradepass are always present
as we explicitly define them in the mod form. So the isset() condition
in the validation was useless and it did not allow to submit the form
with these fields empty.

Additionally, the unformat_float() returns null only if it receives
empty value on the input. Which can't happen in our case so I am
removing this condition to improve the readability of the code.
2016-07-28 09:54:46 +02:00
David Monllao bcf700b088 weekly release 3.0.5+ 2016-07-28 12:07:23 +08:00
David Mudrák 5914ef444c MDL-55166 admin: Fix display of misleading debug warning on manage block
Blocks can declare has_config() as true without actually using the
default node in the admin tree. Typical use case is when the block
injects its settings to other parts of the admin tree and it assigns
null to its $setting node in its settings.php file.

As Janek L.B. correctly spotted, this led to false debugging message
on admin/blocks.php as the code interpreted it as missing settings.php
file.

The patch adds explicit file existence test for this rare case.
2016-07-27 23:16:34 +02:00
Rajesh Taneja 7c74b0aeb8 MDL-55329 behat: PyStrings should end with : (colon) 2016-07-27 07:02:34 +08:00
Rajesh Taneja d574272a0c MDL-55337 behat: After posting click to redirect page 2016-07-27 06:39:40 +08:00
lazydaisy d9d3ec4e55 MDL-53691 theme_bootstrapbase: Backport of MDL-53147 2016-07-26 21:43:44 +01:00
Eloy Lafuente (stronk7) 8d5deef79e Merge branch 'wip-MDL-51735-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-07-26 20:17:50 +02:00
Eloy Lafuente (stronk7) fbba7dfee6 Merge branch 'MDL-54657_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-07-26 19:57:16 +02:00
Eloy Lafuente (stronk7) 89a02c4370 Merge branch 'wip-mdl-55337-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-07-26 13:27:20 +02:00
Rajesh Taneja 22f3ebaad9 MDL-55337 behat: Added 1 sec delay between post
Ensure post is created at different timestamp, else
returned posts will be different and test fails.
This will happen on a fast machine.
2016-07-26 19:01:59 +08:00
David Monllao 568fea46d2 Merge branch 'wip-MDL-55183-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-07-26 09:57:07 +08:00
David Monllao 44d7062228 Merge branch 'MDL-55283-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-07-26 05:05:07 +08:00
David Monllao 329e98a621 Merge branch 'MDL-51242-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-07-26 02:41:27 +08:00
Stephen Bourget e1fe3532a0 MDL-55252 mod_chat: prevent direct script access to lib files. 2016-07-25 09:42:39 +01:00
Stephen Bourget 149ae1248e MDL-55253 mod_choice: prevent direct script access to lib files. 2016-07-25 09:40:48 +01:00
Stephen Bourget 485f8744a4 MDL-55255 mod_data: prevent direct script access to lib files. 2016-07-25 09:40:20 +01:00
An Pham Van 74a0d2afb6 MDL-54838 workshop: Differentiate labels for each comment field.
In a Workshop activity, comment fields on Assessment forms do not properly link to the corresponding Aspect.
So screen reader users may find it difficult to complete the Assessment forms.
There should be a hidden label text for each comment field.
2016-07-25 14:38:36 +07:00
Adrian Greeve c43e0956d5 MDL-51735 mod_lesson: A lesson with no content shows a message.
Before it would show an error.
2016-07-25 10:55:50 +08:00
Adrian Greeve c310304149 MDL-55183 editor_atto: Fix requires error.
When using a different theme and removing an editor
plugin such as the equation plugin, atto will display
an error about a missing dependency.

A thank you to Anthony Forth for providing this patch.
2016-07-25 09:17:53 +08:00
Eloy Lafuente (stronk7) a244bd7eaa weekly release 3.0.5+ 2016-07-21 11:45:03 +02:00
Eloy Lafuente (stronk7) ec75234e9c Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-07-21 11:44:59 +02:00
Andrew Nicols 4fdf0b226c MDL-55283 javascript: Check dir is readable before traversing them 2016-07-20 12:17:08 +08:00
AMOS bot f6409a7719 Automatically generated installer lang files 2016-07-20 00:05:39 +08:00
Eloy Lafuente (stronk7) 44ce1facbc Merge branch 'MDL-55220-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-07-19 13:22:43 +02:00
Dan Poltawski f11742850f Merge branch 'MDL-55206-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-07-19 10:52:47 +01:00
Dan Poltawski baaf2e67e1 Merge branch 'MDL-54915-30' of http://github.com/damyon/moodle into MOODLE_30_STABLE 2016-07-19 09:39:09 +01:00
Dan Poltawski 19421799cb Revert "Merge branch 'MDL-54915-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE"
This reverts commit 4b6e0cbd57, reversing
changes made to 8d6dde0805.
2016-07-19 09:37:36 +01:00
David Monllao 1e56841201 Merge branch 'MDL-55157_m30v6' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-07-19 08:42:24 +02:00
Damyon Wiese 28436ac123 MDL-54915 templates: Fix async rendering of js blocks
Mustache JS helper can overwrite JS blocks when using nested templates.

Each call to render should have it's own scope.

Conflicts:
	lib/amd/build/templates.min.js
	lib/amd/src/templates.js
2016-07-19 13:19:48 +08:00
Frederic Massart d2b890c689 MDL-4915 templates: Improve JS string handling in templates
Backported from MDL-53667 to make cherry-picking easier across branches.

The native String.replace method in extremely slow when we are
dealing with a large string and large quantity of strings to replace.
This new solution walks through the string looking for placeholders
to replace.
2016-07-19 13:15:38 +08:00
Stephen Bourget ad097b6fbd MDL-55157 mod_feedback: Course reset should update dates 2016-07-18 22:11:39 -04:00
Eloy Lafuente (stronk7) 3724d55c21 MDL-52544 oracle: small tweaks
This commit just:

- Moves the null => '' to better place, restricting it to PHP >= 7.0
  (bug https://bugs.php.net/bug.php?id=72524)
- Adds a couple of notes here and there.
- Changes some small details to keep the file using the same coding.
2016-07-19 04:04:57 +02:00
Eloy Lafuente (stronk7) 353c12c32f Merge branch 'MDL-52544-30' of git://github.com/damyon/moodle into MOODLE_30_STABLE 2016-07-19 04:04:51 +02:00
Eloy Lafuente (stronk7) da0d992d20 Merge branch 'MDL-51410_m30v2' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-07-19 02:31:40 +02:00
David Monllao 32d225deab Merge branch 'MDL-55161-m30' of https://github.com/micaherne/moodle into MOODLE_30_STABLE 2016-07-18 20:02:32 +02:00
David Monllao a4de0bbd59 Merge branch 'MDL-55163-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-07-18 19:45:23 +02:00
Dan Poltawski 87c1a2e7e8 Merge branch 'wip-mdl-55174-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-07-18 14:49:54 +01:00
Dan Poltawski 5a00afe7ab Merge branch 'MDL-55012-30' of git://github.com/damyon/moodle into MOODLE_30_STABLE 2016-07-18 13:55:23 +01:00
Dan Poltawski 5ef2a25523 Merge branch 'MDL-55240-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-07-18 10:51:10 +01:00
Dan Poltawski 4b6e0cbd57 Merge branch 'MDL-54915-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-07-18 09:17:55 +01:00
AMOS bot 6eb850896a Automatically generated installer lang files 2016-07-16 00:05:50 +08:00
Jun Pataleta 2148abcd34 MDL-55206 admin: Some code cleanup
* Removed unnecessary TODOs.
* Changed message prompt case to sentence case.
2016-07-15 14:54:44 +08:00
Jun Pataleta 70883b76fd MDL-55206 admin: Remove div tags in password policy error message 2016-07-15 14:54:44 +08:00
Rajesh Taneja b5b18eb572 MDL-55174 core_testing: Use proper directory separator
While searching for existing files if directory
separator is not correct then original files
and directories will be deleted. So use DIRECTORY_SEPARATOR.
2016-07-15 13:54:22 +08:00
Damyon Wiese c345d23084 MDL-55012 Atto: no style attrs on paste
Specifically on paste - we don't need all the random style attributes
from content on the clipboard. When you copy from a webpage - the browser
inlines all the styles from the page so that the pasted content will look
like the place it was copied from. But this is never what you want - you
want the content on paste, but with no special styling.
2016-07-15 13:41:45 +08:00
Jun Pataleta 8e6d1ac1d6 MDL-55240 editpdf: Revert changes in MDL-54772
* Revert rendering of annotations and comments back to the
  drawing region.
* Bind events to stamp annotation when editing only.
2016-07-15 10:39:38 +08:00
David Monllao 8d6dde0805 weekly release 3.0.5+ 2016-07-14 11:28:46 +02:00
David Monllao 0dc21f5a0e Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-07-14 11:28:44 +02:00
Juan Leyva c7ae332304 MDL-55220 forum: Add string filtering in WS
The following external functions now filter the discussion and post
name and subject.
- get_forum_discussions_paginated
- get_forum_discussion_posts
2016-07-14 09:14:59 +01:00
Stephen Bourget 365e6b1c49 MDL-54657 Behat: Add tests for section_links block 2016-07-13 21:40:15 -04:00
Michael Aherne 4063900e2b MDL-55161 assign: Check for existence of gradebook feedback plugin 2016-07-13 09:03:44 +01:00
Andrew Nicols 0949754d1f Merge branch 'MDL-47371-30-fix' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-07-13 12:11:51 +08:00
Cameron Ball bcfca5e67d MDL-47371 mod_book: Fix out of scope $unescapedtitle 2016-07-13 10:28:54 +08:00
Damyon Wiese 373d1eb7d0 MDL-52544 oracle: Apply upstream pull request to AdoDB oracle driver
Upstream: https://github.com/ADOdb/ADOdb/pull/259

Prevent segfault with ocipo driver on php7.

The OCIFetchinto function is causing segfaults on php7 - probably because the fields array
is not initialised or it is optimised out. This fixes just changes to use the safer function
oci_fetch_array instead.
2016-07-13 08:46:40 +08:00
Stephen Bourget 27f6cc4519 MDL-51410 mod_survey: fix notifications when saving analysis 2016-07-12 20:09:26 -04:00
tunele 28027d45ea MDL-55083 admin: provide friendly error in case phpxml is missing 2016-07-13 00:09:52 +02:00
Eloy Lafuente (stronk7) 9251dcc986 MDL-53803 mod_choice: fix trailing whitespace 2016-07-12 18:06:29 +02:00
Eloy Lafuente (stronk7) 970a714e13 Merge branch 'MDL-53803_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-07-12 18:02:52 +02:00
Eloy Lafuente (stronk7) acc2203622 Merge branch 'MDL-54892-MOODLE_30_STABLE' of https://github.com/tobiasreischmann/moodle into MOODLE_30_STABLE 2016-07-12 17:51:56 +02:00
Eloy Lafuente (stronk7) ad857b10c3 Merge branch 'MDL-55136_dataobject_30' of git://github.com/davosmith/moodle into MOODLE_30_STABLE 2016-07-12 15:48:30 +02:00
Eloy Lafuente (stronk7) 726051dcf9 MDL-37250 mod_lesson: Move conditions to queries for better performance
While this ony seems to affect MySQL, better put the filter/conditions
on every query so the temporary view/table does not need to handle
thousands of potentially unrelated records.
2016-07-12 13:33:18 +02:00
Eloy Lafuente (stronk7) cd172ea20e Merge branch 'wip-MDL-37250-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-07-12 13:21:15 +02:00
David Monllao eee0dce093 Merge branch 'MDL-55133-30' of git://github.com/damyon/moodle into MOODLE_30_STABLE 2016-07-12 13:16:48 +02:00
Dan Poltawski 68adc36911 Merge branch 'MDL-47371-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-07-12 10:14:30 +01:00
David Monllao 3be99e4e7c Merge branch 'MDL-55170_M30' of https://github.com/nadavkav/moodle into MOODLE_30_STABLE 2016-07-12 10:30:59 +02:00
Dan Poltawski 8994550de2 Merge branch 'MDL-55007-m30' of https://github.com/dthies/moodle into MOODLE_30_STABLE 2016-07-12 09:21:08 +01:00
Cameron Ball bc63d5bc06 MDL-47371 mod_book: Don't double escape book titles 2016-07-12 10:34:43 +08:00
Cameron Ball 469a0854e3 MDL-47371 block_navigation: Don't double escape course titles 2016-07-12 10:34:43 +08:00
Cameron Ball ce4ff71aa3 MDL-47371 weblib: Add option to disable escaping 2016-07-12 10:34:42 +08:00
Andrew Nicols f811e12a60 MDL-54915 core: JS Blocks must not used shared variables
The JS blocks in a template must _not_ use a shared variable as they can be
executed asynchronously and complete in any order.

Instead it is stored in the only local variable available - the current
context.

Since the context can be passed in from elsewhere, we namespace it to
reduce the chance of collission.
2016-07-12 10:01:52 +08:00
Daniel Thies 5654da6ca2 MDL-5507 filter_mathjaxloader: Add commeents for regexes 2016-07-11 13:23:07 -05:00
Nadav Kavalerchik 9a07482c0b MDL-55170 theme_bootstrapbase: Fix user enrollment dialog, RTL 2016-07-11 18:19:04 +03:00
David Monllao 16d219ac90 Merge branch 'wip-MDL-54962-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-07-11 16:16:07 +02:00
Dan Poltawski 069cc7b961 Merge branch 'MDL-55112-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-07-11 14:42:15 +01:00
Dan Poltawski cdf2cf7f39 Merge branch 'MDL-55137-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-07-11 14:37:59 +01:00
Dan Poltawski e72b815237 Merge branch 'MDL-55128-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-07-11 13:33:24 +01:00
Dan Poltawski 01a64e03ad Merge branch 'wip-MDL-55154-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-07-11 13:31:26 +01:00
Juan Leyva 39e110d145 MDL-55163 mod_assign: Fix mod_assign_copy_previous_attempts
- Not exposed via WS
- Have a bug when calling the api function
2016-07-11 10:30:51 +01:00
David Monllao eb0ac9cbe8 Merge branch 'MDL-54832-30' of https://github.com/nashtechdev01/moodle into MOODLE_30_STABLE 2016-07-11 06:47:47 +02:00
Adrian Greeve c77ade8587 MDL-37250 mod_lesson: All actual attempts on the lesson are displayed.
The lesson overview report now shows all attempts made including hitting
the page and immediately navigating away.
2016-07-11 08:21:23 +08:00
Adrian Greeve e0bf071213 MDL-54962 mod_data: Approval status is now translated.
It was using hardcoded English. Now it uses get_string.
2016-07-11 08:20:43 +08:00
AMOS bot d23f1b75f5 Automatically generated installer lang files 2016-07-11 00:06:14 +08:00
Eloy Lafuente (stronk7) 0324fefaf6 Moodle release 3.0.5 2016-07-10 00:29:18 +02:00
Davo Smith 32a5148e50 MDL-55136 data_object: fix param handling in fetch_all_helper 2016-07-09 09:19:48 +01:00
AMOS bot b7797e9c6c Automatically generated installer lang files 2016-07-09 00:04:53 +08:00
Adrian Greeve 40e105976c MDL-55154 mod_lesson: Lesson numerical response shows images. 2016-07-08 09:54:22 +08:00
Daniel Thies da0e1acfed MDL-55007 filter_mathjaxloader: Change unit test 2016-07-07 20:26:18 -05:00
Daniel Thies 28cdac1c6f MDL-55007 filter_mathjaxloader: Wrap nolink around each expresssion 2016-07-07 20:26:07 -05:00
Eloy Lafuente (stronk7) aa28da8286 weekly release 3.0.4+ 2016-07-07 10:20:00 +02:00
Eloy Lafuente (stronk7) 89a3f06ec5 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-07-07 10:19:55 +02:00
Damyon Wiese 4aec01cc4c MDL-52544 oracle: php7 fixes for oci driver
These are our bugs actually - the oci docs are very clear that bound
params should be in-scope when oci_execute is called - and due to pass by value etc,
this was not true for our driver.

There is another bug that needed fixing - OCI barfs if null values are bound - this
can be avoided by setting them to '' which oci treats as null.

And finally - all our lob/clob/blob hacks were also binding to local "out-of-scope" vars.
2016-07-07 13:10:03 +08:00
Andrew Nicols 119412b0ca Merge branch 'MDL-54734-30' of git://github.com/lameze/moodle into MOODLE_30_STABLE 2016-07-07 09:58:32 +08:00
Simey Lameze 1e8bbc6040 MDL-54734 core_user: do not cache dummy user records 2016-07-07 09:32:47 +08:00
Andrew Nicols 2245bc111b MDL-54734 user: Add tests to demonstrate multi-user issues 2016-07-07 09:31:58 +08:00
Stephen Bourget 9cf520a2e0 MDL-53803 mod_choice: remove orphaned answers when removing options 2016-07-06 17:16:18 -04:00
Eloy Lafuente (stronk7) 27273dab58 Merge branch 'wip-MDL-46682-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-07-06 18:14:08 +02:00
Cameron Ball 574afbc75f MDL-55137: Update PHPDoc for external_format_text 2016-07-06 17:48:41 +08:00
Eloy Lafuente (stronk7) 646d613ed4 MDL-54934 workshop: ensure "Current phase" is always separated
Apparently some readers can join 2 adjacent spans completely, simply
adding a whitespace between them prevents that, ensuring separation.,
2016-07-06 11:36:23 +02:00
Adrian Greeve fb5ea89a95 MDL-46682 auth/db: Increase of chunk size and update change.
The update query was not checking the mnet auth id and could
have been updating the wrong entry.
2016-07-06 16:44:54 +08:00
Damyon Wiese 443feb7ee8 MDL-55133 javascript: Correctly use component names in requirejs
Core subsystems must use the 'core_' prefix always.
2016-07-06 10:29:35 +08:00
Jerome Mouneyrac e8e02a7188 MDL-46682 auth/db: IN clause crashes when too many users to sync 2016-07-06 10:08:26 +08:00
Eloy Lafuente (stronk7) 191d5bc618 Merge branch 'MDL-54934-30' of https://github.com/nashtechdev01/moodle into MOODLE_30_STABLE 2016-07-05 20:44:31 +02:00
Eloy Lafuente (stronk7) 3815754c3b Merge branch 'MDL-49244-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-07-05 20:19:54 +02:00
Eloy Lafuente (stronk7) ea9061b213 Merge branch 'MDL-29738-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-07-05 17:07:31 +02:00
Loc Nguyen 744adf1bb6 MDL-54832 workshop: adding landmark for userplantable
Accessibility enhance: add an aria-label on the userplan table so
that it's accessible to me through my screen reader
2016-07-05 20:34:54 +07:00
Andrew Nicols 96b36b930a MDL-29738 file: Remove unused stylesheet functionality
This functionality was commented out in
78946b9bdb for MDL-20204 back in 2009.
Since then it has been wasting cycles performing utterly pointless
preg_match and preg_replace calls.
2016-07-05 19:29:57 +08:00
Andrew Nicols 7ff1344a59 MDL-55114 chat: Remove commented-out variables 2016-07-05 12:46:55 +02:00
Eloy Lafuente (stronk7) 968a10d3e5 Merge branch 'MDL-55113-30' of git://github.com/dpalou/moodle into MOODLE_30_STABLE 2016-07-05 12:22:00 +02:00
Dan Poltawski e2d37a1957 Merge branch 'MDL-54928-30' of git://github.com/dpalou/moodle into MOODLE_30_STABLE 2016-07-05 11:20:10 +01:00
Dan Poltawski 3e0e8e6fbd Merge branch 'MDL-54841-30' of https://github.com/nashtechdev01/moodle into MOODLE_30_STABLE 2016-07-05 11:13:52 +01:00
Juan Leyva 66efea063b MDL-55128 course: Fix param type for shortname 2016-07-05 09:51:35 +01:00
Dani Palou 044de08f20 MDL-54928 notifications: Add username to emailto users 2016-07-05 10:36:20 +02:00
Dani Palou 1db3d3a676 MDL-54928 notifications: Retrieve username from DB if empty 2016-07-05 10:36:20 +02:00
Andrew Nicols 909c3269bd MDL-51242 messageinbound: Guess the port from hostspec
Existing language strings for the host component suggest that the host can
be provided in the format hostname:port, but we previously did not support
this.

This patch explodes the string based on the colon character and assumes
that if there are two parts, that they are in the format hostname:port.

Note: This does not attempt to deal with full host specifications (e.g.
protocol://hostname:port), as this is beyond the scope of this change.
2016-07-05 14:54:21 +08:00
An Pham Van 1899e49017 MDL-54841 workshop: Combine links for attachment icon and text.
In a workshop activity, on the view submission page where having attachment(s), there's an accessibility issue.
There're 2 separate links for the icon and text which causes an issue for keyboard and screen reader users.
So the text and icon should be combined in one link.
2016-07-05 13:31:22 +07:00
Jake Dallimore 69af79848a MDL-53431 tool_monitor: Access control for tool monitor subscriptions 2016-07-05 10:46:04 +08:00
Dan Poltawski 635c6c8484 Merge branch 'MDL-55019-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-07-04 15:29:46 +01:00
Dan Poltawski 2628e64fa5 Merge branch 'MDL-54976-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-07-04 14:52:04 +01:00
Dan Poltawski ed577ebd43 Merge branch 'MDL-54994_30' of git://github.com/stronk7/moodle into MOODLE_30_STABLE 2016-07-04 14:18:21 +01:00
Dan Poltawski d4a279464e Merge branch 'MDL-55041_30_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_30_STABLE 2016-07-04 12:45:58 +01:00
Dan Poltawski e24a2c5ce2 Merge branch 'MDL-41945-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-07-04 12:39:39 +01:00
Marina Glancy 84cd5dca45 MDL-55069 core: escape special characters in email headers 2016-07-04 12:28:06 +01:00
Dani Palou 693e184927 MDL-55113 assign: Use PARAM_RAW in onlinetext text 2016-07-04 09:59:58 +02:00
Andrew Nicols 6d68238b13 Merge branch 'MDL-54953-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-07-04 15:29:29 +08:00
Jun Pataleta 784c5b9889 MDL-55112 mod_forum: Query all forum fields to avoid debug messages 2016-07-04 15:23:40 +08:00
Davo Smith 93b0fd8f26 MDL-55057 mod_scorm: fix handling of SCO identifiers with apostrophes 2016-07-04 13:14:40 +08:00
Cameron Ball 868fdbbdc0 MDL-41945 mod_assign: Check if submission has been modified
This patch adds a check that stops a user submitting an assignment
if someone else has modified it in the meantime.
2016-07-04 12:25:02 +08:00
Andrew Nicols e11ad0fc71 Merge branch 'MDL-55020-30-pluginzip' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-07-04 11:26:53 +08:00
Andrew Nicols 3c5501fc01 Merge branch 'MDL-54968-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-07-04 10:33:30 +08:00
Andrew Nicols 12cce3ef84 Merge branch 'MDL-53019_30' of git://github.com/stronk7/moodle into MOODLE_30_STABLE 2016-07-04 09:11:04 +08:00
AMOS bot 705b81f2c1 Automatically generated installer lang files 2016-07-02 00:05:24 +08:00
Mark Johnson 74526688a0 MDL-55041 roles: Fix JSON parsing in permission manager 2016-07-01 15:00:36 +01:00
Eloy Lafuente (stronk7) f4adac3f9a MDL-53019 environment: 3.2 requirements added
Changes:
 - PHP 5.6.5 required
2016-07-01 13:50:02 +02:00
Eloy Lafuente (stronk7) 256c202cab MDL-54994 badges: Count correctly the number of external badges shown 2016-07-01 13:41:13 +02:00
Loc Nguyen 5797c5ea2b MDL-54934 workshop: indicate current phase
Indicate phase in page titles, current phase in userplan table
so that it's accessible to me through my screen reader
2016-07-01 18:40:59 +07:00
Jun Pataleta b5d947c09e MDL-54976 mod_scorm: Add validation for availability dates 2016-07-01 14:50:56 +08:00
Andrew Nicols 566f5a7d07 weekly release 3.0.4+ 2016-07-01 10:20:26 +08:00
Andrew Nicols 18af3d7858 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-07-01 10:20:23 +08:00
David Mudrák 811f5b406d MDL-55020 admin: Fix renaming of the plugin package root folder
There was a problem with core\update\code_manager::unzip_plugin_file()
if it was used to extract a plugin package into a non-empty target
directory and the plugin package root folder was being renamed at the
same time.

The problem was caused by the underlying helper method
rename_extracted_rootdir() that worked only for ZIPs extracted to an
empty temporary location. When the plugin was extracted to the actual
dirroot with other existing plugin folders present, the method failed
badly.

The solution in the patch is to always extract the ZIP into a temporary
empty location, perform the eventual root renaming there, and only then
move the extracted contents to the final destination. Additionally we
are changing the behaviour of the rename_extracted_rootdir() method so
that now it throws exception if the plugin package contains multiple
root folders (it should not happen in normal situations as such a plugin
would not pass the pre-install validation).

Unit tests did not catch this bug before because in the tests, the
target directory had been empty. Now we are adding a new directory
"aaa_another" to the target location to test in more realistic
environment. Tests for the new behaviour of the renaming method are
added, too.

p.s. I noticed that moodle_exception class was not imported into the
namespace and this is fixed now too (and covered with unit tests).
2016-07-01 01:05:41 +02:00
Juan Leyva aac89d23ac MDL-49244 course: Clean parameters in core_course_get_categories 2016-06-30 13:27:59 +01:00
Dan Poltawski 5b059a03c5 MDL-32135 mod_choice: fix behat tests 2016-06-30 09:25:31 +01:00
Stephen Bourget 5ca8087ea8 MDL-32135 mod_choice: update behat tests 2016-06-30 09:25:30 +01:00
Dan Poltawski 74630a36fb Merge branch 'MDL-32135_m30v2' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-06-30 09:25:30 +01:00
Dan Poltawski 88b45d17a8 Merge branch 'MDL-55002-30-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-06-28 09:05:59 +01:00
Andrew Nicols ab13910a8e Merge branch 'MDL-54910_m30v2' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-06-28 13:02:11 +08:00
Andrew Nicols b1b833ca00 Merge branch 'MDL-54911_m30v3' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-06-28 12:41:24 +08:00
Andrew Nicols 38d38ee049 MDL-54755 core: Correct behat language 2016-06-28 10:02:13 +08:00
Andrew Nicols 0eb3ffbcec Merge branch 'MDL-54755_moodle30' of https://github.com/StudiUM/moodle into MOODLE_30_STABLE 2016-06-28 10:01:55 +08:00
Andrew Nicols c2c0dc1b4c Merge branch 'MDL-54935-30' of git://github.com/ryanwyllie/moodle into MOODLE_30_STABLE 2016-06-28 09:40:55 +08:00
Andrew Nicols 9543b1c57a Merge branch 'wip-mdl-54974-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-06-28 08:33:48 +08:00
Helen Foster a84e3767b7 MDL-55002 lang: Merge English strings from the en_fix language pack 2016-06-27 23:12:43 +02:00
Eloy Lafuente (stronk7) c59c57a2da Merge branch 'MDL-54900-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-06-27 19:03:42 +02:00
AMOS bot 3a39f54589 Automatically generated installer lang files 2016-06-28 00:06:18 +08:00
Eloy Lafuente (stronk7) 4070006db6 Merge branch 'MDL-52887-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-06-27 16:13:45 +02:00
Gilles-Philippe Leblanc a19df21939 MDL-54755 core: Incorrect redirection after password change 2016-06-27 08:22:11 -04:00
Eloy Lafuente (stronk7) 80c47141a1 Merge branch 'MDL-54663-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-06-27 13:26:51 +02:00
Marina Glancy 9b1f8676c5 MDL-54968 user: change query for resetting dashboard
In case of inconsistent data the fatal error could have happen.
Also improve performance by joining several queries into one.
2016-06-27 15:09:03 +08:00
Rajesh Taneja 723702bf08 MDL-54974 behat: Handle interupts on PHP7
As https://bugs.php.net/bug.php?id=71448 is
not going to get fixed, we need to declare tick
2016-06-27 14:32:54 +08:00
Andrew Nicols 9880e5fbd7 Merge branch 'MDL-53111_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-06-27 14:23:40 +08:00
Marina Glancy 371aae1e1c MDL-54900 mod_choice: correctly count number of answered users 2016-06-27 12:48:20 +08:00
Andrew Nicols 9d087a1a28 Merge branch 'MDL-54785-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-06-27 09:33:40 +08:00
Juan Leyva 4f8e5d15f3 MDL-55019 webservice: Course summary text should not be cleaned 2016-06-24 13:34:35 +01:00
Stephen Bourget ebe33c4377 MDL-54911 mod_feedback: start date should be before the end date 2016-06-23 17:41:15 -04:00
Stephen Bourget 14c7153625 MDL-54910 mod_data: Open dates should be before close dates 2016-06-23 17:34:14 -04:00
Stephen Bourget abef0f8b05 MDL-32135 mod_choice: Open time should be before close time 2016-06-23 17:22:41 -04:00
Andrew Nicols 39087f28ae weekly release 3.0.4+ 2016-06-23 14:49:40 +08:00
Andrew Nicols 7ab2ac2575 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-06-23 14:49:37 +08:00
Frederic Massart fab4c8b424 MDL-54785 files: Deprecate the support for $usepost and related 2016-06-23 12:46:38 +08:00
Frederic Massart 294c33960e Revert "MDL-44626 files: Show the PHP max upload size instead of 'unlimited'"
This reverts commit 6f0768618a.
2016-06-23 12:44:40 +08:00
Frederic Massart 4d957a5373 Revert "Merge branch 'MDL-54110_master' of https://github.com/marxjohnson/moodle"
This reverts commit 016e0abfbc, reversing
changes made to 58a2f0ac40.
2016-06-23 12:44:40 +08:00
Frederic Massart dd12c1df33 Revert "MDL-54110 repositories: Whitespace, Typo + unit test fixes"
This reverts commit 7e4d43e1a2.
2016-06-23 12:44:40 +08:00
Stephen Bourget d4f446f9a8 MDL-54935 Survey: Remove duplicate event trigger 2016-06-23 03:01:30 +00:00
Cameron Ball 7a010b1896 MDL-35104 auth: Always allow editing username for new users 2016-06-22 15:03:47 +08:00
Marina Glancy f5fe07de0c MDL-52887 mod_choice: backup allowmultiple option 2016-06-22 13:52:19 +08:00
Andrew Nicols 79c37128c3 MDL-54663 forum: Correct digest link to forum preferences 2016-06-22 13:12:35 +08:00
Marina Glancy 5ec74b7131 MDL-54953 mod_chat: remove Safari hack
This hack was introduced in MDL-16878 and is not needed in modern Safari versions
but it was reported that it can breaks chat in IE
2016-06-22 12:22:14 +08:00
Eloy Lafuente (stronk7) 7573bf0b66 MDL-54778 form: Make it all js style (eslint) compliant
The changes in this commit should not be problematic, just:

- different whitespace.
- some docs.
- 1 variable to camelCase.

And then, less trivial, but safe enough IMO:

- a change to camelCase some identifiers and their calculation.
2016-06-22 01:30:18 +02:00
Eloy Lafuente (stronk7) d8230f25d0 Merge branch 'MDL-54778-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-06-22 01:30:14 +02:00
AMOS bot dc77a3c5d0 Automatically generated installer lang files 2016-06-22 00:06:30 +08:00
Tobias Reischmann 2dc2a2b663 MDL-54892 core: Pass proper parameter for plugin uninstall queries 2016-06-21 09:16:20 +02:00
Andrew Nicols a55c462eb8 Merge branch 'MDL-54920-m30' of https://github.com/sammarshallou/moodle into MOODLE_30_STABLE 2016-06-21 14:19:33 +08:00
Andrew Nicols 7f93f96a02 Merge branch 'MDL-54894-30' of git://github.com/crazyserver/moodle into MOODLE_30_STABLE 2016-06-21 12:11:12 +08:00
Andrew Nicols 1242b84eb6 Merge branch 'MDL-54881_30' of https://github.com/mr-russ/moodle into MOODLE_30_STABLE 2016-06-21 11:32:35 +08:00
Andrew Nicols 88b799a470 Merge branch 'MDL-35104-30-2' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-06-21 11:23:11 +08:00
Cameron Ball cbce72a73a MDL-35104 auth: Don't allow modification of username
Presently it is either unreliable, or not possible to change
the username of a user created with an authentication plugin.
In some cases it is even hard coded to fail. Ideally we would
sync the username, and the issue MDL-21928 exists to address
that. However, in the mean time we should not allow the
username of an external user to be modified.
2016-06-21 11:14:29 +08:00
Andrew Nicols 3a435c4deb Merge branch 'MDL-51505-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-06-21 10:31:04 +08:00
Andrew Nicols a9972ecea0 MDL-54778 form: Fix lots of issues with form dependencies
The original issue here was that each loop of the named values did not
check for prototypal properties. As a result, if there were input fields
with names such as 'sort', 'valueOf', 'constructor', etc. these would
return their prototypal functions instead of a falsy value, and be treated
as though they are array - hence the 'Cannot push to Function' type error.

Following on from this I discovered that the data stores were being created
as arrays, but used as objects. This can also cause issues with some form
input names -- e.g. if they are numeric.

These two issues were resolved together by correctly storing them in
objects, and checking that those objects had real properties
(hasOwnProperty). This itself has to use the prototypal function to cater
for the potential of a field name called 'hasOwnProperty'.

I also found that the instance value stores were being initialised in the
prototype (and therefore shared), which meant that there were numerous
issues if two forms were present on the same page, or one form replaced an
existing one (e.g. forms initialised in JS).

In addition, it also became apparant that several values were being used
outside of scope, or in the wrong scope. This caused further issues when
creating multiple forms on a page.
2016-06-21 08:07:56 +08:00
Russell Smith 2b04eb1f14 MDL-54881 quiz: Ensure user attempts are deterministic for testing. 2016-06-21 08:33:00 +10:00
AMOS bot 51176946f9 Automatically generated installer lang files 2016-06-21 00:05:46 +08:00
AMOS bot bde2af526d Automatically generated installer lang files 2016-06-21 00:05:45 +08:00
Pau Ferrer Ocaña 1014381131 MDL-54894 comments: Get course from context if not informed 2016-06-20 09:02:17 +02:00
AMOS bot 2f86038ad9 Automatically generated installer lang files 2016-06-20 00:05:13 +08:00
AMOS bot 96d1ff2aaa Automatically generated installer lang files 2016-06-19 00:06:32 +08:00
Eloy Lafuente (stronk7) 364329af40 weekly release 3.0.4+ 2016-06-16 17:01:38 +02:00
sam marshall 5a5815d779 MDL-54920 Behat: Allow viewport size to be set consistently
Provides a new Behat step

And I set viewport size to "800x600"
2016-06-15 15:29:38 +01:00
Andrew Nicols 1367b11624 Merge branch 'MDL-53788_modlti_m30' of git://github.com/nhoobin/moodle into MOODLE_30_STABLE 2016-06-15 09:12:53 +08:00
Nicholas Hoobin 69b9974f91 MDL-53788 multilangupgrade: fix aggressive course cache rebuilding 2016-06-15 10:50:15 +10:00
Nicholas Hoobin 2ad35901a5 MDL-53788 user: fix aggressive course cache rebuilding 2016-06-15 10:44:54 +10:00
Nicholas Hoobin a14ec86bfd MDL-53788 mod_lti: fix aggressive course cache rebuilding 2016-06-15 10:44:54 +10:00
Andrew Nicols 7a58d43b1c Merge branch 'MDL-54559-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-06-14 14:30:53 +08:00
Andrew Nicols 76fd59d287 Merge branch 'MDL-54797_30' of git://github.com/aolley/moodle into MOODLE_30_STABLE 2016-06-14 13:27:35 +08:00
jogarcia 23e40cc6f7 MDL-54576 theme: Redirect to show confirmation
After selecting a new theme, save the new configs
then redirect to show the confirmation and the new
theme's read me.  This prevents any odd behavior
from the old theme bleeding into the display of
the confirmation.
2016-06-14 11:44:42 +08:00
Eloy Lafuente (stronk7) 2c478380d8 Merge branch 'MDL-54890-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-06-13 20:09:29 +02:00
Joby Harding 09bfb22703 MDL-51505 tool_templatelibrary: Prevent jumping when selecting template 2016-06-13 17:07:49 +08:00
Dan Poltawski 112b98def7 Merge branch 'MDL-54772-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-06-13 09:35:36 +01:00
Dan Poltawski 1ccd1c284d Merge branch 'MDL-54842-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-06-13 08:36:40 +01:00
Jun Pataleta 6a798ad9bf MDL-54772 mod_assign: Fixes for PDF editor
* Render the annotations and comments within the drawing canvas, not in
the drawing region.
* Remove edit-related event bindings for stamp annotations.
2016-06-13 10:00:20 +08:00
Stephen Bourget 8730fd39b8 MDL-54656 Behat: Additional tests for advanced search 2016-06-12 21:06:04 -04:00
Stephen Bourget 781b74cf38 MDL-54656 Behat: Add tests for search_forums block 2016-06-12 21:05:45 -04:00
Dan Poltawski 014c45b7ac MDL-54890 course: remove erranous duplicated switch label
Detected by eslint rule 'no-duplicate-case'
2016-06-10 10:10:12 +01:00
Dan Poltawski c6cd02470e MDL-54890 assignfeedback_editpdf: Fix missing semicolon
Detected by eslint rule 'semi'
2016-06-10 10:07:02 +01:00
Jun Pataleta a424f6cb60 MDL-54842 core_renderer: Hide additional body HTML in embedded layout 2016-06-10 14:48:04 +08:00
Stephen Bourget 203e47a3b8 MDL-53111 Lesson: Allow "end reached" criteria to be disabled 2016-06-09 12:22:20 -04:00
Dan Poltawski 83a32727a5 weekly release 3.0.4+ 2016-06-09 11:25:21 +01:00
Dan Poltawski 8416d4cfc2 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-06-09 11:25:19 +01:00
Andrew Nicols 19bc0f5d75 MDL-54853 weblib: Specify version and fixed encoding 2016-06-09 09:57:03 +08:00
Andrew Nicols 53e32ff5b8 Merge branch 'MDL-54853-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-06-09 09:56:58 +08:00
Cameron Ball 4ac487dba6 MDL-54853 weblib: Properly specify encoding for blanktarget 2016-06-08 18:29:52 +08:00
Andrew Nicols e214b30e3f Merge branch 'MDL-53947-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-06-08 08:47:18 +08:00
Dan Poltawski 0e6cbf13cc MDL-46721 assign: clarify ternerary statement 2016-06-07 12:15:53 +01:00
Dan Poltawski 33b234805a Merge branch 'MDL-46721-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-06-07 12:12:39 +01:00
Frederic Massart f710093255 MDL-48756 editor_atto: Bulk atto autosave queries 2016-06-07 11:51:21 +01:00
Dan Poltawski 97edee1f24 Merge branch 'MDL-54765-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-06-07 09:41:32 +01:00
David Monllao 365cc7aaed Merge branch 'MDL-54180_30_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_30_STABLE 2016-06-07 16:17:32 +08:00
Eric Merrill ffb6dc984d MDL-54559 theme: Fix padding that pushes navbar down 2016-06-07 15:01:14 +08:00
Skylar Kelty 8f62c066ad MDL-53947 memcached: Fix memcached session warning on PHP7 2016-06-07 10:27:10 +08:00
Eloy Lafuente (stronk7) e79e879783 Merge branch 'MDL-54769-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-06-06 23:57:00 +02:00
Eloy Lafuente (stronk7) 6ac1f4e96e Merge branch 'MDL-54805-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-06-06 18:08:57 +02:00
Dan Poltawski 9f812d2602 Merge branch 'wip-MDL-50824-MOODLE_30_STABLE' of https://github.com/cdsmith-umn/moodle into MOODLE_30_STABLE 2016-06-06 15:07:03 +01:00
Dan Poltawski e69409fdc0 Merge branch 'MDL-53392_30' of https://github.com/snake/moodle into MOODLE_30_STABLE 2016-06-06 13:21:11 +01:00
Dan Poltawski f2577ea928 Merge branch 'MDL-54557-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-06-06 13:17:10 +01:00
Dan Poltawski 9da0108feb Merge branch 'wip-MDL-49852-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-06-06 11:55:59 +01:00
Eloy Lafuente (stronk7) 678b8f5219 Merge branch 'MDL-41922-30-c' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-06-06 11:52:11 +02:00
Mike Churchward 3ce17afe99 MDL-54805 portfolio_download: Adding a 'require' of necessary library file 2016-06-04 21:54:34 +08:00
AMOS bot 378b29c760 Automatically generated installer lang files 2016-06-04 00:04:39 +08:00
Frederic Massart 0c325214e4 MDL-41922 mod_quiz: Don't report quiz due when an attempt was finished 2016-06-03 14:52:58 +08:00
Jun Pataleta f5194755f1 MDL-54765 mod_assign: Use selectedIndex for setting page selection
Set the 'selectedIndex' attribute of the page selection element instead of
the 'value' attribute since YUI is having trouble with this in IE.
2016-06-03 14:52:50 +08:00
Andrew Nicols 378bd31dbc weekly release 3.0.4+ 2016-06-03 12:01:47 +08:00
Andrew Nicols 451831e313 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-06-03 12:01:45 +08:00
Clement Smith 6b8ce1602c MDL-50824 message/externallib.php: Fix get_string call
This fixes the get_string call by adding the intended recipient's
fullname as the third argument when a user tries to message the
recipient, the recipient is blocking non-contacts from messaging
them, and the user is not in the recipient's contact list.
2016-06-02 07:22:38 -05:00
Adam Olley 9747d42070 MDL-54797 course: Add indexed field to condition of delete query
Deleting records from the course_completion_criteria table goes much
faster when we include the indexed course field in the delete query.
2016-06-02 15:52:59 +09:30
Marina Glancy 847e73efe4 MDL-54557 course: treat section summary as contents 2016-06-02 12:57:00 +08:00
AMOS bot 76f6647587 Automatically generated installer lang files 2016-06-02 00:04:29 +08:00
Frederic Massart 809309af4f MDL-48248 enrol_manual: Handle durations more precise than int days 2016-06-01 16:00:10 +08:00
Marina Glancy de2a386a98 MDL-54769 backup: add missing error language string 2016-06-01 09:45:34 +08:00
Andrew Nicols c2d39f88e3 Merge branch 'MDL-53598-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-06-01 08:26:08 +08:00
Mark Johnson 1ec4e9320a MDL-54180 Behat: Handle exceptions from driver when saving screenshot 2016-05-31 12:39:47 +01:00
Marina Glancy 4bca636f94 MDL-53598 block_glossary_random: do not fail if glossary was deleted
This commit refactors how associated glossary is searched for and removes
unnecessary DB queries. Also prevents from situations when the global glossary or course have
been deleted
2016-05-31 15:31:32 +08:00
David Monllao 65c42a0638 Merge branch 'MDL-54065-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-05-31 15:28:20 +08:00
Andrew Nicols d26072d275 Merge branch 'MDL-54655_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-05-31 13:53:33 +08:00
David Monllao 6fcc6d835f Merge branch 'MDL-54667-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-05-31 13:09:55 +08:00
David Monllao 876db7c5e5 Merge branch 'MDL-53851-30' of https://github.com/blckct/moodle into MOODLE_30_STABLE 2016-05-31 11:47:10 +08:00
David Monllao 2fb8dbad77 Merge branch 'MDL-53938_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-05-31 11:43:27 +08:00
David Monllao 88dcc03e9b Merge branch 'MDL-54605_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-05-31 11:33:02 +08:00
Andrew Nicols af313210ed Merge branch 'MDL-54579_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-05-31 11:19:26 +08:00
Jakub Kania ebc4062450 MDL-54667 core_lib: Fix the param name in edit profile link 2016-05-30 16:35:35 +08:00
Cameron Ball 9196d5ae69 MDL-37138 weblib: Document blanktarget in upgrade.txt 2016-05-30 16:13:10 +08:00
David Monllao c0298a5967 Merge branch 'MDL_54002_m30v3' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-05-30 16:09:26 +08:00
David Monllao d9196660b5 Merge branch 'MDL-54010-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-05-30 16:04:47 +08:00
David Monllao de44442189 Merge branch 'MDL-54577-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-05-30 15:46:10 +08:00
David Monllao 086b3f25a0 Merge branch 'MDL-29905-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-05-30 15:41:29 +08:00
David Monllao 932e53d839 Merge branch 'MDL-54116-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-05-30 15:36:48 +08:00
David Monllao dc54c9af93 Merge branch 'MDL-49943-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-05-30 15:29:43 +08:00
David Monllao dc04236962 Merge branch 'MDL-37138-30-2' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-05-30 15:02:39 +08:00
Andrew Nicols 4c3f595bc5 Merge branch 'MDL-54567-30-build' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-05-30 14:44:35 +08:00
Marina Glancy 30ee8e40e0 MDL-49943 mod_choice: display multiple answers in complete report 2016-05-30 14:17:58 +08:00
Jun Pataleta 247c29e4df MDL-53425 blocklib: Raise execution time for dashboard reset process 2016-05-30 14:12:44 +08:00
Andrew Nicols 1b1ad2f2ee Merge branch 'MDL-35987-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-05-30 13:41:23 +08:00
David Monllao 94320c47c5 Merge branch 'MDL-53425-30-delete-by-chunks' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-05-30 13:35:52 +08:00
Andrew Nicols 3a091f4522 MDL-54567 backup: Fixtures for legacy grade value rewrite 2016-05-30 13:22:21 +08:00
Frederic Massart 946343cd24 MDL-54567 backup: Process the calculations_freeze item upon restore 2016-05-30 13:22:21 +08:00
Cameron Ball cda2a0269f MDL-37138 chat: Use blanktarget option for chat text 2016-05-30 13:18:26 +08:00
Cameron Ball 0bdfc38a6e MDL-37138 message: Use blanktarget option for message text 2016-05-30 13:18:26 +08:00
Cameron Ball 0c1ba9c959 MDL-37138 weblib: Add blanktarget option to format_text 2016-05-30 13:18:26 +08:00
David Monllao abbd492512 Merge branch 'MDL-48248-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-05-30 13:06:47 +08:00
Frederic Massart 5bc25db29c MDL-29905 question: Auto remove stale questions upon category deletion 2016-05-30 12:26:31 +08:00
Eric Merrill 04e9b8e614 MDL-29905 question: Try to delete unused hidden/random questions
Before going to display the warning about moving in use questions,
try to delete unused Random qtype questions, as well as 'hidden'
questions (these are questions that were deleted from the category),
but were in use at the time.
2016-05-30 12:26:30 +08:00
Jun Pataleta d1654d9803 MDL-53425 blocklib: Perform deletion of block instances by chunk 2016-05-30 11:24:27 +08:00
David Monllao ecf200c5f0 Merge branch 'MDL-43887-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-05-30 11:09:14 +08:00
David Monllao 8efb7d9aed Merge branch 'MDL-51806_30' of https://github.com/snake/moodle into MOODLE_30_STABLE 2016-05-30 10:52:21 +08:00
Jake Dallimore 6c361cf374 MDL-51806 mod_workshop: Add locale support for grade values. 2016-05-30 10:48:14 +08:00
David Monllao 0c798d3353 Merge branch 'wip-MDL-45427-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-05-30 10:19:52 +08:00
Marina Glancy bd6c7d5b93 MDL-54065 gradebook: correctly display module icon 2016-05-30 10:08:26 +08:00
Stephen Bourget 53ac88ab8a MDL-54655 Behat: Tests for the online_users block 2016-05-27 18:26:28 -04:00
Adrian Greeve 079c7e4022 MDL-49852 mod_assign: Unit tests for activity completion. 2016-05-27 15:38:29 +08:00
Tim Hunt 9a16044c21 MDL-54605 quiz regrading: incorrect DB query
There were two issues. With groups, the $params array was wrong
due to PHP + vs array_merge sillyness.

Also, the first column in the SQL was not necessarily unique,
so we need to use a recordset rather than get_records.
2016-05-27 08:12:20 +01:00
Steve Bader 2f61c533d4 MDL-49852 mod_assign: Fix group assignment completion tracking
Fixes completion tracking for group assignments where either only
one student is required to click Submit when submitting the
assignment for grading, all students are required to submit,
or no students are required to click submit (meaning that simply
uploading submits for grading).
2016-05-27 13:05:02 +08:00
Cameron Ball 9d661b7030 MDL-43887 formslib: Allow not set date field
Previously if the date field was not enabled it would
be treated as having value 0. A bug would allow this 0
to pass through and save the date as 1 January 1970
2016-05-27 01:53:32 +08:00
AMOS bot 7e99566a9e Automatically generated installer lang files 2016-05-27 00:04:57 +08:00
Jake Dallimore 9402642f95 MDL-53392 mod_assign: Fix selector for alert on increasing max grade 2016-05-26 14:53:52 +08:00
Cameron Ball b1c2c0f474 MDL-54010 roles: Specify encoding for escaped export data 2016-05-26 10:32:09 +08:00
Nigel Cunningham 86100ea6c0 MDL-54010 roles: Fix missing HTMLspecialchars in role export code.
Role name and description fields are currently not escaped when
exporting a role. This results in an unusable file when characters
such as ampersands are used in a name or description. Fix this by
using htmlspecialchars on both fields.

Signed-off-by: Nigel Cunningham <nigelc@catalyst-au.net>
2016-05-26 10:32:09 +08:00
Stephen Bourget 1423682a40 MDL-54577 Behat: Add tests for messages block 2016-05-26 10:22:13 +08:00
Marina Glancy 9994e13064 MDL-54116 block_comments: warnings when commenting outside of a course 2016-05-26 10:20:26 +08:00
Stephen Bourget f1af51c59d MDL-54116 block_comments: behat test 2016-05-26 10:20:26 +08:00
Eloy Lafuente (stronk7) eba73c81f1 weekly release 3.0.4+ 2016-05-26 02:14:13 +02:00
Eloy Lafuente (stronk7) a49305d9c4 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-05-26 02:14:10 +02:00
David Monllao 5beb3657a4 Merge branch 'MDL-54059-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-05-25 16:19:20 +08:00
Adrian Greeve 4f8ae68644 MDL-45427 mod_data: Inserting tags into templates.
Allows tags to be inserted into the editor without
having to touch Atto at all.
2016-05-25 15:29:47 +08:00
David Monllao 07836f7da0 Merge branch 'MDL-46934-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-05-25 13:25:25 +08:00
Frederic Massart f80ab4d427 MDL-35987 qtype_multianswer: Prevent restore failure due to bad sequence 2016-05-25 12:24:14 +08:00
Andrew Nicols 4f538c08a7 MDL-54059 testing: Add grunt test 2016-05-25 10:51:27 +08:00
Andrew Nicols 1db139031d MDL-54059 testing: Simplify travis output 2016-05-25 10:50:42 +08:00
Frederic Massart ff81f1c783 MDL-48248 enrol_manual: Ensure that the default value is always selected 2016-05-25 10:17:23 +08:00
Stephen Bourget 72808207d2 MDL-54002 Behat: tests for recent blogs block 2016-05-24 12:50:38 -04:00
AMOS bot 2302ac07fb Automatically generated installer lang files 2016-05-25 00:04:54 +08:00
Cameron Ball 806a93abdc MDL-46721 assign: Make blind marking participant numbers match
Previously emails were setting the "From" header to the incorrect
participant number.
2016-05-24 18:25:35 +08:00
David Monllao 67dec8d44d Merge branch 'MDL-54582_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-05-24 11:17:27 +08:00
Andrew Nicols 7d5616fa15 MDL-53687 core_media: Comment fix 2016-05-24 09:07:21 +08:00
Andrew Nicols 1ca9ac5b79 Merge branch 'MDL-53687-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-05-24 09:07:16 +08:00
AMOS bot 2ae82421dd Automatically generated installer lang files 2016-05-24 00:04:34 +08:00
Jakub Kania 56afc60c55 MDL-53851 news block: Display news from all the accessible groups 2016-05-23 17:19:01 +02:00
Frederic Massart 3798e7ef55 MDL-53687 core_media: Edge does not yet support WebM and OGG 2016-05-23 16:25:38 +08:00
Dan Poltawski 2772b598b8 weekly release 3.0.4+ 2016-05-20 10:09:17 +01:00
Frederic Massart 0c05085b41 MDL-46934 webservice_rest: Fixed undefined index on XML output 2016-05-20 17:03:50 +08:00
David Monllao a22978b8ad Merge branch 'MDL-54640_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-05-20 09:05:19 +08:00
Rajesh Taneja 63b9cc7b80 MDL-54640 behat: add 1 sec delay before running tasks
Also just execute task, as running whole cron is not
required
2016-05-20 09:03:06 +08:00
Stephen Bourget d0c5c6804f MDL-54579 Behat: tests for the private_files block 2016-05-19 20:03:15 -04:00
David Monllao 9211f438d6 Merge branch 'MDL-54578_m30v2' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-05-19 11:41:41 +08:00
David Monllao a2ddf7d84d Merge branch 'MDL-54613-m30' of https://github.com/micaherne/moodle into MOODLE_30_STABLE 2016-05-19 11:21:11 +08:00
Eloy Lafuente (stronk7) 54d3a2c4e4 Merge branch 'MDL-54553-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-05-18 18:23:59 +02:00
Stephen Bourget d84c524d2c MDL-54578 Behat: Add tests for the myprofile block 2016-05-18 09:09:26 -04:00
Dan Poltawski 114c6918b6 MDL-54553 behat: check statuscode of http request 2016-05-18 11:16:19 +01:00
Dan Poltawski 995994ee75 Merge branch 'MDL-54027-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-05-18 11:05:01 +01:00
Michael Aherne e7a48b1afd MDL-54613 unit tests: Add iteminstance to test grade_item 2016-05-18 10:59:44 +01:00
Dan Poltawski 443487dab7 Merge branch 'wip-mdl-53956-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-05-18 10:45:21 +01:00
Dan Poltawski 58fd7d6345 Merge branch 'MDL-54549-30-en_fix' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-05-18 10:29:17 +01:00
Rajesh Taneja c9072543fc MDL-53956 behat: Avoid before and after step and switch
After pressing the button, if system is slow then
after step and before step might fail as the window
is closed by then. Execute steps one after other
2016-05-18 14:19:09 +08:00
David Monllao c827490373 MDL-45390 grades: Bump build to today's date
To test backup/restore.
2016-05-18 14:13:40 +08:00
David Monllao b4311689f6 Merge branch 'wip-MDL-45390-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-05-18 14:12:51 +08:00
Andrew Nicols b627d8c15b Merge branch 'wip-mdl-54564-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-05-18 12:27:44 +08:00
Andrew Nicols 967adff2ff MDL-54620 rating: Add tests for get_aggregate_string 2016-05-18 12:13:26 +08:00
Andrew Nicols 759c1e65bb Merge branch 'MDL-54620_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-05-18 12:10:21 +08:00
Rajesh Taneja fe04ddaef3 MDL-54564 behat: Wait after hover, to ensure page is ready 2016-05-18 11:18:59 +08:00
Adrian Greeve b215dec368 MDL-45390 gradebook: sql tidy up and version alignment. 2016-05-18 10:44:16 +08:00
Andrew Nicols 544017f884 Merge branch 'MDL-54049-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-05-18 10:38:20 +08:00
David Monllao 69033e2214 MDL-45390 grades: Courses letters using system bad boundaries
Added unit tests to highlight the existing failures and adding
unset_config between each set of tests.
2016-05-18 10:02:46 +08:00
Adrian Greeve f000ff41ae MDL-45390 gradebook: Grade boundary fix.
Code to upgrade, fix, and freeze the gradebook for
courses with letter boundary problems.
2016-05-18 10:02:46 +08:00
Adrian Greeve 5f91a59fed MDL-45390 gradebook: Behat tests for grade boundary issues. 2016-05-18 09:58:15 +08:00
Adrian Greeve 0cbd302b83 MDL-45390 gradebook: Unit tests for grade boundary issue. 2016-05-18 09:58:07 +08:00
Kevin Wiliarty 45294e503e MDL-54620 ratings: display '0' when aggregate = 0 2016-05-18 07:37:41 +08:00
Helen Foster 4a17764ebd MDL-54549 lang: Merge English strings from the en_fix language pack 2016-05-17 13:18:36 +02:00
Dan Poltawski e25d3383b9 weekly release 3.0.4+ 2016-05-17 10:48:45 +01:00
Dan Poltawski b88965b626 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-05-17 10:48:43 +01:00
David Monllao acd9521a65 NOBUG: Bumping versions after a rewrite 2016-05-17 17:11:56 +08:00
Mark Nelson fcebfea419 MDL-52599 block_rss_client: fixed various PHP errors 2016-05-17 17:10:54 +08:00
Rajesh Taneja cab3620f33 MDL-54573 testing: don't uppercase dbtype 2016-05-17 17:10:53 +08:00
Andrew Nicols 61b6d3d204 Merge branch 'MDL-52599-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-05-17 17:10:53 +08:00
Andrew Nicols b69b0543c7 Merge branch 'MDL-54600-m30' of https://github.com/micaherne/moodle into MOODLE_30_STABLE 2016-05-17 17:10:52 +08:00
Dan Poltawski 3bafd53957 MDL-54573 testing: don't uppercase dbtype 2016-05-17 17:10:52 +08:00
David Monllao e6b308401c Merge branch 'MDL-54573-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-05-17 17:10:52 +08:00
Stephen Bourget 3d21fc3bdf MDL-54131 Behat: Fix hide all courses test 2016-05-17 17:10:51 +08:00
David Monllao 844b20e158 Merge branch 'MDL-54584-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-05-17 17:10:51 +08:00
Michael Aherne c9d6c62e47 MDL-54600 phpunit: Prevent locked files failing tests 2016-05-16 14:41:44 +01:00
Dan Poltawski 4174c59a57 MDL-52599 rss block: clarifty sql and make style more moodley 2016-05-16 11:09:54 +01:00
Clement Smith 36f909cc4c MDL-52599 blocks/rss_client: Fix RSS block config page
This fixes an error where the RSS block config page would display
'Array' where the multiselect list of feeds should be when
accessed by a user who has not saved any RSS feed urls and yet the
block has been previously configured by another user.
2016-05-16 11:09:53 +01:00
David Monllao aabfa11f71 Merge branch 'MDL-54133_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-05-16 12:03:18 +08:00
David Monllao c6fe3d243d Merge branch 'MDL-54131_m30v3' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-05-16 12:01:49 +08:00
David Monllao cb921865b7 Merge branch 'MDL-54130_m30v2' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-05-16 11:32:12 +08:00
Andrew Nicols cbef0010f0 MDL-54584 repository: Set a default filename in prepare_file 2016-05-16 11:08:46 +08:00
vpisabeywardana def7e7843a MDL-52815 theme: group select overlapping issue
Gave minimum width for select tags which are under 'groups' and 'members' classes
2016-05-16 02:44:31 +00:00
AMOS bot 9dbb91f678 Automatically generated installer lang files 2016-05-15 00:04:53 +08:00
Stephen Bourget d058341145 MDL-54131 Behat: tests for the course list block 2016-05-13 22:06:40 -04:00
Stephen Bourget 52a630f7c8 MDL-54133 Behat: tests for the course overview block 2016-05-13 21:42:38 -04:00
Tim Hunt 77c4401c02 MDL-54582 accesslib: improve performance of load_course_context
The new query is logically equivalen, but much, much faster, at
least on Postgred. (15ms, instead of 700ms, in one example I tried
on the database for the OU's main Moodle site.)
2016-05-13 20:38:03 +01:00
Dan Poltawski 06c174bab8 MDL-54573 testing: use dbtype rather dbvendor for diagnostics
So that we can differentiate between drivers
2016-05-13 14:53:47 +01:00
David Monllao 4b6e571ccb weekly release 3.0.4+ 2016-05-13 18:32:28 +08:00
Frederic Massart 81b676c3a9 MDL-54027 mod_forum: Display sub-header on user posts/discussions page 2016-05-13 17:40:24 +08:00
Dan Poltawski 0d1e222b3d NOBUG: ensure version number doesn't go backwards
(Due to reverts happening in MDL-45390)
2016-05-13 09:36:37 +01:00
Dan Poltawski 9528275bee Merge branch 'MDL-54101_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2016-05-13 09:34:31 +01:00
Dan Poltawski 782ad586a8 Merge branch 'wip-mdl-54543-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-05-13 09:34:31 +01:00
Stephen Bourget b19552e332 MDL-54130 Behat: Add tests for Completion Status block 2016-05-12 21:27:18 -04:00
Mark Nelson 86f523fdf9 MDL-54101 core: fixed core/str get_string caching issue 2016-05-12 18:59:19 +08:00
Rajesh Taneja 0f24b0ae06 MDL-54543 behat: Increase file download range
with different db's, the id and defaultgrade
might be different, so increasing the range
to avoid such failures
2016-05-12 16:02:03 +08:00
Tim Hunt a4079c3c74 MDL-53938 qformat_gift: handle multi-choice MR with one 100% choice 2016-05-11 18:07:46 +01:00
Andrew Nicols c3bac7250a Merge branch 'MDL-54055-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-05-11 15:02:09 +08:00
Jun Pataleta 6cb33703ba MDL-54055 gradingform_guide: Skip insertion of empty comments
We should not be adding empty entries for the frequently-used comments.
2016-05-11 14:54:50 +08:00
Andrew Nicols cb19237594 Merge branch 'MDL-54125_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2016-05-11 14:12:41 +08:00
Mark Nelson ac6d4ce728 MDL-54125 mod_data: fixed PHP notice
Also removed unused variables.
2016-05-11 13:02:01 +08:00
Andrew Nicols c768daa20b Merge branch 'MDL-52800-30' of git://github.com/ryanwyllie/moodle into MOODLE_30_STABLE 2016-05-11 11:16:00 +08:00
Andrew Nicols 3945629232 MDL-54110 repositories: Whitespace, Typo + unit test fixes 2016-05-11 10:42:53 +08:00
Andrew Nicols 539c1cf9ec Merge branch 'MDL-54110_30_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_30_STABLE 2016-05-11 10:42:42 +08:00
Mark Johnson a674b3659c MDL-54110 repositories: Allow repositories to ignore post_max_size
Repositories can now override usespost() if they don't upload using POST
requests. This restores the ability of users with
moodle/course:ignorefilesizelimits to upload files of unlimited size
lost in MDL-44626.
2016-05-10 16:11:28 +01:00
Dan Poltawski 8e25eba291 Merge branch 'MDL-50704-30-bp' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-05-10 15:59:43 +01:00
David Monllao a5b26a385a Merge branch 'MDL-52133-30' of git://github.com/ryanwyllie/moodle into MOODLE_30_STABLE 2016-05-10 21:41:41 +08:00
David Monllao 94d6b16158 weekly release 3.0.4+ 2016-05-10 18:55:11 +08:00
David Monllao 82c2cde553 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-05-10 18:55:09 +08:00
Ryan Wyllie 42defe4dc1 MDL-52800 theme: Fix styling for inplace editing tooltip 2016-05-10 05:16:04 +00:00
Andrew Nicols d7491c3314 Merge branch 'MDL-54115_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-05-10 12:09:53 +08:00
Andrew Nicols 2941f5ce70 MDL-54004 behat: Whitespace fixes 2016-05-10 12:02:52 +08:00
Andrew Nicols 1a1182740b Merge branch 'MDL-54004_m30v2' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-05-10 11:38:34 +08:00
Andrew Nicols a5573b4862 Merge branch 'MDL-52506-30' of git://github.com/ryanwyllie/moodle into MOODLE_30_STABLE 2016-05-10 10:16:44 +08:00
Ryan Wyllie 3f6149cce3 MDL-52506 mod_assign: Fix return links for atto auto save 2016-05-10 01:23:50 +00:00
Stephen Bourget f7c3ff4b3b MDL-54115 Behat: tests for the comments block 2016-05-09 19:02:24 -04:00
Stephen Bourget 9955806518 MDL-54004 Behat: tests for calendar block 2016-05-09 16:08:30 -04:00
Stephen Bourget 7ff356aa3d MDL-54004 Behat: tests for upcoming events block 2016-05-09 16:08:09 -04:00
AMOS bot 91c42f09a7 Automatically generated installer lang files 2016-05-10 00:04:52 +08:00
Frederic Massart 396e1a76d3 MDL-50704 date: Fix invalid timezone mapping for +14
The value Etc/GMT-14 was added to the list of known timezones,
and Etc/GMT+13 & Etc/GMT+14 were removed as they are not valid.

Tests were added to ensure that legacy user timezones are mapped
to known timezones. Other tests were changed to reflect the changes
with regards to Etc/GMT+13 and +-14.
2016-05-09 17:36:36 +08:00
Andrew Nicols 1ffadaf625 Merge branch 'MDL-52708-30_STABLE' of https://github.com/ramdesh/moodle into MOODLE_30_STABLE 2016-05-09 15:52:30 +08:00
David Monllao 1c28c9fc20 Merge branch 'MDL-54034-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-05-09 07:50:47 +08:00
Eloy Lafuente (stronk7) d97b3d4c81 Moodle release 3.0.4 2016-05-08 00:23:59 +02:00
Dan Poltawski 3d9c67b089 Merge branch 'MDL-54042-30' of git://github.com/damyon/moodle into MOODLE_30_STABLE 2016-05-06 14:08:59 +01:00
Frederic Massart d2d41fa003 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 18:02:46 +08:00
Damyon Wiese 845f0cf71e MDL-54042 user: Add unit test to cover change 2016-05-06 16:40:59 +08:00
Damyon Wiese f808005051 MDL-54042 user: Fix debugging in core_user_get_users_by_field
The course object returned by enrol_get_all_users_courses does not include the defaultgroupingid.

This course object is passed to user_get_user_details - which does need
the defaultgroupingid.

All the other group info is returned (groupmode) etc - so it makes sense to also return this extra field.
2016-05-06 16:40:58 +08:00
David Monllao ca0c65427d weekly release 3.0.3+ 2016-05-06 16:15:06 +08:00
David Monllao 20460bd637 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-05-06 16:15:04 +08:00
Ryan Wyllie a95f10f2d6 MDL-52133 mod_assign: Support userid on single grade page 2016-05-06 07:20:09 +00:00
Andrew Nicols 33647345e4 Merge branch 'wip-mdl-53701-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-05-06 10:07:29 +08:00
Dan Poltawski 5ef6ac5a35 MDL-54062 bootstrapbase: remove unused less file
This file has never been included in our CSS.
2016-05-06 09:44:23 +08:00
Eloy Lafuente (stronk7) d0b09c8d76 MDL-53944 dml: make char2real() for mysql to support decimals
- With the patch, 6 positions of scale accuracy are guaranteed
  per individual casted value.
- Backed with unit tests, both for varchar and clob.
- Added 2 missing tests about uses of the method with params
  and values.

Note: 6 was picked because looking to all databases implementation
postgres was found to be casting to real, aka, 6.
2016-05-06 09:44:23 +08:00
Adam Olley 2efd5adc61 MDL-54007 mod_assign: Limit unit tests to core plugins
Without this change, the unit tests make assumptions for the output of
mod_assign functions/webservices that do not hold true when 3rd party
submission and feedback plugins are installed.
2016-05-06 09:44:22 +08:00
Simey Lameze c12a862c95 MDL-53913 core_user: make parameters consistent across versions 2016-05-06 09:44:22 +08:00
Stephen Bourget 69a3c19fcb MDL-54003 Behat: tests for recent badges block 2016-05-06 09:44:22 +08:00
Fred Woolard 834b9a8e18 MDL-53713 core: account for session_start returning false 2016-05-06 09:44:21 +08:00
David Monllao 4a029f6843 MDL-53750 shibboleth: Passing a var to empty for PHP 5.4 2016-05-06 09:44:21 +08:00
Frederic Massart 7d8050dd38 MDL-51369 course: Adding tests to cover restoring course info 2016-05-06 09:44:20 +08:00
Frederic Massart 3c9d2b1040 MDL-51369 backup: Respect capabilities when restoring course info
In short, when a user is creating a new course they can set
the ID number, shortname, fullname and summary. However, when
they merge a backup into a course they need the permissions to do so.
2016-05-06 09:44:20 +08:00
Frederic Massart f1a4d829e3 MDL-53954 user: Prevent locked profile fields from being edited 2016-05-06 09:44:20 +08:00
Andrew Nicols 01408d619b MDL-53755 forum: Check session when marking posts 2016-05-06 09:44:19 +08:00
Andrew Nicols e4e7a097f6 MDL-53696 forum: Check discussion in forum 2016-05-06 09:44:19 +08:00
John Okely 510efb7455 MDL-53750 auth: fix logout bug in shibboleth
Original patch by Dr. Michael Schneider
2016-05-06 09:44:18 +08:00
Tim Hunt 3a5cfc1f59 MDL-53589 badges: fix capability check 2016-05-06 09:44:18 +08:00
Dan Marsden 4fc53e7a24 MDL-53546 SCORM: Set window.opener to null 2016-05-06 09:44:18 +08:00
AMOS bot d869267c7a Automatically generated installer lang files 2016-05-06 00:04:36 +08:00
Rajesh Taneja 31d15bc64e MDL-53701 core_lib: use date_format_string for utf8
So when language is different say Hebrew then
it would pic codepage-1255. As  is json_encoded
we need to ensure we get utf8 string. so use
date_format_string instead
2016-05-05 16:36:02 +08:00
AMOS bot 0297d3e3ac Automatically generated installer lang files 2016-05-05 00:04:40 +08:00
Juan Leyva 477cfba57c MDL-54049 core_message: Add missing external format text 2016-05-04 12:54:27 +02:00
Dan Poltawski f38e287c16 weekly release 3.0.3+ 2016-05-03 20:38:11 +01:00
Dan Poltawski bbeab900d6 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-05-03 20:38:08 +01:00
AMOS bot c92c1e2b4a Automatically generated installer lang files 2016-05-04 00:04:32 +08:00
Dan Poltawski 4cb7ae6fa2 Merge branch 'wip-MDL-53402-30-v2' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-05-03 09:13:25 +01:00
Dan Poltawski 7d0b6bea51 MDL-54008 tests: clarify comment in tz test 2016-05-03 09:10:35 +01:00
Dan Poltawski a5df2ffa52 Merge branch 'MDL-54008_30-normalise' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-05-03 09:09:13 +01:00
Adrian Greeve 77552e5f5b MDL-53402 mod_data: field values of 0 are now displayed. 2016-05-03 15:06:46 +08:00
David Monllao 57411a05d8 MDL-54008 tz: Unexisting tz with decimals fallback to rounded down integer 2016-05-03 13:59:29 +08:00
David Monllao bc1d0d15da Merge branch 'wip-MDL-53402-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-05-03 13:03:33 +08:00
Adrian Greeve 8dc2647f0f MDL-53402 mod_data: Added custom validation code for data fields.
Added custom validation to radiobutton, menu, and checkbox.
2016-05-03 12:53:36 +08:00
David Monllao 222bb751c9 Merge branch 'MDL-53899-30-pluginperm' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-05-03 10:28:44 +08:00
David Monllao 0a274ff84e Merge branch 'MDL-51142-30' of git://github.com/damyon/moodle into MOODLE_30_STABLE 2016-05-03 09:58:55 +08:00
Dan Poltawski bc22230af9 Merge branch 'wip-MDL-53402-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-05-02 17:06:26 +01:00
Dan Poltawski 05b5af2721 Merge branch 'MDL-54019_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2016-05-02 16:57:12 +01:00
Dan Poltawski 62c8fe2d9c Merge branch 'wip-mdl-53861-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-05-02 16:56:38 +01:00
Mark Nelson 8ffc5f3410 MDL-54019 core_behat: fixed typo 2016-05-02 18:11:56 +08:00
Dan Poltawski c48a174fc4 Merge branch 'wip_MDL-53033_m30' of git://github.com/gjb2048/moodle into MOODLE_30_STABLE 2016-05-02 10:17:09 +01:00
Dan Poltawski cd25907728 Merge branch 'MDL-53904-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-05-02 10:16:36 +01:00
Dan Poltawski 372b792a25 Merge branch 'MDL-54008_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-05-02 09:52:24 +01:00
Damyon Wiese a1be99096e MDL-51142 assign: Fix for group assignments with NEW status 2016-05-02 16:44:28 +08:00
Clement Smith 968b596138 MDL-51142 mod/assign: Fix erroneous submission status display
This prevents display of submission time/date when the assignment
submission record is in a new state. It also keeps the display of
overdue assignments identical for those students who have viewed
the assignment yet not submitted, for those students who have
not viewed the assignment, and for those students who have not
viewed the assignment yet the instructor has accessed the grading
page.
2016-05-02 16:44:27 +08:00
David Monllao 1bd5e7f579 Merge branch 'MDL-53901-30' of git://github.com/damyon/moodle into MOODLE_30_STABLE 2016-05-02 15:54:16 +08:00
Rajesh Taneja cd20424b89 MDL-53861 behat: o/p buffer is not used in Behat 2.5.x
Don't need ob_flush() as o/p is not buffered
in behat 2.5.x
2016-05-02 15:54:00 +08:00
David Monllao 8c46d78dba Merge branch 'MDL-53635-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-05-02 15:38:21 +08:00
Juan Leyva 92730c8eb9 MDL-53635 message_airnotifier: Remove tags from notifications 2016-05-02 09:33:14 +02:00
David Monllao cda239e63e MDL-54008 timezone: Updating references to Caracas tz.
I've removed Caracas direct references because it would fail on
some systems, it would depend on how updated is the olson version
PHP is using.
2016-05-02 14:14:05 +08:00
Adrian Greeve a476c985a8 MDL-53402 mod_data: Behat test for entering zero in required fields. 2016-05-02 13:37:55 +08:00
Adrian Greeve 2e01123bf4 MDL-53402 mod_data: Required fields can contain 0.
The number and text field would not accept 0 as a
valid response.
2016-05-02 13:37:36 +08:00
Damyon Wiese 388a23e9d3 MDL-53901 login: Redirect to https if loginhttps is enabled
This just prevents a double redirect.
2016-05-02 11:22:06 +08:00
David Monllao a6f8c022f6 Merge branch 'MDL-53980-30-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-05-02 10:47:45 +08:00
AMOS bot 063ae6b180 Automatically generated installer lang files 2016-05-02 00:04:24 +08:00
AMOS bot d933ddac17 Automatically generated installer lang files 2016-04-30 00:06:58 +08:00
Dan Poltawski 29f88b5783 weekly release 3.0.3+ 2016-04-29 12:27:04 +01:00
Andrew Nicols 1e09fe76f2 MDL-53858 quiz accessibility: Correct aria-labelledby attribute 2016-04-29 12:14:53 +01:00
Andrew Nicols 6dec102c62 Merge branch 'MDL-53858_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-04-29 12:14:52 +01:00
David Monllao 44df7437f9 Merge branch 'MDL-53928_30' of git://github.com/stronk7/moodle into MOODLE_30_STABLE 2016-04-29 12:14:52 +01:00
Helen Foster f7423fa240 MDL-53980 lang: Merge English strings from the en_fix language pack 2016-04-28 19:02:48 +02:00
Marina Glancy 76c684dc65 MDL-53904 course: apply default completion when approving request 2016-04-27 15:57:07 +08:00
Henning Bostelmann 16067645b4 MDL-53780 mod_assign: Remove teachers from submission group members 2016-04-26 15:37:58 +01:00
Dan Poltawski ac01be5ffe Merge branch 'MDL-53855_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-04-26 11:18:29 +01:00
Dan Poltawski e56209d815 weekly release 3.0.3+ 2016-04-26 09:28:30 +01:00
David Monllao e37906c31e Merge branch 'MDL-52550-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-04-26 11:12:44 +08:00
Dan Poltawski 25f201c259 Merge branch 'MDL-49754-30' of https://github.com/xow/moodle into MOODLE_30_STABLE 2016-04-25 14:36:50 +01:00
Eloy Lafuente (stronk7) 3fecbbe510 MDL-53928 environment: add xmlreader requirement for 3.1 2016-04-24 01:34:38 +02:00
Eloy Lafuente (stronk7) e28a53bcb0 weekly release 3.0.3+ 2016-04-22 10:57:10 +02:00
David Mudrák 70d6b77c14 MDL-53899 admin: Fix permissions of extracted plugin files 2016-04-21 14:31:26 +02:00
Panagiotis Nikoloutsopoulos 58f4420d0f MDL-52550 atto: Added preventDefaults for events dragover and dragenter 2016-04-21 15:22:40 +08:00
Dan Poltawski c287b85806 Merge branch 'wip-MDL-52642-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-04-20 13:30:36 +01:00
Dan Poltawski 82c38e0c45 Merge branch 'MDL-53095-30' of git://github.com/lameze/moodle into MOODLE_30_STABLE 2016-04-20 11:50:01 +01:00
David Monllao 5d1b9e7b00 Merge branch 'MDL-53757_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2016-04-20 15:53:32 +08:00
Nick Phillips 9047653ffe MDL-53757 core_calendar: always show whole day's events in 'day' view 2016-04-20 15:49:35 +08:00
David Monllao 5401e6b923 Merge branch 'MDL-53676_30' of https://github.com/wjroes/moodle into MOODLE_30_STABLE 2016-04-20 11:16:05 +08:00
Eloy Lafuente (stronk7) 484a08cc15 Merge branch 'MDL-53660-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-04-20 01:20:10 +02:00
Andrew Nicols a57c6830ea Merge branch 'MDL-53779-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-04-19 10:34:57 +08:00
Eloy Lafuente (stronk7) 1491aca61d Merge branch 'MDL-53796_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-04-19 01:58:36 +02:00
Eloy Lafuente (stronk7) 0fd01700f4 Merge branch 'MDL-53795-30' of git://github.com/merrill-oakland/moodle into MOODLE_30_STABLE 2016-04-19 01:46:17 +02:00
Tim Hunt 6e7aa92bc6 MDL-53858 quiz accessibility: nav block should have role='navigation' 2016-04-18 17:37:20 +01:00
Tim Hunt dacb0f0a94 MDL-53855 accessibility: navbar should be in exactly one nav region
And that should be labelled.
2016-04-18 16:57:18 +01:00
Eloy Lafuente (stronk7) fd95e9c70d weekly release 3.0.3+ 2016-04-15 10:19:22 +02:00
Eloy Lafuente (stronk7) bec5339281 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-04-15 10:19:17 +02:00
Ramindu Deshapriya b906a29e50 MDL-52708 core_admin: Added Behat test to automate MDLQA-8190 2016-04-15 00:07:36 +05:30
Mark Nielsen 354fd0dba7 MDL-53660 mod_forum: Fix link decoding in single discussions
This only happens when user data is not included.
2016-04-13 16:00:40 +01:00
Gareth J Barnard a4001824d9 MDL-53033 themes: Invalid attribute values for div.c1.btn. 2016-04-13 13:05:17 +01:00
Dan Poltawski 6abc42a404 Revert "Merge branch 'MDL-52944-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE"
This reverts commit 3fc6d79de2, reversing
changes made to 7f438e833e.
2016-04-13 10:49:03 +01:00
David Risner 9f1b6babf0 MDL-53095 repository_merlot: change merlot url use https 2016-04-13 15:12:09 +08:00
David Monllao 306561a926 MDL-53796 behat: Move get_debug_text to base class 2016-04-13 10:36:47 +08:00
Eric Merrill e9024a1443 MDL-53795 logging: Add DB index for use when backing up logs 2016-04-12 22:26:35 -04:00
AMOS bot 2d4f5d18d0 Automatically generated installer lang files 2016-04-13 00:04:20 +08:00
Dan Poltawski e0b61ea590 Merge branch 'MDL-52263-30' of git://github.com/crazyserver/moodle into MOODLE_30_STABLE 2016-04-12 16:50:29 +01:00
Pau Ferrer Ocaña d830d4601d MDL-52263 libraries: Add test cases to external_format_text options 2016-04-12 15:06:33 +02:00
Pau Ferrer Ocaña 328b4a73fb MDL-52263 libraries: Add options to external_format_text 2016-04-12 15:06:33 +02:00
Dan Poltawski 3fc6d79de2 Merge branch 'MDL-52944-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-04-12 13:18:01 +01:00
Frederic Massart c14bbcf890 MDL-53779 external: get_string and get_strings use PARAM_RAW
For the string parameters and translated strings.
2016-04-12 17:05:01 +08:00
spvickers b67fda1e31 MDL-49754 mod_lti: Fixes to JSON format
@id elements in JSON corrected to match the IMS spec.  Version number of
the service updated.
2016-04-12 15:48:21 +08:00
Adrian Greeve 4b1de0b64b MDL-52642 blog: Fix notices for swapping contexts in activities. 2016-04-12 13:49:20 +08:00
Stephen Bourget b421c1cd70 MDL-52642 block_blog_menu: behat test 2016-04-12 13:49:09 +08:00
David Monllao 7f438e833e Merge branch 'MDL-53007_30_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_30_STABLE 2016-04-12 11:31:30 +08:00
David Monllao c9db0e876b Merge branch 'MDL-53770-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-04-12 10:54:24 +08:00
Dan Poltawski 6639edc34f Merge branch 'MDL-53417-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-04-11 16:36:58 +01:00
Dan Poltawski 56342d4eb1 Merge branch 'MDL-53674-30-eventmsg' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-04-11 14:29:15 +01:00
Dan Poltawski b512fdd040 Merge branch 'MDL-53728_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-04-11 14:10:08 +01:00
Dan Poltawski 12f8cb4e56 Merge branch 'MDL-52338-30' of https://github.com/dg711/moodle into MOODLE_30_STABLE 2016-04-11 13:54:31 +01:00
Andrew Nicols 35b5a7fcd9 MDL-52942 forum: Allow posting to multiple groups in eachuser forums 2016-04-11 12:44:19 +08:00
Devang Gaur 56f496f26d MDL-52338 blocks: message link should not appear when set false 2016-04-11 08:34:18 +05:30
Marina Glancy 0169a60751 MDL-53770 mod_lti: allow to uninstall ltisource plugins 2016-04-11 09:04:56 +08:00
David Mudrák 6238007754 MDL-53674 event monitor: Do not send HTML as plain text formatted emails
There were two problems here.

* The $msgdata->fullmessage was always formatted as HTML even if the
  $msgdata->fullmessageformat was set to the original template's format.
* The plain text part of the emailed message contained HTML code.

The patch makes sure that the original template is always formatted into
HTML and then converted to plain text before setting the text/plain
multipart of the sent email.
2016-04-08 15:13:39 +02:00
Cameron Ball c9a1658c50 MDL-52944 atto: Use event-key to handle enter key 2016-04-08 12:29:01 +08:00
Panagiotis Nikoloutsopoulos 6c0ec8dd4c MDL-52944 atto: Contenteditable command 'FormatBlock' set to 'p' 2016-04-08 12:29:01 +08:00
Mark Johnson 5bd06806e2 MDL-53007 block_navigation: Set width of item text to prevent overflow 2016-04-07 11:51:12 +01:00
Andrew Nicols 80b5eb78dd weekly release 3.0.3+ 2016-04-07 14:00:44 +08:00
Andrew Nicols bfea54fdb6 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-04-07 14:00:42 +08:00
Willem Roes 50f5630dd6 MDL-53676 block_navigation: fix incorrect array iteration 2016-04-07 07:47:59 +02:00
Rajesh Taneja 2eac5e6aa0 MDL-52502 behat: Flush buffer to show differences 2016-04-07 09:39:20 +08:00
AMOS bot c98e007a88 Automatically generated installer lang files 2016-04-07 00:05:02 +08:00
Dan Poltawski f0df8853df Merge branch 'MDL-53000-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-04-06 15:48:17 +01:00
Tim Hunt 7d82cbc6bb MDL-53728 question import/export: improve form structure 2016-04-06 15:36:01 +01:00
Juan Leyva dc08c1fd79 MDL-53000 mod_assign: Unit tests for get_file_areas 2016-04-06 12:49:29 +02:00
Andrew Nicols 42462c057a Merge branch 'wip-mdl-53381-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-04-06 12:23:47 +08:00
Rajesh Taneja 586869780f MDL-53381 behat: Add support to execute step api
With chain step deprecation, execute api will
help user to execute step api and backport it
2016-04-06 10:59:12 +08:00
Eloy Lafuente (stronk7) d5344f23e4 Merge branch 'MDL-53115-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-04-06 03:33:09 +02:00
Andrew Nicols ee73ad1ef6 MDL-53461 assign: Unit test regex fix 2016-04-06 08:56:31 +08:00
Andrew Nicols c86fca01c7 Merge branch 'MDL-53461-30' of git://github.com/crazyserver/moodle into MOODLE_30_STABLE 2016-04-06 08:56:25 +08:00
Andrew Nicols ce0bb6e843 MDL-53115 mod_lesson: Remove unnecessary @javascript tags 2016-04-06 08:40:22 +08:00
Andrew Nicols 2311226b42 MDL-53115 mod_choice: Remove unnecessary @javascript tags 2016-04-06 08:40:20 +08:00
Eloy Lafuente (stronk7) d854b87af0 MDL-52502 behat: clean 2 uses of method and fix upgrade.txt version 2016-04-06 00:23:17 +02:00
Eloy Lafuente (stronk7) 1ae503de34 Merge branch 'wip-mdl-52502-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-04-06 00:20:04 +02:00
Eloy Lafuente (stronk7) 23a605d65c Merge branch 'MDL-53671-30' of git://github.com/dpalou/moodle into MOODLE_30_STABLE 2016-04-06 00:04:29 +02:00
Eloy Lafuente (stronk7) e0a473a0b4 Merge branch 'MDL-53647_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-04-05 22:00:21 +02:00
Dan Poltawski 5937ca9c69 Merge branch 'MDL-53000-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-04-05 14:34:13 +01:00
Dani Palou 5d1cc5707e MDL-53671 book: Return whole filepath in book_export_contents 2016-04-05 13:35:56 +02:00
Dan Poltawski deb17cad7b Merge branch 'MDL-53175-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-04-05 12:17:50 +01:00
Pau Ferrer Ocaña 114f5f134b MDL-53461 assign: Fix intro images to be shown in the mobile app 2016-04-05 09:33:53 +02:00
Andrew Nicols 6bb1094932 Merge branch 'MDL-53500-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-04-05 12:23:43 +08:00
Rajesh Taneja f7e66c022e MDL-52502 behat: Ensure php web and cli version is same 2016-04-05 11:47:32 +08:00
Rajesh Taneja dfb103a7c1 MDL-52502 phpunit: Add php, db and os deatils 2016-04-05 11:47:31 +08:00
Eloy Lafuente (stronk7) f80a695b4c Merge branch 'MDL-53256-m30' of https://github.com/micaherne/moodle into MOODLE_30_STABLE 2016-04-04 19:02:53 +02:00
Dan Poltawski 63a1a289e9 Merge branch 'wip-MDL-49861-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-04-04 12:10:18 +01:00
Dan Poltawski 5052caed58 Merge branch 'm30_MDL-53622_Fix_Missing_Rewrite_Pluginfile_URLs' of https://github.com/scara/moodle into MOODLE_30_STABLE 2016-04-04 08:39:22 +01:00
Andrew Nicols 144720047a Merge branch 'MDL-53661_30' of https://github.com/sam-moodle/moodle into MOODLE_30_STABLE 2016-04-04 12:25:21 +08:00
Tim Hunt 8dc237213b MDL-53647 quiz summary: keep row class names in synch around headings 2016-04-02 13:23:15 +01:00
Matteo Scaramuccia eddae29cdf MDL-53622 mod_forum: Added the file_rewrite_pluginfile_urls() call. 2016-04-01 22:43:55 +02:00
AMOS bot cc58798dc3 Automatically generated installer lang files 2016-04-01 00:04:50 +08:00
Dan Poltawski 4ed2d20325 weekly release 3.0.3+ 2016-03-31 14:06:39 +08:00
Dan Poltawski bbe790a42e Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-03-31 14:06:36 +08:00
Jay Jayswal ff6c283651 MDL-53417 glossary: Glossary printer friendly link responsive 2016-03-31 13:59:32 +08:00
Dan Marsden 3789c23fd1 MDL-53500 report_outline: Allow parent role to view all activities.
Parents are not enrolled in the course, use $user to generate modinfo
for uservisible checks.
2016-03-31 13:38:55 +08:00
Sam Chaffee f609364544 MDL-53661 mod_lti: Fix lti_prepare_type_for_save forcessl config 2016-03-30 18:31:42 -06:00
Michael Aherne ad23f18a40 MDL-53256 cache: Prevent overwriting of cache config with invalid data 2016-03-30 11:34:52 +01:00
Juan Leyva 6e3bce00b8 MDL-53175 filter: Fix text formatting for the book and page modules 2016-03-30 09:32:19 +01:00
Juan Leyva 4bc5ddb074 MDL-53175 file: Allow file_rewrite_pluginfile_urls to reverse 2016-03-30 09:32:18 +01:00
Adrian Greeve d94f588b67 MDL-49861 mod_data: Behat step to test adding records.
Clicking 'Save and add another' should clear the form.
2016-03-30 16:28:35 +08:00
Adrian Greeve dc844c1eae MDL-49861 mod_data: Save and add another button clears fields. 2016-03-30 16:28:14 +08:00
Eloy Lafuente (stronk7) 2f416e9f87 Merge branch 'wip-mdl-49150-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-03-30 00:10:59 +02:00
Eloy Lafuente (stronk7) 19e286bbe4 Merge branch 'MDL-52388-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-03-29 23:14:21 +02:00
AMOS bot 93afe952d9 Automatically generated installer lang files 2016-03-30 00:04:26 +08:00
David Monllao 92b0b88db1 Merge branch 'MDL-53356-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-03-29 15:57:16 +08:00
David Monllao 0a02b7cb02 Merge branch 'MDL-53432-git-less-css-MOODLE_30_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_30_STABLE 2016-03-29 15:43:41 +08:00
David Monllao 5948df3878 Merge branch 'wip-mdl-53434-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-03-29 14:23:53 +08:00
David Monllao 634d36641e Merge branch 'MDL-52646_30' of https://github.com/wjroes/moodle into MOODLE_30_STABLE 2016-03-29 12:58:52 +08:00
David Monllao 07111d3af6 Merge branch 'wip-MDL-52760-m30' of https://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-03-29 12:56:05 +08:00
AMOS bot 651ad2d035 Automatically generated installer lang files 2016-03-29 00:04:26 +08:00
Brendan Heywood dcf9108490 MDL-53432 core: Treat derived css and js as binary files in git 2016-03-26 22:19:43 +11:00
Dan Poltawski f256bf9169 Merge branch 'wip-MDL-53538-30' of git://github.com/abgreeve/moodle into MOODLE_30_STABLE 2016-03-26 11:37:38 +08:00
Dan Poltawski e068c3f054 Merge branch 'MDL-53562-forum-reply-re-MOODLE_30_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_30_STABLE 2016-03-26 10:36:38 +08:00
Dan Poltawski 71869bc4d3 Merge branch 'MDL-53180_30' of git://github.com/stronk7/moodle into MOODLE_30_STABLE 2016-03-26 10:33:06 +08:00
Dan Poltawski 8df8ca11a2 MDL-53507 quiz: fix bad htmlid 2016-03-26 10:06:49 +08:00
Dan Poltawski f67e31c195 Merge branch 'MDL-53507_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-03-26 10:06:11 +08:00
Adrian Greeve 53d2f810ea MDL-50795 atto: Pasting into atto removes background colour style.
Copying from one atto editor to another comes with a lot of style
information. This removes the color attributes which make the page
look ugly when competing with different themes.
2016-03-26 09:32:08 +08:00
AMOS bot a784fee34c Automatically generated installer lang files 2016-03-25 00:04:39 +08:00
Eloy Lafuente (stronk7) a30a81e3a0 weekly release 3.0.3+ 2016-03-24 12:58:25 +01:00
Cameron Ball 49dbcbd998 MDL-52388 output: Only stop displaying pager next link on last page
Thank you to Brenda Uga for working on this.
2016-03-24 17:19:58 +08:00
Eloy Lafuente (stronk7) 35c61094e8 MDL-53180 libraries: Fix thirdpartylib to point to directory 2016-03-23 17:08:13 +01:00
Brendan Heywood c0eeb8c461 MDL-53356 admin: Fixed erroneous sectionerror when upgrade is needed 2016-03-23 16:26:59 +08:00
Dan Poltawski 4840ec1193 Merge branch 'MDL-52952-30-fix' of github.com:xow/moodle into MOODLE_30_STABLE 2016-03-23 12:08:22 +08:00
John Okely 4565c9b575 MDL-52952 forms: Ignore autofill catching fields in form change checker 2016-03-23 11:56:03 +08:00
David Monllao b9114ec746 Merge branch 'wip-MDL-53254-m30' of https://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-03-23 09:20:35 +08:00
Dan Poltawski f01974e9d7 Merge branch 'MDL-53383-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-03-23 08:31:52 +08:00
Tim Hunt 0a15d762b8 MDL-53507 quiz editing: was possible to lose questions
If you dragged a question to the top of the quiz, it could
disappear. Several other cases of dragging questions to the
same place in sequence, but to a different page/section were
also failing, and have been fixed.
2016-03-22 23:02:30 +00:00
Marina Glancy 37b3541eab MDL-45274 mod_feedback: show heading on non-respondents page 2016-03-22 23:05:37 +01:00
Eloy Lafuente (stronk7) 28e7877645 Merge branch 'MDL-53547_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-03-22 22:58:41 +01:00
Tim Hunt 01bacdae55 MDL-53547 logstore_database: better DB driver handling in unit test 2016-03-22 06:45:51 +00:00
Adrian Greeve 02c3b88fcd MDL-53538 mod_data: Unit test for data_get_advance_search_ids 2016-03-22 14:27:24 +08:00
Adrian Greeve f186db050c MDL-53538 mod_data: Show no records message instead of error.
When there are no records in the database module and a user
does an advanced search. Show a message that there are no entries
in the database.
2016-03-22 14:27:09 +08:00
Rajesh Taneja f825607286 MDL-49150 behat: Removed unnecessary @javascript tags 2016-03-22 13:55:22 +08:00
Dan Poltawski 800d62c56d Merge branch 'MDL-52158-30' of https://github.com/xow/moodle into MOODLE_30_STABLE 2016-03-22 10:32:36 +08:00
Eloy Lafuente (stronk7) 546aae396b Merge branch 'MDL-48307-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-03-22 00:14:17 +01:00
Brendan Heywood 68b5a23a4a MDL-53562 forum: Fixed missing forum subject Re: prefix 2016-03-22 09:30:02 +11:00
Eloy Lafuente (stronk7) 20d094cb7c Merge branch 'MDL-52978_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2016-03-21 23:07:24 +01:00
Willem Roes 6b6f4abe3e MDL-52646 mod_scorm: fix missing launch_data for SCORM 2004 2016-03-21 09:05:10 +01:00
Dan Poltawski c52508979e Merge branch 'MOODLE_30_STABLE-MDL-53407-editing-css' of https://github.com/Dagefoerde/moodle into MOODLE_30_STABLE 2016-03-21 14:48:43 +08:00
Dan Poltawski 547e685ce3 Merge branch 'MDL-52952-30' of https://github.com/xow/moodle into MOODLE_30_STABLE 2016-03-21 14:44:19 +08:00
Dan Poltawski a4cbeb7d02 Merge branch 'MDL-53239_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-03-21 14:12:14 +08:00
James 03b4d4fc20 MDL-53383 navigation: Do not require $type in remove()
navigation_node_collection -> remove function broken when $type is null
2016-03-21 12:18:05 +08:00
Dan Poltawski c49bb9d425 Merge branch 'MDL-53262-verp-confirm-from-support-MOODLE_30_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_30_STABLE 2016-03-21 11:37:35 +08:00
Dan Poltawski daa42c3ade Merge branch 'MDL-53489_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-03-21 11:02:04 +08:00
Jay Jayswal 95e68d8982 MDL-52158 auth: Improve recaptcha settings and help 2016-03-21 10:28:33 +08:00
Dan Poltawski 07054b65a8 Merge branch 'MDL-53548-m30' of https://github.com/sammarshallou/moodle into MOODLE_30_STABLE 2016-03-21 09:20:34 +08:00
David Monllao 557bdeba78 Merge branch 'MDL-53509-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-03-21 08:43:16 +08:00
Brendan Heywood 6db1bfacee MDL-53262 inboundmessage: Fix inconsistent confirm From vs email body 2016-03-20 15:53:19 +11:00
sam marshall c32962f318 MDL-53548 Accessibility: Block show/hide keyboard access broken 2016-03-18 13:47:30 +00:00
Grigory Baleevskiy b08fc23a6c MDL-52978 core_lib: fixed wrong days showing for dates in datepicker 2016-03-18 12:31:14 +08:00
Marina Glancy a386305756 MDL-52760 forms: notify form changes in autocomplete element 2016-03-18 08:17:22 +08:00
Eloy Lafuente (stronk7) 225913650f weekly release 3.0.3+ 2016-03-17 14:00:43 +01:00
Eloy Lafuente (stronk7) a24459d354 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-03-17 14:00:39 +01:00
David Monllao 692fbff031 MDL-53239 grader report: Add all names to error msg 2016-03-17 10:57:51 +08:00
Dan Poltawski be8769b841 Revert "MDL-52133 mod_assign: Pass userid param when saving grade"
This reverts commit 99a895b7c3.
2016-03-17 09:31:00 +08:00
Andrew Nicols 83ca070484 MDL-53509 mod_forum: Stop over-escaping quoted variables
{{# quote }}<a href=\"foo\">{{/ quote }}

becomes:

    "<a href=\\"foo\\">"

This causes a mustache syntax error.

The quote helper negates the need to escape quotes in normal use, e.g.:

    {{# quote }}<a href="foo">{{/ quote }}

which instead becomes:

    "<a href=\"foo\">"
2016-03-17 08:40:24 +08:00
Andrew Nicols 38ad80c54e Merge branch 'MDL-51828-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-03-16 10:03:37 +08:00
Frederic Massart 024a976c26 MDL-51828 repository_wikimedia: Always use PNG for SVG files 2016-03-16 09:53:02 +08:00
Eloy Lafuente (stronk7) 158a5fe613 Merge branch 'MDL-53139-30' of https://github.com/dg711/moodle into MOODLE_30_STABLE 2016-03-16 00:19:02 +01:00
Eloy Lafuente (stronk7) 9e1680299a Merge branch 'MDL-53430-30' of git://github.com/merrill-oakland/moodle into MOODLE_30_STABLE 2016-03-16 00:05:25 +01:00
Eloy Lafuente (stronk7) ff1cbbe51f Merge branch 'mdl-53133-m30' of git://github.com/deraadt/moodle into MOODLE_30_STABLE 2016-03-15 23:53:48 +01:00
Russell Smith 5dfd5066c0 MDL-53323 profiling: Close session as early as possible. 2016-03-15 21:21:15 +01:00
Tim Hunt 9184cc647c MDL-53489 quiz editing: fix display of long section headings 2016-03-15 18:35:53 +00:00
AMOS bot a48022f059 Automatically generated installer lang files 2016-03-16 00:04:17 +08:00
Andrew Nicols 2941895cda Merge branch 'MDL-53234-support-email-MOODLE_30_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_30_STABLE 2016-03-15 13:43:51 +08:00
Andrew Nicols 222ada1726 Merge branch 'MDL-53351-30-lti-notice' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-03-15 12:49:42 +08:00
David Monllao 9ff251a882 MDL-53176 grades: Fix upgrade version 2016-03-14 14:07:57 +08:00
David Monllao 48d8bf0c0b Merge branch 'MDL-53176-30' of git://github.com/merrill-oakland/moodle into MOODLE_30_STABLE
Conflicts:
	version.php
2016-03-14 14:05:14 +08:00
Marina Glancy 800204438c MDL-53254 core_tag: ensure page context is set in WS 2016-03-14 08:34:35 +08:00
Eloy Lafuente (stronk7) 97dd32edd6 Moodle release 3.0.3 2016-03-12 00:38:07 +01:00
Rajesh Taneja 41fc0ff97e MDL-53434 behat: Improved exit status of parallel run
Exit status should contain pass/fail information
of each run it is executing. Every bit of status
will have information of pass/fail status of parallel
process
2016-03-11 21:13:38 +08:00
Rajesh Taneja 440f668464 MDL-53434 behat: Added support for $CFG->behat_profiles
This config will be supported to avoid broken configuration
in future. As this is limited, we need will still use
->behat_config to set config values which can't be set by
behat_profiles
2016-03-11 21:13:25 +08:00
dg711 8b91709968 MDL-53139 admin: case diff issue with email 2016-03-11 16:32:06 +05:30
John Okely a9362990ef MDL-52952 forms: Fix chrome autofilling passwords again
In MDL-45772 a hack was introduced to some forms to stop browsers from
putting the user's password into password fields in forms unrelated to
logging in.

Chrome now no longer fills the user's password in the first password
field in the page. There now needs to be a plain text input above it
for the username too.
2016-03-11 10:33:45 +08:00
Eric Merrill 17bf9bbdaf MDL-53430 dml: Fix recordset_walk for additional parameters 2016-03-10 16:33:21 -05:00
Eric Merrill 3ecd9378e9 MDL-53176 grades: Adding index to improve history search
Backport of MDL-50385
2016-03-10 11:59:50 -05:00
Eloy Lafuente (stronk7) a0b2c28080 weekly release 3.0.2+ 2016-03-10 13:31:14 +01:00
Eloy Lafuente (stronk7) bddf27de35 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-03-10 13:31:10 +01:00
Jan C. Dageförde 77f6265af4 MDL-53407 themes: Add CSS class editing only if appropriate
The CSS class `editing` should only be added if the user is in editing
mode AND she is allowed to edit the rendered page. `user_is_editing()`
achieves exactly this, without changing behaviour for the appropriate
pages.
2016-03-10 10:41:18 +01:00
Eloy Lafuente (stronk7) 406a0efd37 MDL-51167 tool_monitor: fix too strict condition & minor cleanup 2016-03-10 00:06:52 +01:00
Eloy Lafuente (stronk7) eb7715d16f Merge branch 'MDL-53369_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-03-09 18:59:45 +01:00
Simey Lameze 4db8407d3e MDL-50705 auth_db: apply standard cleaning to all fields
Also unit tests were added to cover the new clean_data() method.
2016-03-09 18:33:11 +01:00
Simey Lameze 61da84e414 MDL-50705 core_user: introduce new fill_properties_cache()
Also the get_property_definition() was created to get the property without retrieve the whole definition cache and
    unit tests were created to tests those new methods.
2016-03-09 18:33:09 +01:00
Brendan Heywood 73e281cdc4 MDL-53234 admin: Fixed wrong default support email bug 2016-03-09 20:57:10 +11:00
Andrew Nicols a034f66e0b MDL-49897 calendar: mktime => usergetmidnight 2016-03-09 13:18:19 +08:00
Michael de Raadt 99a895b7c3 MDL-52133 mod_assign: Pass userid param when saving grade 2016-03-09 15:56:49 +11:00
Simey Lameze 1452f1e1d3 MDL-53031 mod_assign: add session check on assignment plugins management 2016-03-08 19:54:06 +01:00
AMOS bot d59b91c6a8 Automatically generated installer lang files 2016-03-09 00:04:12 +08:00
Jun Pataleta 85380c6b61 MDL-52433 user: Remove unnecessary capability check 2016-03-08 12:24:04 +01:00
David Monllao 9aff357438 Merge branch 'wip-MDL-41648-30' of https://github.com/dg711/moodle into MOODLE_30_STABLE 2016-03-08 15:32:46 +08:00
Andrew Nicols e567d6eda3 Merge branch 'MDL-49897_30' of https://github.com/rushi963/moodle into MOODLE_30_STABLE 2016-03-08 15:27:06 +08:00
David Monllao a51a17c846 Merge branch 'MDL-50218-30' of https://github.com/xow/moodle into MOODLE_30_STABLE 2016-03-08 14:41:50 +08:00
Andrew Nicols 5dbd593d3a Merge branch 'MDL-53010-30' of git://github.com/lameze/moodle into MOODLE_30_STABLE 2016-03-08 14:34:53 +08:00
David Monllao 484d8abc22 Merge branch 'MDL-52068-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-03-08 14:29:38 +08:00
David Monllao 6e036a74b0 Merge branch 'MDL-52984_30' of https://github.com/rushi963/moodle into MOODLE_30_STABLE 2016-03-08 14:04:27 +08:00
Andrew Nicols 38dfee06dd Merge branch 'MDL-53047-login-anchor-MOODLE_30_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_30_STABLE 2016-03-08 13:15:56 +08:00
Simey Lameze 475362630b MDL-51167 tool_monitor: check course visibility and user capabilities 2016-03-08 03:09:04 +01:00
Andrew Nicols b643f44415 Merge branch 'MDL-53210-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-03-08 09:54:04 +08:00
Cameron Ball 314d105c16 MDL-52651 htmlpurifier: Append rel=noreferrer to links.
Thank you to Zachary Durber for originally working on this issue.
2016-03-08 02:07:54 +01:00
David Monllao 61ba63d516 Merge branch 'MDL-53350_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-03-08 09:05:05 +08:00
David Monllao 16e85de11f Merge branch 'MDL-53353_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-03-08 08:44:49 +08:00
Andrew Nicols b46e8a7b32 Merge branch 'MDL-53291_30_ajax_fix' of https://github.com/BenKelada/moodle into MOODLE_30_STABLE 2016-03-08 07:42:44 +08:00
Krista Koivisto 0766509ab0 MDL-52774 ajax: Require authentication when getting nav branch
When getting the navigation branch data through AJAX, require
login if forcelogin is set.
2016-03-08 00:39:26 +01:00
Juan Leyva 56a067e7c1 MDL-52901 mod_assign: Check due dates in external save_submission 2016-03-08 00:13:14 +01:00
David Monllao c7f7b18ade MDL-52378 singleview: Using is_disabled instead of is_locked 2016-03-07 23:04:16 +01:00
Travis Noll 3328dc32a7 MDL-52378 Singleview: Exclude Grade Attribute Permissions
Singleview users must have Manage Grade permission to modify the
Exclude grade attribute.
2016-03-07 23:04:07 +01:00
Juan Leyva 783e695e00 MDL-52808 calendar: Do not return events for hidden activities 2016-03-07 22:36:15 +01:00
David Mudrák de60fc23ae MDL-52727 mod_data: Improve output of the form fields values
This issue mostly affects the search form fields. Submitted values for
these fields are typically obtained via optional_param() with
PARAM_NOTAGS specified as the parameter type - see parse_search_field()
methods. Such values themselves are not safe enough to be printed back
directly into the HTML as they might contain malicious code.

While working on the patch, some other places with weak protection were
detected and fixed.

In case of the itemid parameters, explicit clean_param() is added to
make sure we cast the value as an integer. That should make the s()
unnecessary but it was added anyway as an extra protection (just in case
the code flow changes or the parts of the code are re-used elsewhere).
2016-03-07 22:08:26 +01:00
Eloy Lafuente (stronk7) 04576de946 Merge branch 'MDL-53061-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-03-07 16:52:56 +01:00
Tim Hunt 0c5c778ae7 MDL-53369 qtype_ddwtos: prevent boxes on consecutive lines touching 2016-03-07 15:24:03 +00:00
dg711 4d2eab6932 MDL-41648 grade: Remove 'error' parameter in grading notification divs 2016-03-06 09:44:44 +05:30
Tim Hunt 7f81a8388a MDL-53353 drag-drop marker quetions: fix edit form jitter 2016-03-04 17:42:16 +00:00
Tim Hunt 76dad4b0a2 MDL-53350 drag-drop to text: layout problem on reivew 2016-03-04 17:12:24 +00:00
David Mudrák 8b65d0cdff MDL-53351 lti: Do not throw PHP notice when deleting LTI instance
The typeid=0 is a valid and common value representing "Automatic, based
on launch URL" type. In that case, no record in the lti_types table is
found. Thence attempting to access its toolproxyid property used to
throw PHP notice.
2016-03-04 16:50:45 +01:00
Brendan Heywood 857919df34 MDL-53047 login: Fixed #anchor being lost after login process 2016-03-04 22:55:33 +11:00
John Okely 0b1455e93b MDL-50218 lti: Return empty grade when none exists 2016-03-04 16:27:13 +08:00
Dan Poltawski fba7a51461 weekly release 3.0.2+ 2016-03-04 10:34:37 +08:00
Dan Poltawski 7fa00f860e Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-03-04 10:34:35 +08:00
AMOS bot 3ce4502093 Automatically generated installer lang files 2016-03-03 22:24:13 +08:00
AMOS bot 5739b1b6b9 Automatically generated installer lang files 2016-03-03 22:24:13 +08:00
Dan Poltawski 7097828ac7 MDL-53061 grunt: watch and various improvements
This is a backport of a number of commits from MDL-49817  which
in general are about simplifying and moving to standard 'grunt' things.
2016-03-03 11:39:25 +08:00
Ben Kelada 438995ddc1 MDL-53291 javascript: fix jquery ajax requests when data contains ??
jQuery ajax requests containing multiple '?' get replaced with a
string similar to jQuery152330039032_1231231, this is because it
is processing a stringified data object as jsonp and thinks its a url.
 workaround is to add contenttype
see https://github.com/jquery/jquery/issues/1799
2016-03-03 09:20:57 +11:00
AMOS bot 53c59fae82 Automatically generated installer lang files 2016-03-03 00:04:23 +08:00
Frederic Massart eb0a4127d4 MDL-52068 repository: Prevent JS errors due to unescaped lang strings 2016-03-02 15:35:29 +08:00
Andrew Nicols 8eaea8e878 Merge branch 'MDL-53214-30-category-feedback' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-03-02 14:49:44 +08:00
Cameron Ball cb23ec3e1c MDL-53214 grades: Fix labels on feedback fields 2016-03-02 14:31:16 +08:00
Dan Poltawski f4f44fb59d Merge branch 'MDL-52513_30' of https://github.com/rushi963/moodle into MOODLE_30_STABLE 2016-03-02 13:23:57 +08:00
Eloy Lafuente (stronk7) 850a632505 MDL-52136 mod_forum: fix some out-of-sync stuff
Thanks CIs!
2016-03-02 05:42:04 +01:00
Eloy Lafuente (stronk7) cc52eadad9 Merge branch 'MDL-52136-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-03-02 05:26:29 +01:00
Andrew Nicols 0b1c48f422 MDL-52136 mod_forum: forum_post is templatable 2016-03-02 12:10:29 +08:00
Andrew Nicols d64639a987 MDL-52136 mod_forum: Correctly quote get_string vars in mustache 2016-03-02 11:52:58 +08:00
Andrew Nicols 50aff07c9f MDL-52136 core: Add support for quoting variables in mustache helpers
This is required for when helpers include json-encoded variables as arguments.
As an example, imagine a template with content:

{{# str }} somekey, someidentifier, { "fullname": "{{ fullname }}" } {{/ str }}

If the fullname variable were to include the double-quote character (e.g.
John "Trevor" Doe) because of the way in which mustache renders content, it
would become:

{{# str }} somekey, someidentifier, { "fullname": "John "Trevor" Doe" } {{/ str }}

This results in an invalid JSON structure.

To work around this issue, the quote characters in the passed variable
must be escaped:

{{# str }} somekey, someidentifier, { "fullname": "John \"Trevor\" Doe" } {{/ str }}

Unfortunately, Mustache provides no way of doing so natively.

With this function, we can quote the text as appropriate:

{{# str }} somekey, someidentifier, { "fullname": {{# quote }}{{ fullname }}{{/ quote }} } {{/ str }}

This also handles the case where the quoted content includes the Mustache
delimeter ({{ or }}).

For example:
fullname = 'John "}}Trevor{{" Doe'

Ordinarily this would be rendered as:
{{# str }} somekey, someidentifier, { "fullname": "John "}}Trevor{{" Doe" } {{/ str }}

This rendering is both a JSON error, and also a mustache syntax error because of the mustache delimeters.

The quote helper also escapes these by wrapping them in change delimeter
tags:

{{# str }} somekey, someidentifier, { "fullname": "John "{{=<% %>=}}}}<%={{ }}=%>Trevor{{=<% %>=}}{{{{=<% %>=}}" Doe" } {{/ str }}
2016-03-02 09:00:55 +08:00
Eloy Lafuente (stronk7) 87568b0cfa Merge branch 'MDL-52763-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-03-01 21:38:38 +01:00
Eloy Lafuente (stronk7) dea510bfe0 Merge branch 'wip-mdl-53126-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-03-01 21:35:11 +01:00
Eloy Lafuente (stronk7) 4fb283dea5 Merge branch 'MDL-53200-30-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-03-01 21:25:00 +01:00
Rushikesh b2a2dfe8ae MDL-49897 Calendar : Calendar day view showing past events 2016-03-01 20:16:36 +05:30
Dan Poltawski 62bdb2b8ec Merge branch '30_MDL-53166' of https://github.com/eugeneventer/moodle-fixes into MOODLE_30_STABLE 2016-03-01 12:55:23 +08:00
Dan Poltawski bce722a96d Merge branch 'MDL-46424_30' of https://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-03-01 12:38:53 +08:00
Marina Glancy 7266f8301e MDL-44952 mod_feedback: set value for hidenoselect if disabled 2016-03-01 12:31:24 +08:00
Dan Poltawski e102b4c4d9 Merge branch 'MDL-52928-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-03-01 11:38:30 +08:00
Andrew Nicols 4abf4d9ada Merge branch 'MDL-53027-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-03-01 10:40:40 +08:00
Simey Lameze 477cad6875 MDL-53010 core_role: add missing coursecatlib include 2016-03-01 10:22:03 +08:00
Andrew Nicols 7ce4f46db6 Merge branch 'MDL-52936_30_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_30_STABLE 2016-03-01 10:07:07 +08:00
Andrew Nicols 471da1eca2 Merge branch 'MDL-53214-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-03-01 09:44:49 +08:00
Kevin Bruton efc68f119d MDL-52568 core_cohort: added ability to return all cohorts in WS 2016-03-01 01:02:27 +01:00
Rushikesh b18af92a44 MDL-52984 Roles : Logs store newly created role's id 2016-02-29 15:01:07 +05:30
Dan Poltawski 0e88a593fd Merge branch 'MDL-44952-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-02-29 16:34:24 +08:00
Andrew Nicols 9125eef5b4 Merge branch 'MDL-52965_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-02-29 15:21:43 +08:00
Andrew Nicols d2c16cde78 Merge branch 'MDL-53249-30' of git://github.com/merrill-oakland/moodle into MOODLE_30_STABLE 2016-02-29 14:36:22 +08:00
Andrew Nicols 787aa4333a Merge branch 'MDL-53206_30' of https://github.com/mr-russ/moodle into MOODLE_30_STABLE 2016-02-29 13:15:26 +08:00
Russell Smith a8ee2c885d MDL-53206 caching: Ensure get_many and set_many dereference objects. 2016-02-29 15:59:21 +11:00
Dan Poltawski 14a0b42eec Merge branch 'MDL-53154-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-02-29 10:13:07 +08:00
Rushikesh a6a982d798 MDL-46424 Upload: Error message for a file exceeding maxsize 2016-02-29 08:58:52 +08:00
AMOS bot a09f722564 Automatically generated installer lang files 2016-02-28 00:04:15 +08:00
Marina Glancy a2c926a184 MDL-48307 mod_wiki: protect [edit] section link from nwiki parser 2016-02-26 13:27:26 +08:00
Eric Merrill df64a2ca06 MDL-53249 atto: Make sure all editors see end move event 2016-02-25 21:37:07 -05:00
Helen Foster c490457a71 MDL-53200 lang: Merge English strings from the en_fix language pack 2016-02-25 17:59:24 +01:00
Mark Johnson 06b13fb79f MDL-52936 theme_bootstrapbase: Fix link hover bug on iOS 2016-02-25 11:57:42 +00:00
Davo Smith 260c6b548c MDL-52965 medialib: fix preload attribute 2016-02-25 15:24:21 +08:00
Andrew Nicols e50cd7c14f weekly release 3.0.2+ 2016-02-25 13:52:30 +08:00
Andrew Nicols 66427af8b7 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-02-25 13:52:27 +08:00
Rajesh Taneja 54472938c1 MDL-53126 behat: Fixed radio button in backup step
Rather than calling click and check on radio node
use radio form field to set value
2016-02-25 10:34:06 +08:00
AMOS bot 873fcd7abf Automatically generated installer lang files 2016-02-25 00:11:33 +08:00
Rushikesh 5ea1c8027c MDL-52513 Grading : Change in display message after publishing 2016-02-24 18:13:49 +05:30
David Balch 6b36cd591e MDL-53027 calendar: Fix false empty result from calendar_get_events(). 2016-02-24 18:42:58 +08:00
Eloy Lafuente (stronk7) c896607100 Merge branch 'MDL-53071-30-2' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-02-24 11:41:08 +01:00
Jun Pataleta f0944e4f7a MDL-53071 course: Allow blank space input for section name 2016-02-24 17:40:10 +08:00
Marina Glancy c82a5b3692 MDL-53210 mod_feedback: fixes in check feedback access
1. show only uservisible feedbacks in block_feedback
2. nicer error message when user opens feedback on frontpage instead of from the mapped course
3. corrected cap check in view.php page before displaying link to complete.php
2016-02-24 13:33:19 +08:00
Cameron Ball a6d32ec56e MDL-53214 grades: Ensure grader report correctly labels fields.
The editable fields for the grader report should have unique labels.
Previously category grade items were not being labelled with the
category name.
2016-02-24 10:44:48 +08:00
AMOS bot 40565791ff Automatically generated installer lang files 2016-02-24 00:04:30 +08:00
Dan Poltawski 650071c3c3 Merge branch 'MDL-42460-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-02-23 14:36:55 +00:00
Dan Poltawski 52db4dbd91 Merge branch 'MDL-52958_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-02-23 10:57:49 +00:00
Dan Poltawski 1823daac03 Merge branch 'MDL-50312_30' of https://github.com/jinhofer/moodle into MOODLE_30_STABLE 2016-02-23 08:07:12 +00:00
Andrew Nicols 7a6ba516c8 Merge branch 'MDL-49338_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-02-23 13:44:34 +08:00
Marina Glancy 6ca319debc MDL-44952 mod_feedback: validate required multichoice 2016-02-23 13:07:30 +08:00
Michael Milette 351fed869c MDL-42460 mod_feedback: Fix markup validation 2016-02-23 12:56:23 +08:00
Davo Smith dd0af0fad5 MDL-52371 theme_base: activity chooser - support long names 2016-02-23 11:39:38 +08:00
Kenny McCormack 6d27533ac0 MDL-52371 theme_bootstrapbase: activity chooser - support long names 2016-02-23 11:39:36 +08:00
Andrew Nicols d04d763594 Merge branch 'MDL-52892-30_STABLE' of https://github.com/dg711/moodle into MOODLE_30_STABLE 2016-02-23 10:19:56 +08:00
Eloy Lafuente (stronk7) 6f17dd18c8 Merge branch 'MDL-53065_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-02-22 23:01:13 +01:00
AMOS bot 560d38c251 Automatically generated installer lang files 2016-02-23 00:04:30 +08:00
Dan Poltawski 1ab7bb3c6f Merge branch 'MDL-44093-30-flowplayer' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-02-22 09:04:15 +00:00
Andrew Nicols 2410893797 Merge branch 'wip-mdl-52970-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-02-22 15:22:57 +08:00
Eugene Venter 6c735bd4bb MDL-53166 mod_forum: fix fatal error in backup phpunit test
when running mod_forum_testsuite mod_forum_testsuite
2016-02-22 13:48:37 +13:00
Tim Hunt 51089c2079 MDL-53065 quiz redo question: avoid PHP notice in edge case
When selecting the variant of the new question, we need to add the
new question to the usage before trying to select a variant.

Also, we need to acutally use the selected variant number!
2016-02-19 12:11:08 +00:00
Tim Hunt 70cfad6550 MDL-49338 quiz stats: preview urls wrong for question variants 2016-02-19 12:02:35 +00:00
Rajesh Taneja 93d9e77b73 MDL-52970 behat: Wait for page to be ready after click
After click enusre to wait so text fields are not
use autosize
2016-02-19 15:24:46 +08:00
Rajesh Taneja 9026f8aa42 MDL-52970 behat: Navigation step improvement
If navigation node to expand is a link then first
click on it and navigate to next page where it is
expanded, and then click on link within. This is
needed as some drivers click on link and don't open
the navigation node which are links
2016-02-19 15:24:46 +08:00
Rajesh Taneja 36fd5a2e74 MDL-52970 behat: For single select only click event is enough 2016-02-19 15:24:45 +08:00
Rajesh Taneja 86ebfb0bb5 MDL-52970 behat: don't set select value if already set
In FF 44.0, it fails to click on submit button if
select value is set to the original value
2016-02-19 15:24:45 +08:00
dg711 a6a46d4fc3 MDL-52892 message: users' pic overrides others
While listing the messages , the logged in users' profile pic used to
override over other users' pics .
2016-02-19 02:33:09 +05:30
David Mudrák f64c024648 MDL-44093 flowplayer: Provide information about source code location
Moodle ships with compiled binary code of the flowplayer. This patch
adds information about the source code location according to GNU GPLv3
section 6d and provides the original license for the code from
https://github.com/flowplayer/flash/blob/7c39fbe31ecddc/core/LICENSE.txt
2016-02-18 16:30:03 +01:00
Dan Poltawski 8d42058734 weekly release 3.0.2+ 2016-02-18 09:14:25 +00:00
Dan Poltawski 06ad488970 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-02-18 09:14:23 +00:00
Jun Pataleta cca7714daf MDL-53154 course: Raise PHP time limit when deleting a course 2016-02-18 10:11:13 +08:00
Eloy Lafuente (stronk7) 7080a26ecc MDL-52964 Qtype: Small fixes to behat tests
This applies some small changes to proposed behat tests:

- Geting rid of the @javascript tag when it's not needed.
- Adding some missing @_switch_window tags.
- Fixing some scenario names, previously duplicated.
- Fixing some typos and whitespace.
2016-02-18 02:31:44 +01:00
M Kassaei 56b8a5c80c MDL-52964 Qtype: Add behat tests to core question types 2016-02-18 02:31:40 +01:00
Marina Glancy 0a43324230 MDL-49807 mod_wiki: section detection regexp fix 2016-02-17 13:11:14 +08:00
David Monllao b14945cc2f Merge branch 'MDL-48015-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-02-17 09:52:53 +08:00
Eloy Lafuente (stronk7) c25eb5d673 Merge branch 'MDL-51852-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-02-17 02:04:08 +01:00
Andrew Nicols 4741ff9810 MDL-51852 mod_forum: Respect timed discussions in emails 2016-02-17 07:59:13 +08:00
Eloy Lafuente (stronk7) 5dc2d2eb4e Merge branch 'MDL-29506-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-02-16 17:50:31 +01:00
Eloy Lafuente (stronk7) 3bb2f388bb Merge branch 'MDL-52997-email-threading-MOODLE_30_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_30_STABLE 2016-02-16 17:11:48 +01:00
AMOS bot 611c47c861 Automatically generated installer lang files 2016-02-17 00:05:51 +08:00
Eloy Lafuente (stronk7) 29e70c0ffa Merge branch 'MDL-52814_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-02-16 16:48:59 +01:00
Dani Palou a8615c22c8 MDL-52993 wiki: Add unit tests for wiki_user_can_edit
Note: amended on integration to fix some comments.
2016-02-16 16:43:09 +01:00
Dani Palou 5d14c00774 MDL-52993 wiki: Fix wiki_user_can_edit for collab and separate groups 2016-02-16 16:42:46 +01:00
Dan Poltawski 60a26ddf42 Merge branch 'MDL-52862_30' of https://github.com/juancs/moodle into MOODLE_30_STABLE 2016-02-16 15:18:48 +00:00
Dan Poltawski db57772b2f Merge branch 'MDL-53012-m30' of https://github.com/sammarshallou/moodle into MOODLE_30_STABLE 2016-02-16 10:44:58 +00:00
Dan Poltawski e7a4135526 Merge branch 'MDL-52879_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-02-16 10:26:00 +00:00
Dan Poltawski 5e86ebcd3b Merge branch 'MDL-49612-30' of git://github.com/dpalou/moodle into MOODLE_30_STABLE 2016-02-16 09:30:13 +00:00
David Monllao 0682e95c72 Merge branch 'MDL-51117-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-02-16 13:27:04 +08:00
Eloy Lafuente (stronk7) a4112f7906 Merge branch 'MDL-52511-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-02-16 02:00:44 +01:00
David Monllao 2cc9af244b Merge branch 'MDL-52217-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-02-16 05:56:56 +08:00
David Monllao 6ad63c6a2b Merge branch 'MDL-51580_30' of git://github.com/stronk7/moodle into MOODLE_30_STABLE 2016-02-16 05:05:43 +08:00
sam marshall 4ff024c5ab MDL-53012 Behat: Add step to run scheduled task 2016-02-15 17:34:31 +00:00
Dan Poltawski 0c92dc487f Merge branch 'MDL-53039-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-02-15 15:33:40 +00:00
Dan Poltawski 3277a55bd5 Merge branch 'MDL-52342-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-02-15 13:28:16 +00:00
Dan Poltawski 6f55d77ab1 Merge branch 'MDL-49146_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-02-15 12:13:31 +00:00
Dan Poltawski 22fcbd1f22 Merge branch 'wip_MDL-53029_m30' of git://github.com/gjb2048/moodle into MOODLE_30_STABLE 2016-02-15 11:07:37 +00:00
Dan Poltawski b1f4f5bae8 Merge branch 'MDL-44626-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-02-15 10:36:21 +00:00
Andrew Nicols 15ba94e132 MDL-52217 repository: prepare_file should use per-request directory
The repository API defaults has a function, prepare_file, which is
responsible for creating a unique file to be used during the current
request.

This is usually used in the repository's get_file() function to store the
file before it is used elsewhere in the API to save the file to the
filestorage API.
It is also sometimes used to temporarily store credentials for the lifetime
of the session.

In all cases, this file is only expected to exist for the duration of the
session.

Switching to use of a per-request directory using make_request_directory()
ensures that the tempdir does not grow without control.

This commit also adds an upgrade step to remove all old temp directories
created by any repository currently installed.
2016-02-15 15:55:06 +08:00
David Monllao 76996862ed Merge branch 'wip-MDL-52566-MOODLE_30_STABLE-2' of https://github.com/cdsmith-umn/moodle into MOODLE_30_STABLE 2016-02-15 15:18:12 +08:00
David Monllao a900614082 Merge branch 'MDL-49807-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-02-15 15:12:00 +08:00
Juan Segarra Montesinos af56a3c5b8 MDL-52862 mod_forum: format non HTML messages in search results
Override messageformat to FORMAT_HTML before calling forum_print_post
2016-02-15 07:54:32 +01:00
David Monllao 76c73a9895 Merge branch 'MDL-52249-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-02-15 14:20:26 +08:00
Andrew Nicols c063da3610 MDL-29506 forum: Add tests for encode_content_links 2016-02-15 08:08:57 +08:00
Rushikesh a027928b32 MDL-29506 forum: Fix use of ampersand in backup parent links 2016-02-15 08:08:57 +08:00
AMOS bot 8fefce40e2 Automatically generated installer lang files 2016-02-13 00:04:19 +08:00
Eloy Lafuente (stronk7) 23cd87285b MDL-51580 environment: 3.1 requirements added
Only important change is that Moodle 2.7 installed is
required to be able to upgrade to 3.1. See the issue
for opinions, votes and agreed outcomes.
2016-02-11 16:09:00 +01:00
Brendan Heywood 58a10b8e47 MDL-52997 forum: Add more robust threading email headers 2016-02-11 20:39:12 +11:00
David Monllao 288f92e8bd weekly release 3.0.2+ 2016-02-11 13:58:59 +08:00
David Monllao 87fa90f7a5 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-02-11 13:58:57 +08:00
Andrew Nicols 9a5b9c76fc MDL-44626 files: Show the PHP max upload size instead of 'unlimited'
Even when a user has the appropriate capability to upload any sized files,
they are still restricted to the PHP post_max_size, and upload_max_filesize
values.

Rather than showing a value of "Unlimited', we should always restrict to
this value.
2016-02-11 10:56:31 +08:00
Andrew Nicols 70a52304db MDL-44626 repository: Correct error message when uploading large files 2016-02-11 10:56:30 +08:00
Andrew Nicols e271dc1e96 MDL-51117 JavaScript: Convert alert to M.core.alert in dndupload 2016-02-11 08:44:39 +08:00
Andrew Nicols c8b4b14574 MDL-52342 theme: Reduce specificity of selector
These selectors were introduced to fix a real issue (highlighted by behat with
Chromedriver) whereby the 'Show section foo' link was partially covered by
another layer.

The fix in that issue was too broad and applied to all content > div areas,
which had some unforseen effects.

Since the original issue only affected activity instances, and sections (and
not content > div regions), I've removed this from the original patch.
2016-02-11 08:20:28 +08:00
Gareth J Barnard 925c6bba13 MDL-53029 mod_book: Hidden chapter has markup in alt and title attrs. 2016-02-10 18:08:37 +00:00
Petr Skoda 60f89a0364 MDL-52511 dml: add support for PostgreSQL 9.5
The default definition behaviour has changed for some int values.
2016-02-10 09:45:44 +00:00
Tim Hunt 4b3f09c081 MDL-52814 questions: Show extra info in the outcomes area not info
Currently the only use is the quiz Redo question button, and that would
be much better placed in the feedback area, not least for langages where
the button label needs to be longer.
2016-02-10 08:47:40 +00:00
Marina Glancy f47289bc99 MDL-49807 mod_wiki: correctly form toc and sections for atto 2016-02-10 13:31:57 +08:00
Andrew Nicols 8d6b7362e2 MDL-52930 forum: Fix random test failure caused by passing of time 2016-02-10 12:24:39 +08:00
David Monllao 78ede65849 Merge branch 'MDL-52766-30-mnet-url-length' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-02-10 08:55:23 +08:00
Tim Hunt a52191b36b MDL-52879 quiz editing: allow removal of the last question in a quiz
Even though you are not normally allowed to remove the last question
in a section.
2016-02-09 21:49:05 +00:00
AMOS bot 166c123bc3 Automatically generated installer lang files 2016-02-10 00:04:11 +08:00
Michael Hughes 01707afd17 MDL-52763 Assignment: Display Participant Number
Display participant number when user holds mod/assign:viewblinddetails capability.

Backport of MDL-52270
2016-02-09 15:59:15 +00:00
Davo Smith b3995066ad MDL-49620 availability: plugins can have global settings 2016-02-09 10:35:30 +00:00
Juan Leyva 2332e18b87 MDL-53000 mod_assign: Add missing get_file_areas in editpdf subplugin 2016-02-09 11:34:19 +01:00
David Monllao 587d575de1 Merge branch 'MDL-52930-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-02-09 18:06:26 +08:00
Dan Poltawski d5df4d045f Merge branch 'MDL-52895-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-02-09 09:44:53 +00:00
David Monllao 5ed3f867eb Merge branch 'MDL-52902-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-02-09 16:40:19 +08:00
David Monllao 80e7dc9740 Merge branch 'MDL-52927_30' of https://github.com/mkassaei/moodle into MOODLE_30_STABLE 2016-02-09 16:40:19 +08:00
Marina Glancy d25ef0fbde MDL-53039 rss: allow guest access to front page forum 2016-02-09 15:55:53 +08:00
Andrew Nicols 3468942807 MDL-52928 message: Correct contact fetching in recent conversations 2016-02-09 13:39:44 +08:00
Jun Pataleta 65b930fcbd MDL-48015 grade: Fix the display of grade categories 2016-02-09 13:33:21 +08:00
Eloy Lafuente (stronk7) 0e1df382a5 Merge branch 'wip-mdl-52949-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-02-09 02:30:44 +01:00
Andrew Nicols db80cf54a6 MDL-52339 question: Fix question attempt removal for MySQL
Derived table support was altered in MySQL 5.7 changing the way in which
DELETE FROM works in some cases.

This change modifies the way in which deletion occurs by selecting all IDs
and batching them into groups of 1000.
2016-02-09 00:45:50 +01:00
Eloy Lafuente (stronk7) be82fa5053 Merge branch 'MDL-52938-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-02-09 00:30:44 +01:00
Eloy Lafuente (stronk7) 7fa20a8f2e Merge branch 'MDL-52975-30-mnet-context' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-02-08 22:58:05 +01:00
Eloy Lafuente (stronk7) 87935201fe Merge branch 'MDL-52981-m30' of https://github.com/sammarshallou/moodle into MOODLE_30_STABLE 2016-02-08 22:55:17 +01:00
Eloy Lafuente (stronk7) bf60b24c82 Merge branch 'MDL-51075_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-02-08 22:44:59 +01:00
Eloy Lafuente (stronk7) bed63ca74f Merge branch 'MDL-50310-30-random-glossary' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-02-08 22:34:32 +01:00
Dan Poltawski bf209aea14 Merge branch 'MDL-48778-30' of git://github.com/lameze/moodle into MOODLE_30_STABLE 2016-02-08 17:15:44 +00:00
Eloy Lafuente (stronk7) 27802334e2 Merge branch 'MDL-52983_30' of git://github.com/aolley/moodle into MOODLE_30_STABLE 2016-02-08 13:05:39 +01:00
Andrew Nicols 4d51f843be MDL-52249 theme_bootstrapbase: Remove dropdown-backdrop
Standard bootstrap adds a backdrop for touch-responsive clients.
Unfortunately the backdrop is not compatible with submenus.

The backdrop was only added in Bootstrap v2.3.1, and Moodle switched to
using the bootstrap JS in version 3.0.0.
2016-02-08 14:46:08 +08:00
Simey Lameze a40195b455 MDL-48778 mod_assign: behat tests for group submission 2016-02-08 14:24:04 +08:00
Eric Merrill f94c215231 MDL-48778 assign: Use proper latest attempt for quickgrading prechecks
The code that stored lastmodified in gradingtable used a different
method to produce it than the processor used to generate the check
value. Fix that and also check that the attempt number has not changed.
2016-02-08 14:24:04 +08:00
David Monllao 3bfe6aa877 Merge branch 'MDL-50115-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-02-08 14:11:37 +08:00
David Monllao 5d09708b25 Merge branch 'm30_MDL-52637_Disable_Automatically_Enabling_TLS_Encryption' of https://github.com/scara/moodle into MOODLE_30_STABLE 2016-02-08 13:51:17 +08:00
Adam Olley 10bf1500da MDL-52983 excel output: avoid single quote on end of sheet name
This change resolves a problem where a long sheet name, which gets
trimmed down with substr($name, 0, 31), could result in a sheet name
with a single quote on the end because the quote removal was done before
the substr.
2016-02-08 15:17:35 +10:30
David Monllao 091fc5259b Merge branch 'MDL-51723-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-02-08 09:03:28 +08:00
Tim Hunt 3286622534 MDL-49146 single-activity course format: key activity must be visible
With a single-activity course, visibility to students is controlled by
course visibility. There is no sense in having the key activity not
visible to students, and, if you did, the symptoms were almost
incomprehensible. It was very hard to work out what you had done wrong.
2016-02-06 14:59:03 +00:00
AMOS bot fd6d42de20 Automatically generated installer lang files 2016-02-06 00:04:15 +08:00
Andrew Nicols 8275f30231 MDL-52930 mod_forum: Add get_unmailed_posts tests 2016-02-05 14:40:26 +08:00
Josh Marshall 6d425afa4f MDL-52930 forum: Correct get_unmailed_posts logic 2016-02-05 14:37:04 +08:00
David Monllao e4e7acde8b MDL-52958 medialib: Allow vimeo fullscreen using links
All credit to Henrik Sune Pedersen.
2016-02-05 10:18:45 +08:00
David Monllao a80a00aa08 MDL-51075 filter_glossary: Fix popup position when no popups
Thanks to Andrew Nicols for cleaning my eyes.
2016-02-05 09:24:41 +08:00
David Mudrák 18b2d9d2f9 MDL-50310 glossary: Fix restore of random glossary entry block
When restoring the random glossary entry block, we need to check that
the associated glossary has also been included in the backup and is
being restored. If not, we must invalidate the block configuration.

Before this patch, the block configuration was not invalidated.

Additionally, as a result of MDL-20131, the block configuration also
contains the course id of the associated glossary (which by the way does
not seem to be a wise choice, but I may be missing something). So we
need to remap this course id as well to avoid mismatch.
2016-02-04 23:44:15 +01:00
Matteo Scaramuccia c577e1af6a MDL-52637 mail: Disabled automatic TLS encryption. 2016-02-04 21:18:34 +01:00
David Mudrák b704533f0a MDL-52975 mnet: Set system context on the MNet SSO landing page
Without the context being explicitly set, debugging warning can be
displayed in certain rare situations.
2016-02-04 17:16:18 +01:00
David Mudrák 117ee3a064 MDL-52766 mnet: Support MNet peer URLs longer than 64 characters
The commonName in SSL certificate is limited to 64 characters as per
RFC 5280 (https://www.ietf.org/rfc/rfc5280.txt). We respect that limit
when generating the CN attribute from the site's $CFG->wwwroot. But then
we did not respect it when comparing the common name with the peer's
URL so the certificate was not considered valid.
2016-02-04 17:11:56 +01:00
Dan Poltawski c0abaa9fdf MDL-50115 grunt: add missing jshint configuration
The gruntfile isn't a normal browser environment
2016-02-04 12:04:20 +00:00
Dan Poltawski ca86656416 MDL-50115 grunt: provide a --root option to set base path
Windows users are not able to run grunt on a subpath due to platform
restrictions. So we provide this option to provide a workaround for that.

Thanks to Ty Delean who proposed this idea.
2016-02-04 12:04:20 +00:00
David Monllao 22fa1056d7 weekly release 3.0.2+ 2016-02-04 14:30:16 +08:00
David Monllao 628462b78d Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-02-04 14:30:14 +08:00
AMOS bot 6944c07406 Automatically generated installer lang files 2016-02-04 00:04:21 +08:00
sam marshall 74e7fab22e MDL-52981 Unit tests: Reset global after test 2016-02-03 10:28:21 +00:00
Juan Leyva 6b6d2633b0 MDL-52895 webservice: Fix capability checks 2016-02-03 11:24:00 +01:00
David Monllao b0f5eb7d36 Merge branch 'MDL-52899_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-02-03 13:44:57 +08:00
David Monllao 162c33d75e Merge branch 'MDL-52873-30-modgradeid' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-02-02 12:12:45 +08:00
David Monllao 641eab45e0 Merge branch 'MDL-52137-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-02-02 10:57:00 +08:00
Marina Glancy 18ff1708e4 MDL-52938 mod_forum: check global setting to track forum posts 2016-02-02 10:54:59 +08:00
M Kassaei 39396934da MDL-52927 qtype ddwtos and ddimageortext focus using keyboard 2016-02-01 14:50:55 +00:00
Dan Poltawski a6a883df2d Merge branch 'wip-mdl-52932-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-02-01 10:27:27 +00:00
Dan Poltawski 3e5db201a5 Merge branch 'MDL-52940_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2016-02-01 09:49:23 +00:00
David Monllao 5a8f2ba046 Merge branch 'MDL-51704-30' of git://github.com/dpalou/moodle into MOODLE_30_STABLE 2016-02-01 17:20:49 +08:00
David Monllao 3c63c2c900 Merge branch 'MDL-52261_30_file_not_found' of git://github.com/BenKelada/moodle into MOODLE_30_STABLE 2016-02-01 13:56:16 +08:00
David Monllao 96c7474eb0 Merge branch 'MDL-52913_30_STABLE' of git://github.com/marxjohnson/moodle into MOODLE_30_STABLE 2016-02-01 13:46:32 +08:00
Mark Nelson 20e102773f MDL-52940 core_backup: prevent always displaying logs 2016-02-01 12:45:05 +08:00
David Monllao 36719a497f Merge branch 'MDL-52831-30-emptynames' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-02-01 11:31:44 +08:00
Rajesh Taneja 1d1d4952b0 MDL-52949 behat: Use hover step and not click step
Message delete link is visible on hover
Click event can fail randomly.
2016-02-01 11:15:25 +08:00
Andrew Nicols faef5d14c7 MDL-51723 enrol_ldap: Normalise user objectclass in dn 2016-02-01 10:28:54 +08:00
Rajesh Taneja 61358a918d MDL-52932 behat: Restart session if it fails because of some reason 2016-02-01 09:32:29 +08:00
jinhofer 1a6dac81ed MDL-50312 grade/report/grader: Fixed remaining issue
MDL-49764 fixed the appearance of user cells. However, the window
resize event was still incorrect. This is a fix for the window
resize event for ALL IE versions.
2016-01-29 12:22:56 -06:00
Mark Johnson df443f4d83 MDL-52913 behat: Abort database transactions on exception. 2016-01-29 11:56:30 +00:00
David Monllao 5677aedfd3 weekly release 3.0.2+ 2016-01-29 14:37:04 +08:00
David Monllao 20f2e2ec6a Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-01-29 14:37:01 +08:00
David Monllao 6309e63d41 MDL-52825 atto: Listen to gesturemovestart to discard some events 2016-01-28 12:21:20 +08:00
AMOS bot fb0a1132c9 Automatically generated installer lang files 2016-01-28 00:04:29 +08:00
Juan Leyva 3b5f57029b MDL-52902 webservice: Send CORS header before params validation 2016-01-27 10:27:00 +01:00
Eloy Lafuente (stronk7) 859d6e470e Merge branch 'MDL-29817_30' of https://github.com/rushi963/moodle into MOODLE_30_STABLE 2016-01-27 00:52:05 +01:00
Eloy Lafuente (stronk7) 8e114d80fb MDL-52567 Core: amend existing test to new counting rules 2016-01-27 00:37:42 +01:00
Eloy Lafuente (stronk7) f41a364e27 Merge branch 'MDL-52567_M30' of https://github.com/nadavkav/moodle into MOODLE_30_STABLE 2016-01-27 00:37:23 +01:00
Eloy Lafuente (stronk7) 33cd0e15f1 MDL-37739 mod_wiki: test headings being wikilinks (toc and content) 2016-01-27 00:13:52 +01:00
Luca Bösch a6c941f063 MDL-37739 mod_wiki: Wiki ToC header href remove square double brackets.
When H1, H2 and H3 links in wiki act themselves as hyperlinks, they
were displayed in double brackets. This patch removes [[ and ]] out of
the table of content displayed header hyperlinks.
2016-01-26 23:16:27 +01:00
AMOS bot d0090576e1 Automatically generated installer lang files 2016-01-27 00:04:13 +08:00
Dani Palou 2feef8ec73 MDL-51704 survey: Fix display problems in report page 2016-01-26 14:07:16 +01:00
Tim Hunt ca7c500826 MDL-52899 behat: make PAGE_READY_JS more robust 2016-01-26 11:23:47 +00:00
Dan Poltawski ec4dc1d0c2 Merge branch 'MDL-48953_m30v4' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-01-26 11:10:15 +00:00
Rushikesh c10119a059 MDL-25864 Blog: Confirmation dialog before unregistering 2016-01-26 11:06:27 +00:00
David Monllao 54405a604f Merge branch 'MDL-52459-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-01-26 18:23:00 +08:00
Dani Palou 00a3d0bdcf MDL-49612 forum: Fix some external_value creation in params declaration 2016-01-26 09:16:51 +01:00
Eloy Lafuente (stronk7) 5b647d65f2 Merge branch 'wip-mdl-52839-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-01-26 00:40:48 +01:00
Eloy Lafuente (stronk7) 4d9adf0f60 Merge branch 'MDL-52843-30-paramsignup' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-01-26 00:38:22 +01:00
Clement Smith 59dd3269fb MDL-52566 mod/assign: Fix group submission draft records
When group assignments are submitted by the first student in a group,
the logic that saves the submission is not creating a draft
assignment record in mdl_assign_submission. This leads to problems
when other functions are used that depend on these records, such as
marking workflow. This fixes the issue and correctly creates
draft assignment submission records for the non-submitting students
in the group.
2016-01-25 09:40:27 -06:00
Dan Poltawski 70ddb4e2c6 Merge branch 'MDL-52791_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-01-25 14:27:03 +00:00
Dan Poltawski d55eb769e4 Merge branch 'MDL-52835-m30' of git://github.com/deraadt/moodle into MOODLE_30_STABLE 2016-01-25 14:14:49 +00:00
Dan Poltawski 08610c078f Merge branch 'MDL-51702_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-01-25 10:30:04 +00:00
Dan Poltawski 1f3f47fe97 Merge branch 'MDL-52825_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-01-25 10:25:57 +00:00
David Monllao 15ccd59dc1 Merge branch 'MDL-52682-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-01-25 15:39:27 +08:00
David Monllao f8f27a5013 MDL-52683 mod_scorm: Test for scorm_get_last_completed_attempt 2016-01-25 15:34:09 +08:00
David Monllao 42d5dcb5c3 Merge branch 'MDL-52683-30' of git://github.com/s-cenni/moodle into MOODLE_30_STABLE 2016-01-25 15:32:38 +08:00
David Monllao da3aaf3a63 Merge branch 'wip-mdl-52799-m30' of git://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-01-25 14:39:46 +08:00
David Monllao 3ab644e94e Merge branch 'MDL-31635-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2016-01-25 12:33:56 +08:00
Marina Glancy 1d188cb1d3 MDL-31635 completion: do not show % for the grade
Also show grades with the configured number of decimal points
2016-01-25 10:23:54 +08:00
AMOS bot d5dd5bd085 Automatically generated installer lang files 2016-01-25 00:04:16 +08:00
Nadav Kavalerchik cb61fdd961 MDL-52567 Core: remove quotation marks, for proper word count 2016-01-24 00:46:39 +02:00
AMOS bot 4c2746d752 Automatically generated installer lang files 2016-01-23 00:04:24 +08:00
David Mudrák 9e065db83d MDL-52873 forms: Generate unique id attributes for modgrade elements
The previous method of generating the id attribute of the elements
within the modgrade group did not take the name of the modgrade field
into account. So if there were multiple fields of the modgrade type
added into a form (not a common case yet still valid), elements created
within the group were assigned same id attributes.

The patch introduces a new method for generating the id attribute of
modgrade elements. The new method takes the name of the modgrade group
into account and returns the id in the format similar to the default one
returned by HTML_QuickForm_element::_generateId().

The patch changes the generated id attribute. Apart from the
block_activity_results' behat feature files, not other places seem to
rely on the exact value.
2016-01-22 14:33:07 +01:00
Andrew Nicols aa720a52ed MDL-52137 mod_forum: Move post body into html digest full body 2016-01-22 10:12:21 +08:00
Andrew Nicols 963681fdc0 MDL-52682 mod_forum: Correct redirect URL when marking posts as read 2016-01-22 08:04:39 +08:00
Michael de Raadt de7454d413 MDL-52835 mod_data: Correct MIME type for JS template 2016-01-22 09:55:28 +11:00
Rushikesh c327cc5c77 MDL-29817 Form : advcheckbox allows attributes even without group key 2016-01-21 22:20:17 +05:30
Sara Cenni bc77304aa5 MDL-52683 mod_scorm: Fix for Last completed attempt error with Oracle 2016-01-21 17:27:48 +01:00
Rajesh Taneja 7b30d1e84a MDL-52839 behat: Fixed xpath and wait to ensure element is visible 2016-01-21 15:51:43 +08:00
Andrew Nicols 4ffe9d1bd3 weekly release 3.0.2+ 2016-01-21 13:43:48 +08:00
Andrew Nicols be932909b5 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-01-21 13:43:45 +08:00
David Monllao 665db4c894 MDL-51702 blocks: Allow permission overrides in dashboard 2016-01-21 08:48:22 +08:00
David Mudrák 960c5cce5c MDL-52843 users: Fix the PARAM type of the name fields in signup form
If editing the profile, the useredit_shared_definition() function set
the type of all name fields to PARAM_NOTAGS. This patch sets that type
consistently in the user signup form, too.
2016-01-20 11:03:32 +01:00
Eloy Lafuente (stronk7) e2baf7ed8a MDL-50083 mod_assign: protect code against not set flags
Yes could have used !empty() but for some reason found
the isset() && condition more clear. Tired brain, surely.
2016-01-20 10:05:38 +08:00
Andrew Nicols 0ef9c59d09 Merge branch 'MDL-52435_30' of https://github.com/jinhofer/moodle into MOODLE_30_STABLE 2016-01-20 09:51:59 +08:00
Eloy Lafuente (stronk7) c3d1a15532 Merge branch 'm30_MDL-50083' of https://github.com/greg-or/moodle-mod_assign into MOODLE_30_STABLE 2016-01-20 01:36:34 +01:00
jinhofer e65317c3f3 MDL-52435 mod/assign: Added and move plagiarism links
Backport of MDL-51693 and MDL-51706
2016-01-19 18:19:11 -06:00
Greg Faller 32f27a6c69 MDL-50083 mod_assign: unlock submission when adding attempt 2016-01-20 09:31:11 +10:30
David Mudrák d3ea8cbc07 MDL-52831 users: Do not delete Mr. and Mrs. Whitespace accounts
Due to imperfect validation of the user registration and profile forms,
we allowed for firstname and lastname be just a whitespace. On MySQL,
such a whitespace is not significant for VARCHAR comparison so these
otherwise valid accounts could be silently deleted.

The patch makes sure that at least one of the checked fields is a real
empty string before deleting such account.
2016-01-19 21:32:42 +01:00
David Mudrák 73f2ca5411 MDL-52831 users: Automatically strip whitespace from name fields
This change prevents from registering and/or saving the profile of a
user with the whitespace instead of the required name.

Additionally, there is accessibility improvement for better error labels
in case of missing values (copied over from signup_form).
2016-01-19 21:32:42 +01:00
Rajesh Taneja 7b30789ce7 MDL-52721 behat: Exclude links in moodle while finding tests
Parallel run create links within moodle
so avoid searching for tests within links
2016-01-19 14:35:34 +00:00
Dan Poltawski 0de2b00a8a Merge branch 'MDL-51123-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-01-19 11:01:48 +00:00
Colin Campbell f71446f628 MDL-51715 lib/grade: Unit test for aggregationweight 2016-01-19 10:40:13 +00:00
Colin Campbell 26933d15b0 MDL-51715 lib/grade: Zero out aggregationweight for novalue and dropped
set_usedinaggregation was setting aggregationweight to zero in these
cases for non-category grades, but not for category grades.
2016-01-19 10:40:05 +00:00
David Monllao f769b21680 MDL-52825 atto: Ignore out of bounds event targets 2016-01-19 15:38:59 +08:00
Andrew Nicols 0c6c844cb8 Merge branch 'MDL-52673-30' of https://github.com/pauln/moodle into MOODLE_30_STABLE 2016-01-19 11:00:12 +08:00
Rushikesh 2940d926a5 MDL-52519 Idap tests: use consistent var name 2016-01-19 10:20:26 +08:00
Andrew Nicols 4e65da4a2f Merge branch 'MDL-52773-30' of https://github.com/pauln/moodle into MOODLE_30_STABLE 2016-01-19 10:02:53 +08:00
Tim Hunt 229072cc77 MDL-52784 quiz: unused param in quiz_get_combined_reviewoptions calls 2016-01-19 09:05:42 +08:00
Eloy Lafuente (stronk7) 79b58bee2b Merge branch 'MDL-52615_M30' of https://github.com/nadavkav/moodle into MOODLE_30_STABLE 2016-01-19 00:29:36 +01:00
Tim Hunt 4b13200c2f MDL-52791 quiz editing: handle unknown question types 2016-01-18 17:37:32 +00:00
AMOS bot f70eede993 Automatically generated installer lang files 2016-01-19 00:04:44 +08:00
Dan Poltawski 1414b0a7d4 Merge branch 'MDL-52750_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2016-01-18 15:54:44 +00:00
Dan Poltawski f80cf7dcf1 Merge branch 'wip-mdl-52721-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-01-18 14:39:44 +00:00
Dan Poltawski c8393f44df Merge branch 'MDL-52218_m30_alt' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2016-01-18 14:04:01 +00:00
Dan Poltawski 63453ea129 Merge branch 'MDL-52486-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-01-18 11:19:54 +00:00
Rajesh Taneja 974ccb5121 MDL-52799 unittest: Removed empty if statement 2016-01-18 15:47:59 +08:00
Andrew Nicols 9604b3e9d8 Merge branch 'MDL-45265-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-01-18 15:19:14 +08:00
Andrew Nicols 3516f2b3ef Merge branch 'MDL-52608-30' of https://github.com/xow/moodle into MOODLE_30_STABLE 2016-01-18 14:48:28 +08:00
Andrew Nicols 2622aa2f9d Merge branch 'MDL-52573-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-01-18 14:43:49 +08:00
Rajesh Taneja 31bbc4db30 MDL-52799 phpunit: Truncate records for brokedmysql not empty. 2016-01-18 14:36:29 +08:00
Andrew Nicols a52a2d3b26 MDL-50915 mod_lesson: Remove js dependencies from behat tests 2016-01-18 10:53:29 +08:00
Andrew Nicols d4bb5da618 Merge branch 'MDL-50915_m30v5' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-01-18 10:53:09 +08:00
Rajesh Taneja 591eb7449f MDL-52721 unittest: Exclude tests in vendor and node_modules 2016-01-18 10:25:48 +08:00
Andrew Nicols a46efc23a3 Merge branch 'MDL-52570-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-01-18 09:52:02 +08:00
Stephen Bourget 4784153309 MDL-48953 choice: Improve chart labels 2016-01-15 13:42:48 -05:00
Tim Hunt d780b39188 MDL-52750 quiz reviewQ/comment: add page title & student name 2016-01-15 11:11:09 +00:00
Paul Nicholls 9cb7b278af MDL-52773 course: Fix section return from single section page
When editing a section from a single section page, you should be returned
to the section you were viewing/editing, not always to section 1.
2016-01-15 11:51:22 +13:00
Dan Poltawski 114ebc3742 MDL-52573 report_grader: only check cap of installed plugins
Previously we were linking to gradebook plugins regardless of whether
they were installed. This should be fixed properly in MDL-52678.
2016-01-14 10:26:03 +00:00
Dan Poltawski 6a01418aa1 weekly release 3.0.2+ 2016-01-14 10:10:05 +00:00
Dan Poltawski ce87f75cf6 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-01-14 10:10:03 +00:00
Mark Nelson a5289915ca MDL-52218 gradereport_grader: added behat test for switching views 2016-01-13 15:29:16 +08:00
Mark Nelson 2381a9327f MDL-52218 gradereport_grader: fixed 'grade:viewhidden' related errors
There were two main reasons why there were PHP errors.

1) We were not passing variables as references.
2) When we were restricting the number of items shown in
   the report we were not collecting all of the dependencies
   which were required when a user did *not* have the
   capability 'moodle/grade:viewhidden'. This would cause
   an undefined offset error due to the index missing in
   the dependency array.

This also meant that a user without the capability 'moodle/grade:viewhidden'
could view the course total without hidden items being taken into account
if they were not being displayed. To resolve this we now pass all the grades
and grade items when the user does not have the capability - which also solves
the PHP errors listed above.
2016-01-13 15:29:16 +08:00
Andrew Nicols 934a6d94ef MDL-43620 mod_chat: Whitespace fix 2016-01-13 10:20:30 +08:00
Andrew Nicols a24477c30a Merge branch 'MDL-50829-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-01-13 09:57:33 +08:00
Andrew Nicols cdfcaa4876 Merge branch 'MDL-43620_m30v2' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-01-13 09:43:11 +08:00
Andrew Nicols 994ad03eb4 Merge branch 'MDL-51710-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2016-01-13 09:17:28 +08:00
Andrew Nicols e8047b8876 Merge branch 'MDL-52507_30' of https://github.com/jinhofer/moodle into MOODLE_30_STABLE 2016-01-13 09:08:01 +08:00
Andrew Nicols ce9eec227b Merge branch 'MDL-52649-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-01-13 09:00:46 +08:00
Joseph Inhofer 1e9de38a74 MDL-52507 enrol/manual: Generated a smart zIndex 2016-01-12 12:11:55 -06:00
AMOS bot 1db782af87 Automatically generated installer lang files 2016-01-13 00:04:09 +08:00
Dan Poltawski 6e120bba12 Merge branch 'MDL-52400-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-01-12 13:12:44 +00:00
Dan Poltawski cad2583872 Merge branch 'MDL-21912-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-01-12 11:08:13 +00:00
Dan Poltawski 60d47c2170 MDL-52656 mod_forum: remove $SSSION test hack 2016-01-12 10:48:19 +00:00
Dan Poltawski 572eca5748 Merge branch 'wip-mdl-52656-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-01-12 10:48:15 +00:00
Andrew Nicols 03f2be3e3d Merge branch 'MOODLE_30_STABLE' of https://github.com/janeklb/moodle into MOODLE_30_STABLE 2016-01-12 15:57:56 +08:00
Andrew Nicols 6b6487eeed Merge branch 'MDL-52585-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2016-01-12 14:37:09 +08:00
Andrew Nicols 63265e4709 Merge branch 'MDL-52610_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-01-12 14:33:32 +08:00
David Monllao 140b58502c MDL-52610 user: Honour allowaccountssameemail in create_users ws
Credit to Dmitriy Kuzevanov.
2016-01-12 13:57:11 +08:00
Andrew Nicols dfa680442c Merge branch 'MDL-52643_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-01-12 13:12:42 +08:00
Andrew Nicols 81df060697 Merge branch 'patch-10' of https://github.com/sk-unikent/moodle into MOODLE_30_STABLE 2016-01-12 12:34:53 +08:00
Andrew Nicols ac0f173e2e Merge branch 'MDL-52563-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-01-12 12:30:38 +08:00
Andrew Nicols 70d41bafa1 MDL-38020 behat: Correct singleselect usage 2016-01-12 12:23:53 +08:00
Andrew Nicols 418a05d706 Merge branch 'MDL-38020-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-01-12 12:23:49 +08:00
Andrew Nicols 0761304d2f Merge branch 'MDL-27840-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2016-01-12 11:49:09 +08:00
Jun Pataleta 6b1ca71974 MDL-52649 user: Add check for potentially undefined variables 2016-01-12 08:57:08 +08:00
Michael Aherne 7f7b3c1b5b MDL-52589 cache: Allow unused stores to be uninstalled 2016-01-11 15:33:33 +00:00
Dan Poltawski 1abbe2a268 Merge branch 'MDL-52000-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2016-01-11 13:17:06 +00:00
Dan Poltawski 2086e272e8 Merge branch 'MDL-41531-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2016-01-11 11:09:10 +00:00
Andrew Nicols f2cd45004b MDL-52000 mod_forum: Respect timed posts in course overview block 2016-01-11 18:56:36 +08:00
Cameron Ball efee20c43b MDL-52486 JavaScript: Make sure lang codes use underscores.
In some cases, underscores in lang codes get replaced with dashes
which causes some JavaScript to be unhappy. This patch simply reverse
the underscore to dash replacement on the JS side.
2016-01-11 16:57:11 +08:00
Cameron Ball 6ab7e0d283 MDL-21912 restore: Add admin setting to restore conflicting admin user 2016-01-11 14:09:30 +08:00
eWallah da3ca5041f MDL-41531 enrol_paypal: Fix enrol errors due to non-ASCII characters 2016-01-11 10:50:07 +08:00
AMOS bot 841db8ec77 Automatically generated installer lang files 2016-01-11 00:04:17 +08:00
Eloy Lafuente (stronk7) 5d35d7b884 Moodle release 3.0.2 2016-01-09 00:49:58 +01:00
Frederic Massart ac70fb827a MDL-51710 repository_s3: Use proxy settings when communicating with S3 2016-01-08 16:55:27 +08:00
Stephen Bourget 21b17fe49c MDL-52643 block_blog_menu: Add behat tests 2016-01-07 20:17:17 -05:00
Rajesh Taneja c4c0518d90 MDL-52656 unittest: Reset original session while setting user 2016-01-08 10:48:56 +10:00
Juan Leyva bad5905952 MDL-52570 message: Do not return deleted messages in WS 2016-01-07 12:12:26 +01:00
Dan Poltawski 7817f82c15 weekly release 3.0.1+ 2016-01-07 08:32:46 +00:00
Dan Poltawski cabf0dbd40 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2016-01-07 08:32:44 +00:00
John Okely ec6f81207a MDL-52608 core: Use property_exists in fullname
Credit to Dmitriy Kuzevanov for the patch.
2016-01-07 07:39:13 +00:00
Paul Nicholls 4cae8e7a30 MDL-52673 workshop: fix dndnotsupported message in assessment form
An old CSS rule which doesn't seem to serve any purpose any more was
causing the "drag and drop not supported" message to be displayed (even
when incorrect) in the workshop assessment form when using a list-view
rubric as the grading strategy.
2016-01-07 15:38:29 +13:00
AMOS bot cd326efb57 Automatically generated installer lang files 2016-01-07 00:04:35 +08:00
Skylar Kelty ab430ba5fd MDL-52664 forum: Fix forum email unsubscribe/discussion URL 2016-01-06 12:48:41 +00:00
Dan Poltawski 4c395d5b09 MDL-45265 behat: tests for admin_bookmarks block 2016-01-06 11:01:34 +00:00
Rajesh Taneja 39f2c0f711 MDL-52614 mod_workshop: right align for dir-rtl only 2016-01-06 13:38:15 +08:00
Nadav Kavalerchik 3e1089a7f1 MDL-52615 Workshop: Right align phase status icons, in RTL mode. 2016-01-05 20:39:46 +02:00
AMOS bot 02dae40716 Automatically generated installer lang files 2016-01-06 00:04:05 +08:00
Dan Poltawski 408beb96d6 Merge branch 'MDL-52503_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2016-01-05 15:30:55 +00:00
Juan Leyva c4e2c3ba9b MDL-52072 enrol: Fix course visibility checks in external functions 2016-01-05 10:31:26 +00:00
Janek Lasocki-Biczysko 48db5765ac MDL-52504 grunt: fixed scope of jshint when in amd directory 2016-01-05 09:58:15 +00:00
David Monllao 4d59af4afa MDL-52503 mod_assign: Removing session cache
Replaced with a global $SESSION var, deferring cleanup to session
destroy.
2016-01-05 17:50:58 +08:00
Matt Rice f9758178c6 MDL-52563 mod_forum: Cleanup digestbasic template 2016-01-05 15:38:45 +08:00
Andrew Nicols 695ecfc67d Merge branch 'wip-mdl-51881-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-01-05 14:09:22 +08:00
Rajesh Taneja e02155048a MDL-51881 behat: updated composer pointing to new tag 2016-01-05 14:02:39 +08:00
Rajesh Taneja 0177319237 MDL-51881 behat: Set navbar to be absolutely positioned
All behat drivers are now replicating human behavior
so when the browser scrolls something into view it doesn't account
for fixed positioned elements that end up obscuring the item thus
leading to errors that could be avoided by scrolling an additional amount.
2016-01-05 14:02:39 +08:00
Andrew Nicols e5f8c4d2e3 Merge branch 'MDL-52078-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2016-01-05 13:55:29 +08:00
Cameron Ball edbb4f6e53 MDL-52078 gradebook: Behat tests for hidden grade items. 2016-01-05 13:49:28 +08:00
Peter Miller 07b51eebf3 MDL-52078 gradebook: Stop totals including hidden items.
This patch fixes a problem where the course and user reports, when viewed by
a student, were incorrectly including hidden grade items in the course totals,
making the percentages lower than they should be.
2016-01-05 13:49:28 +08:00
Nadav Kavalerchik 5240013d21 MDL-52625 Badges: Right align manage badges table content, in RTL mode. 2016-01-05 08:12:06 +08:00
Stephen Bourget ee687f8919 MDL-50915 Lesson: Behat test for overview report 2016-01-04 18:39:05 -05:00
Stephen Bourget 4c2336663a MDL-50915 Lesson: Fix information on outline report 2016-01-04 18:38:52 -05:00
Nadav Kavalerchik a0984c46a1 MDL-52614 Workshop: Right align user's picture on Assessed submission. 2016-01-04 18:14:00 +00:00
Stephen Bourget 4077d3e696 MDL-43620 Chat: Behat test for course reset 2016-01-04 11:57:54 -05:00
Stephen Bourget d9e423dc82 MDL-43620 Chat: Fix error on course reset 2016-01-04 11:57:40 -05:00
Juan Leyva c58421208c MDL-52400 webservice: Add core_notes_delete_notes to the mobile service 2016-01-04 16:32:23 +01:00
Dan Poltawski f361d3e20f Merge branch 'MDL-52645-30-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2016-01-04 15:32:05 +00:00
Dan Poltawski b238a8658f Merge branch 'MDL-52576_user_profile_30' of https://github.com/BenKelada/moodle into MOODLE_30_STABLE 2016-01-04 15:06:18 +00:00
Dan Poltawski 4513906883 Merge branch 'wip-mdl-52605-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2016-01-04 13:41:57 +00:00
Dan Poltawski 1052567d7e Merge branch 'MDL-52638_m30v2' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-01-04 11:36:38 +00:00
Helen Foster 1f43996636 MDL-52645 lang: Merge English strings from the en_fix language pack 2016-01-04 11:37:51 +01:00
Andrew Nicols 0d18a2c74d Merge branch 'MDL-49566_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2016-01-04 13:54:18 +08:00
Dan Poltawski 3302964844 MDL-52552 course management: insufficient cleaning of search output 2016-01-04 10:14:16 +08:00
Stephen Bourget 70d71d3af7 MDL-52638 activity_results: Improve Behat tests 2016-01-03 21:02:35 -05:00
Andrew Nicols 0b841c0c72 Merge branch 'MDL-51445_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2016-01-04 09:21:50 +08:00
Ben Kelada bc66f3d7b2 MDL-52576 forum: fix user profile picture in external service 2016-01-04 11:38:15 +11:00
Mark Nielsen f3008d2a08 MDL-52605 phpunit: Improve get_message_processors reset 2016-01-04 07:52:49 +08:00
Mark Nielsen 7de2aa1a95 MDL-52605 phpunit: Prevent querying database metadata 2016-01-04 07:52:49 +08:00
Rajesh Taneja 69b2e68d27 MDL-52605 phpunit: Check file only if needed 2016-01-04 07:52:49 +08:00
Rajesh Taneja b7327c6c19 MDL-52605 phpunit: Keep track of initial reset sequence 2016-01-04 07:52:48 +08:00
AMOS bot f06196976a Automatically generated installer lang files 2016-01-04 00:04:29 +08:00
Stephen Bourget 44f9a36089 MDL-51445 Chat: Fix broken profile links 2015-12-31 11:08:37 -05:00
Dan Poltawski d92624e11f weekly release 3.0.1+ 2015-12-31 08:16:47 +00:00
Dan Poltawski 2264a0454c Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2015-12-31 08:16:45 +00:00
David Monllao 0944647413 MDL-52347 format_social: Replicate wait between new discussions 2015-12-31 13:22:11 +08:00
AMOS bot 8917f657a1 Automatically generated installer lang files 2015-12-31 00:04:00 +08:00
Dan Poltawski b8b43072c2 MDL-38020 behat: for enrollment management from participants page 2015-12-30 15:26:38 +00:00
Dan Poltawski a85c16aea5 MDL-38020 participants: Use consistent link for editing enrollments
Previously the role assignment url was used when a role was selected, but
this page doesn't enrol users into the course (its the old 1.9 way
before we had the enrollments table).
2015-12-30 15:26:38 +00:00
Dan Poltawski aade13141c MDL-27840 course: prevent warnings on half-uninstall mod 2015-12-30 14:13:46 +00:00
Dan Poltawski 41d53f9bd5 Merge branch 'MDL-50357_30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2015-12-30 09:19:35 +00:00
Juan Leyva 0d3baf5f8e MDL-51123 mod_scorm: Do not display SCO with invisible = false 2015-12-30 10:17:27 +01:00
AMOS bot 793d034c4a Automatically generated installer lang files 2015-12-30 00:04:07 +08:00
Dan Poltawski 92236e4345 MDL-50829 lang: fix to RTL/LTR bracket confusion
Thanks to ISHIKAWA Takayuki for the initial patch
2015-12-29 12:32:15 +00:00
Juan Leyva c14c042aca MDL-52459 mod_scorm: Auto-update downloaded packages 2015-12-29 12:44:16 +01:00
Michael Aherne 45b9bcd9a0 MDL-52439 assign: correct get_user_submission() phpdoc 2015-12-29 10:38:22 +00:00
Dan Poltawski f45a62e469 Merge branch 'MDL-52275_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2015-12-29 10:04:47 +00:00
Mark Nelson 650d4000cb MDL-49566 core: used reflection in unit tests
Also split the tests into multiple functions for each scenario.
2015-12-29 17:44:35 +08:00
Ankit Agarwal a411fd9ad7 MDL-49566 core: Write unittests for MDL-45898 2015-12-29 17:43:51 +08:00
Ankit Agarwal 9c35910821 MDL-49566 myprofile: Fix bugs in myprofilelib 2015-12-29 17:43:02 +08:00
Ankit Agarwal 47e5ed8e30 MDL-49566 notes: Notes link should not show up for guests 2015-12-29 17:43:02 +08:00
David Monllao b2e6bee53e Merge branch 'MDL-51889_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2015-12-29 15:35:38 +08:00
Eugene Venter e217f4914a MDL-52530 unittest: more robust capability assignments for guest
for core_files_file_storage_testcase and core_repositorylib_testcase
2015-12-29 14:06:32 +08:00
David Monllao 1ba350d146 Merge branch 'wip-mdl-52347-m30' of git://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2015-12-29 14:03:22 +08:00
David Monllao ec921c9d7b Merge branch 'MDL-52591-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-29 13:47:23 +08:00
Mark Nelson ec3be4584c MDL-51889 enrol_guest: always check password before re-enabling 2015-12-29 13:43:32 +08:00
David Monllao e8f73b9edd MDL-52597 mod_forum: Remove duplicated query 2015-12-29 10:04:10 +08:00
David Monllao e9716eda2f Merge branch 'MDL-52597-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2015-12-29 10:01:32 +08:00
AMOS bot df8d12b685 Automatically generated installer lang files 2015-12-29 00:04:08 +08:00
AMOS bot 1c529d9897 Automatically generated installer lang files 2015-12-28 00:04:13 +08:00
AMOS bot 4ac2ded44b Automatically generated installer lang files 2015-12-25 00:04:15 +08:00
Marina Glancy f11ab3b3ed MDL-52347 behat: fix random failures on fast computer 2015-12-24 14:17:52 +08:00
Rajesh Taneja 471b5b73a3 MDL-52606 behat: Added time delay to avoid random fails
If attempts are created at same timestamp, then results are
not same, and lesson module finds that attmpt was in progress.
To avoid this problem, attempts should be created at different
timestamp.
2015-12-24 14:02:16 +08:00
Dan Poltawski ebc7b73150 weekly release 3.0.1+ 2015-12-23 11:36:03 +00:00
Dan Poltawski a06ed7e888 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2015-12-23 11:36:00 +00:00
Dan Poltawski 92a25cff43 Merge branch 'MDL-52595-30' of git://github.com/andrewnicols/moodle into MOODLE_30_STABLE 2015-12-23 11:29:09 +00:00
Mark Nelson e5549f4f16 MDL-52275 core: fixed grade-to-pass being overwritten
Thanks goes to W.J. Roes for the patch.
2015-12-23 16:51:26 +08:00
Andrew Nicols 0d4fda7843 MDL-52597 mod_forum: Remove sleep from tests 2015-12-23 14:26:57 +08:00
Andrew Nicols f083859e96 MDL-52595 tests: Disable xdebug for travis runs 2015-12-23 13:15:25 +08:00
Andrew Nicols 29d83deae9 Merge branch 'MDL-52355-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2015-12-23 10:05:20 +08:00
Jun Pataleta 2217e2fea9 MDL-52355 mod_data: Added Gregorian hour and minute values 2015-12-23 09:56:46 +08:00
Shamim Rezaie 68927e83e5 MDL-52355 mod_data: Make date field respect the calendar type in use
Updated the date subplugin to consider that the input date element
values might be for any calendar type and not just the Gregorian
calendar.
2015-12-23 09:56:46 +08:00
Shamim Rezaie 819020ac57 MDL-52354 select_time: Make select_time respect the set calendar type
The select_time method updated to display form elements in accordance
to the calendar type plugin that is in use.
2015-12-23 09:56:46 +08:00
Dan Poltawski 1e5a066247 MDL-52591 grunt: make shifter task respect --no-color 2015-12-22 18:37:48 +00:00
Eloy Lafuente (stronk7) 24a7fc2f07 Merge branch 'MDL-49743-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-22 17:14:36 +01:00
AMOS bot 03f0b4fc14 Automatically generated installer lang files 2015-12-23 00:04:14 +08:00
Juan Leyva 8c1261bd97 MDL-52585 webservices: Return correct invalid login message 2015-12-22 17:00:07 +01:00
Dan Poltawski 17af025b52 Merge branch 'm30_MDL-51916' of https://github.com/danmarsden/moodle into MOODLE_30_STABLE 2015-12-22 13:17:54 +00:00
Dan Poltawski ac56855bbc Merge branch 'MDL-52365_30_new' of git://github.com/mkassaei/moodle into MOODLE_30_STABLE 2015-12-22 13:14:48 +00:00
Eloy Lafuente (stronk7) 6f6ef56253 Merge branch 'MDL-51719-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-22 13:13:58 +01:00
M Kassaei 79d202c36d MDL-52365 qtype ddwtos & ddimageortext: 20 drag items IE11/Edge 2015-12-22 12:13:23 +00:00
Dan Poltawski 962aca6ad6 MDL-52017 enrol_self: fix incorrect empty statement
Ironically this was detected by causing a syntax error on php54
2015-12-22 09:52:10 +00:00
David Monllao 7473e54a3d Merge branch 'MDL-52017_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2015-12-22 16:37:03 +08:00
Andrew Nicols 105370c407 Merge branch 'MDL-52250-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-22 15:06:58 +08:00
Andrew Nicols 869ffde772 Merge branch 'MDL-23128-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-22 13:11:46 +08:00
Andrew Nicols 73d2934ba5 Merge branch 'MDL-52363_30' of git://github.com/mkassaei/moodle into MOODLE_30_STABLE 2015-12-22 12:34:21 +08:00
David Monllao 74a51dd48a Merge branch 'wip-mdl-52376-m30' of git://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2015-12-22 11:25:01 +08:00
David Monllao 9005a3bb96 Merge branch 'MDL-52558-m30' of git://github.com/sammarshallou/moodle into MOODLE_30_STABLE 2015-12-22 11:16:53 +08:00
Rajesh Taneja 6fccd1fe35 MDL-52427 behat: Fixed question selectors
As class is changed, we need to convert selector
to check if class is contained, rather then checking
selecting with specific class.
2015-12-22 10:43:18 +08:00
Andrew Nicols ea78dbdf50 Merge branch 'MDL-52334_30' of git://github.com/aolley/moodle into MOODLE_30_STABLE 2015-12-22 09:14:34 +08:00
Dan Poltawski db3cdb6d25 Merge branch 'MDL-52380-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2015-12-21 16:47:21 +00:00
Dan Poltawski ccc297f01a Merge branch 'MDL-52354-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2015-12-21 16:44:25 +00:00
Dan Poltawski 8dd7e73294 Merge branch 'MDL-52427_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2015-12-21 13:27:40 +00:00
Dan Poltawski f2087a7fcb Merge branch 'MDL-52402_30' of git://github.com/mr-russ/moodle into MOODLE_30_STABLE 2015-12-21 12:46:20 +00:00
Dan Poltawski b1fe9348db Merge branch 'MDL-52455_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2015-12-21 12:43:53 +00:00
Dan Poltawski c3183cb6fe Merge branch 'MDL-52542_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2015-12-21 11:07:23 +00:00
Mark Nelson d47064c4b2 MDL-50357 core_group: tidy up the function groups_delete_group_members 2015-12-21 17:41:12 +08:00
David Monllao 66a28fbaa4 Merge branch 'MDL-51257-30' of git://github.com/cameron1729/moodle into MOODLE_30_STABLE 2015-12-21 17:33:05 +08:00
David Monllao d5d7d57d6d Merge branch 'MDL-52429-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2015-12-21 17:17:10 +08:00
David Monllao db3bcaba14 Merge branch 'MDL-49758-30' of git://github.com/StudiUM/moodle into MOODLE_30_STABLE 2015-12-21 17:06:04 +08:00
David Monllao 145467fadf MDL-52226 tests: Fix behat phpunit naming conflict 2015-12-21 08:32:06 +00:00
David Monllao 07021369d7 Merge branch 'MDL-52226-m30' of git://github.com/sammarshallou/moodle into MOODLE_30_STABLE 2015-12-21 14:42:47 +08:00
Andrew Nicols 836172f366 Merge branch 'm30_MDL-50972' of https://github.com/danmarsden/moodle into MOODLE_30_STABLE 2015-12-21 14:03:47 +08:00
Andrew Nicols 2c3d0c3b6f Merge branch 'MDL-52457-30' of git://github.com/jleyva/moodle into MOODLE_30_STABLE 2015-12-21 12:10:58 +08:00
David Monllao 1388dece19 Merge branch 'MDL-47106_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2015-12-21 11:33:09 +08:00
David Monllao 41ec284720 Merge branch 'MDL-52523_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2015-12-21 10:48:06 +08:00
Eloy Lafuente (stronk7) 62e799ac84 Moodle release 3.0.1 2015-12-19 19:03:16 +01:00
AMOS bot 2945fe403b Automatically generated installer lang files 2015-12-20 00:05:24 +08:00
Dan Poltawski 6af9a4e21c weekly release 3.0+ 2015-12-18 12:27:09 +00:00
Dan Poltawski 86c5e56baf Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2015-12-18 12:27:07 +00:00
sam marshall bde99c5a4b MDL-52558 Data generator: enrol_user should allow shortname 2015-12-18 11:01:30 +00:00
Dan Poltawski abde041907 Merge branch 'MDL-52553_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2015-12-18 10:56:31 +00:00
David Monllao bba453b9ed MDL-52553 question: Adding missing required constants 2015-12-18 14:43:31 +08:00
Shamim Rezaie 8abf3701a6 MDL-52380 mod_forum: Non-Gregorian dates in forum advance search
Convert the fromdate and todate date parts to Gregorian before passing them to make_timestamp
2015-12-17 18:04:16 -06:00
Shamim Rezaie d607b840b8 MDL-52354 select_time: Make select_time respect the set calendar type
The select_time method updated to display form elements in accordance
to the calendar type plugin that is in use.
2015-12-17 18:04:16 -06:00
Shamim Rezaie c65d2ccb13 MDL-52354 select_time: Make select_time respect the set calendar type
The select_time method updated to display form elements in accordance
to the calendar type plugin that is in use.
2015-12-17 15:49:20 -06:00
Eloy Lafuente (stronk7) 9149eaae18 Merge branch 'wip-mdl-52540-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2015-12-17 10:18:58 +01:00
Tim Hunt b35e24e254 MDL-52542 qtype_multianswer: field names must match string placeholders 2015-12-17 08:36:34 +00:00
Rajesh Taneja 8a0c8192c8 MDL-52540 behat: mouse events are not handled well with phantomjs 2015-12-17 12:06:06 +08:00
Dan Marsden f5f86a68ac MDL-51916 mod_scorm: allow html5 scorm content fullscreen 2015-12-16 20:28:06 +13:00
Tim Hunt 57b1d3ea85 MDL-52523 backup of subplugins: add missing global 2015-12-15 16:00:23 +00:00
M Kassaei 9611df0f92 MDL-52363 qtype_ddimageortext: Incorrectly sized drag item 2015-12-15 11:21:29 +00:00
Marina Glancy 74c19577c9 MDL-52286 core: mute erros in adodb destructor 2015-12-15 13:11:45 +08:00
AMOS bot c7231d5235 Automatically generated installer lang files 2015-12-15 00:04:13 +08:00
Dan Poltawski 3cf111c8d3 Merge branch 'MDL-52451-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-14 10:46:33 +00:00
Dan Poltawski e0518a0940 Merge branch 'wip-MDL-52286-m30' of https://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-14 10:24:50 +00:00
Marina Glancy b000642c03 MDL-52286 core: corrected version of adodb to 5.20.1 2015-12-14 18:12:17 +08:00
Marina Glancy aae5800486 MDL-52286 core: several fixes to ADOdb 2015-12-14 18:11:48 +08:00
Dan Poltawski 9ef2475cdd Merge branch 'MDL-52499-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-14 09:44:19 +00:00
Dan Poltawski 8513fdd0ba Merge branch 'MDL-52487_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2015-12-14 09:23:14 +00:00
David Monllao 19da0bad13 MDL-52487 rss: PHP 7 compatible error supression
PHP5 used to update error_reporting to 0 on functions called with the
suppress errors operator (@). In PHP7 it is not updated.

Credit to Rajesh Taneja
2015-12-14 15:29:34 +08:00
Marina Glancy ff64873ece MDL-52499 core: link to php7 documentation 2015-12-14 12:56:34 +08:00
Marina Glancy 7bd6de4822 MDL-52451 forms: replace deprecated function 2015-12-14 12:43:54 +08:00
Dan Marsden eb127e0b21 MDL-50972 mod_scorm: set autocommit as boolean
var currently passed as string so not evaluated correctly
2015-12-14 14:26:55 +13:00
Matthew Pruett 9797983c6f MDL-47106 quiz 'secure' window: Finish review link did not work 2015-12-13 22:08:53 +00:00
Amanda Doughty 6767a5d631 MDL-52455 quiz: doesn't include all user fields required by messaging 2015-12-13 20:48:52 +00:00
Tim Hunt 1507697d9f MDL-52427 questions: all parts of a Q should be clearfix
Otherwise large floated images may overflow.
2015-12-13 20:32:13 +00:00
Jean-Philippe Gaudreau daf7e2a478 MDL-49758 mod_quiz: Fix require on completionlib.php
Credits: Gordon Bateson
2015-12-11 13:01:56 -05:00
Dan Poltawski 771e49de0c Merge branch 'wip-MDL-52286-m30' of https://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-11 09:16:53 +00:00
David Monllao c19896ff95 Merge branch 'MDL-52472-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-11 16:03:28 +08:00
David Monllao 68494c8ef2 Merge branch 'MDL-52361-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-11 15:20:48 +08:00
David Monllao 0a44e7d8cc MDL-51784 general: Adding missing php4 style constructors
Adding them to maintain backwards compatibility.
2015-12-11 14:56:31 +08:00
Marina Glancy 345f365555 MDL-51784 various: use __construct() for PHP7 compatibility 2015-12-11 13:53:59 +08:00
David Monllao 8079f3343f MDL-52471 setuplib: Removing debugging message from stables 2015-12-11 12:02:00 +08:00
David Monllao 005f7c8b24 Merge branch 'MDL-52471-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-11 11:53:37 +08:00
David Monllao a6f084c9c5 Merge branch 'wip-MDL-52475-m30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-11 11:24:35 +08:00
Tony Levi 0e7a5b346f MDL-52475 core: workaround PHP7 bug #70110 with preg_match 2015-12-11 08:30:37 +08:00
Dan Poltawski 8640c059d8 MDL-52471 tests: simplify setup code
Test code was not using the generator for simple enrollments, couldn't
help to fix when noticed.
2015-12-10 18:00:41 +00:00
Dan Poltawski a3f65f8b5b MDL-52471 completion: fix deprecated use of 'object'
And add a unit test covering completion_can_view_data() without
full course object passed.
2015-12-10 18:00:40 +00:00
Dan Poltawski 88cece4bd7 MDL-52471 quiz: remove broken code question_print_comment_fields() 2015-12-10 18:00:40 +00:00
Dan Poltawski ddfebd633e MDL-52471 setuplib: depreciate class object properly
Previously was marked depricated but not throwwing debugging
2015-12-10 17:57:47 +00:00
Dan Poltawski ac4baac8b9 MDL-52472 travis: remove mongo/memcached testing
At the moment the extensions aren't available in php7 env:
https://github.com/travis-ci/travis-ci/issues/5256

And really its probably not worth the effort/buildtime to
enable them IMO so simpler to just disable.
2015-12-10 17:38:56 +00:00
Dan Poltawski a0ef20cfe4 MDL-52472 travis: enable php7
Relegate 5.6 runs (following the principle of highest and lowest version
only, to conserve travis resources and get faster test completions)
2015-12-10 17:38:55 +00:00
Eloy Lafuente (stronk7) e819a58b6e Merge branch 'MDL-52284-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-10 16:16:09 +01:00
Dan Poltawski 2adbbcac0a Merge branch 'MDL-52333_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2015-12-10 11:03:57 +00:00
Dan Poltawski 4e5e185f80 MDL-52285 auth: Add constructors for backwards compat
These are very unlikely to be used but just to be safe..
2015-12-10 10:36:20 +00:00
Dan Poltawski 68cbd0599d Merge branch 'MDL-52285-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-10 10:36:14 +00:00
David Monllao 2134746dea Merge branch 'MDL-52336-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-10 17:40:10 +08:00
David Monllao 4d56fe7d60 Merge branch 'MDL-52081-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-10 17:15:54 +08:00
David Monllao 1c4bc77d44 MDL-52333: qtype_calculated: Adding division by zero test 2015-12-10 16:40:16 +08:00
Tony Levi bc91b91ab1 MDL-52333 qtype: PHP7-compatibility in calculate_raw()
Code also modified by Tim Hunt
2015-12-10 16:40:08 +08:00
David Monllao 9887a4cbae Merge branch 'MDL-52335-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-10 15:48:28 +08:00
David Monllao 7d8fb1962e Merge branch 'MDL-52438-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-10 15:32:43 +08:00
David Monllao 07fbf4515c Merge branch 'MDL-52312_m30' of git://github.com/markn86/moodle into MOODLE_30_STABLE 2015-12-10 13:56:43 +08:00
Marina Glancy e81e12cd79 MDL-52285 auth: use __construct() for constructors 2015-12-10 13:51:11 +08:00
Marina Glancy f318ef32bc MDL-52081 forms: indicate usage of grandparent constructor 2015-12-10 13:45:18 +08:00
Marina Glancy 696f3dcc83 MDL-52081 forms: Use __construct() for constructors 2015-12-10 13:45:16 +08:00
Marina Glancy 804a5f59ce MDL-52284 core: PHP7 engine errors have type Throwable 2015-12-10 10:50:12 +08:00
Tony Levi 3f45d8fece MDL-52284 core: compatibility with Exception/Throwable changes in PHP7 2015-12-10 10:50:12 +08:00
AMOS bot dfe989c826 Automatically generated installer lang files 2015-12-10 00:04:26 +08:00
Juan Leyva ed6277f9f7 MDL-52457 mod_scorm: Fix return types definitions in SCORM WS
Incorrect return types definitions in external function
mod_scorm_external::get_scorm_by_courses (hidetoc, displayattemptstatus
and skipview)
2015-12-09 14:07:10 +01:00
sam marshall 48db0e02cd MDL-52226 Forms: max_input_vars problems with advanced checkbox 2015-12-09 12:17:13 +00:00
Dan Poltawski 6ace0f59ae weekly release 3.0+ 2015-12-09 12:09:37 +00:00
Dan Poltawski fbf528eb95 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2015-12-09 12:09:36 +00:00
Eloy Lafuente (stronk7) 220ea7cd09 Merge branch 'MDL-51483_30' of https://github.com/jinhofer/moodle into MOODLE_30_STABLE 2015-12-09 02:22:39 +01:00
Adam Olley 7f1c642112 MDL-52334 enrol_database: Add missing filter to user_enrolment lookup
Without the user filter, the left join to the user enrolment table
results in a much larger set of data being returned than before
MDL-28420. Which makes login time for users in many busy courses much
worse than before (3x worse on average, observed upto 40x).
2015-12-09 09:26:33 +10:30
Dan Poltawski 6530c22a11 Merge branch 'MDL-51097_m30v1' of https://github.com/sbourget/moodle into MOODLE_30_STABLE 2015-12-08 10:07:46 +00:00
Dan Poltawski ab37a1c815 Merge branch 'MDL-51411_30' of https://github.com/andrewhancox/moodle into MOODLE_30_STABLE 2015-12-08 09:05:47 +00:00
Marina Glancy 75b13bba36 MDL-52438 core: allow Moodle 3.0 to be used with PHP7 2015-12-08 12:54:54 +08:00
Marina Glancy 2cebc825e9 MDL-52361 core: patch Horde library for PHP7 compatibility 2015-12-08 12:48:21 +08:00
Marina Glancy ffe7dd3769 MDL-52336 core: patch PHPExcel for PHP7 compatibility 2015-12-08 12:14:15 +08:00
Marina Glancy f41205a84c MDL-52286 core: update ADODB library to 5.21 2015-12-08 12:04:05 +08:00
Mark Nelson 3046ae85cc MDL-52312 assignfeedback_editpdf: changes to files after FPDI update
1) Change the fpdi_bridge class so that it extends the pdf class,
rather than the TCPDF class.
2) Updated the editpdf/fpdi/readme_moodle.txt file to document the changes.
3) Updated the editpdf/thirdpartylibs.xml to reflect the update to the
FPDI library.
2015-12-08 11:41:22 +08:00
Mark Nelson 536892fd4c MDL-52312 assignfeedback_editpdf: updated the FPDI libary to 1.6.1 2015-12-08 11:41:22 +08:00
Marina Glancy 2cae0d3b15 MDL-52193 questions: add missing require_once 2015-12-07 15:38:02 +00:00
jinhofer bdb1cab348 MDL-51483 lib/moodlelib.php: Added conditional checks to shorten_text 2015-12-07 09:21:26 -06:00
Juan Leyva d08bcc4ded MDL-52429 mod_scorm: Fix SCORM completion checking in nested SCOs 2015-12-07 11:29:43 +01:00
Dan Poltawski 2f1473ac6d Merge branch 'MDL-50258_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2015-12-07 09:04:39 +00:00
David Monllao 899f21fc26 Merge branch 'MDL-52204-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-07 16:35:09 +08:00
Dan Poltawski c60a3ef656 Merge branch 'MDL-52304_30' of https://github.com/dmonllao/moodle into MOODLE_30_STABLE 2015-12-07 08:21:35 +00:00
Dan Poltawski 8262d6133a MDL-52271 install: don't allow installer to be indexed
Following guidance from:
https://support.google.com/webmasters/answer/93710?hl=en
2015-12-07 15:42:47 +08:00
David Monllao e662941230 Merge branch 'MDL-52370-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-07 15:02:03 +08:00
Russell Smith 89feea07d3 MDL-52402 backup, quiz: Fix attempt token and add missing rule. 2015-12-05 10:11:36 +11:00
Russell Smith 9c2784ca30 MDL-52402 backup: Improve debugging output on failed log restores 2015-12-05 10:11:35 +11:00
Dan Poltawski e18b4b0918 MDL-51582 readme: update less building instructions
I forgot to update this after the changes in 490c5cabb4
2015-12-04 16:41:24 +00:00
Eloy Lafuente (stronk7) 14d8971cd6 Merge branch 'MDL-51582-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-04 17:15:20 +01:00
AMOS bot 7c8149d6af Automatically generated installer lang files 2015-12-05 00:04:37 +08:00
Dan Poltawski 096a908dbe MDL-52250 npm: shrinkwrap to lock down dependencies
We've tried various approaches to lock down our dependencies and they
have been flawed because dependencies in our included packages may not
be locked down and previous attempts to do that have not been correct.

With npm shrinkwrap we lock down versions so that any npm install will
always install the exact same versions for all developers - see:
https://docs.npmjs.com/cli/shrinkwrap

(This is a lot like composer.lock for those more fluent with composer)
2015-12-04 15:35:33 +00:00
Dan Poltawski 68dfa89fea MDL-52250 npm: remove uglify-js dependency/bump grunt-contrib-uglify
A) Remove direct dependency on uglify-js:

This dependency was added in MDL-50277, but it isn't quite correct, the
way npm installs dependencies means that grunt-contrib-uglify *could* use
'our' version if its satisifed. But does not *always* and especially does
not if the grunt-contrib-uglify requirement is higher than ours.

Long story short, in many cases this means that this is used:
 node_modules/grunt-contrib-uglify/node_modules/uglify-js
But this is not:
  node_modules/uglify-js

In MDL-50277 we thought we were making the version sticky, but in
reality we were just fixing previous problems by updating
grunt-contrib-uglify to a version which fixed a bug:

 https://github.com/gruntjs/grunt-contrib-uglify/issues/313

It seems the better solution will come with using npm shrinkwrap to lock
down depdencies.

B) Bump grunt-contrib-uglify to 0.11.0

This moves us to uglify-js ~2.6.0 - which doens't change any output
files.
2015-12-04 15:34:16 +00:00
Dan Poltawski e64751fb8a MDL-52204 grunt: update to grunt-contrib-jshint v0.11.3
This version of grunt-contrib-jshint itself uses a better fixed
requirement on "~2.8.0" rather than "^2.8.0" which was giving variable
results with some people updating to 2.9-rc1.

See also https://github.com/gruntjs/grunt-contrib-jshint/pull/219
2015-12-04 11:40:28 +00:00
Dan Poltawski 490c5cabb4 MDL-51582 grunt: task improvements
* Introduce the 'css' task - this will give us flexibility to do things
  in future rather than relying on the inbuilt 'less' task (e.g. sourcemap
  generating task which doesn't run by default)

* Introduce 'amd' task which runs only amd tasks

* Introduce 'js' task which runs all JS (amd/shifter) tasks

* Tweak the ordering so that slow shifter always runs last (useful for
  people like me who forget to specif the task)
2015-12-04 10:45:24 +00:00
Dan Poltawski 4269cac414 MDL-51582 css: built with new grunt task 2015-12-04 10:45:24 +00:00
Dan Poltawski cd319f3f2f MDL-51582 grunt: add less complilation support
Previously we were using recess to build bootstrap base as it was what
was used by the original project. But recess is no longer maintained.

Now we use grunt for building js, it makes sense to use it for less too.

(If you really don't want to use grunt, you almost certainly can just
use lessc -x as it uses the same less.js on backend).
2015-12-04 10:44:54 +00:00
Michael Aherne da14ce45dd MDL-52304 media: Allow full screen in Flash player 2015-12-04 10:06:52 +08:00
David Monllao 818f90abd3 MDL-50258 themes: Fix CSS source maps 2015-12-04 09:02:57 +08:00
Ben Kelada 8ab3584274 MDL-52261 filelib: Do login check for files in blocks 2015-12-04 11:04:05 +11:00
Eloy Lafuente (stronk7) 13ce9a38a2 weekly release 3.0+ 2015-12-03 19:41:23 +01:00
Eloy Lafuente (stronk7) d5699018b0 Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2015-12-03 19:41:17 +01:00
Eloy Lafuente (stronk7) fbb8579c1a MDL-52141 backup: test restore_log_rule don't modify passed log anymore 2015-12-03 19:01:48 +01:00
David Monllao f248c81e5a Merge branch 'MDL-48004-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-03 19:01:47 +01:00
Andrew Nicols 7d05696b12 Merge branch 'wip-mdl-52357-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2015-12-03 19:01:46 +01:00
David Monllao 716c7536cb Merge branch 'MDL-50710-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-12-03 19:01:45 +01:00
AMOS bot 4cdf94a602 Automatically generated installer lang files 2015-12-04 00:04:23 +08:00
Mark Nelson c9f2b241e0 MDL-52017 enrol_self: always check password before re-enabling 2015-12-03 19:26:56 +08:00
David Monllao 8dbe8449e0 Merge branch 'MDL-52260-30-2' of git://github.com/xow/moodle into MOODLE_30_STABLE 2015-12-03 11:53:13 +01:00
Eloy Lafuente (stronk7) 4841169211 Merge branch 'MDL-45364-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-12-03 11:53:12 +01:00
Dan Poltawski 3fe4b72c34 MDL-35982 behat: fix incorrectly backported test
Due to alterations with release/freeze, the lang string change
didn't get backported to 3.x, but the behat did.
2015-12-03 11:53:12 +01:00
Dan Poltawski 3c1e7a0759 MDL-52292 testing: block generator fix
Stop errors when no $options supplied
2015-12-03 11:53:11 +01:00
Dan Poltawski 98ad5c6191 Merge branch 'MDL-52292_30' of git://github.com/timhunt/moodle into MOODLE_30_STABLE 2015-12-03 11:53:10 +01:00
Dan Poltawski 0872bf3175 MDL-26935 behat: add coverage for role renaming in course 2015-12-03 11:53:10 +01:00
Russell Smith 6e8ca8a6ce MDL-52141 backup: Ensure we don't alter the log record when parsing it. 2015-12-03 11:53:09 +01:00
Dan Poltawski e2de9c6b6d Merge branch 'MDL-37308-30' of git://github.com/junpataleta/moodle into MOODLE_30_STABLE 2015-12-03 11:53:09 +01:00
Tony Levi 59b25acd22 MDL-51757 mod_scorm: Remove duplicate function param
convert invalid break calls to exceptions for PHP 7
2015-12-03 11:53:08 +01:00
Rajesh Taneja af145cdac1 MDL-52376 behat: Add 1 sec delay to ensure cron works
course completion record should be created at time
which is before the time cron is run. On fast machine
this both might be done at same time. So added 1 sec delay
2015-12-03 13:17:49 +08:00
Cameron Ball bf68d558af MDL-51257 messages: Improve message form.
- Add sudmit button
- Add formchangechecker
- Update behat tests
2015-12-03 10:23:43 +08:00
Marina Glancy f3d159dea1 MDL-52335 tool_uploaduser: php7 compatibility in variable syntax 2015-12-03 09:33:24 +08:00
Marina Glancy 3af4f54efb MDL-52335 mod_data: php7 compatibility in variable syntax 2015-12-03 09:33:24 +08:00
Marina Glancy 6698b06b11 MDL-52335 mod_lti: php7 compatibility in variable syntax 2015-12-03 09:33:24 +08:00
Marina Glancy 545d2c9290 MDL-52335 core: php7 compatibility in XMPP library 2015-12-03 09:33:24 +08:00
Tim Hunt 7cac3f6fe9 MDL-52292 block testing generators: improve the API
* Refactor the block generator base class, to remove the amount
  of duplication required in base classes.

* Change the defaults that are filled in to be a little more natural.

* Make the Behat step 'Given the following "block" exist:' work.
2015-12-01 13:49:24 +00:00
Dan Poltawski db198f615a MDL-52370 role: purge coursecontacts when role is edited
This is perhaps a bit more brutal purge than you'd like, but it only
affects coursecat role edits.
2015-12-01 13:14:55 +00:00
Dan Poltawski bbf7cf2c44 MDL-52370 course: purge contacts cache on role rename
Previously teachers would rename roles and the change would not be
reflected in course listings.
2015-12-01 13:14:54 +00:00
Rajesh Taneja 0f62dd32c7 MDL-52357 behat: add 2 sec delay to ensure window is stable 2015-12-01 15:46:30 +08:00
Ryan Wyllie 67e82ebe0b MDL-52042 autocomplete: close suggestion box
Close the suggestion box when the input loses focus for more
than half a second.
2015-11-30 13:21:07 +00:00
Dan Poltawski ac16eaa936 Merge branch 'MDL-52283-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-11-30 11:27:50 +00:00
Dan Poltawski bfe6b3cdd1 Merge branch 'MDL-52332-30' of git://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-11-30 10:22:52 +00:00
David Monllao f1bf39c2f8 Merge branch 'MDL-35982-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-11-30 15:46:25 +08:00
Marina Glancy 6064114c32 MDL-52332 calendar: load settings using API 2015-11-30 11:47:09 +08:00
Rajesh Taneja e0d74e610a MDL-52279 core_lib: Remove php4 style constructor
filterobject is called from core and as it's
using php4 style constructor, global USER is
not set properly because of deprecation warning
2015-11-30 11:31:33 +08:00
Jun Pataleta 8948d04695 MDL-37308 files: Additional fixes for transparency
Fixed transparency support when resizing and when not resizing.
2015-11-29 20:28:23 -06:00
Jetha Chan 9993c6bcc0 MDL-37308 files: support transparency when not resizing; new unit test 2015-11-29 20:28:23 -06:00
Adrian Greeve 1da82165ef MDL-37308 files: convert_image() now supports transparency. 2015-11-29 20:28:23 -06:00
Marina Glancy cf139e224e MDL-50710 block_glossary_random: more precise sorting 2015-11-30 09:17:03 +08:00
AMOS bot f8bce590ba Automatically generated installer lang files 2015-11-28 00:04:50 +08:00
Dan Poltawski 715eb9438c MDL-51719 atto_rtl: RTL/LTR buttons now indicate state
Previously the RTL buttons did not indiciate wether RTL or LTR was
selected. Thanks to Andrew Nicols for guiding how to do this.
2015-11-27 14:10:18 +00:00
John Okely 9c461eae4e MDL-52260 user: Fix error when saving profile with locked field 2015-11-27 11:02:45 +08:00
Tony Levi fe6a3c0531 MDL-52283 core: password_hash() deprecation in PHP7 2015-11-27 09:13:08 +08:00
Dan Poltawski 793c80165d MDL-45364 ddimageortext: refine naming & docs of new methods 2015-11-26 19:50:03 +00:00
Andrew Nicols a4f457e111 MDL-45364 qtype_ddimageortext: Fix JS Lint issues 2015-11-26 19:50:03 +00:00
Andrew Nicols 4110561f3e MDL-45364 atto_rtl: Fix JS lint 2015-11-26 19:50:03 +00:00
Dan Poltawski b1549e4127 MDL-48004 question: prevent notices on import screen
If query params were not passed the page would previously display debug
notices as setting the $requirecourseid param to question_edit_setup()
was buggy.
2015-11-26 15:03:43 +00:00
Dan Poltawski 724513e5d8 MDL-35982 behat: delete blog entry coverage 2015-11-26 14:12:22 +00:00
Dan Poltawski c14fbe69f5 MDL-35982 blog: reorder blog delete confirmation
Improves accessibility to be ordered logically in page
2015-11-26 14:12:00 +00:00
Dan Poltawski 8b4e2418f6 MDL-35982 blog: prevent index throwing errors with 0 courseid
Regression from MDL-49845 where Dave made the page not handle courseid = 0
and so now some urls will send you back to a db error..
2015-11-26 14:11:59 +00:00
David Monllao 8568798f76 weekly release 3.0+ 2015-11-26 10:54:50 +08:00
David Monllao 66533b249e Merge branch 'install_30_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_30_STABLE 2015-11-26 10:54:48 +08:00
Dan Poltawski e5baddebcd MDL-23128 tex: silence dvips output
This was causing spewwing of lots of messages to the error log..

Thanks to Fred Woolard for the suggestion
2015-11-25 17:07:40 +00:00
AMOS bot 0efd3318b2 Automatically generated installer lang files 2015-11-26 00:04:31 +08:00
Dan Poltawski 16acfc55f4 MDL-49743 singleview: slightly clarify logic
Make it clearer what the 'unset' behaviour is because previously
we've set the default for 'empty' values twice.
2015-11-25 15:12:02 +00:00
Conn 31328e3ede MDL-49743 singleview: Prevent errors when no itemid was selected
Signed-off-by: Conn <conn@cmrwarwicker.com>
2015-11-25 15:12:02 +00:00
Andrew Hancox c83c1ee838 MDL-51411 course: Fixed warning when deleting activity with js disabled 2015-11-25 14:39:59 +00:00
Eloy Lafuente (stronk7) 95f83b70b0 MDL-52291 questions: fix upgrade from 2.5 and earlier
Because of some changes performed to the multichoice qtype
for Moodle 2.6, older sites are not able to upgrade properly.

This commits does introduce DB introspection to decide which
table and column names must be used. Nasty but enough.

Note MDL-52298 has been created about to avoid/minimize the
chances of this happening again.
2015-11-25 11:23:34 +00:00
Frederic Massart 53253aea3a MDL-52160 navigation: Mark category and module settings nodes as branch 2015-11-25 13:13:05 +08:00
AMOS bot c244cd14b7 Automatically generated installer lang files 2015-11-25 00:04:24 +08:00
David Monllao a1b7cd7090 Merge branch 'MDL-44330-m30' of git://github.com/NeillM/moodle into MOODLE_30_STABLE 2015-11-24 17:03:42 +08:00
David Monllao e4ffce07cf Merge branch 'MDL-45934-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-11-24 16:55:56 +08:00
Neill Magill 6b4ce43d1d MDL-44330 Assign: Assignment grading may not display expected student
Before this patch it was possible for the student displayed on the grading page to
not be the student that the user selected to grade. This would occur if:

1) The user had the table ordered by a value that could be modified,
   for example Last modified (submission), Grade, Last modified (grade)
2) Another user performed an action that was recorded in Moodle in the time
   between the user generating the table and clicking on a grade link.

If a user did not notice a different user had been loaded it could result in them giving
a grade to the incorrect user.

This patch ensures that the state of the table is cached every time it is viewed by a user
who has the capability to grade.
2015-11-24 08:41:27 +00:00
Rajesh Taneja 107ab59c29 MDL-50163 behat: wait to ensure elements are placed properly by js. 2015-11-24 12:25:16 +08:00
David Monllao 4cd0bc7ece MDL-52095 themes: Padding to the left on RTL langs 2015-11-23 19:30:56 +01:00
Eloy Lafuente (stronk7) 42952482c9 Merge branch 'MDL-52185-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-11-23 19:27:03 +01:00
AMOS bot 3804a59fb6 Automatically generated installer lang files 2015-11-24 00:04:33 +08:00
Dan Poltawski 174faea612 Merge branch 'wip-mdl-51063-m30' of https://github.com/rajeshtaneja/moodle into MOODLE_30_STABLE 2015-11-23 11:33:51 +00:00
Tim Hunt dec56ff204 MDL-52166 gradebook: overview report fails with separate groups 2015-11-23 09:44:25 +00:00
David Monllao c6d3f0d107 Merge branch 'MDL-52214-30-crawler' of git://github.com/mudrd8mz/moodle into MOODLE_30_STABLE 2015-11-23 17:01:51 +08:00
David Mudrák 8f36db0be5 MDL-52214 core: Fix case sensitivity in user agent comparison
The previous 2.9 implementation of is_web_crawler() used stripos() in
certain cases. The unit tests re-added in the previous commit revealed
that certain crawlers (such as BaiDuSpider) were not correctly detected
in the new refactored implementation.

It seems lesser evil and safe enough to use /i in the regex search even
though it is not 100% same logic as before - as stripos() was used in
some cases only, not always.
2015-11-23 09:43:20 +01:00
David Mudrák f554e04a27 MDL-52214 core: Fix the is_web_crawler() regression
In MDL-50891, the is_web_crawler() was refactored into a core_useragent
method and the function itself was deprecated. However, there were no
unit tests kept to check the backwards compatible behaviour. It turned
out that the deprecated function leads to PHP fatal error due to a typo.

This patch fixes the typo and brings back the previous unit tests. To be
able to explicitly check the raised debugging message, the test case
now must be subclass of advanced_testcase.

Additionally fixes missing info about the function being deprecated.
2015-11-23 09:42:27 +01:00
David Monllao 20c532caf8 Merge branch 'MDL-52180-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-11-23 16:40:38 +08:00
David Monllao a1b0938c16 Merge branch 'MDL-52086-30' of git://github.com/bostelm/moodle into MOODLE_30_STABLE 2015-11-23 16:10:42 +08:00
Vadim Dvorovenko 3e1da76d54 MDL-52029 installer: Unstyled installer if display_errors is on
Error in MDL-43839 solution caused inclusion of unexistent file in
install/css.php.
2015-11-23 15:44:12 +08:00
David Monllao e3dcc260fb Merge branch 'MDL-52160-30' of git://github.com/FMCorz/moodle into MOODLE_30_STABLE 2015-11-23 14:09:36 +08:00
David Monllao ae50bef5e6 Merge branch 'MDL-49490-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-11-23 13:55:48 +08:00
David Monllao 1b1e4d2670 Merge branch 'MDL-43069-30' of git://github.com/danpoltawski/moodle into MOODLE_30_STABLE 2015-11-23 13:32:57 +08:00
Dan Poltawski c31a650aad MDL-37834 assign: avoid newlines in status column of csv
Previously we were generating a CSV file with newlines in it, which
seems to cause problems importing into some versions of MS Excel.

Instead seperate status lines by '-' - this column is only used to
provide context to the teacher in the spreadsheet.
2015-11-20 18:36:49 +00:00
AMOS bot 76943b900c Automatically generated installer lang files 2015-11-21 00:04:19 +08:00
AMOS bot c05a3e254c Automatically generated installer lang files 2015-11-20 00:04:20 +08:00
AMOS bot 63385ff2b5 Merge branch 'MOODLE_30_STABLE' into install_30_STABLE 2015-11-20 00:04:20 +08:00
AMOS bot 42d7bc64f5 Automatically generated installer lang files 2015-11-19 19:14:29 +08:00
Dan Poltawski f0aa5b7e3b weekly release 3.0+ 2015-11-19 09:20:30 +00:00
Marina Glancy 40e33b6e75 MDL-52203 qtype_multianswer: avoid fatal error during upgrade 2015-11-19 09:45:28 +01:00
David Monllao e06768b331 MDL-42571 editpdf: Fix search comments
They are also hidden instead of destroyed.
2015-11-19 07:06:37 +00:00
Dan Poltawski ab58f3ee49 Merge branch 'wip-MDL-52194-m30' of https://github.com/marinaglancy/moodle into MOODLE_30_STABLE 2015-11-19 06:49:52 +00:00
Dan Poltawski 6a30312beb Merge branch 'MDL-52162_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE 2015-11-19 06:34:35 +00:00
David Monllao 8c4dbdfd56 MDL-42571 editpdf: Fix comments search and multiple views drawing 2015-11-19 12:56:55 +08:00
Stephen Bourget e9b0443000 MDL-51097 Lesson: allow resume from within a cluster 2015-11-18 23:20:57 -05:00
Henning Bostelmann fab5233096 MDL-52086 output renderers: show subtree only when tab is activated 2015-11-18 16:18:59 +00:00
Pavel Sokolov 2748bf5900 MDL-43069 assign: prevent JS error on grading table
Previously submission comments failed to expand if you hid
the file submissions column.
2015-11-18 15:42:56 +00:00
Dan Poltawski 2adf914723 MDL-45934 backup: do not reset completion enabled flag
The 'completion enabled' flag does not reflect any course data, its a
course setting. Previously when doing a backup deleteting existing
course content this was forced off when it should not have been.
2015-11-18 11:56:30 +00:00
Dan Poltawski 96a2e4086f MDL-49490 assign: can't export to portfolio on non-submission 2015-11-18 09:10:45 +00:00
Marina Glancy a2d94f3d20 MDL-52194 flowplayer: do not check request
$_REQUEST variable may contain cookies in some php configurations. See also MDL-48085
2015-11-18 15:36:48 +08:00
David Monllao 33784bd64b MDL-52162 question: Removing unnecessary dependency
APIs dependencies were correctly removed during MDL-38214 review although
this unnecessary require remained here.

Credit to Marina Glancy.
2015-11-18 13:18:09 +08:00
Rajesh Taneja 4e5efb5c0c MDL-50163 behat: Return subcontext from session
Creating a new context with new mink context
with different session was keeping the session
and was not returning proper session information
2015-11-18 12:19:19 +08:00
rajesh Taneja 5cb434f62b MDL-50163 behat: Restart session after scenario with switch_window
Restart session after a scenario with switch window
is finished. This will close all open browser windows
and open a new browser window
2015-11-18 12:19:15 +08:00
Dan Poltawski 6117291e6b Merge branch 'MDL-52140_30' of git://github.com/stronk7/moodle into MOODLE_30_STABLE 2015-11-17 16:27:52 +00:00
Eloy Lafuente (stronk7) 4e342f5397 MDL-52140 upgrade: add 3.0.0 separation line to all upgrade scripts 2015-11-17 17:11:15 +01:00
Dan Poltawski 6b85e6affd MDL-52185 report: remove ugly bullet points 2015-11-17 15:33:03 +00:00
Dan Poltawski e71116f768 MDL-52180 travis: remove weekly release checker
To prevent false positives
2015-11-17 09:40:30 +00:00
Dan Poltawski a0172a28fc MDL-51988 behat: Add coverage of participation report messaging 2015-11-17 10:23:00 +08:00
Dan Poltawski 60020ccaa9 MDL-51988 behat: select a table by <th> tag 2015-11-17 10:22:59 +08:00
Dan Poltawski 3987e19c3f MDL-51988 report_particiption: do not allow messaging when disabled
Previously the option to send messages when presented regardless of the
site setting.
2015-11-17 10:22:58 +08:00
Russell Smith 2068b31847 MDL-50700 gradereport_overview: Call $PAGE->set_course
To ensure correct blocks are displayed.
2015-11-17 10:02:51 +08:00
Dan Poltawski 9a5f3f7672 MDL-46049 chat: update calendar times on repeating chat sessions
Previously were using the invalid chat id and the calendar entry was not
updated.

Thanks to Andy McGill who worked this out.
2015-11-17 08:55:34 +08:00
Dan Poltawski 75aa0f73db MDL-46049 chat: add missing closing parenthesis 2015-11-17 08:55:32 +08:00
Syam Mohan 2efce29560 MDL-52021 enrollib: Removed repeated capability
'moodle/role:assign' replicated in the permission checking
2015-11-16 16:21:35 +00:00
Frederic Massart a4c6ffd85f MDL-52160 navigation: Really remove module settings empty nodes 2015-11-16 19:44:28 +08:00
Dan Poltawski 184169cd76 MDL-47065 notes: prevent empty spaces added as note
(And updated behat test for this test case)
2015-11-16 15:21:00 +08:00
Jun Pataleta 55d5b4168e MDL-47065 behat: improve verificaton of lack of note 2015-11-16 15:15:25 +08:00
Dan Poltawski 6ccff3ba5d MDL-47065 notes: don't add blank notes
Previously the logic was wrong and was proceeding to add a note
when content was missing.

Also add behat coverage for adding notes to participants (this test is
not perfect, but better than zero coverage we had before).
2015-11-16 15:15:24 +08:00
David Monllao 44f23c7ec1 Merge branch 'MDL-41643-master' of git://github.com/jojoob/moodle into MOODLE_30_STABLE 2015-11-16 14:54:30 +08:00
Dan Poltawski 492b025f5f MDL-50687 phpunit: error early if required locale not installed 2015-11-16 14:26:29 +08:00
Frederic Massart 7f98e36008 MDL-50564 atto: Require atto_menu in atto_plugin 2015-11-16 14:20:41 +08:00
David Monllao f53c016704 Merge branch 'MDL-42571' of git://github.com/blaky/moodle into MOODLE_30_STABLE
Conflicts:
	mod/assign/feedback/editpdf/version.php
2015-11-16 13:41:15 +08:00
19073 changed files with 753203 additions and 1931759 deletions
+3
View File
@@ -0,0 +1,3 @@
--errors=errors,duplicate-properties
--warnings=known-properties,display-property-grouping,empty-rules,important
--exclude-list=vendor/,lib/editor/tinymce/,lib/yuilib/,theme/bootstrapbase/style/
+17
View File
@@ -0,0 +1,17 @@
*/**/yui/src/*/meta/
*/**/build/
node_modules/
vendor/
lib/editor/atto/yui/src/rangy/js/
lib/editor/tinymce/plugins/pdw/tinymce/
lib/editor/tinymce/tiny_mce/
lib/requirejs/
lib/yuilib/
lib/jquery/
lib/htmlpurifier/
lib/flowplayer/
lib/xhprof/
lib/amd/src/loglevel.js
lib/amd/src/mustache.js
theme/bootstrapbase/javascript/html5shiv.js
theme/bootstrapbase/amd/src/bootstrap.js
+5 -141
View File
@@ -1,9 +1,4 @@
{
'plugins': [
'babel',
'promise',
'jsdoc',
],
'env': {
'browser': true,
'amd': true
@@ -18,7 +13,6 @@
// === Possible Errors ===
'comma-dangle': 'off',
'no-compare-neg-zero': 'error',
'no-cond-assign': 'error',
'no-console': 'error',
'no-constant-condition': 'error',
@@ -37,6 +31,7 @@
'no-inner-declarations': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-negated-in-lhs': 'error',
'no-obj-calls': 'error',
'no-prototype-builtins': 'off',
'no-regex-spaces': 'error',
@@ -44,7 +39,6 @@
'no-unexpected-multiline': 'error',
'no-unreachable': 'warn',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'use-isnan': 'error',
'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
'valid-typeof': 'error',
@@ -69,7 +63,7 @@
'no-extra-bind': 'warn',
'no-fallthrough': 'error',
'no-floating-decimal': 'warn',
'no-global-assign': 'warn',
// Enabled by grunt for AMD modules: 'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
'no-iterator': 'error',
@@ -77,6 +71,7 @@
'no-loop-func': 'error',
'no-multi-spaces': 'warn',
'no-multi-str': 'error',
'no-native-reassign': 'warn',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal': 'error',
@@ -108,13 +103,11 @@
'block-spacing': 'warn',
'brace-style': ['warn', '1tbs'],
'camelcase': 'warn',
'capitalized-comments': ['warn', 'always', { 'ignoreConsecutiveComments': true }],
'comma-spacing': ['warn', { 'before': false, 'after': true }],
'comma-style': ['warn', 'last'],
'computed-property-spacing': 'error',
'consistent-this': 'off',
'eol-last': 'off',
'func-call-spacing': ['warn', 'never'],
'func-names': 'off',
'func-style': 'off',
// indent currently not doing well with our wrapping style, so disabled.
@@ -147,7 +140,7 @@
'no-nested-ternary': 'warn',
'no-new-object': 'off',
'no-plusplus': 'off',
'no-tabs': 'error',
'no-spaced-func': 'warn',
'no-ternary': 'off',
'no-trailing-spaces': 'error',
'no-underscore-dangle': 'off',
@@ -175,134 +168,5 @@
'spaced-comment': 'warn',
'unicode-bom': 'error',
'wrap-regex': 'off',
// === Promises ===
'promise/always-return': 'warn',
'promise/no-return-wrap': 'warn',
'promise/param-names': 'warn',
'promise/catch-or-return': ['warn', {terminationMethod: ['catch', 'fail']}],
'promise/no-native': 'warn',
'promise/no-promise-in-callback': 'warn',
'promise/no-callback-in-promise': 'warn',
'promise/avoid-new': 'warn',
// === Deprecations ===
"no-restricted-properties": ['warn', {
'object': 'M',
'property': 'str',
'message': 'Use AMD module "core/str" or M.util.get_string()'
}],
},
overrides: [
{
files: ["**/yui/src/**/*.js"],
// Disable some rules which we can't safely define for YUI rollups.
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'no-unused-expressions': 'off',
// === JSDocs ===
"jsdoc/check-access": 'off',
"jsdoc/check-alignment": 'off',
"jsdoc/check-param-names": 'off',
"jsdoc/check-property-names": 'off',
"jsdoc/empty-tags": 'off',
"jsdoc/implements-on-classes": 'off',
"jsdoc/multiline-blocks": 'off',
"jsdoc/require-jsdoc": 'off',
"jsdoc/require-param": 'off',
"jsdoc/require-param-name": 'off',
"jsdoc/require-param-type": 'off',
"jsdoc/require-property": 'off',
"jsdoc/require-property-name": 'off',
"jsdoc/require-property-type": 'off',
}
},
{
files: ["**/amd/src/*.js", "**/amd/src/**/*.js", "Gruntfile.js", ".grunt/*.js", ".grunt/tasks/*.js", "jsdoc.conf.js"],
// We support es6 now. Woot!
env: {
es6: true
},
// We're using babel transpiling so use their parser
// for linting.
parser: '@babel/eslint-parser',
// Check AMD with some slightly stricter rules.
rules: {
'no-unused-vars': 'error',
'no-implicit-globals': 'error',
// Disable all of the rules that have babel versions.
'new-cap': 'off',
// Not using this rule for the time being because it isn't
// compatible with jQuery and ES6.
'no-invalid-this': 'off',
'object-curly-spacing': 'off',
'quotes': 'off',
'semi': 'off',
'no-unused-expressions': 'off',
// Enable all of the babel version of these rules.
'babel/new-cap': ['warn', { 'properties': false }],
// Not using this rule for the time being because it isn't
// compatible with jQuery and ES6.
'babel/no-invalid-this': 'off',
'babel/object-curly-spacing': 'warn',
// This is off in the original style int.
'babel/quotes': 'off',
'babel/semi': 'error',
'babel/no-unused-expressions': 'error',
// === Promises ===
// We have Promise now that we're using ES6.
'promise/no-native': 'off',
'promise/avoid-new': 'off',
// === JSDocs ===
"jsdoc/check-access": [
'error',
],
"jsdoc/check-alignment": 1, // Recommended.
"jsdoc/check-param-names": [
'error',
],
"jsdoc/check-property-names": [
'error',
],
"jsdoc/empty-tags": [
'error',
],
"jsdoc/implements-on-classes": [
'error',
],
"jsdoc/multiline-blocks": [
'error',
],
"jsdoc/require-jsdoc": [
'error',
],
"jsdoc/require-param": [
'error',
],
"jsdoc/require-param-name": [
'error',
],
"jsdoc/require-param-type": [
'error',
],
"jsdoc/require-property": [
'error',
],
"jsdoc/require-property-name": [
'error',
],
"jsdoc/require-property-type": [
'error',
],
},
parserOptions: {
'ecmaVersion': 9,
'sourceType': 'module',
'requireConfigFile': false,
}
}
]
}
}
-24
View File
@@ -1,24 +0,0 @@
{
"indentation": ["on",{
"Feature": 0,
"Background": 2,
"Scenario": 2,
"Examples": 4,
"example": 6,
"Step": 4,
"given": 4,
"and": 4
}],
"no-dupe-feature-names": "on",
"no-dupe-scenario-names": "off",
"no-empty-file": "on",
"no-files-without-scenarios": "on",
"no-multiple-empty-lines": "on",
"no-partially-commented-tag-lines": "on",
"no-trailing-spaces": "on",
"no-unnamed-features": "on",
"no-unnamed-scenarios": "on",
"no-scenario-outlines-without-examples": "on",
"no-examples-in-scenarios": "on",
"new-line-at-eof": ["on", "yes"]
}
+2 -1
View File
@@ -1,3 +1,4 @@
**/yui/build/** -diff
**/amd/build/** -diff
lib/dml/oci_native_moodle_package.sql text eol=lf
theme/bootstrapbase/style/editor.css -diff
theme/bootstrapbase/style/moodle.css -diff
-2
View File
@@ -1,2 +0,0 @@
# Primary donations pages.
custom: ["https://moodle.com/donations/", moodle.org]
-71
View File
@@ -1,71 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Template configuraton file for github actions CI/CD.
*
* @package core
* @copyright 2020 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// This cannot be used out from a github actions workflow, so just exit.
getenv('GITHUB_WORKFLOW') || die; // phpcs:ignore moodle.Files.MoodleInternal.MoodleInternalGlobalState
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = getenv('dbtype');
$CFG->dblibrary = 'native';
$CFG->dbhost = '127.0.0.1';
$CFG->dbname = 'test';
$CFG->dbuser = 'test';
$CFG->dbpass = 'test';
$CFG->prefix = 'm_';
$CFG->dboptions = ['dbcollation' => 'utf8mb4_bin'];
$host = 'localhost';
$CFG->wwwroot = "http://{$host}";
$CFG->dataroot = realpath(dirname(__DIR__)) . '/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
// Debug options - possible to be controlled by flag in future.
$CFG->debug = (E_ALL | E_STRICT); // DEBUG_DEVELOPER.
$CFG->debugdisplay = 1;
$CFG->debugstringids = 1; // Add strings=1 to url to get string ids.
$CFG->perfdebug = 15;
$CFG->debugpageinfo = 1;
$CFG->allowthemechangeonurl = 1;
$CFG->passwordpolicy = 0;
$CFG->cronclionly = 0;
$CFG->pathtophp = getenv('pathtophp');
$CFG->phpunit_dataroot = realpath(dirname(__DIR__)) . '/phpunitdata';
$CFG->phpunit_prefix = 't_';
define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://localhost:8080');
define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://localhost:8080');
define('TEST_SESSION_REDIS_HOST', 'localhost');
define('TEST_CACHESTORE_REDIS_TESTSERVERS', 'localhost');
// TODO: add others (solr, mongodb, memcached, ldap...).
// Too much for now: define('PHPUNIT_LONGTEST', true); // Only leaves a few tests out and they are run later by CI.
require_once(__DIR__ . '/lib/setup.php');
-115
View File
@@ -1,115 +0,0 @@
name: Core
on:
push:
branches-ignore:
- master
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
env:
php: 8.0
jobs:
Grunt:
runs-on: ubuntu-20.04
steps:
- name: Checking out code
uses: actions/checkout@v2
- name: Configuring node & npm
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
- name: Installing node stuff
run: npm install
- name: Running grunt
run: npx grunt
- name: Looking for uncommitted changes
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
run: |
git add .
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
PHPUnit:
runs-on: ${{ matrix.os }}
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
php: 7.3
extensions:
db: mysqli
- os: ubuntu-20.04
php: 8.0
db: pgsql
extensions: xmlrpc-beta
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: johanmeiring/mysql-action@tmpfs-patch
with:
collation server: utf8mb4_bin
mysql version: 5.7
mysql database: test
mysql user: test
mysql password: test
use tmpfs: true
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
uses: m4nu56/postgresql-action@v1
with:
postgresql version: 9.6
postgresql db: test
postgresql user: test
postgresql password: test
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v3.x
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v2
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
sudo locale-gen en_AU.UTF-8
php admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options
+2 -18
View File
@@ -9,24 +9,15 @@
#
# See gitignore(5) man page for more details
#
# Swap files (vim)
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Temporary files including undo
*~
#
/config.php
/lib/editor/tinymce/extra/tools/temp/
*~
*.swp
/tags
/TAGS
/cscope.*
/.patches/
/.idea/
.phpstorm.*
/nbproject/
CVS
.DS_Store
@@ -34,7 +25,6 @@ CVS
/.project
/.buildpath
/.cache
.phpunit.result.cache
phpunit.xml
# Composer support. Do not ignore composer.json, or composer.lock. These should be shipped by us.
composer.phar
@@ -46,9 +36,3 @@ composer.phar
/lib/yuilib/*/*/*-coverage.js
atlassian-ide-plugin.xml
/node_modules/
/.vscode/
moodle-plugin-ci.phar
.eslintignore
.stylelintignore
/jsdoc
.phpcs.xml
-169
View File
@@ -1,169 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This is a babel plugin to add the Moodle module names to the AMD modules
* as part of the transpiling process.
*
* In addition it will also add a return statement for the default export if the
* module is using default exports. This is a highly specific Moodle thing because
* we're transpiling to AMD and none of the existing Babel 7 plugins work correctly.
*
* This will fix the issue where an ES6 module using "export default Foo" will be
* transpiled into an AMD module that returns {default: Foo}; Instead it will now
* just simply return Foo.
*
* Note: This means all other named exports in that module are ignored and won't be
* exported.
*
* @copyright 2018 Ryan Wyllie <ryan@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
module.exports = ({template, types}) => {
const fs = require('fs');
const path = require('path');
const cwd = process.cwd();
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
/**
* Search the list of components that match the given file name
* and return the Moodle component for that file, if found.
*
* Throw an exception if no matching component is found.
*
* @throws {Error}
* @param {string} searchFileName The file name to look for.
* @return {string} Moodle component
*/
function getModuleNameFromFileName(searchFileName) {
searchFileName = fs.realpathSync(searchFileName);
const relativeFileName = searchFileName.replace(`${cwd}${path.sep}`, '').replace(/\\/g, '/');
const [componentPath, file] = relativeFileName.split('/amd/src/');
const fileName = file.replace('.js', '');
// Check subsystems first which require an exact match.
const componentName = ComponentList.getComponentFromPath(componentPath);
if (componentName) {
return `${componentName}/${fileName}`;
}
// This matches the previous PHP behaviour that would throw an exception
// if it couldn't parse an AMD file.
throw new Error(`Unable to find module name for ${searchFileName} (${componentPath}::${file}}`);
}
/**
* This is heavily inspired by the babel-plugin-add-module-exports plugin.
* See: https://github.com/59naga/babel-plugin-add-module-exports
*
* This is used when we detect a module using "export default Foo;" to make
* sure the transpiled code just returns Foo directly rather than an object
* with the default property (i.e. {default: Foo}).
*
* Note: This means that we can't support modules that combine named exports
* with a default export.
*
* @param {String} path
* @param {String} exportObjectName
*/
function addModuleExportsDefaults(path, exportObjectName) {
const rootPath = path.findParent(path => {
return path.key === 'body' || !path.parentPath;
});
// HACK: `path.node.body.push` instead of path.pushContainer(due doesn't work in Plugin.post).
// This is hardcoded to work specifically with AMD.
rootPath.node.body.push(template(`return ${exportObjectName}.default`)());
}
return {
pre() {
this.seenDefine = false;
this.addedReturnForDefaultExport = false;
},
visitor: {
// Plugin ordering is only respected if we visit the "Program" node.
// See: https://babeljs.io/docs/en/plugins.html#plugin-preset-ordering
//
// We require this to run after the other AMD module transformation so
// let's visit the "Program" node.
Program: {
exit(path) {
path.traverse({
CallExpression(path) {
// If we find a "define" function call.
if (!this.seenDefine && path.get('callee').isIdentifier({name: 'define'})) {
// We only want to modify the first instance of define that we find.
this.seenDefine = true;
// Get the Moodle component for the file being processed.
var moduleName = getModuleNameFromFileName(this.file.opts.filename);
// The function signature of `define()` is:
// define = function (name, deps, callback) {...}
// Ensure that if the moduel supplied its own name that it is replaced.
if (path.node.arguments.length > 0) {
// Ensure that there is only one name.
if (path.node.arguments[0].type === 'StringLiteral') {
// eslint-disable-next-line
console.log(`Replacing module name '${path.node.arguments[0].extra.rawValue}' with ${moduleName}`);
path.node.arguments.shift();
}
}
// Add the module name as the first argument to the define function.
path.node.arguments.unshift(types.stringLiteral(moduleName));
// Add a space after the define function in the built file so that previous versions
// of Moodle will not try to add the module name to the file when it's being served
// by PHP. This forces the regex in PHP to not match for this file.
path.node.callee.name = 'define ';
}
// Check for any Object.defineProperty('exports', 'default') calls.
if (!this.addedReturnForDefaultExport && path.get('callee').matchesPattern('Object.defineProperty')) {
const [identifier, prop] = path.get('arguments');
const objectName = identifier.get('name').node;
const propertyName = prop.get('value').node;
if ((objectName === 'exports' || objectName === '_exports') && propertyName === 'default') {
addModuleExportsDefaults(path, objectName);
this.addedReturnForDefaultExport = true;
}
}
},
AssignmentExpression(path) {
// Check for an exports.default assignments.
if (
!this.addedReturnForDefaultExport &&
(
path.get('left').matchesPattern('exports.default') ||
path.get('left').matchesPattern('_exports.default')
)
) {
const objectName = path.get('left.object.name').node;
addModuleExportsDefaults(path, objectName);
this.addedReturnForDefaultExport = true;
}
}
}, this);
}
}
}
};
};
-243
View File
@@ -1,243 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Helper functions for working with Moodle component names, directories, and sources.
*
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
/** @var {Object} A list of subsystems in Moodle */
const componentData = {};
/**
* Load details of all moodle modules.
*
* @returns {object}
*/
const fetchComponentData = () => {
const fs = require('fs');
const path = require('path');
const glob = require('glob');
const gruntFilePath = process.cwd();
if (!Object.entries(componentData).length) {
componentData.subsystems = {};
componentData.pathList = [];
// Fetch the component definiitions from the distributed JSON file.
const components = JSON.parse(fs.readFileSync(`${gruntFilePath}/lib/components.json`));
// Build the list of moodle subsystems.
componentData.subsystems.lib = 'core';
componentData.pathList.push(process.cwd() + path.sep + 'lib');
for (const [component, thisPath] of Object.entries(components.subsystems)) {
if (thisPath) {
// Prefix "core_" to the front of the subsystems.
componentData.subsystems[thisPath] = `core_${component}`;
componentData.pathList.push(process.cwd() + path.sep + thisPath);
}
}
// The list of components incldues the list of subsystems.
componentData.components = componentData.subsystems;
// Go through each of the plugintypes.
Object.entries(components.plugintypes).forEach(([pluginType, pluginTypePath]) => {
// We don't allow any code in this place..?
glob.sync(`${pluginTypePath}/*/version.php`).forEach(versionPath => {
const componentPath = fs.realpathSync(path.dirname(versionPath));
const componentName = path.basename(componentPath);
const frankenstyleName = `${pluginType}_${componentName}`;
componentData.components[`${pluginTypePath}/${componentName}`] = frankenstyleName;
componentData.pathList.push(componentPath);
// Look for any subplugins.
const subPluginConfigurationFile = `${componentPath}/db/subplugins.json`;
if (fs.existsSync(subPluginConfigurationFile)) {
const subpluginList = JSON.parse(fs.readFileSync(fs.realpathSync(subPluginConfigurationFile)));
Object.entries(subpluginList.plugintypes).forEach(([subpluginType, subpluginTypePath]) => {
glob.sync(`${subpluginTypePath}/*/version.php`).forEach(versionPath => {
const componentPath = fs.realpathSync(path.dirname(versionPath));
const componentName = path.basename(componentPath);
const frankenstyleName = `${subpluginType}_${componentName}`;
componentData.components[`${subpluginTypePath}/${componentName}`] = frankenstyleName;
componentData.pathList.push(componentPath);
});
});
}
});
});
}
return componentData;
};
/**
* Get the list of component paths.
*
* @param {string} relativeTo
* @returns {array}
*/
const getComponentPaths = (relativeTo = '') => fetchComponentData().pathList.map(componentPath => {
return componentPath.replace(relativeTo, '');
});
/**
* Get the list of paths to build AMD sources.
*
* @returns {Array}
*/
const getAmdSrcGlobList = () => {
const globList = [];
fetchComponentData().pathList.forEach(componentPath => {
globList.push(`${componentPath}/amd/src/*.js`);
globList.push(`${componentPath}/amd/src/**/*.js`);
});
return globList;
};
/**
* Get the list of paths to build YUI sources.
*
* @param {String} relativeTo
* @returns {Array}
*/
const getYuiSrcGlobList = relativeTo => {
const globList = [];
fetchComponentData().pathList.forEach(componentPath => {
const relativeComponentPath = componentPath.replace(relativeTo, '');
globList.push(`${relativeComponentPath}/yui/src/**/*.js`);
});
return globList;
};
/**
* Get the list of paths to thirdpartylibs.xml.
*
* @param {String} relativeTo
* @returns {Array}
*/
const getThirdPartyLibsList = relativeTo => {
const fs = require('fs');
const path = require('path');
return fetchComponentData().pathList
.map(componentPath => path.relative(relativeTo, componentPath) + '/thirdpartylibs.xml')
.map(componentPath => componentPath.replace(/\\/g, '/'))
.filter(path => fs.existsSync(path))
.sort();
};
/**
* Get the list of thirdparty library paths.
*
* @returns {array}
*/
const getThirdPartyPaths = () => {
const DOMParser = require('xmldom').DOMParser;
const fs = require('fs');
const path = require('path');
const xpath = require('xpath');
const thirdpartyfiles = getThirdPartyLibsList(fs.realpathSync('./'));
const libs = ['node_modules/', 'vendor/'];
const addLibToList = lib => {
if (!lib.match('\\*') && fs.statSync(lib).isDirectory()) {
// Ensure trailing slash on dirs.
lib = lib.replace(/\/?$/, '/');
}
// Look for duplicate paths before adding to array.
if (libs.indexOf(lib) === -1) {
libs.push(lib);
}
};
thirdpartyfiles.forEach(function(file) {
const dirname = path.dirname(file);
const xmlContent = fs.readFileSync(file, 'utf8');
const doc = new DOMParser().parseFromString(xmlContent);
const nodes = xpath.select("/libraries/library/location/text()", doc);
nodes.forEach(function(node) {
let lib = path.posix.join(dirname, node.toString());
addLibToList(lib);
});
});
return libs;
};
/**
* Find the name of the component matching the specified path.
*
* @param {String} path
* @returns {String|null} Name of matching component.
*/
const getComponentFromPath = path => {
const componentList = fetchComponentData().components;
if (componentList.hasOwnProperty(path)) {
return componentList[path];
}
return null;
};
/**
* Check whether the supplied path, relative to the Gruntfile.js, is in a known component.
*
* @param {String} checkPath The path to check. This can be with either Windows, or Linux directory separators.
* @returns {String|null}
*/
const getOwningComponentDirectory = checkPath => {
const path = require('path');
// Fetch all components into a reverse sorted array.
// This ensures that components which are within the directory of another component match first.
const pathList = Object.keys(fetchComponentData().components).sort().reverse();
for (const componentPath of pathList) {
// If the componentPath is the directory being checked, it will be empty.
// If the componentPath is a parent of the directory being checked, the relative directory will not start with ..
if (!path.relative(componentPath, checkPath).startsWith('..')) {
return componentPath;
}
}
return null;
};
module.exports = {
getAmdSrcGlobList,
getComponentFromPath,
getComponentPaths,
getOwningComponentDirectory,
getYuiSrcGlobList,
getThirdPartyLibsList,
getThirdPartyPaths,
};
-19
View File
@@ -1,19 +0,0 @@
# Moodle JavaScript Documentation
```
.-..-.
_____ | || |
/____/-.---_ .---. .---. .-.| || | .---.
| | _ _ |/ _ \/ _ \/ _ || |/ __ \
* | | | | | || |_| || |_| || |_| || || |___/
|_| |_| |_|\_____/\_____/\_____||_|\_____)
Moodle - the world's open source learning platform
```
## About
This generated documentation includes API documentation for JavaScript written in the AMD and ES2015 module formats within Moodle.
## Related information
See [https://docs.moodle.org/dev](https://docs.moodle.org/dev) for other related Developer Documentation.
-131
View File
@@ -1,131 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Helper functions for working with Moodle component names, directories, and sources.
*
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
// Do not include any plugins as stanard.
const plugins = [];
plugins.push('plugins/markdown');
/**
* Get the source configuration.
*
* @return {Object}
*/
const getSource = () => {
const glob = require('glob');
const path = require('path');
const ComponentList = require(path.resolve('.grunt/components.js'));
const thirdPartyPaths = ComponentList.getThirdPartyPaths();
const source = {
include: [],
includePattern: ".+\\.js$",
};
let includeList = [];
ComponentList.getAmdSrcGlobList().forEach(async pattern => {
includeList.push(...glob.sync(pattern));
});
const cwdLength = process.cwd().length + 1;
includeList.forEach(path => {
if (source.include.indexOf(path) !== -1) {
// Ensure no duplicates.
return;
}
const relPath = path.substring(cwdLength);
if (thirdPartyPaths.indexOf(relPath) !== -1) {
return;
}
source.include.push(path);
});
source.include.push('.grunt/jsdoc/README.md');
return source;
};
const tags = {
// Allow the use of unknown tags.
// We have a lot of legacy uses of these.
allowUnknownTags: true,
// We make use of jsdoc and closure dictionaries as standard.
dictionaries: [
'jsdoc',
'closure',
],
};
// Template configuraiton.
const templates = {
cleverLinks: false,
monospaceLinks: false,
};
module.exports = {
opts: {
destination: "./jsdoc/",
template: "node_modules/docdash",
},
plugins,
recurseDepth: 10,
source: getSource(),
sourceType: 'module',
tags,
templates,
docdash: {
collapse: true,
search: true,
sort: true,
sectionOrder: [
"Namespaces",
"Modules",
"Events",
"Classes",
"Externals",
"Mixins",
"Tutorials",
"Interfaces"
],
"menu": {
"Developer Docs": {
href: "https://docs.moodle.org/dev",
target: "_blank",
"class": "menu-item",
id: "devdocs"
},
"MDN Docs": {
href: "https://developer.mozilla.org/en-US/docs/Web/JavaScript",
target: "_blank",
"class": "menu-item",
id: "mdndocs",
},
},
typedefs: true,
},
};
-64
View File
@@ -1,64 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
const files = grunt.moodleEnv.files;
// Project configuration.
grunt.config.merge({
eslint: {
// Even though warnings dont stop the build we don't display warnings by default because
// at this moment we've got too many core warnings.
// To display warnings call: grunt eslint --show-lint-warnings
// To fail on warnings call: grunt eslint --max-lint-warnings=0
// Also --max-lint-warnings=-1 can be used to display warnings but not fail.
options: {
quiet: (!grunt.option('show-lint-warnings')) && (typeof grunt.option('max-lint-warnings') === 'undefined'),
maxWarnings: ((typeof grunt.option('max-lint-warnings') !== 'undefined') ? grunt.option('max-lint-warnings') : -1)
},
// Check AMD src files.
amd: {src: files ? files : grunt.moodleEnv.amdSrc},
// Check YUI module source files.
yui: {src: files ? files : grunt.moodleEnv.yuiSrc},
},
});
grunt.loadNpmTasks('grunt-eslint');
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('eslint.amd.src', files);
grunt.config('eslint.yui.src', files);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', (action, filepath) => {
changedFiles[filepath] = action;
onChange();
});
};
-89
View File
@@ -1,89 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Get the list of feature files to pass to the gherkin linter.
*
* @returns {Array}
*/
const getGherkinLintTargets = () => {
if (grunt.moodleEnv.files) {
// Specific files were requested. Only check these.
return grunt.moodleEnv.files;
}
if (grunt.moodleEnv.inComponent) {
return [`${grunt.moodleEnv.runDir}/tests/behat/*.feature`];
}
return ['**/tests/behat/*.feature'];
};
const handler = function() {
const done = this.async();
const options = grunt.config('gherkinlint.options');
// Grab the gherkin-lint linter and required scaffolding.
const linter = require('gherkin-lint/dist/linter.js');
const featureFinder = require('gherkin-lint/dist/feature-finder.js');
const configParser = require('gherkin-lint/dist/config-parser.js');
const formatter = require('gherkin-lint/dist/formatters/stylish.js');
// Run the linter.
return linter.lint(
featureFinder.getFeatureFiles(grunt.file.expand(options.files)),
configParser.getConfiguration(configParser.defaultConfigFileName)
)
.then(results => {
// Print the results out uncondtionally.
formatter.printResults(results);
return results;
})
.then(results => {
// Report on the results.
// The done function takes a bool whereby a falsey statement causes the task to fail.
return results.every(result => result.errors.length === 0);
})
.then(done); // eslint-disable-line promise/no-callback-in-promise
};
grunt.registerTask('gherkinlint', 'Run gherkinlint against the current directory', handler);
grunt.config.set('gherkinlint', {
options: {
files: getGherkinLintTargets(),
}
});
grunt.config.merge({
watch: {
gherkinlint: {
files: [grunt.moodleEnv.inComponent ? 'tests/behat/*.feature' : '**/tests/behat/*.feature'],
tasks: ['gherkinlint'],
},
},
});
return handler;
};
-99
View File
@@ -1,99 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate the PHPCS configuration.
*
* @param {Object} thirdPartyPaths
*/
const phpcsIgnore = (thirdPartyPaths) => {
const {toXML} = require('jstoxml');
const config = {
_name: 'ruleset',
_attrs: {
name: "MoodleCore",
},
_content: [
{
rule: {
_attrs: {
ref: './.phpcs.xml.dist',
},
},
},
],
};
thirdPartyPaths.forEach(library => {
config._content.push({
'exclude-pattern': library,
});
});
grunt.file.write('.phpcs.xml', toXML(config, {
header: true,
indent: ' ',
}) + "\n");
};
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
const handler = function() {
const path = require('path');
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
// An array of paths to third party directories.
const thirdPartyPaths = ComponentList.getThirdPartyPaths();
// Generate .eslintignore.
const eslintIgnores = [
'# Generated by "grunt ignorefiles"',
// Do not ignore the .grunt directory.
'!/.grunt',
// Ignore all yui/src meta directories and build directories.
'*/**/yui/src/*/meta/',
'*/**/build/',
].concat(thirdPartyPaths);
grunt.file.write('.eslintignore', eslintIgnores.join('\n') + '\n');
// Generate .stylelintignore.
const stylelintIgnores = [
'# Generated by "grunt ignorefiles"',
'**/yui/build/*',
'theme/boost/style/moodle.css',
'theme/classic/style/moodle.css',
'jsdoc/styles/*.css',
].concat(thirdPartyPaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n') + '\n');
phpcsIgnore(thirdPartyPaths);
};
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', handler);
return handler;
};
-222
View File
@@ -1,222 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Function to generate the destination for the uglify task
* (e.g. build/file.min.js). This function will be passed to
* the rename property of files array when building dynamically:
* http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
*
* @param {String} destPath the current destination
* @param {String} srcPath the matched src path
* @return {String} The rewritten destination path.
*/
const babelRename = function(destPath, srcPath) {
destPath = srcPath.replace('src', 'build');
destPath = destPath.replace('.js', '.min.js');
return destPath;
};
module.exports = grunt => {
// Load the Ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Shifter tasks.
require('./shifter')(grunt);
// Load ESLint.
require('./eslint')(grunt);
// Load JSDoc.
require('./jsdoc')(grunt);
const path = require('path');
// Register JS tasks.
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
grunt.registerTask('amd', ['ignorefiles', 'eslint:amd', 'rollup']);
grunt.registerTask('js', ['amd', 'yui']);
// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-rollup');
const babelTransform = require('@babel/core').transform;
const babel = (options = {}) => {
return {
name: 'babel',
transform: (code, id) => {
grunt.log.debug(`Transforming ${id}`);
options.filename = id;
const transformed = babelTransform(code, options);
return {
code: transformed.code,
map: transformed.map
};
}
};
};
// Note: We have to use a rate limit plugin here because rollup runs all tasks asynchronously and in parallel.
// When we kick off a full run, if we kick off a rollup of every file this will fork-bomb the machine.
// To work around this we use a concurrent Promise queue based on the number of available processors.
const rateLimit = () => {
const queue = [];
let queueRunner;
const startQueue = () => {
if (queueRunner) {
return;
}
queueRunner = setTimeout(() => {
const limit = Math.max(1, require('os').cpus().length / 2);
grunt.log.debug(`Starting rollup with queue size of ${limit}`);
runQueue(limit);
}, 100);
};
// The queue runner will run the next `size` items in the queue.
const runQueue = (size = 1) => {
queue.splice(0, size).forEach(resolve => {
resolve();
});
};
return {
name: 'ratelimit',
// The options hook is run in parallel.
// We can return an unresolved Promise which is queued for later resolution.
options: async() => {
return new Promise(resolve => {
queue.push(resolve);
startQueue();
});
},
// When an item in the queue completes, start the next item in the queue.
buildEnd: () => {
runQueue();
},
};
};
const terser = require('rollup-plugin-terser').terser;
grunt.config.merge({
rollup: {
options: {
format: 'esm',
dir: 'output',
sourcemap: true,
treeshake: false,
context: 'window',
plugins: [
rateLimit(),
babel({
sourceMaps: true,
comments: false,
compact: false,
plugins: [
'transform-es2015-modules-amd-lazy',
'system-import-transformer',
// This plugin modifies the Babel transpiling for "export default"
// so that if it's used then only the exported value is returned
// by the generated AMD module.
//
// It also adds the Moodle plugin name to the AMD module definition
// so that it can be imported as expected in other modules.
path.resolve('.grunt/babel-plugin-add-module-to-define.js'),
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
['@babel/plugin-proposal-class-properties', {'loose': false}],
'@babel/plugin-proposal-json-strings'
],
presets: [
['@babel/preset-env', {
targets: {
browsers: [
">0.25%",
"last 2 versions",
"not ie <= 10",
"not op_mini all",
"not Opera > 0",
"not dead"
]
},
modules: false,
useBuiltIns: false
}]
]
}),
terser({
// Do not mangle variables.
// Makes debugging easier.
mangle: false,
}),
],
},
dist: {
files: [{
expand: true,
src: grunt.moodleEnv.files ? grunt.moodleEnv.files : grunt.moodleEnv.amdSrc,
rename: babelRename
}],
},
},
});
grunt.config.merge({
watch: {
amd: {
files: grunt.moodleEnv.inComponent
? ['amd/src/*.js', 'amd/src/**/*.js']
: ['**/amd/src/**/*.js'],
tasks: ['amd']
},
},
});
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('rollup.dist.files', [{expand: true, src: files, rename: babelRename}]);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', function(action, filepath) {
changedFiles[filepath] = action;
onChange();
});
return {
babelRename,
};
};
-36
View File
@@ -1,36 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
// Project configuration.
grunt.config.merge({
jsdoc: {
dist: {
options: {
configure: ".grunt/jsdoc/jsdoc.conf.js",
},
},
},
});
grunt.loadNpmTasks('grunt-jsdoc');
};
-40
View File
@@ -1,40 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
grunt.loadNpmTasks('grunt-sass');
grunt.config.merge({
sass: {
dist: {
files: {
"theme/boost/style/moodle.css": "theme/boost/scss/preset/default.scss",
"theme/classic/style/moodle.css": "theme/classic/scss/classicgrunt.scss"
}
},
options: {
implementation: require('node-sass'),
includePaths: ["theme/boost/scss/", "theme/classic/scss/"]
}
},
});
};
-155
View File
@@ -1,155 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/* eslint-env node */
module.exports = grunt => {
/**
* Shifter task. Is configured with a path to a specific file or a directory,
* in the case of a specific file it will work out the right module to be built.
*
* Note that this task runs the invidiaul shifter jobs async (becase it spawns
* so be careful to to call done().
*/
const handler = function() {
const done = this.async();
const options = grunt.config('shifter.options');
const async = require('async');
const path = require('path');
// Run the shifter processes one at a time to avoid confusing output.
async.eachSeries(options.paths, function(src, filedone) {
var args = [];
args.push(path.normalize(process.cwd() + '/node_modules/shifter/bin/shifter'));
// Always ignore the node_modules directory.
args.push('--excludes', 'node_modules');
// Determine the most appropriate options to run with based upon the current location.
if (grunt.file.isMatch('**/yui/**/*.js', src)) {
// When passed a JS file, build our containing module (this happen with
// watch).
grunt.log.debug('Shifter passed a specific JS file');
src = path.dirname(path.dirname(src));
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src', src)) {
// When in a src directory --walk all modules.
grunt.log.debug('In a src directory');
args.push('--walk');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*', src)) {
// When in module, only build our module.
grunt.log.debug('In a module directory');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*/js', src)) {
// When in module src, only build our module.
grunt.log.debug('In a source directory');
src = path.dirname(src);
options.recursive = false;
}
if (grunt.option('watch')) {
grunt.fail.fatal('The --watch option has been removed, please use `grunt watch` instead');
}
// Add the stderr option if appropriate
if (grunt.option('verbose')) {
args.push('--lint-stderr');
}
if (grunt.option('no-color')) {
args.push('--color=false');
}
var execShifter = function() {
grunt.log.ok("Running shifter on " + src);
grunt.util.spawn({
cmd: "node",
args: args,
opts: {cwd: src, stdio: 'inherit', env: process.env}
}, function(error, result, code) {
if (code) {
grunt.fail.fatal('Shifter failed with code: ' + code);
} else {
grunt.log.ok('Shifter build complete.');
filedone();
}
});
};
// Actually run shifter.
if (!options.recursive) {
execShifter();
} else {
// Check that there are yui modules otherwise shifter ends with exit code 1.
if (grunt.file.expand({cwd: src}, '**/yui/src/**/*.js').length > 0) {
args.push('--recursive');
execShifter();
} else {
grunt.log.ok('No YUI modules to build.');
filedone();
}
}
}, done);
};
// Register the shifter task.
grunt.registerTask('shifter', 'Run Shifter against the current directory', handler);
// Configure it.
grunt.config.set('shifter', {
options: {
recursive: true,
// Shifter takes a relative path.
paths: grunt.moodleEnv.files ? grunt.moodleEnv.files : [grunt.moodleEnv.runDir]
}
});
grunt.config.merge({
watch: {
yui: {
files: grunt.moodleEnv.inComponent
? ['yui/src/*.json', 'yui/src/**/*.js']
: ['**/yui/src/**/*.js'],
tasks: ['yui']
},
},
});
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('shifter.options.paths', files);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', (action, filepath) => {
changedFiles[filepath] = action;
onChange();
});
return handler;
};
-48
View File
@@ -1,48 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
const handler = function() {
const path = require('path');
// Are we in a YUI directory?
if (path.basename(path.resolve(grunt.moodleEnv.cwd, '../../')) == 'yui') {
grunt.task.run('yui');
// Are we in an AMD directory?
} else if (grunt.moodleEnv.inAMD) {
grunt.task.run('amd');
} else {
// Run them all!.
grunt.task.run('css');
grunt.task.run('js');
grunt.task.run('gherkinlint');
}
};
// Register the startup task.
grunt.registerTask('startup', 'Run the correct tasks for the current directory', handler);
return handler;
};
-32
View File
@@ -1,32 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
// Load the ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Style Lint tasks.
require('./stylelint')(grunt);
// Load the SASS tasks.
require('./sass')(grunt);
};
-183
View File
@@ -1,183 +0,0 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
const getCssConfigForFiles = files => {
return {
stylelint: {
css: {
// Use a fully-qualified path.
src: files,
options: {
configOverrides: {
rules: {
// These rules have to be disabled in .stylelintrc for scss compat.
"at-rule-no-unknown": true,
}
}
}
},
},
};
};
const getScssConfigForFiles = files => {
return {
stylelint: {
scss: {
options: {syntax: 'scss'},
src: files,
},
},
};
};
/**
* Register any stylelint tasks.
*
* @param {Object} grunt
* @param {Array} files
* @param {String} fullRunDir
*/
const registerStyleLintTasks = () => {
const glob = require('glob');
// The stylelinters do not handle the case where a configuration was provided but no files were included.
// Keep track of whether any files were found.
let hasCss = false;
let hasScss = false;
// The stylelint processors do not take a path argument. They always check all provided values.
// As a result we must check through each glob and determine if any files match the current directory.
const scssFiles = [];
const cssFiles = [];
const requestedFiles = grunt.moodleEnv.files;
if (requestedFiles) {
// Grunt was called with a files argument.
// Check whether each of the requested files matches either the CSS or SCSS source file list.
requestedFiles.forEach(changedFilePath => {
let matchesGlob;
// Check whether this watched path matches any watched SCSS file.
matchesGlob = grunt.moodleEnv.scssSrc.some(watchedPathGlob => {
return glob.sync(watchedPathGlob).indexOf(changedFilePath) !== -1;
});
if (matchesGlob) {
scssFiles.push(changedFilePath);
hasScss = true;
}
// Check whether this watched path matches any watched CSS file.
matchesGlob = grunt.moodleEnv.cssSrc.some(watchedPathGlob => {
return glob.sync(watchedPathGlob).indexOf(changedFilePath) !== -1;
});
if (matchesGlob) {
cssFiles.push(changedFilePath);
hasCss = true;
}
});
} else {
// Grunt was called without a list of files.
// The start directory (runDir) may be a child dir of the project.
// Check each scssSrc file to see if it's in the start directory.
// This means that we can lint just mod/*/styles.css if started in the mod directory.
grunt.moodleEnv.scssSrc.forEach(path => {
if (path.startsWith(grunt.moodleEnv.runDir)) {
scssFiles.push(path);
hasScss = true;
}
});
grunt.moodleEnv.cssSrc.forEach(path => {
if (path.startsWith(grunt.moodleEnv.runDir)) {
cssFiles.push(path);
hasCss = true;
}
});
}
// Register the tasks.
const scssTasks = ['sass'];
if (hasScss) {
grunt.config.merge(getScssConfigForFiles(scssFiles));
scssTasks.unshift('stylelint:scss');
}
scssTasks.unshift('ignorefiles');
const cssTasks = ['ignorefiles'];
if (hasCss) {
grunt.config.merge(getCssConfigForFiles(cssFiles));
cssTasks.push('stylelint:css');
}
// The tasks must be registered, even if empty to ensure a consistent command list.
// They jsut won't run anything.
grunt.registerTask('scss', scssTasks);
grunt.registerTask('rawcss', cssTasks);
};
// Register CSS tasks.
grunt.loadNpmTasks('grunt-stylelint');
// Register the style lint tasks.
registerStyleLintTasks();
grunt.registerTask('css', ['scss', 'rawcss']);
const getCoreThemeMatches = () => {
const scssMatch = 'scss/**/*.scss';
if (grunt.moodleEnv.inTheme) {
return [scssMatch];
}
if (grunt.moodleEnv.runDir.startsWith('theme')) {
return [`*/${scssMatch}`];
}
return [`theme/*/${scssMatch}`];
};
// Add the watch configuration for rawcss, and scss.
grunt.config.merge({
watch: {
rawcss: {
files: [
'**/*.css',
],
excludes: [
'**/moodle.css',
'**/editor.css',
'jsdoc/styles/*.css',
],
tasks: ['rawcss']
},
scss: {
files: getCoreThemeMatches(),
tasks: ['scss']
},
},
});
};
-272
View File
@@ -1,272 +0,0 @@
/**
* This is a wrapper task to handle the grunt watch command. It attempts to use
* Watchman to monitor for file changes, if it's installed, because it's much faster.
*
* If Watchman isn't installed then it falls back to the grunt-contrib-watch file
* watcher for backwards compatibility.
*/
/* eslint-env node */
module.exports = grunt => {
/**
* This is a wrapper task to handle the grunt watch command. It attempts to use
* Watchman to monitor for file changes, if it's installed, because it's much faster.
*
* If Watchman isn't installed then it falls back to the grunt-contrib-watch file
* watcher for backwards compatibility.
*/
const watchHandler = function() {
const async = require('async');
const watchTaskDone = this.async();
let watchInitialised = false;
let watchTaskQueue = {};
let processingQueue = false;
const watchman = require('fb-watchman');
const watchmanClient = new watchman.Client();
// Grab the tasks and files that have been queued up and execute them.
var processWatchTaskQueue = function() {
if (!Object.keys(watchTaskQueue).length || processingQueue) {
// If there is nothing in the queue or we're already processing then wait.
return;
}
processingQueue = true;
// Grab all tasks currently in the queue.
var queueToProcess = watchTaskQueue;
// Reset the queue.
watchTaskQueue = {};
async.forEachSeries(
Object.keys(queueToProcess),
function(task, next) {
var files = queueToProcess[task];
var filesOption = '--files=' + files.join(',');
grunt.log.ok('Running task ' + task + ' for files ' + filesOption);
// Spawn the task in a child process so that it doesn't kill this one
// if it failed.
grunt.util.spawn(
{
// Spawn with the grunt bin.
grunt: true,
// Run from current working dir and inherit stdio from process.
opts: {
cwd: grunt.moodleEnv.fullRunDir,
stdio: 'inherit'
},
args: [task, filesOption]
},
function(err, res, code) {
if (code !== 0) {
// The grunt task failed.
grunt.log.error(err);
}
// Move on to the next task.
next();
}
);
},
function() {
// No longer processing.
processingQueue = false;
// Once all of the tasks are done then recurse just in case more tasks
// were queued while we were processing.
processWatchTaskQueue();
}
);
};
const originalWatchConfig = grunt.config.get(['watch']);
const watchConfig = Object.keys(originalWatchConfig).reduce(function(carry, key) {
if (key == 'options') {
return carry;
}
const value = originalWatchConfig[key];
const taskNames = value.tasks;
const files = value.files;
let excludes = [];
if (value.excludes) {
excludes = value.excludes;
}
taskNames.forEach(function(taskName) {
carry[taskName] = {
files,
excludes,
};
});
return carry;
}, {});
watchmanClient.on('error', function(error) {
// We have to add an error handler here and parse the error string because the
// example way from the docs to check if Watchman is installed doesn't actually work!!
// See: https://github.com/facebook/watchman/issues/509
if (error.message.match('Watchman was not found')) {
// If watchman isn't installed then we should fallback to the other watch task.
grunt.log.ok('It is recommended that you install Watchman for better performance using the "watch" command.');
// Fallback to the old grunt-contrib-watch task.
grunt.renameTask('watch-grunt', 'watch');
grunt.task.run(['watch']);
// This task is finished.
watchTaskDone(0);
} else {
grunt.log.error(error);
// Fatal error.
watchTaskDone(1);
}
});
watchmanClient.on('subscription', function(resp) {
if (resp.subscription !== 'grunt-watch') {
return;
}
resp.files.forEach(function(file) {
grunt.log.ok('File changed: ' + file.name);
var fullPath = grunt.moodleEnv.fullRunDir + '/' + file.name;
Object.keys(watchConfig).forEach(function(task) {
const fileGlobs = watchConfig[task].files;
var match = fileGlobs.some(function(fileGlob) {
return grunt.file.isMatch(`**/${fileGlob}`, fullPath);
});
if (match) {
// If we are watching a subdirectory then the file.name will be relative
// to that directory. However the grunt tasks expect the file paths to be
// relative to the Gruntfile.js location so let's normalise them before
// adding them to the queue.
var relativePath = fullPath.replace(grunt.moodleEnv.gruntFilePath + '/', '');
if (task in watchTaskQueue) {
if (!watchTaskQueue[task].includes(relativePath)) {
watchTaskQueue[task] = watchTaskQueue[task].concat(relativePath);
}
} else {
watchTaskQueue[task] = [relativePath];
}
}
});
});
processWatchTaskQueue();
});
process.on('SIGINT', function() {
// Let the user know that they may need to manually stop the Watchman daemon if they
// no longer want it running.
if (watchInitialised) {
grunt.log.ok('The Watchman daemon may still be running and may need to be stopped manually.');
}
process.exit();
});
// Initiate the watch on the current directory.
watchmanClient.command(['watch-project', grunt.moodleEnv.fullRunDir], function(watchError, watchResponse) {
if (watchError) {
grunt.log.error('Error initiating watch:', watchError);
watchTaskDone(1);
return;
}
if ('warning' in watchResponse) {
grunt.log.error('warning: ', watchResponse.warning);
}
var watch = watchResponse.watch;
var relativePath = watchResponse.relative_path;
watchInitialised = true;
watchmanClient.command(['clock', watch], function(clockError, clockResponse) {
if (clockError) {
grunt.log.error('Failed to query clock:', clockError);
watchTaskDone(1);
return;
}
// Generate the expression query used by watchman.
// Documentation is limited, but see https://facebook.github.io/watchman/docs/expr/allof.html for examples.
// We generate an expression to match any value in the files list of all of our tasks, but excluding
// all value in the excludes list of that task.
//
// [anyof, [
// [allof, [
// [anyof, [
// ['match', validPath, 'wholename'],
// ['match', validPath, 'wholename'],
// ],
// [not,
// [anyof, [
// ['match', invalidPath, 'wholename'],
// ['match', invalidPath, 'wholename'],
// ],
// ],
// ],
var matchWholeName = fileGlob => ['match', fileGlob, 'wholename'];
var matches = Object.keys(watchConfig).map(function(task) {
const matchAll = [];
matchAll.push(['anyof'].concat(watchConfig[task].files.map(matchWholeName)));
if (watchConfig[task].excludes.length) {
matchAll.push(['not', ['anyof'].concat(watchConfig[task].excludes.map(matchWholeName))]);
}
return ['allof'].concat(matchAll);
});
matches = ['anyof'].concat(matches);
var sub = {
expression: matches,
// Which fields we're interested in.
fields: ["name", "size", "type"],
// Add our time constraint.
since: clockResponse.clock
};
if (relativePath) {
/* eslint-disable camelcase */
sub.relative_root = relativePath;
}
watchmanClient.command(['subscribe', watch, 'grunt-watch', sub], function(subscribeError) {
if (subscribeError) {
// Probably an error in the subscription criteria.
grunt.log.error('failed to subscribe: ', subscribeError);
watchTaskDone(1);
return;
}
grunt.log.ok('Listening for changes to files in ' + grunt.moodleEnv.fullRunDir);
});
});
});
};
// Rename the grunt-contrib-watch "watch" task because we're going to wrap it.
grunt.renameTask('watch', 'watch-grunt');
// Register the new watch handler.
grunt.registerTask('watch', 'Run tasks on file changes', watchHandler);
grunt.config.merge({
watch: {
options: {
nospawn: true // We need not to spawn so config can be changed dynamically.
},
},
});
return watchHandler;
};
-2
View File
@@ -1,2 +0,0 @@
**/amd/**
/*.js
-3
View File
@@ -1,6 +1,3 @@
// NOTE: We use eslint now. This file is used only by shifter. We keep the configuration
// here because shifter uses jshint after modules have been concating. Eslint can't
// currently do this.
{
"asi": false,
"bitwise": true,
-1
View File
@@ -1 +0,0 @@
lts/gallium
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="MoodleCore">
<rule ref="moodle"/>
</ruleset>
-95
View File
@@ -1,95 +0,0 @@
{
"plugins": [
"stylelint-csstree-validator"
],
"rules": {
"csstree/validator": true,
"at-rule-empty-line-before": [ "always",
{"except": [ "blockless-after-blockless"], ignore: ["after-comment", "inside-block"]}
],
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always-single-line",
"at-rule-no-unknown": null, # Enabled for non-scss in grunt.
"at-rule-semicolon-newline-after": "always",
"at-rule-semicolon-space-before": "never",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always",
"block-closing-brace-space-before": "always-single-line",
"block-no-empty": true,
"block-opening-brace-newline-after": "always",
"block-opening-brace-space-after": "always-single-line",
"block-opening-brace-space-before": "always",
"color-hex-case": ["lower", { "severity": "warning" }],
"color-hex-length": ["short", { "severity": "warning" }],
"color-no-invalid-hex": true,
"declaration-bang-space-after": "never",
"declaration-bang-space-before": "always",
"declaration-block-no-duplicate-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-semicolon-newline-after": "always-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-semicolon-space-before": "never",
"declaration-block-single-line-max-declarations": 1,
"declaration-block-trailing-semicolon": "always",
"declaration-colon-newline-after": "always-multi-line",
"declaration-colon-space-after": "always-single-line",
"declaration-colon-space-before": "never",
"declaration-no-important": true,
"font-family-no-duplicate-names": true,
"function-calc-no-unspaced-operator": true,
"function-comma-newline-after": "always-multi-line",
"function-comma-space-after": "always-single-line",
"function-comma-space-before": "never",
"function-linear-gradient-no-nonstandard-direction": true,
"function-max-empty-lines": 0,
"function-name-case": "lower",
"function-parentheses-newline-inside": "always-multi-line",
"function-parentheses-space-inside": "never-single-line",
"function-url-scheme-blacklist": ["data"],
"function-whitespace-after": "always",
"indentation": 4,
"keyframe-declaration-no-important": true,
"length-zero-no-unit": [true, { "severity": "warning" }],
"max-empty-lines": 2,
"max-line-length": [132, { "severity": "warning" }],
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-parentheses-space-inside": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "always",
"media-query-list-comma-newline-after": "always-multi-line",
"media-query-list-comma-space-after": "always-single-line",
"media-query-list-comma-space-before": "never",
"no-empty-source": true,
"no-eol-whitespace": true,
"no-extra-semicolons": [true, { "severity": "warning" }],
"no-invalid-double-slash-comments": true,
"no-unknown-animations": true,
"property-case": "lower",
"property-no-unknown": true,
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-list-comma-newline-after": "always",
"selector-list-comma-space-before": "never",
"selector-max-empty-lines": 0,
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-class-parentheses-space-inside": "never",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-no-unknown": true,
"selector-type-case": "lower",
"selector-type-no-unknown": true,
"string-no-newline": true,
"time-min-milliseconds": 100,
"unit-blacklist": ["pt"],
"unit-case": "lower",
"unit-no-unknown": true,
"value-keyword-case": ["lower", {"ignoreKeywords": ["/(@|$)/"]}],
"value-list-comma-newline-after": "always-multi-line",
"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
}
}
+57 -102
View File
@@ -2,97 +2,77 @@
# process (which uses our internal CI system) this file is here for the benefit
# of community developers git clones - see MDL-51458.
sudo: false
# We currently disable Travis notifications entirely until https://github.com/travis-ci/travis-ci/issues/4976
# is fixed.
notifications:
email:
if: env(MOODLE_EMAIL) != no
email: false
language: php
os: linux
php:
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
- 7.0
# - 5.6
# - 5.5
- 5.4
dist: bionic
env:
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
# start first so that the total run time is not too high.
#
# We only run MySQL on PHP 5.6, so run that first.
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
# Postgres is significantly is pretty reasonable in its run-time.
services:
- mysql
- docker
# Run unit tests on MySQL
- DB=mysqli TASK=PHPUNIT
addons:
postgresql: "9.6"
# Run CI Tests without running PHPUnit.
- DB=none TASK=CITEST
branches:
except:
- master
- /MOODLE_[0-9]+_STABLE/
- /^v[0-9]+\.[0-9]+\.[0-9]+.*/
# Run unit tests on Postgres
- DB=pgsql TASK=PHPUNIT
jobs:
matrix:
# Enable fast finish.
# This will fail the build if a single job fails (except those in allow_failures).
# It will not stop the jobs from running.
fast_finish: true
include:
# First all the lowest php ones (7.3)
- php: 7.3
env: DB=none TASK=CITEST
- php: 7.3
env: DB=none TASK=GRUNT NVM_VERSION='lts/gallium'
# Run grunt/npm install on lowest supported npm version
- php: 7
env: DB=none TASK=GRUNT NVM_VERSION='0.10'
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
- php: 7
env: DB=none TASK=GRUNT NVM_VERSION='node'
- if: env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present
php: 7.3
env: DB=pgsql TASK=PHPUNIT
exclude:
# MySQL - it's just too slow.
# Exclude it on all versions except for 7.0
# - env: DB=mysqli TASK=PHPUNIT
# php: 5.6
#
# - env: DB=mysqli TASK=PHPUNIT
# php: 5.5
- if: env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all"
php: 7.3
env: DB=mysqli TASK=PHPUNIT
- env: DB=mysqli TASK=PHPUNIT
php: 5.4
# Then, conditionally, all the highest php ones (8.0)
- if: env(MOODLE_PHP) = "all"
php: 8.0
env: DB=none TASK=CITEST
- if: env(MOODLE_PHP) = "all"
php: 8.0
env: DB=none TASK=GRUNT NVM_VERSION='lts/gallium'
- if: env(MOODLE_PHP) = "all" AND (env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present)
php: 8.0
env: DB=pgsql TASK=PHPUNIT
- if: env(MOODLE_PHP) = "all" AND (env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all")
php: 8.0
env: DB=mysqli TASK=PHPUNIT
- env: DB=none TASK=GRUNT
php: 5.4
cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm
before_install:
- docker run -d -p 127.0.0.1:8080:80 --name exttests moodlehq/moodle-exttests
# Avoid IPv6 default binding as service (causes redis not to start).
- sudo service redis-server start --bind 127.0.0.1
install:
- >
if [ "$DB" = 'mysqli' ];
then
sudo mkdir /mnt/ramdisk
sudo mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk
sudo service mysql stop
sudo mv /var/lib/mysql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/mysql /var/lib/mysql
sudo service mysql restart
fi
- >
if [ "$DB" = 'pgsql' ];
then
sudo mkdir /mnt/ramdisk
sudo mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk
sudo service postgresql stop
sudo mv /var/lib/postgresql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/postgresql /var/lib/postgresql
sudo service postgresql start 9.6
fi
# Disable xdebug. We aren't generating code coverage, and it has a huge impact upon test performance.
- rm /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
- >
if [ "$TASK" = 'PHPUNIT' ];
then
@@ -101,9 +81,6 @@ install:
echo 'auth.json' >> .git/info/exclude
fi
echo 'extension="redis.so"' > /tmp/redis.ini
phpenv config-add /tmp/redis.ini
# Install composer dependencies.
# We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
# Typically it should be able to use the Composer cache if any other job has already completed before we started here.
@@ -118,9 +95,6 @@ install:
fi
before_script:
- if [[ ${TRAVIS_PHP_VERSION:0:1} -gt 7 ]]; then pecl install xmlrpc-beta; fi
- echo 'max_input_vars=5000' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- phpenv config-rm xdebug.ini
- >
if [ "$TASK" = 'PHPUNIT' ];
then
@@ -138,7 +112,7 @@ before_script:
# The wwwroot and dataroot.
sed -i \
-e "s%http://example.com/moodle%https://localhost%" \
-e "s%http://example.com/moodle%http://localhost%" \
-e "s%/home/example/moodledata%/home/travis/roots/base%" \
config.php ;
@@ -158,13 +132,11 @@ before_script:
sed -i \
-e "s%= 'pgsql'%= 'mysqli'%" \
-e "s%= 'username'%= 'travis'%" \
-e "s%=> 'utf8mb4_unicode_ci'%=> 'utf8mb4_bin'%" \
config.php;
mysql -u root -e 'SET GLOBAL innodb_file_format=barracuda;' ;
mysql -u root -e 'SET GLOBAL innodb_file_per_table=ON;' ;
mysql -u root -e 'SET GLOBAL innodb_large_prefix=ON;' ;
mysql -e 'CREATE DATABASE travis_ci_test DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_bin;' ;
mysql -e 'CREATE DATABASE travis_ci_test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;' ;
fi
fi
@@ -179,20 +151,6 @@ before_script:
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
config.php ;
# Enable test external resources
sed -i \
-e "/require_once/i \\define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://127.0.0.1:8080');" \
-e "/require_once/i \\define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://127.0.0.1:8080');" \
config.php ;
# Redis cache store tests
sed -i \
-e "/require_once/i \\define('TEST_CACHESTORE_REDIS_TESTSERVERS', '127.0.0.1');" \
config.php ;
# Redis session tests
sed -i \
-e "/require_once/i \\define('TEST_SESSION_REDIS_HOST', '127.0.0.1');" \
config.php ;
# Initialise PHPUnit for Moodle.
php admin/tool/phpunit/cli/init.php
@@ -221,7 +179,7 @@ before_script:
# We need the official upstream for comparison
git remote add upstream https://github.com/moodle/moodle.git;
git fetch upstream MOODLE_311_STABLE;
git fetch upstream MOODLE_30_STABLE;
export GIT_PREVIOUS_COMMIT="`git merge-base FETCH_HEAD $TRAVIS_COMMIT`";
export GIT_COMMIT="$TRAVIS_COMMIT";
export UPSTREAM_FETCH_HEAD=`git rev-parse FETCH_HEAD`
@@ -232,11 +190,18 @@ before_script:
export phpcmd=`which php`;
fi
# Actually run the CI Tests - do this outside of the main test to make output clearer.
- >
if [ "$TASK" = 'CITEST' ];
then
bash local/ci/php_lint/php_lint.sh;
fi
script:
- >
if [ "$TASK" = 'PHPUNIT' ];
then
vendor/bin/phpunit --fail-on-risky --disallow-test-output --verbose;
vendor/bin/phpunit;
fi
- >
@@ -251,16 +216,6 @@ script:
grunt ;
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
git add . ;
git reset -- npm-shrinkwrap.json ;
git diff --cached --exit-code ;
fi
after_script:
- >
if [ "$TASK" = 'PHPUNIT' ];
then
EXTTESTS_HITS=$(docker logs exttests 2>&1 | grep -Fv -e 'AH00558' -e '[pid 1]' | wc -l)
echo -e "\nTest local resources number of hits: ${EXTTESTS_HITS}.\n"
fi
-56
View File
@@ -1,56 +0,0 @@
CONTRIBUTING TO MOODLE
======================
Moodle is made by people like you. We are members of a big worldwide community
of developers, designers, teachers, testers, translators and other users. We
work in universities, schools, companies and other places. You are very welcome
to join us and contribute to the project.
See <https://docs.moodle.org/dev/Contributing_to_Moodle> for the many ways you
can help, not only with coding.
Moodle is open to community contributions to core, though all code must go
through peer-review, automated behaviour testing, continuous integration and
human post-integration checks.
Pull requests
-------------
Please do not open pull requests via Github. The repository there is just a
mirror of the official repository at <https://git.moodle.org>. Issues are
reported and patches provided via <https://tracker.moodle.org>. See below for
more information.
Moodle core bug fixes and new features
--------------------------------------
During the years of intensive development, a mature process of including
submitted patches has evolved.
* Every bug fix or new feature must have a tracker issue.
* You publish the branch implementing the fix or new feature in your public
clone of the moodle.git repository (typically on Github).
* Your patch is peer-reviewed, discussed, integrated, tested and then released
as a part of moodle.git.
* New features are developed on the master branch. Bug fixes are also
backported to currently supported maintenance (stable) branches.
For further details, see <https://docs.moodle.org/dev/Process>.
Moodle plugins
--------------
Moodle has a framework for additional plugins to extend its functionality. We
have a Moodle plugins directory <https://moodle.org/plugins/> where you can
register and maintain your plugin. Plugins hosted in the plugins directory can
be easily installed and updated via the Moodle administration interface.
* You are expected to have a public source code repository with your plugin
code.
* After registering your plugin in the plugins directory it is reviewed before
being published.
* You are expected to continuously release updated versions of the plugin via
the plugins directory. We do not pull from your code repository; you must do
it explicitly.
For further details, see <https://docs.moodle.org/dev/Plugin_contribution>.
+216 -223
View File
@@ -13,249 +13,242 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* Grunt configuration for Moodle.
*
* @copyright 2014 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Setup the Grunt Moodle environment.
*
* @param {Grunt} grunt
* @returns {Object}
* Grunt configuration
*/
const setupMoodleEnvironment = grunt => {
const fs = require('fs');
const path = require('path');
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
const getAmdConfiguration = () => {
// If the cwd is the amd directory in the current component then it will be empty.
// If the cwd is a child of the component's AMD directory, the relative directory will not start with ..
let inAMD = !path.relative(`${componentDirectory}/amd`, cwd).startsWith('..');
// Globbing pattern for matching all AMD JS source files.
let amdSrc = [];
if (inComponent) {
amdSrc.push(
componentDirectory + "/amd/src/*.js",
componentDirectory + "/amd/src/**/*.js"
);
} else {
amdSrc = ComponentList.getAmdSrcGlobList();
}
return {
inAMD,
amdSrc,
};
};
const getYuiConfiguration = () => {
let yuiSrc = [];
if (inComponent) {
yuiSrc.push(componentDirectory + "/yui/src/**/*.js");
} else {
yuiSrc = ComponentList.getYuiSrcGlobList(gruntFilePath + '/');
}
return {
yuiSrc,
};
};
const getStyleConfiguration = () => {
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
// Build the cssSrc and scssSrc.
// Valid paths are:
// [component]/styles.css; and either
// [theme/[themename]]/scss/**/*.scss; or
// [theme/[themename]]/style/*.css.
//
// If a theme has scss, then it is assumed that the style directory contains generated content.
let cssSrc = [];
let scssSrc = [];
const checkComponentDirectory = componentDirectory => {
const isTheme = componentDirectory.startsWith('theme/');
if (isTheme) {
const scssDirectory = `${componentDirectory}/scss`;
if (fs.existsSync(scssDirectory)) {
// This theme has an SCSS directory.
// Include all scss files within it recursively, but do not check for css files.
scssSrc.push(`${scssDirectory}/*.scss`);
scssSrc.push(`${scssDirectory}/**/*.scss`);
} else {
// This theme has no SCSS directory.
// Only hte CSS files in the top-level directory are checked.
cssSrc.push(`${componentDirectory}/style/*.css`);
}
} else {
// This is not a theme.
// All other plugin types are restricted to a single styles.css in their top level.
cssSrc.push(`${componentDirectory}/styles.css`);
}
};
if (inComponent) {
checkComponentDirectory(componentDirectory);
} else {
ComponentList.getComponentPaths(`${gruntFilePath}/`).forEach(componentPath => {
checkComponentDirectory(componentPath);
});
}
return {
cssSrc,
scssSrc,
};
};
/**
* Calculate the cwd, taking into consideration the `root` option (for Windows).
*
* @param {Object} grunt
* @returns {String} The current directory as best we can determine
*/
const getCwd = grunt => {
let cwd = fs.realpathSync(process.env.PWD || process.cwd());
// Windows users can't run grunt in a subdirectory, so allow them to set
// the root by passing --root=path/to/dir.
if (grunt.option('root')) {
const root = grunt.option('root');
if (grunt.file.exists(__dirname, root)) {
cwd = fs.realpathSync(path.join(__dirname, root));
grunt.log.ok('Setting root to ' + cwd);
} else {
grunt.fail.fatal('Setting root to ' + root + ' failed - path does not exist');
}
}
return cwd;
};
// Detect directories:
// * gruntFilePath The real path on disk to this Gruntfile.js
// * cwd The current working directory, which can be overridden by the `root` option
// * relativeCwd The cwd, relative to the Gruntfile.js
// * componentDirectory The root directory of the component if the cwd is in a valid component
// * inComponent Whether the cwd is in a valid component
// * runDir The componentDirectory or cwd if not in a component, relative to Gruntfile.js
// * fullRunDir The full path to the runDir
const gruntFilePath = fs.realpathSync(process.cwd());
const cwd = getCwd(grunt);
const relativeCwd = path.relative(gruntFilePath, cwd);
const componentDirectory = ComponentList.getOwningComponentDirectory(relativeCwd);
const inComponent = !!componentDirectory;
const inTheme = !!componentDirectory && componentDirectory.startsWith('theme/');
const runDir = inComponent ? componentDirectory : relativeCwd;
const fullRunDir = fs.realpathSync(gruntFilePath + path.sep + runDir);
const {inAMD, amdSrc} = getAmdConfiguration();
const {yuiSrc} = getYuiConfiguration();
const {cssSrc, scssSrc} = getStyleConfiguration();
let files = null;
if (grunt.option('files')) {
// Accept a comma separated list of files to process.
files = grunt.option('files').split(',');
}
grunt.log.debug('============================================================================');
grunt.log.debug(`= Node version: ${process.versions.node}`);
grunt.log.debug(`= grunt version: ${grunt.package.version}`);
grunt.log.debug(`= process.cwd: '` + process.cwd() + `'`);
grunt.log.debug(`= process.env.PWD: '${process.env.PWD}'`);
grunt.log.debug(`= path.sep '${path.sep}'`);
grunt.log.debug('============================================================================');
grunt.log.debug(`= gruntFilePath: '${gruntFilePath}'`);
grunt.log.debug(`= relativeCwd: '${relativeCwd}'`);
grunt.log.debug(`= componentDirectory: '${componentDirectory}'`);
grunt.log.debug(`= inComponent: '${inComponent}'`);
grunt.log.debug(`= runDir: '${runDir}'`);
grunt.log.debug(`= fullRunDir: '${fullRunDir}'`);
grunt.log.debug('============================================================================');
if (inComponent) {
grunt.log.ok(`Running tasks for component directory ${componentDirectory}`);
}
return {
amdSrc,
componentDirectory,
cwd,
cssSrc,
files,
fullRunDir,
gruntFilePath,
inAMD,
inComponent,
inTheme,
relativeCwd,
runDir,
scssSrc,
yuiSrc,
};
};
/**
* Verify tha tthe current NodeJS version matches the required version in package.json.
*
* @param {Grunt} grunt
*/
const verifyNodeVersion = grunt => {
const semver = require('semver');
// Verify the node version is new enough.
var expected = semver.validRange(grunt.file.readJSON('package.json').engines.node);
var actual = semver.valid(process.version);
if (!semver.satisfies(actual, expected)) {
grunt.fail.fatal('Node version not satisfied. Require ' + expected + ', version installed: ' + actual);
}
};
/**
* Grunt configuration.
*
* @param {Grunt} grunt
*/
module.exports = function(grunt) {
// Verify that the Node version meets our requirements.
verifyNodeVersion(grunt);
var path = require('path'),
tasks = {},
cwd = process.env.PWD || process.cwd();
// Setup the Moodle environemnt within the Grunt object.
grunt.moodleEnv = setupMoodleEnvironment(grunt);
// Windows users can't run grunt in a subdirectory, so allow them to set
// the root by passing --root=path/to/dir.
if (grunt.option('root')) {
var root = grunt.option('root');
if (grunt.file.exists(__dirname, root)) {
cwd = path.join(__dirname, root);
grunt.log.ok('Setting root to '+cwd);
} else {
grunt.fail.fatal('Setting root to '+root+' failed - path does not exist');
}
}
var inAMD = path.basename(cwd) == 'amd';
// Globbing pattern for matching all AMD JS source files.
var amdSrc = [inAMD ? cwd + '/src/*.js' : '**/amd/src/*.js'];
/**
* Add the named task.
* Function to generate the destination for the uglify task
* (e.g. build/file.min.js). This function will be passed to
* the rename property of files array when building dynamically:
* http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
*
* @param {string} name
* @param {Grunt} grunt
* @param {String} destPath the current destination
* @param {String} srcPath the matched src path
* @return {String} The rewritten destination path.
*/
const addTask = (name, grunt) => {
const path = require('path');
const taskPath = path.resolve(`./.grunt/tasks/${name}.js`);
grunt.log.debug(`Including tasks for ${name} from ${taskPath}`);
require(path.resolve(`./.grunt/tasks/${name}.js`))(grunt);
var uglify_rename = function (destPath, srcPath) {
destPath = srcPath.replace('src', 'build');
destPath = destPath.replace('.js', '.min.js');
destPath = path.resolve(cwd, destPath);
return destPath;
};
// Project configuration.
grunt.initConfig({
jshint: {
options: {jshintrc: '.jshintrc'},
amd: { src: amdSrc }
},
uglify: {
amd: {
files: [{
expand: true,
src: amdSrc,
rename: uglify_rename
}]
}
},
less: {
bootstrapbase: {
files: {
"theme/bootstrapbase/style/moodle.css": "theme/bootstrapbase/less/moodle.less",
"theme/bootstrapbase/style/editor.css": "theme/bootstrapbase/less/editor.less",
},
options: {
compress: true
}
}
},
watch: {
options: {
nospawn: true // We need not to spawn so config can be changed dynamically.
},
amd: {
files: ['**/amd/src/**/*.js'],
tasks: ['amd']
},
bootstrapbase: {
files: ["theme/bootstrapbase/less/**/*.less"],
tasks: ["less:bootstrapbase"]
},
yui: {
files: ['**/yui/src/**/*.js'],
tasks: ['shifter']
},
},
shifter: {
options: {
recursive: true,
paths: [cwd]
}
}
});
// Add Moodle task configuration.
addTask('gherkinlint', grunt);
addTask('ignorefiles', grunt);
/**
* Shifter task. Is configured with a path to a specific file or a directory,
* in the case of a specific file it will work out the right module to be built.
*
* Note that this task runs the invidiaul shifter jobs async (becase it spawns
* so be careful to to call done().
*/
tasks.shifter = function() {
var async = require('async'),
done = this.async(),
options = grunt.config('shifter.options');
addTask('javascript', grunt);
addTask('style', grunt);
// Run the shifter processes one at a time to avoid confusing output.
async.eachSeries(options.paths, function (src, filedone) {
var args = [];
args.push( path.normalize(__dirname + '/node_modules/shifter/bin/shifter'));
addTask('watch', grunt);
addTask('startup', grunt);
// Always ignore the node_modules directory.
args.push('--excludes', 'node_modules');
// Determine the most appropriate options to run with based upon the current location.
if (grunt.file.isMatch('**/yui/**/*.js', src)) {
// When passed a JS file, build our containing module (this happen with
// watch).
grunt.log.debug('Shifter passed a specific JS file');
src = path.dirname(path.dirname(src));
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src', src)) {
// When in a src directory --walk all modules.
grunt.log.debug('In a src directory');
args.push('--walk');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*', src)) {
// When in module, only build our module.
grunt.log.debug('In a module directory');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*/js', src)) {
// When in module src, only build our module.
grunt.log.debug('In a source directory');
src = path.dirname(src);
options.recursive = false;
}
if (grunt.option('watch')) {
grunt.fail.fatal('The --watch option has been removed, please use `grunt watch` instead');
}
// Add the stderr option if appropriate
if (grunt.option('verbose')) {
args.push('--lint-stderr');
}
if (grunt.option('no-color')) {
args.push('--color=false');
}
var execShifter = function() {
grunt.log.ok("Running shifter on " + src);
grunt.util.spawn({
cmd: "node",
args: args,
opts: {cwd: src, stdio: 'inherit', env: process.env}
}, function (error, result, code) {
if (code) {
grunt.fail.fatal('Shifter failed with code: ' + code);
} else {
grunt.log.ok('Shifter build complete.');
filedone();
}
});
};
// Actually run shifter.
if (!options.recursive) {
execShifter();
} else {
// Check that there are yui modules otherwise shifter ends with exit code 1.
if (grunt.file.expand({cwd: src}, '**/yui/src/**/*.js').length > 0) {
args.push('--recursive');
execShifter();
} else {
grunt.log.ok('No YUI modules to build.');
filedone();
}
}
}, done);
};
tasks.startup = function() {
// Are we in a YUI directory?
if (path.basename(path.resolve(cwd, '../../')) == 'yui') {
grunt.task.run('shifter');
// Are we in an AMD directory?
} else if (inAMD) {
grunt.task.run('amd');
} else {
// Run them all!.
grunt.task.run('css');
grunt.task.run('js');
}
};
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
var changedFiles = Object.create(null);
var onChange = grunt.util._.debounce(function() {
var files = Object.keys(changedFiles);
grunt.config('jshint.amd.src', files);
grunt.config('uglify.amd.files', [{ expand: true, src: files, rename: uglify_rename }]);
grunt.config('shifter.options.paths', files);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', function(action, filepath) {
changedFiles[filepath] = action;
onChange();
});
// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
// Register JS tasks.
grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
grunt.registerTask('amd', ['jshint', 'uglify']);
grunt.registerTask('js', ['amd', 'shifter']);
// Register CSS taks.
grunt.registerTask('css', ['less:bootstrapbase']);
// Register the startup task.
grunt.registerTask('startup', 'Run the correct tasks for the current directory', tasks.startup);
// Register the default task.
grunt.registerTask('default', ['startup']);
-20
View File
@@ -1,20 +0,0 @@
MOODLE INSTALLATION
===================
Here is a short summary of the installation process (which can take just a few
minutes):
1. Move the Moodle files into your web directory.
2. Create a single database for Moodle to store all its tables in (or choose an
existing database).
3. Visit your Moodle site with a browser. You should be taken to the
install.php script, which will lead you through creating a config.php file
and then setting up Moodle, creating an admin account etc.
4. Set up a cron task to call the file admin/cron.php every minute.
For more information, see <https://docs.moodle.org/en/Installing_Moodle>.
Good luck and have fun!
-7
View File
@@ -1,7 +0,0 @@
*** PLEASE DO NOT OPEN PULL REQUESTS VIA GITHUB ***
The moodle.git repository at Github is just a mirror of the official repository. We do not accept pull requests at Github.
See CONTRIBUTING.txt guidelines for how to contribute patches for Moodle. Thank you.
--
+22 -21
View File
@@ -1,28 +1,29 @@
.-..-.
_____ | || |
/____/-.---_ .---. .---. .-.| || | .---.
| | _ _ |/ _ \/ _ \/ _ || |/ __ \
* | | | | | || |_| || |_| || |_| || || |___/
|_| |_| |_|\_____/\_____/\_____||_|\_____)
QUICK INSTALL
=============
Moodle - the world's open source learning platform
For the impatient, here is a basic outline of the
installation process, which normally takes me only
a few minutes:
Moodle <https://moodle.org> is a learning platform designed to provide
educators, administrators and learners with a single robust, secure and
integrated system to create personalised learning environments.
1) Move the Moodle files into your web directory.
You can download Moodle <https://download.moodle.org> and run it on your own
web server, ask one of our Moodle Partners <https://moodle.com/partners/> to
assist you, or have a MoodleCloud site <https://moodle.com/cloud/> set up for
you.
2) Create a single database for Moodle to store all
its tables in (or choose an existing database).
Moodle is widely used around the world by universities, schools, companies and
all manner of organisations and individuals.
3) Visit your Moodle site with a browser, you should
be taken to the install.php script, which will lead
you through creating a config.php file and then
setting up Moodle, creating an admin account etc.
Moodle is provided freely as open source software, under the GNU General Public
License <https://docs.moodle.org/dev/License>.
4) Set up a cron task to call the file admin/cron.php
every five minutes or so.
Moodle is written in PHP and JavaScript and uses an SQL database for storing
the data.
See <https://docs.moodle.org> for details of Moodle's many features.
For more information, see the INSTALL DOCUMENTATION:
http://docs.moodle.org/en/Installing_Moodle
Good luck and have fun!
Martin Dougiamas, Lead Developer
+28 -42
View File
@@ -1,48 +1,34 @@
MOODLE TRADEMARKS POLICY
========================
------------------------
Moodle Trademark License
------------------------
The word "Moodle" is trademarked in many countries around the world. The word
was originally coined as an acronym: Modular Object-Oriented Dynamic Learning
Environment. The trademark is owned by Martin Dougiamas, Founder and Director
of Moodle.
The name Moodle is a registered trademark of the Moodle Trust.
The law obligates trademark owners to police their marks and prevent the use of
confusingly similar names by third parties. Through this policy wed like to
make it clear how Moodle-related projects, organisations, and people can use
the Moodle trademark. Wed also like to be clear about how use of the word is
restricted when used to promote commercial Moodle services. We do this to
protect the very business model that allows us to continue developing Moodle
for you.
A key part of the business model that allows us to produce and
distribute Moodle as completely Free open source software is that
we restrict the commercial use of the Moodle trademark to those
who have contracted to support Moodle development (Moodle Partners).
Allowed uses
------------
If you are intending to use the name (and/or logo) to advertise
generic Moodle™ services (eg Moodle Hosting, Moodle Support,
Moodle Certification, Moodle Training, Moodle Consulting,
Moodle Customisation, Moodle Courseware Development, Moodle
Theme design, Moodle Integrations, Moodle Installations, etc)
or as the name of a software package, then you must seek
direct permission in writing from the Moodle Trust via the
moodle.com helpdesk, in accordance with normal trademark
restrictions.
The following uses dont require any permission at all:
There are no restrictions on how you use the name in other
contexts (for example, if you use Moodle just to provide
courses then you can use the name freely to refer to it.)
* Referring to the software or the Moodle project.
* Describing your own Moodle implementation (including within corporate
settings).
* Describing a Moodle-based community hub.
* Describing some software youve made that integrates with Moodle
(eg a Moodle integration feature on another system).
If you aren't sure of a particular case, please ask us via
http://moodle.com/helpdesk: we'll be happy to either provide
you with official permission in writing or help you fix
your wording.
Restricted uses
---------------
The following uses are generally prohibited without explicit and direct
permission being granted to you by Moodle Pty Ltd. We do this to protect the
Moodle project from software and sites which could confuse people. Please
contact us to ask for permission in writing.
* You cant use "Moodle" in the name of your software (including Mobile apps)
* You cant use "Moodle" in your company name
* You cant use "Moodle" in your domain name
* You cant use "Moodle" in advertising-related keywords (such as Adsense)
* You cant use "Moodle" to describe services around Moodle (such as hosting,
training, support, consulting, course creation services, theme development,
customisation, installation, integration and certification). This applies
even if you do not charge for the services. Note that usually only Moodle
Partners have this permission.
For information about the Moodle Partner Certification Mark as well as for how
to contact us, please see <https://moodle.com/trademarks/>.
Martin Dougiamas
Executive Director
Moodle Trust
http://moodle.com
-107
View File
@@ -1,107 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Allows admin to configure antiviruses.
*
* @package core_antivirus
* @copyright 2015 Ruslan Kabalin, Lancaster University.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$antivirus = required_param('antivirus', PARAM_PLUGIN);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$PAGE->set_url('/admin/antiviruses.php', array('action' => $action, 'antivirus' => $antivirus));
$PAGE->set_context(context_system::instance());
require_admin();
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageantiviruses";
// Get currently installed and enabled antivirus plugins.
$availableantiviruses = \core\antivirus\manager::get_available();
if (!empty($antivirus) and empty($availableantiviruses[$antivirus])) {
redirect ($returnurl);
}
$activeantiviruses = explode(',', $CFG->antiviruses);
foreach ($activeantiviruses as $key => $active) {
if (empty($availableantiviruses[$active])) {
unset($activeantiviruses[$key]);
}
}
if (!confirm_sesskey()) {
redirect($returnurl);
}
switch ($action) {
case 'disable':
// Remove from enabled list.
$key = array_search($antivirus, $activeantiviruses);
unset($activeantiviruses[$key]);
break;
case 'enable':
// Add to enabled list.
if (!in_array($antivirus, $activeantiviruses)) {
$activeantiviruses[] = $antivirus;
$activeantiviruses = array_unique($activeantiviruses);
}
break;
case 'down':
$key = array_search($antivirus, $activeantiviruses);
// Check auth plugin is valid.
if ($key !== false) {
// Move down the list.
if ($key < (count($activeantiviruses) - 1)) {
$fsave = $activeantiviruses[$key];
$activeantiviruses[$key] = $activeantiviruses[$key + 1];
$activeantiviruses[$key + 1] = $fsave;
}
}
break;
case 'up':
$key = array_search($antivirus, $activeantiviruses);
// Check auth is valid.
if ($key !== false) {
// Move up the list.
if ($key >= 1) {
$fsave = $activeantiviruses[$key];
$activeantiviruses[$key] = $activeantiviruses[$key - 1];
$activeantiviruses[$key - 1] = $fsave;
}
}
break;
default:
break;
}
$new = implode(',', $activeantiviruses);
add_to_config_log('antiviruses', $CFG->antiviruses, $new, 'core');
set_config('antiviruses', $new);
core_plugin_manager::reset_caches();
redirect ($returnurl);
+6 -14
View File
@@ -11,7 +11,8 @@ require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_admin();
require_login();
require_capability('moodle/site:config', context_system::instance());
$returnurl = new moodle_url('/admin/settings.php', array('section'=>'manageauths'));
@@ -44,9 +45,7 @@ switch ($action) {
$key = array_search($auth, $authsenabled);
if ($key !== false) {
unset($authsenabled[$key]);
$value = implode(',', $authsenabled);
add_to_config_log('auth', $CFG->auth, $value, 'core');
set_config('auth', $value);
set_config('auth', implode(',', $authsenabled));
}
if ($auth == $CFG->registerauth) {
@@ -61,11 +60,8 @@ switch ($action) {
if (!in_array($auth, $authsenabled)) {
$authsenabled[] = $auth;
$authsenabled = array_unique($authsenabled);
$value = implode(',', $authsenabled);
add_to_config_log('auth', $CFG->auth, $value, 'core');
set_config('auth', $value);
set_config('auth', implode(',', $authsenabled));
}
\core\session\manager::gc(); // Remove stale sessions.
core_plugin_manager::reset_caches();
break;
@@ -81,9 +77,7 @@ switch ($action) {
$fsave = $authsenabled[$key];
$authsenabled[$key] = $authsenabled[$key + 1];
$authsenabled[$key + 1] = $fsave;
$value = implode(',', $authsenabled);
add_to_config_log('auth', $CFG->auth, $value, 'core');
set_config('auth', $value);
set_config('auth', implode(',', $authsenabled));
}
break;
@@ -98,9 +92,7 @@ switch ($action) {
$fsave = $authsenabled[$key];
$authsenabled[$key] = $authsenabled[$key - 1];
$authsenabled[$key - 1] = $fsave;
$value = implode(',', $authsenabled);
add_to_config_log('auth', $CFG->auth, $value, 'core');
set_config('auth', $value);
set_config('auth', implode(',', $authsenabled));
}
break;
+8 -29
View File
@@ -16,9 +16,6 @@ $err = array();
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageauths";
debugging("Use of config.html files in authentication plugins have been deprecated. " .
" Please migrate your plugin to use the admin settings API", DEBUG_DEVELOPER);
// save configuration changes
if ($frm = data_submitted() and confirm_sesskey()) {
@@ -67,6 +64,8 @@ echo "<form id=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
echo "<div>\n";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />\n";
echo "<input type=\"hidden\" name=\"auth\" value=\"".$auth."\" />\n";
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
// auth plugin description
echo $OUTPUT->box_start();
@@ -89,28 +88,12 @@ exit;
/// Functions /////////////////////////////////////////////////////////////////
/**
* auth field locking
* Good enough for most auth plugins
* but some may want a custom one if they are offering
* other options
* Note: lockconfig_ fields have special handling.
*
* @param string $auth authentication plugin shortname
* @param array $user_fields user profile fields
* @param string $helptext help text to be displayed at top of form
* @param boolean $retrieveopts Map fields or lock only.
* @param boolean $updateopts Allow remote updates
* @param array $customfields list of custom profile fields
* @deprecated since Moodle 3.3
*/
// Good enough for most auth plugins
// but some may want a custom one if they are offering
// other options
// Note: lockconfig_ fields have special handling.
function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts, $updateopts, $customfields = array()) {
global $DB, $OUTPUT;
debugging("The function 'print_auth_lock_options' has been deprecated, " .
"Please migrate your code to use the admin settings API and use the function 'display_auth_lock_options' instead. ",
DEBUG_DEVELOPER);
echo '<tr><td colspan="3">';
if ($retrieveopts) {
echo $OUTPUT->heading(get_string('auth_data_mapping', 'auth'));
@@ -165,12 +148,8 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
// If custom field then pick name from database.
$fieldshortname = str_replace('profile_field_', '', $fieldname);
$fieldname = $customfieldname[$fieldshortname]->name;
if (core_text::strlen($fieldshortname) > 67) {
// If custom profile field name is longer than 67 characters we will not be able to store the setting
// such as 'field_updateremote_profile_field_NOTSOSHORTSHORTNAME' in the database because the character
// limit for the setting name is 100.
continue;
}
} elseif ($fieldname == 'url') {
$fieldname = get_string('webpage');
} else {
$fieldname = get_string($fieldname);
}
+26 -11
View File
@@ -4,7 +4,6 @@
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->libdir.'/tablelib.php');
admin_externalpage_setup('manageblocks');
@@ -37,7 +36,6 @@
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '0', array('id'=>$block->id)); // Hide block
add_to_config_log('block_visibility', $block->visible, '0', $block->name);
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
@@ -47,23 +45,40 @@
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '1', array('id'=>$block->id)); // Show block
add_to_config_log('block_visibility', $block->visible, '1', $block->name);
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
if (!isset($CFG->undeletableblocktypes) || (!is_array($CFG->undeletableblocktypes) && !is_string($CFG->undeletableblocktypes))) {
$undeletableblocktypes = array('navigation', 'settings');
} else if (is_string($CFG->undeletableblocktypes)) {
$undeletableblocktypes = explode(',', $CFG->undeletableblocktypes);
} else {
$undeletableblocktypes = $CFG->undeletableblocktypes;
}
if (!empty($protect) && confirm_sesskey()) {
block_manager::protect_block((int)$protect);
if (!$block = $DB->get_record('block', array('id'=>$protect))) {
print_error('blockdoesnotexist', 'error');
}
if (!in_array($block->name, $undeletableblocktypes)) {
$undeletableblocktypes[] = $block->name;
set_config('undeletableblocktypes', implode(',', $undeletableblocktypes));
}
admin_get_root(true, false); // settings not required - only pages
}
if (!empty($unprotect) && confirm_sesskey()) {
block_manager::unprotect_block((int)$unprotect);
if (!$block = $DB->get_record('block', array('id'=>$unprotect))) {
print_error('blockdoesnotexist', 'error');
}
if (in_array($block->name, $undeletableblocktypes)) {
$undeletableblocktypes = array_diff($undeletableblocktypes, array($block->name));
set_config('undeletableblocktypes', implode(',', $undeletableblocktypes));
}
admin_get_root(true, false); // settings not required - only pages
}
$undeletableblocktypes = block_manager::get_undeletable_block_types();
echo $OUTPUT->header();
echo $OUTPUT->heading($strmanageblocks);
@@ -168,10 +183,10 @@
$visible = '';
} else if ($blocks[$blockid]->visible) {
$visible = '<a href="blocks.php?hide='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strhide.'">'.
$OUTPUT->pix_icon('t/hide', $strhide) . '</a>';
'<img src="'.$OUTPUT->pix_url('t/hide') . '" class="iconsmall" alt="'.$strhide.'" /></a>';
} else {
$visible = '<a href="blocks.php?show='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strshow.'">'.
$OUTPUT->pix_icon('t/show', $strshow) . '</a>';
'<img src="'.$OUTPUT->pix_url('t/show') . '" class="iconsmall" alt="'.$strshow.'" /></a>';
$class = 'dimmed_text';
}
@@ -186,10 +201,10 @@
$undeletable = '';
} else if (in_array($blockname, $undeletableblocktypes)) {
$undeletable = '<a href="blocks.php?unprotect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strunprotect.'">'.
$OUTPUT->pix_icon('t/unlock', $strunprotect) . '</a>';
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="iconsmall" alt="'.$strunprotect.'" /></a>';
} else {
$undeletable = '<a href="blocks.php?protect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strprotect.'">'.
$OUTPUT->pix_icon('t/lock', $strprotect) . '</a>';
'<img src="'.$OUTPUT->pix_url('t/lock') . '" class="iconsmall" alt="'.$strprotect.'" /></a>';
}
$row = array(
+12 -20
View File
@@ -30,6 +30,7 @@ $category = required_param('category', PARAM_SAFEDIR);
$return = optional_param('return','', PARAM_ALPHA);
$adminediting = optional_param('adminedit', -1, PARAM_BOOL);
/// no guest autologin
require_login(0, false);
$PAGE->set_context(context_system::instance());
$PAGE->set_url('/admin/category.php', array('category' => $category));
@@ -53,16 +54,14 @@ $statusmsg = '';
$errormsg = '';
if ($data = data_submitted() and confirm_sesskey()) {
$count = admin_write_settings($data);
if (admin_write_settings($data)) {
$statusmsg = get_string('changessaved');
}
if (empty($adminroot->errors)) {
// No errors. Did we change any setting? If so, then indicate success.
if ($count) {
$statusmsg = get_string('changessaved');
} else {
switch ($return) {
case 'site': redirect("$CFG->wwwroot/");
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
}
switch ($return) {
case 'site': redirect("$CFG->wwwroot/");
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
}
} else {
$errormsg = get_string('errorwithsettings', 'admin');
@@ -74,7 +73,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
if ($PAGE->user_allowed_editing() && $adminediting != -1) {
$USER->editing = $adminediting;
}
$buttons = null;
if ($PAGE->user_allowed_editing()) {
$url = clone($PAGE->url);
if ($PAGE->user_is_editing()) {
@@ -90,7 +89,7 @@ if ($PAGE->user_allowed_editing()) {
$savebutton = false;
$outputhtml = '';
foreach ($settingspage->children as $childpage) {
if ($childpage->is_hidden() || !$childpage->check_access()) {
if ($childpage->is_hidden()) {
continue;
}
if ($childpage instanceof admin_externalpage) {
@@ -121,16 +120,14 @@ foreach ($settingspage->children as $childpage) {
}
if ($savebutton) {
$outputhtml .= html_writer::start_tag('div', array('class' => 'form-buttons'));
$outputhtml .= html_writer::empty_tag('input', array('class' => 'btn btn-primary form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
$outputhtml .= html_writer::empty_tag('input', array('class' => 'form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
$outputhtml .= html_writer::end_tag('div');
}
$visiblepathtosection = array_reverse($settingspage->visiblepath);
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
$PAGE->set_heading($SITE->fullname);
if ($buttons) {
$PAGE->set_button($buttons);
}
$PAGE->set_button($buttons);
echo $OUTPUT->header();
@@ -158,9 +155,4 @@ echo $outputhtml;
echo html_writer::end_tag('fieldset');
echo html_writer::end_tag('form');
$PAGE->requires->yui_module('moodle-core-formchangechecker', 'M.core_formchangechecker.init', [[
'formid' => 'adminsettings'
]]);
$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
echo $OUTPUT->footer();
-76
View File
@@ -1,76 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Form for selective purging of caches.
*
* @package core
* @copyright 2018 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\form;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/formslib.php');
/**
* Form for selecting which caches to purge on admin/purgecaches.php
*
* @package core
* @copyright 2018 The Open University
* @author Mark Johnson <mark.johnson@open.ac.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class purge_caches extends \moodleform {
/**
* Define a "Purge all caches" button, and a fieldset with checkboxes for selectively purging separate caches.
*/
public function definition() {
$mform = $this->_form;
$mform->addElement('hidden', 'returnurl', $this->_customdata['returnurl']);
$mform->setType('returnurl', PARAM_LOCALURL);
$mform->addElement('submit', 'all', get_string('purgecaches', 'admin'));
$mform->addElement('header', 'purgecacheheader', get_string('purgeselectedcaches', 'admin'));
$checkboxes = [
$mform->createElement('advcheckbox', 'theme', '', get_string('purgethemecache', 'admin')),
$mform->createElement('advcheckbox', 'lang', '', get_string('purgelangcache', 'admin')),
$mform->createElement('advcheckbox', 'js', '', get_string('purgejscache', 'admin')),
$mform->createElement('advcheckbox', 'template', '', get_string('purgetemplates', 'admin')),
$mform->createElement('advcheckbox', 'filter', '', get_string('purgefiltercache', 'admin')),
$mform->createElement('advcheckbox', 'muc', '', get_string('purgemuc', 'admin')),
$mform->createElement('advcheckbox', 'other', '', get_string('purgeothercaches', 'admin'))
];
$mform->addGroup($checkboxes, 'purgeselectedoptions');
$mform->addElement('submit', 'purgeselectedcaches', get_string('purgeselectedcaches', 'admin'));
}
/**
* If the "Purge selected caches" button was pressed, ensure at least one cache was selected.
*
* @param array $data
* @param array $files
* @return array Error messages
*/
public function validation($data, $files) {
$errors = [];
if (isset($data['purgeselectedcaches']) && empty(array_filter($data['purgeselectedoptions']))) {
$errors['purgeselectedoptions'] = get_string('purgecachesnoneselected', 'admin');
}
return $errors;
}
}
@@ -1,59 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Testing outgoing mail configuration form
*
* @package core
* @copyright 2019 Victor Deniz <victor@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\form;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/formslib.php');
/**
* Test mail form
*
* @package core
* @copyright 2019 Victor Deniz <victor@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class testoutgoingmailconf_form extends \moodleform {
/**
* Add elements to form
*/
public function definition() {
$mform = $this->_form;
// Recipient.
$options = ['maxlength' => '100', 'size' => '25', 'autocomplete' => 'email'];
$mform->addElement('text', 'recipient', get_string('testoutgoingmailconf_toemail', 'admin'), $options);
$mform->setType('recipient', PARAM_EMAIL);
$mform->addRule('recipient', get_string('required'), 'required');
$buttonarray = array();
$buttonarray[] = $mform->createElement('submit', 'send', get_string('testoutgoingmailconf_sendtest', 'admin'));
$buttonarray[] = $mform->createElement('cancel');
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
$mform->closeHeaderBefore('buttonar');
}
}
@@ -1,71 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* External admin page class that allows a callback to be provided to determine whether page can be accessed
*
* @package core_admin
* @copyright 2019 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\local\externalpage;
use admin_externalpage;
defined('MOODLE_INTERNAL') || die();
require_once("{$CFG->libdir}/adminlib.php");
/**
* Admin externalpage class
*
* @package core_admin
* @copyright 2019 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class accesscallback extends admin_externalpage {
/** @var callable $accesscheckcallback */
protected $accesscheckcallback;
/**
* Class constructor
*
* @param string $name
* @param string $visiblename
* @param string $url
* @param callable $accesscheckcallback The callback method that will be executed to check whether user has access to
* this page. The setting instance ($this) is passed as an argument to the callback. Should return boolean value
* @param bool $hidden
*/
public function __construct(string $name, string $visiblename, string $url, callable $accesscheckcallback,
bool $hidden = false) {
$this->accesscheckcallback = $accesscheckcallback;
parent::__construct($name, $visiblename, $url, [], $hidden);
}
/**
* Determines if the current user has access to this external page based on access callback
*
* @return bool
*/
public function check_access() {
return ($this->accesscheckcallback)($this);
}
}
@@ -1,206 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Auto complete admin setting.
*
* @package core_admin
* @copyright 2020 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\local\settings;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/adminlib.php');
/**
* Auto complete setting class.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2020 The Open University
*/
class autocomplete extends \admin_setting_configmultiselect {
/** @var boolean Should we allow typing new entries to the field? */
protected $tags = false;
/** @var string Name of an AMD module to send/process ajax requests. */
protected $ajax = '';
/** @var string Placeholder text for an empty list. */
protected $placeholder = '';
/** @var bool Whether the search has to be case-sensitive. */
protected $casesensitive = false;
/** @var bool Show suggestions by default - but this can be turned off. */
protected $showsuggestions = true;
/** @var string String that is shown when there are no selections. */
protected $noselectionstring = '';
/** @var string Delimiter to store values in database. */
protected $delimiter = ',';
/** @var string Should be multiple choices? */
protected $multiple = true;
/** @var string The link to manage choices. */
protected $manageurl = true;
/** @var string The text to display in manage link. */
protected $managetext = true;
/**
* Constructor
*
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting'
* for ones in config_plugins.
* @param string $visiblename localised
* @param string $description long localised info
* @param array $defaultsetting array of selected items
* @param array $choices options for autocomplete field
* @param array $attributes settings for autocomplete field
*/
public function __construct($name, $visiblename, $description, $defaultsetting, $choices, $attributes = null) {
if ($attributes === null) {
$attributes = [];
}
$this->placeholder = get_string('search');
$this->noselectionstring = get_string('noselection', 'form');
$defaultattributes = [
'tags',
'showsuggestions',
'placeholder',
'noselectionstring',
'ajax',
'casesensitive',
'delimiter',
'multiple',
'manageurl',
'managetext'
];
foreach ($defaultattributes as $attributename) {
if (isset($attributes[$attributename])) {
$this->$attributename = $attributes[$attributename];
}
}
parent::__construct($name, $visiblename, $description, $defaultsetting, $choices);
}
/**
* Returns the select setting(s)
*
* @return mixed null or array. Null if no settings else array of setting(s)
*/
public function get_setting() {
$result = $this->config_read($this->name);
if (is_null($result)) {
return null;
}
if ($result === '') {
return [];
}
return explode($this->delimiter, $result);
}
/**
* Saves setting(s) provided through $data
*
* @param array $data
*/
public function write_setting($data) {
if (!is_array($data)) {
return ''; // Ignore it.
}
if (!$this->load_choices() || empty($this->choices)) {
return '';
}
unset($data['xxxxx']);
$save = [];
foreach ($data as $value) {
if (!array_key_exists($value, $this->choices)) {
continue; // Ignore it.
}
$save[] = $value;
}
return ($this->config_write($this->name, implode($this->delimiter, $save)) ? '' : get_string('errorsetting', 'admin'));
}
/**
* Returns XHTML autocomplete field
*
* @param array $data Array of values to select by default
* @param string $query
* @return string XHTML autocomplete field
*/
public function output_html($data, $query = '') {
global $OUTPUT;
if (!$this->load_choices() or empty($this->choices)) {
return '';
}
$default = $this->get_defaultsetting();
if (empty($default)) {
$default = [];
}
if (is_null($data)) {
$data = [];
}
$context = [
'id' => $this->get_id(),
'name' => $this->get_full_name()
];
$defaults = [];
$options = [];
$template = 'core_admin/local/settings/autocomplete';
foreach ($this->choices as $value => $name) {
if (in_array($value, $default)) {
$defaults[] = $name;
}
$options[] = [
'value' => $value,
'text' => $name,
'selected' => in_array($value, $data),
'disabled' => false
];
}
$context['options'] = $options;
$context['tags'] = $this->tags;
$context['placeholder'] = $this->placeholder;
$context['casesensitive'] = $this->casesensitive;
$context['multiple'] = $this->multiple;
$context['showsuggestions'] = $this->showsuggestions;
$context['manageurl'] = $this->manageurl;
$context['managetext'] = $this->managetext;
if (is_null($default)) {
$defaultinfo = null;
} if (!empty($defaults)) {
$defaultinfo = implode(', ', $defaults);
} else {
$defaultinfo = get_string('none');
}
$element = $OUTPUT->render_from_template($template, $context);
return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '', $defaultinfo, $query);
}
}
-197
View File
@@ -1,197 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* File size admin setting.
*
* @package core_admin
* @copyright 2019 Shamim Rezaie <shamim@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\local\settings;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/adminlib.php');
/**
* An admin setting to support entering and displaying of file sizes in Bytes, KB, MB or GB.
*
* @copyright 2019 Shamim Rezaie <shamim@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class filesize extends \admin_setting {
/** @var int The byte unit. Number of bytes in a byte */
const UNIT_B = 1;
/** @var int The kilobyte unit (number of bytes in a kilobyte) */
const UNIT_KB = 1024;
/** @var int The megabyte unit (number of bytes in a megabyte) */
const UNIT_MB = 1048576;
/** @var int The gigabyte unit (number of bytes in a gigabyte) */
const UNIT_GB = 1073741824;
/** @var int default size unit */
protected $defaultunit;
/**
* Constructor
*
* @param string $name unique ascii name, either 'mysetting' for settings that in config,
* or 'myplugin/mysetting' for ones in config_plugins.
* @param string $visiblename localised name
* @param string $description localised long description
* @param int|null $defaultvalue Value of the settings in bytes
* @param int|null $defaultunit GB, MB, etc. (in bytes)
*/
public function __construct(string $name, string $visiblename, string $description,
int $defaultvalue = null, int $defaultunit = null) {
$defaultsetting = self::parse_bytes($defaultvalue);
if ($defaultunit && array_key_exists($defaultunit, self::get_units())) {
$this->defaultunit = $defaultunit;
} else {
$this->defaultunit = self::UNIT_MB;
}
parent::__construct($name, $visiblename, $description, $defaultsetting);
}
/**
* Returns selectable units.
*
* @return array
*/
protected static function get_units(): array {
return [
self::UNIT_GB => get_string('sizegb'),
self::UNIT_MB => get_string('sizemb'),
self::UNIT_KB => get_string('sizekb'),
self::UNIT_B => get_string('sizeb'),
];
}
/**
* Converts bytes to some more user friendly string.
*
* @param int $bytes The number of bytes we want to convert from
* @return string
*/
protected static function get_size_text(int $bytes): string {
if (empty($bytes)) {
return get_string('none');
}
return display_size($bytes);
}
/**
* Finds suitable units for given file size.
*
* @param int $bytes The number of bytes
* @return array Parsed file size in the format of ['v' => value, 'u' => unit]
*/
protected static function parse_bytes(int $bytes): array {
foreach (self::get_units() as $unit => $unused) {
if ($bytes % $unit === 0) {
return ['v' => (int)($bytes / $unit), 'u' => $unit];
}
}
return ['v' => (int)$bytes, 'u' => self::UNIT_B];
}
/**
* Get the selected file size as array.
*
* @return array|null An array containing 'v' => xx, 'u' => xx, or null if not set
*/
public function get_setting(): ?array {
$bytes = $this->config_read($this->name);
if (is_null($bytes)) {
return null;
}
$bytes = intval($bytes);
return self::parse_bytes($bytes);
}
/**
* Store the file size as bytes.
*
* @param array $data Must be form 'h' => xx, 'm' => xx
* @return string The error string if any
*/
public function write_setting($data): string {
if (!is_array($data)) {
return '';
}
if (!is_numeric($data['v']) || $data['v'] < 0) {
return get_string('errorsetting', 'admin');
}
// Calculate size in bytes, ensuring we don't overflow PHP_INT_MAX.
$bytes = $data['v'] * $data['u'];
$result = (is_int($bytes) && $this->config_write($this->name, $bytes));
return ($result ? '' : get_string('errorsetting', 'admin'));
}
/**
* Returns file size text+select fields.
*
* @param array $data The current setting value. Must be form 'v' => xx, 'u' => xx.
* @param string $query Admin search query to be highlighted.
* @return string File size text+select fields and wrapping div(s).
*/
public function output_html($data, $query = ''): string {
global $OUTPUT;
$default = $this->get_defaultsetting();
if (is_number($default)) {
$defaultinfo = self::get_size_text($default);
} else if (is_array($default)) {
$defaultinfo = self::get_size_text($default['v'] * $default['u']);
} else {
$defaultinfo = null;
}
$inputid = $this->get_id() . 'v';
$units = self::get_units();
$defaultunit = $this->defaultunit;
$context = (object) [
'id' => $this->get_id(),
'name' => $this->get_full_name(),
'value' => $data['v'],
'readonly' => $this->is_readonly(),
'options' => array_map(function($unit, $title) use ($data, $defaultunit) {
return [
'value' => $unit,
'name' => $title,
'selected' => ($data['v'] == 0 && $unit == $defaultunit) || $unit == $data['u']
];
}, array_keys($units), $units)
];
$element = $OUTPUT->render_from_template('core_admin/setting_configfilesize', $context);
return format_admin_setting($this, $this->visiblename, $element, $this->description, $inputid, '', $defaultinfo, $query);
}
}
@@ -1,74 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Payment gateway admin setting.
*
* @package core_admin
* @copyright 2020 Shamim Rezaie <shamim@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\local\settings;
/**
* Generic class for managing plugins in a table that allows re-ordering and enable/disable of each plugin.
*/
class manage_payment_gateway_plugins extends \admin_setting_manage_plugins {
/**
* Get the admin settings section title (use get_string).
*
* @return string
*/
public function get_section_title() {
return get_string('type_paygw_plural', 'plugin');
}
/**
* Get the type of plugin to manage.
*
* @return string
*/
public function get_plugin_type() {
return 'paygw';
}
/**
* Get the name of the second column.
*
* @return string
*/
public function get_info_column_name() {
return get_string('supportedcurrencies', 'core_payment');
}
/**
* Get the type of plugin to manage.
*
* @param plugininfo The plugin info class.
* @return string
*/
public function get_info_column($plugininfo) {
$codes = $plugininfo->get_supported_currencies();
$currencies = [];
foreach ($codes as $c) {
$currencies[$c] = new \lang_string($c, 'core_currencies');
}
return implode(get_string('listsep', 'langconfig') . ' ', $currencies);
}
}
-41
View File
@@ -1,41 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for core_admin.
*
* @package core_admin
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for core_admin implementing null_provider.
*
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason() : string {
return 'privacy:metadata';
}
}
-293
View File
@@ -1,293 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Task log table.
*
* @package core_admin
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_admin;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/tablelib.php');
/**
* Table to display list of task logs.
*
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class task_log_table extends \table_sql {
/**
* Constructor for the task_log table.
*
* @param string $filter
* @param int $resultfilter
*/
public function __construct(string $filter = '', int $resultfilter = null) {
global $DB;
if (-1 === $resultfilter) {
$resultfilter = null;
}
parent::__construct('tasklogs');
$columnheaders = [
'classname' => get_string('name'),
'type' => get_string('tasktype', 'admin'),
'userid' => get_string('user', 'admin'),
'timestart' => get_string('task_starttime', 'admin'),
'duration' => get_string('task_duration', 'admin'),
'hostname' => get_string('hostname', 'tool_task'),
'pid' => get_string('pid', 'tool_task'),
'db' => get_string('task_dbstats', 'admin'),
'result' => get_string('task_result', 'admin'),
'actions' => '',
];
$this->define_columns(array_keys($columnheaders));
$this->define_headers(array_values($columnheaders));
// The name column is a header.
$this->define_header_column('classname');
// This table is not collapsible.
$this->collapsible(false);
// The actions class should not wrap. Use the BS text utility class.
$this->column_class('actions', 'text-nowrap');
// Allow pagination.
$this->pageable(true);
// Allow sorting. Default to sort by timestarted DESC.
$this->sortable(true, 'timestart', SORT_DESC);
// Add filtering.
$where = [];
$params = [];
if (!empty($filter)) {
$orwhere = [];
$filter = str_replace('\\', '\\\\', $filter);
// Check the class name.
$orwhere[] = $DB->sql_like('classname', ':classfilter', false, false);
$params['classfilter'] = '%' . $DB->sql_like_escape($filter) . '%';
$orwhere[] = $DB->sql_like('output', ':outputfilter', false, false);
$params['outputfilter'] = '%' . $DB->sql_like_escape($filter) . '%';
$where[] = "(" . implode(' OR ', $orwhere) . ")";
}
if (null !== $resultfilter) {
$where[] = 'tl.result = :result';
$params['result'] = $resultfilter;
}
$where = implode(' AND ', $where);
$this->set_sql('', '', $where, $params);
}
/**
* Query the db. Store results in the table object for use by build_table.
*
* @param int $pagesize size of page for paginated displayed table.
* @param bool $useinitialsbar do you want to use the initials bar. Bar
* will only be used if there is a fullname column defined for the table.
*/
public function query_db($pagesize, $useinitialsbar = true) {
global $DB;
// Fetch the attempts.
$sort = $this->get_sql_sort();
if ($sort) {
$sort = "ORDER BY $sort";
}
// TODO Does not support custom user profile fields (MDL-70456).
$userfieldsapi = \core_user\fields::for_identity(\context_system::instance(), false)->with_userpic();
$userfields = $userfieldsapi->get_sql('u', false, 'user', 'userid2', false)->selects;
$where = '';
if (!empty($this->sql->where)) {
$where = "WHERE {$this->sql->where}";
}
$sql = "SELECT
tl.id, tl.type, tl.component, tl.classname, tl.userid, tl.timestart, tl.timeend,
tl.hostname, tl.pid,
tl.dbreads, tl.dbwrites, tl.result,
tl.dbreads + tl.dbwrites AS db,
tl.timeend - tl.timestart AS duration,
{$userfields}
FROM {task_log} tl
LEFT JOIN {user} u ON u.id = tl.userid
{$where}
{$sort}";
$this->pagesize($pagesize, $DB->count_records_sql("SELECT COUNT('x') FROM {task_log} tl {$where}", $this->sql->params));
if (!$this->is_downloading()) {
$this->rawdata = $DB->get_records_sql($sql, $this->sql->params, $this->get_page_start(), $this->get_page_size());
} else {
$this->rawdata = $DB->get_records_sql($sql, $this->sql->params);
}
}
/**
* Format the name cell.
*
* @param \stdClass $row
* @return string
*/
public function col_classname($row) : string {
$output = '';
if (class_exists($row->classname)) {
$task = new $row->classname;
if ($task instanceof \core\task\scheduled_task) {
$output = $task->get_name();
}
}
$output .= \html_writer::tag('div', "\\{$row->classname}", [
'class' => 'task-class',
]);
return $output;
}
/**
* Format the type cell.
*
* @param \stdClass $row
* @return string
*/
public function col_type($row) : string {
if (\core\task\database_logger::TYPE_SCHEDULED == $row->type) {
return get_string('task_type:scheduled', 'admin');
} else {
return get_string('task_type:adhoc', 'admin');
}
}
/**
* Format the timestart cell.
*
* @param \stdClass $row
* @return string
*/
public function col_result($row) : string {
if ($row->result) {
return get_string('task_result:failed', 'admin');
} else {
return get_string('success');
}
}
/**
* Format the timestart cell.
*
* @param \stdClass $row
* @return string
*/
public function col_timestart($row) : string {
return userdate($row->timestart, get_string('strftimedatetimeshort', 'langconfig'));
}
/**
* Format the duration cell.
*
* @param \stdClass $row
* @return string
*/
public function col_duration($row) : string {
$duration = round($row->timeend - $row->timestart, 2);
if (empty($duration)) {
// The format_time function returns 'now' when the difference is exactly 0.
// Note: format_time performs concatenation in exactly this fashion so we should do this for consistency.
return '0 ' . get_string('secs', 'moodle');
}
return format_time($duration);
}
/**
* Format the DB details cell.
*
* @param \stdClass $row
* @return string
*/
public function col_db($row) : string {
$output = '';
$output .= \html_writer::div(get_string('task_stats:dbreads', 'admin', $row->dbreads));
$output .= \html_writer::div(get_string('task_stats:dbwrites', 'admin', $row->dbwrites));
return $output;
}
/**
* Format the actions cell.
*
* @param \stdClass $row
* @return string
*/
public function col_actions($row) : string {
global $OUTPUT;
$actions = [];
$url = new \moodle_url('/admin/tasklogs.php', ['logid' => $row->id]);
// Quick view.
$actions[] = $OUTPUT->action_icon(
$url,
new \pix_icon('e/search', get_string('view')),
new \popup_action('click', $url)
);
// Download.
$actions[] = $OUTPUT->action_icon(
new \moodle_url($url, ['download' => true]),
new \pix_icon('t/download', get_string('download'))
);
return implode('&nbsp;', $actions);
}
/**
* Format the user cell.
*
* @param \stdClass $row
* @return string
*/
public function col_userid($row) : string {
if (empty($row->userid)) {
return '';
}
$user = (object) [];
username_load_fields_from_object($user, $row, 'user');
return fullname($user);
}
}
-131
View File
@@ -1,131 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Task executor for adhoc tasks.
*
* @package core
* @subpackage cli
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__ . '/../../config.php');
require_once("{$CFG->libdir}/clilib.php");
require_once("{$CFG->libdir}/cronlib.php");
list($options, $unrecognized) = cli_get_params(
[
'execute' => false,
'help' => false,
'keep-alive' => 0,
'showsql' => false,
'showdebugging' => false,
'ignorelimits' => false,
'force' => false,
], [
'h' => 'help',
'e' => 'execute',
'k' => 'keep-alive',
'i' => 'ignorelimits',
'f' => 'force',
]
);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help'] or empty($options['execute'])) {
$help = <<<EOT
Ad hoc cron tasks.
Options:
-h, --help Print out this help
--showsql Show sql queries before they are executed
--showdebugging Show developer level debugging information
-e, --execute Run all queued adhoc tasks
-k, --keep-alive=N Keep this script alive for N seconds and poll for new adhoc tasks
-i --ignorelimits Ignore task_adhoc_concurrency_limit and task_adhoc_max_runtime limits
-f, --force Run even if cron is disabled
Example:
\$sudo -u www-data /usr/bin/php admin/cli/adhoc_task.php --execute
EOT;
echo $help;
die;
}
if ($options['showdebugging']) {
set_debugging(DEBUG_DEVELOPER, true);
}
if ($options['showsql']) {
$DB->set_debug(true);
}
if (CLI_MAINTENANCE) {
echo "CLI maintenance mode active, cron execution suspended.\n";
exit(1);
}
if (moodle_needs_upgrading()) {
echo "Moodle upgrade pending, cron execution suspended.\n";
exit(1);
}
if (empty($options['execute'])) {
exit(0);
}
if (!get_config('core', 'cron_enabled') && !$options['force']) {
mtrace('Cron is disabled. Use --force to override.');
exit(1);
}
if (empty($options['keep-alive'])) {
$options['keep-alive'] = 0;
}
if (!empty($CFG->showcronsql)) {
$DB->set_debug(true);
}
if (!empty($CFG->showcrondebugging)) {
set_debugging(DEBUG_DEVELOPER, true);
}
$checklimits = empty($options['ignorelimits']);
core_php_time_limit::raise();
// Increase memory limit.
raise_memory_limit(MEMORY_EXTRA);
// Emulate normal session - we use admin account by default.
cron_setup_user();
$humantimenow = date('r', time());
$keepalive = (int)$options['keep-alive'];
\core\local\cli\shutdown::script_supports_graceful_exit();
mtrace("Server Time: {$humantimenow}\n");
cron_run_adhoc_tasks(time(), $keepalive, $checklimits);
+1 -1
View File
@@ -28,7 +28,7 @@
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
require_once($CFG->libdir.'/cronlib.php');
+1 -1
View File
@@ -25,7 +25,7 @@
define('CLI_SCRIPT', 1);
require(__DIR__.'/../../config.php');
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php');
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
-119
View File
@@ -1,119 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Build and store theme CSS.
*
* @package core
* @subpackage cli
* @copyright 2017 Ryan Wyllie <ryan@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once("$CFG->libdir/clilib.php");
require_once("$CFG->libdir/csslib.php");
require_once("$CFG->libdir/outputlib.php");
$longparams = [
'themes' => null,
'direction' => null,
'help' => false,
'verbose' => false
];
$shortmappings = [
't' => 'themes',
'd' => 'direction',
'h' => 'help',
'v' => 'verbose'
];
// Get CLI params.
list($options, $unrecognized) = cli_get_params($longparams, $shortmappings);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
echo
"Compile the CSS for one or more installed themes.
Existing CSS caches will replaced.
By default all themes will be recompiled unless otherwise specified.
Options:
-t, --themes A comma separated list of themes to be compiled
-d, --direction Only compile a single direction (either ltr or rtl)
-v, --verbose Print info comments to stdout
-h, --help Print out this help
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/build_theme_css.php --themes=boost --direction=ltr
";
die;
}
if (empty($options['verbose'])) {
$trace = new null_progress_trace();
} else {
$trace = new text_progress_trace();
}
cli_heading('Build theme css');
// Determine which themes we need to build.
$themenames = [];
if (is_null($options['themes'])) {
$trace->output('No themes specified. Finding all installed themes.');
$themenames = array_keys(core_component::get_plugin_list('theme'));
} else {
if (is_string($options['themes'])) {
$themenames = explode(',', $options['themes']);
} else {
cli_error('--themes must be a comma separated list of theme names');
}
}
$trace->output('Checking that each theme is correctly installed...');
$themeconfigs = [];
foreach ($themenames as $themename) {
if (is_null(theme_get_config_file_path($themename))) {
cli_error("Unable to find theme config for {$themename}");
}
// Load the config for the theme.
$themeconfigs[] = theme_config::load($themename);
}
$directions = ['ltr', 'rtl'];
if (!is_null($options['direction'])) {
if (!in_array($options['direction'], $directions)) {
cli_error("--direction must be either ltr or rtl");
}
$directions = [$options['direction']];
}
$trace->output('Building CSS for themes: ' . implode(', ', $themenames));
theme_build_css_for_themes($themeconfigs, $directions);
exit(0);
-185
View File
@@ -1,185 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* CLI script allowing to get and set config values.
*
* This is technically just a thin wrapper for {@link get_config()} and
* {@link set_config()} functions.
*
* @package core
* @subpackage cli
* @copyright 2017 David Mudrák <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
$usage = "Displays the current value of the given site setting. Allows to set it to the given value, too.
Usage:
# php cfg.php [--component=<componentname>] [--json] [--shell-arg]
# php cfg.php --name=<configname> [--component=<componentname>] [--shell-arg] [--no-eol]
# php cfg.php --name=<configname> [--component=<componentname>] --set=<value>
# php cfg.php --name=<configname> [--component=<componentname>] --unset
# php cfg.php [--help|-h]
Options:
-h --help Print this help.
--component=<frankenstyle> Name of the component the variable is part of. Defaults to core.
--name=<configname> Name of the configuration variable to get/set. If missing, print all
configuration variables of the given component.
--set=<value> Set the given variable to this value.
--unset Unset the given variable.
--shell-arg Escape output values so that they can be directly used as shell script arguments.
--json Encode output list of values using JSON notation.
--no-eol Do not include the trailing new line character when printing the value.
The list of all variables of the given component can be printed as
tab-separated list (default) or JSON object (--json). Particular values are
printed as raw text values, optionally escaped so that they can be directly
used as shell script arguments (--shell-arg). Single values are displayed with
trailing new line by default, unless explicitly disabled (--no-eol).
In the read mode, the script exits with success status 0 if the requested value
is found. If the requested variable is not set, the script exits with status 3.
When listing all variables of the component, the exit status is always 0 even
if no variables for the given component are found. When setting/unsetting a
value, the exit status is 0. When attempting to set/unset a value that has
already been hard-set in config.php, the script exits with error status 4. In
case of unexpected error, the script exits with error status 1.
Examples:
# php cfg.php
Prints tab-separated list of all core configuration variables and their values.
# php cfg.php --json
Prints list of all core configuration variables and their values as a JSON object.
# php cfg.php --name=release
Prints the given configuration variable - e.g. \$CFG->release in this case.
# php cfg.php --component=tool_recyclebin
# Prints tab-separated list of the plugin's configuration variables.
# export DATAROOT=\$(php cfg.php --name=dataroot --shell-arg --no-eol)
Stores the given configuration variable in the shell variable, escaped
so that it can be safely used as a shell argument.
# php cfg.php --name=theme --set=classic
Sets the given configuration variable to the given value.
# php cfg.php --name=noemailever --unset
Unsets the previously configured variable.
";
list($options, $unrecognised) = cli_get_params([
'help' => false,
'component' => null,
'name' => null,
'set' => null,
'unset' => false,
'shell-arg' => false,
'json' => false,
'no-eol' => false,
], [
'h' => 'help'
]);
if ($unrecognised) {
$unrecognised = implode(PHP_EOL.' ', $unrecognised);
cli_error(get_string('cliunknowoption', 'core_admin', $unrecognised));
}
if ($options['help']) {
cli_writeln($usage);
exit(2);
}
if ($options['unset'] || $options['set'] !== null) {
// Unset the variable or set it to the given value.
if (empty($options['name'])) {
cli_error('Missing configuration variable name', 2);
}
// Check that the variable is not hard-set in the main config.php already.
$component = $options['component'];
if (!empty($component)) {
$componentsettings = $CFG->forced_plugin_settings[$component] ?? [];
$settinginconfig = array_key_exists($options['name'], $componentsettings);
} else {
$settinginconfig = array_key_exists($options['name'], $CFG->config_php_settings);
}
if ($settinginconfig) {
cli_error('The configuration variable is hard-set in the config.php, unable to change.', 4);
}
$new = $options['set'];
$old = get_config($options['component'], $options['name']);
if ($new !== $old) {
set_config($options['name'], $options['set'], $options['component']);
add_to_config_log($options['name'], $old, $new, $options['component']);
}
exit(0);
}
if ($options['name'] === null) {
// List all variables provided by the component (defaults to core).
$got = get_config($options['component']);
if ($options['json']) {
cli_writeln(json_encode($got));
} else {
foreach ($got as $name => $value) {
if ($options['shell-arg']) {
$value = escapeshellarg($value);
}
cli_writeln($name."\t".$value);
}
}
exit(0);
} else {
// Display the value of a single variable.
$got = get_config($options['component'], $options['name']);
if ($got === false) {
cli_error('No such configuration variable found.', 3);
}
if ($options['shell-arg']) {
$got = escapeshellarg($got);
}
if ($options['json']) {
$got = json_encode($got);
}
if ($options['no-eol']) {
cli_write($got);
} else {
cli_writeln($got);
}
exit(0);
}
-171
View File
@@ -1,171 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* CLI tool for system checks
*
* @package core
* @category check
* @copyright 2020 Brendan Heywood (brendan@catalyst-au.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__ . '/../../config.php');
require_once($CFG->libdir.'/clilib.php');
use core\check\result;
list($options, $unrecognized) = cli_get_params([
'help' => false,
'filter' => '',
'type' => 'status',
'verbose' => false,
], [
'h' => 'help',
'f' => 'filter',
'v' => 'verbose',
't' => 'type',
]);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
$checks = \core\check\manager::get_checks($options['type']);
$types = join(', ', \core\check\manager::TYPES);
$help = "Run Moodle system checks
Options:
-h, --help Print out this help
-f, --filter Filter to a subset of checks
-t, --type Which set of checks? Defaults to 'status'
One of $types
-v, --verbose Show details of all checks, not just failed checks
Example:
sudo -u www-data php admin/cli/checks.php
sudo -u www-data php admin/cli/checks.php -v
sudo -u www-data php admin/cli/checks.php -v --filter=environment
";
if ($options['help']) {
echo $help;
die();
}
$filter = $options['filter'];
if ($filter) {
$checks = array_filter($checks, function($check, $key) use ($filter) {
$ref = $check->get_ref();
return (strpos($ref, $filter) !== false);
}, 1);
}
// These shell exit codes and labels align with the NRPE standard.
$exitcodes = [
result::NA => 0,
result::OK => 0,
result::INFO => 0,
result::UNKNOWN => 3,
result::WARNING => 1,
result::ERROR => 2,
result::CRITICAL => 2,
];
$exitlabel = [
result::NA => 'OK',
result::OK => 'OK',
result::INFO => 'OK',
result::UNKNOWN => 'UNKNOWN',
result::WARNING => 'WARNING',
result::ERROR => 'CRITICAL',
result::CRITICAL => 'CRITICAL',
];
$format = "% 10s| % -60s\n";
$spacer = "----------+--------------------------------------------------------------------\n";
$prefix = ' |';
$output = '';
$header = $exitlabel[result::OK] . ': ' . get_string('checksok', '', $options['type']) . "\n";
$exitcode = $exitcodes[result::OK];
foreach ($checks as $check) {
$ref = $check->get_ref();
$result = $check->get_result();
$status = $result->get_status();
$checkexitcode = $exitcodes[$status];
// Summary is treated as html.
$summary = $result->get_summary();
$summary = html_to_text($summary, 60, false);
if ($checkexitcode > $exitcode) {
$exitcode = $checkexitcode;
$header = $exitlabel[$status] . ': ' . $check->get_name() . " (" . $check->get_ref() . ")\n";
}
if (empty($messages[$status])) {
$messages[$status] = $result;
}
$len = strlen(get_string('status' . $status));
if ($options['verbose'] ||
$status == result::WARNING ||
$status == result::CRITICAL ||
$status == result::ERROR) {
$output .= sprintf(
$format,
$OUTPUT->check_result($result),
sprintf('%s (%s)', $check->get_name(), $ref)
);
$summary = str_replace("\n", "\n" . $prefix . ' ', $summary);
$output .= sprintf( $format, '', ' ' . $summary);
if ($options['verbose']) {
$actionlink = $check->get_action_link();
if ($actionlink) {
$output .= sprintf( $format, '', ' ' . $actionlink->url);
}
$output .= sprintf( $format, '', '');
}
}
}
// Print NRPE header.
print $header;
// Only show the table header if there is anything to show.
if ($output) {
print sprintf($format,
get_string('status'). ' ',
get_string('check')
) . $spacer;
print $output;
}
// NRPE shell exit code.
exit($exitcode);
+4 -121
View File
@@ -30,30 +30,13 @@
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
require_once($CFG->libdir.'/cronlib.php');
// now get cli options
list($options, $unrecognized) = cli_get_params(
[
'help' => false,
'stop' => false,
'list' => false,
'force' => false,
'enable' => false,
'disable' => false,
'disable-wait' => false,
], [
'h' => 'help',
's' => 'stop',
'l' => 'list',
'f' => 'force',
'e' => 'enable',
'd' => 'disable',
'w' => 'disable-wait',
]
);
list($options, $unrecognized) = cli_get_params(array('help'=>false),
array('h'=>'help'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
@@ -65,13 +48,7 @@ if ($options['help']) {
"Execute periodic cron actions.
Options:
-h, --help Print out this help
-s, --stop Notify all other running cron processes to stop after the current task
-l, --list Show the list of currently running tasks and how long they have been running
-f, --force Execute task even if cron is disabled
-e, --enable Enable cron
-d, --disable Disable cron
-w, --disable-wait=600 Disable cron and wait until all tasks finished or fail after N seconds (optional param)
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/cron.php
@@ -81,98 +58,4 @@ Example:
die;
}
if ($options['stop']) {
// By clearing the caches this signals to other running processes
// to exit after finishing the current task.
\core\task\manager::clear_static_caches();
die;
}
if ($options['enable']) {
set_config('cron_enabled', 1);
mtrace('Cron has been enabled for the site.');
exit(0);
}
if ($options['disable']) {
set_config('cron_enabled', 0);
\core\task\manager::clear_static_caches();
mtrace('Cron has been disabled for the site.');
exit(0);
}
if ($options['list']) {
$tasks = \core\task\manager::get_running_tasks();
mtrace('The list of currently running tasks:');
$format = "%7s %-12s %-9s %-20s %-52s\n";
printf ($format,
'PID',
'HOST',
'TYPE',
'TIME',
'CLASSNAME'
);
foreach ($tasks as $task) {
printf ($format,
$task->pid,
substr($task->hostname, 0, 12),
$task->type,
format_time(time() - $task->timestarted),
substr($task->classname, 0, 52)
);
}
exit(0);
}
if ($wait = $options['disable-wait']) {
$started = time();
if (true === $wait) {
// Default waiting time.
$waitsec = 600;
} else {
$waitsec = $wait;
$wait = true;
}
set_config('cron_enabled', 0);
\core\task\manager::clear_static_caches();
mtrace('Cron has been disabled for the site.');
mtrace('Allocating '. format_time($waitsec) . ' for the tasks to finish.');
$lastcount = 0;
while ($wait) {
$tasks = \core\task\manager::get_running_tasks();
if (count($tasks) == 0) {
mtrace('');
mtrace('All scheduled and adhoc tasks finished.');
exit(0);
}
if (time() - $started >= $waitsec) {
mtrace('');
mtrace('Wait time ('. format_time($waitsec) . ') elapsed, but ' . count($tasks) . ' task(s) still running.');
mtrace('Exiting with code 1.');
exit(1);
}
if (count($tasks) !== $lastcount) {
mtrace('');
mtrace(count($tasks) . " tasks currently running.", '');
$lastcount = count($tasks);
} else {
mtrace('.', '');
}
sleep(1);
}
}
if (!get_config('core', 'cron_enabled') && !$options['force']) {
mtrace('Cron is disabled. Use --force to override.');
exit(1);
}
\core\local\cli\shutdown::script_supports_graceful_exit();
cron_run();
-65
View File
@@ -1,65 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* CLI script to reset dashboards.
*
* @package core
* @subpackage cli
* @copyright 2021 Brendan Heywood (brendan@catalyst-au.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
require_once($CFG->dirroot.'/my/lib.php');
list($options, $unrecognized) = cli_get_params([
'help' => false,
'execute' => false,
], [
'h' => 'help',
'e' => 'execute',
]);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized), 2);
}
if (!$options['execute']) {
$help = <<<EOF
Resets Moodle dashboards for all users
Options:
-h, --help Print out this help
-e, --execute Actually run the reset
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/dashboard_reset.php -e
EOF;
echo $help;
exit(0);
}
$progressbar = new progress_bar();
$progressbar->create();
my_reset_page_for_all_users(MY_PAGE_PRIVATE, 'my-index', $progressbar);
-1
View File
@@ -73,7 +73,6 @@ foreach ($rs as $user) {
echo "Redeleting user $user->id: $user->username ($user->email)\n";
delete_user($user);
}
$rs->close();
cli_heading('Deleting all leftovers');
-138
View File
@@ -1,138 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Fix orphaned calendar events that were broken by MDL-67494.
*
* This script will look for all the calendar events which userids
* where broken by a wrong upgrade step, affecting to Moodle 3.9.5
* and up.
*
* It performs checks to both:
* a) Detect if the site was affected (ran the wrong upgrade step).
* b) Look for orphaned calendar events, categorising them as:
* - standard: site / category / course / group / user events
* - subscription: events created via subscriptions.
* - action: normal action events, created to show common important dates.
* - override: user and group override events, particular, that some activities support.
* - custom: other events, not being any of the above, common or particular.
* By specifying it (--fix) try to recover as many broken events (missing userid) as
* possible. Standard, subscription, action, override events in core are fully supported but
* override or custom events should be fixed by each plugin as far as there isn't any standard
* API (plugin-wise) to launch a rebuild of the calendar events.
*
* @package core
* @copyright 2021 onwards Simey Lameze <simey@moodle.com>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir . "/clilib.php");
require_once($CFG->libdir . '/db/upgradelib.php');
// Supported options.
$long = ['fix' => false, 'help' => false];
$short = ['f' => 'fix', 'h' => 'help'];
// CLI options.
[$options, $unrecognized] = cli_get_params($long, $short);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
$help = <<<EOT
Fix orphaned calendar events.
This script detects calendar events that have had their
userid lost. By default it will perform various checks
and report them, showing the site status in an easy way.
Also, optionally (--fix), it wil try to recover as many
lost userids as possible from different sources. Note that
this script aims to process well-know events in core,
leaving custom events in 3rd part plugins mostly unmodified
because there isn't any consistent way to regenerate them.
For more details: https://tracker.moodle.org/browse/MDL-71156
Options:
-h, --help Print out this help.
-f, --fix Fix the orphaned calendar events in the DB.
If not specified only check and report problems to STDERR.
Usage:
- Only report: \$ sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_calendar_events.php
- Report and fix: \$ sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_calendar_events.php -f
EOT;
cli_writeln($help);
die;
}
// Check various usual pre-requisites.
if (empty($CFG->version)) {
cli_error('Database is not yet installed.');
}
$admin = get_admin();
if (!$admin) {
cli_error('Error: No admin account was found.');
}
if (moodle_needs_upgrading()) {
cli_error('Moodle upgrade pending, script execution suspended.');
}
// Do everything as admin by default.
\core\session\manager::set_user($admin);
// Report current site status.
cli_heading('Checking the site status');
$needsfix = upgrade_calendar_site_status();
// Report current calendar events status.
cli_heading('Checking the calendar events status');
$info = upgrade_calendar_events_status();
$hasbadevents = $info['total']->bad > 0 || $info['total']->bad != $info['other']->bad;
$needsfix = $needsfix || $hasbadevents;
// If, selected, fix as many calendar events as possible.
if ($options['fix']) {
// If the report has told us that the fix was not needed... ask for confirmation!
if (!$needsfix) {
cli_writeln("This site DOES NOT NEED to run the calendar events fix.");
$input = cli_input('Are you completely sure that you want to run the fix? (y/N)', 'N', ['y', 'Y', 'n', 'N']);
if (strtolower($input) != 'y') {
exit(0);
}
cli_writeln("");
}
cli_heading('Fixing as many as possible calendar events');
upgrade_calendar_events_fix_remaining($info);
// Report current (after fix) calendar events status.
cli_heading('Checking the calendar events status (after fix)');
upgrade_calendar_events_status();
} else if ($needsfix) {
// Fix option was not provided but problem events have been found. Notify the user and provide info how to fix these events.
cli_writeln("This site NEEDS to run the calendar events fix!");
cli_writeln("To fix the calendar events, re-run this script with the --fix option.");
}
-79
View File
@@ -1,79 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Generates a secure key for the current server (presuming it does not already exist).
*
* @package core_admin
* @copyright 2020 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use \core\encryption;
define('CLI_SCRIPT', true);
require(__DIR__ . '/../../config.php');
require_once($CFG->libdir . '/clilib.php');
// Get cli options.
[$options, $unrecognized] = cli_get_params(
['help' => false, 'method' => null],
['h' => 'help']);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
// TODO: MDL-71421 - Remove the openssl alternative once sodium becomes a requirement in Moodle 4.2.
if ($options['help']) {
echo "Generate secure key
This script manually creates a secure key within the secret data root folder (configured in
config.php as \$CFG->secretdataroot). You must run it using an account with access to write
to that folder.
In normal use Moodle automatically creates the key; this script is intended when setting up
a new Moodle system, for cases where the secure folder is not on shared storage and the key
may be manually installed on multiple servers.
Options:
-h, --help Print out this help
--method <method> Generate key for specified encryption method instead of default.
* sodium
* openssl-aes-256-ctr
Example:
php admin/cli/generate_key.php
";
exit;
}
$method = $options['method'];
if (encryption::key_exists($method)) {
echo 'Key already exists: ' . encryption::get_key_file($method) . "\n";
exit;
}
// Creates key with default permissions (no chmod).
echo "Generating key...\n";
encryption::create_key($method, false);
echo "\nKey created: " . encryption::get_key_file($method) . "\n\n";
echo "If the key folder is not shared storage, then key files should be copied to all servers.\n";
+200 -219
View File
@@ -90,7 +90,7 @@ Example:
// distro specific customisation
$distrolibfile = __DIR__.'/../../install/distrolib.php';
$distrolibfile = dirname(dirname(dirname(__FILE__))).'/install/distrolib.php';
$distro = null;
if (file_exists($distrolibfile)) {
require_once($distrolibfile);
@@ -100,7 +100,7 @@ if (file_exists($distrolibfile)) {
}
// Nothing to do if config.php exists
$configfile = __DIR__.'/../../config.php';
$configfile = dirname(dirname(dirname(__FILE__))).'/config.php';
if (file_exists($configfile)) {
require($configfile);
require_once($CFG->libdir.'/clilib.php');
@@ -146,15 +146,20 @@ define('PHPUNIT_TEST', false);
define('IGNORE_COMPONENT_CACHE', true);
// Check that PHP is of a sufficient version as soon as possible.
require_once(__DIR__.'/../../lib/phpminimumversionlib.php');
moodle_require_minimum_php_version();
// Check that PHP is of a sufficient version
if (version_compare(phpversion(), "5.4.4") < 0) {
$phpversion = phpversion();
// do NOT localise - lang strings would not work here and we CAN NOT move it after installib
fwrite(STDERR, "Moodle 2.7 or later requires at least PHP 5.4.4 (currently using version $phpversion).\n");
fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
exit(1);
}
// set up configuration
global $CFG;
$CFG = new stdClass();
$CFG->lang = 'en';
$CFG->dirroot = dirname(dirname(__DIR__));
$CFG->dirroot = dirname(dirname(dirname(__FILE__)));
$CFG->libdir = "$CFG->dirroot/lib";
$CFG->wwwroot = "http://localhost";
$CFG->httpswwwroot = $CFG->wwwroot;
@@ -167,7 +172,7 @@ $CFG->debug = (E_ALL | E_STRICT);
$CFG->debugdisplay = true;
$CFG->debugdeveloper = true;
$parts = explode('/', str_replace('\\', '/', dirname(__DIR__)));
$parts = explode('/', str_replace('\\', '/', dirname(dirname(__FILE__))));
$CFG->admin = array_pop($parts);
//point pear include path to moodles lib/pear so that includes and requires will search there for files before anywhere else
@@ -215,11 +220,11 @@ define('SITEID', 1);
//Database types
$databases = array('mysqli' => moodle_database::get_driver_instance('mysqli', 'native'),
'auroramysql' => moodle_database::get_driver_instance('auroramysql', 'native'),
'mariadb'=> moodle_database::get_driver_instance('mariadb', 'native'),
'pgsql' => moodle_database::get_driver_instance('pgsql', 'native'),
'oci' => moodle_database::get_driver_instance('oci', 'native'),
'sqlsrv' => moodle_database::get_driver_instance('sqlsrv', 'native'), // MS SQL*Server PHP driver
'mssql' => moodle_database::get_driver_instance('mssql', 'native'), // FreeTDS driver
);
foreach ($databases as $type=>$database) {
if ($database->driver_installed() !== true) {
@@ -239,7 +244,7 @@ list($options, $unrecognized) = cli_get_params(
'chmod' => isset($distro->directorypermissions) ? sprintf('%04o',$distro->directorypermissions) : '2777', // let distros set dir permissions
'lang' => $CFG->lang,
'wwwroot' => '',
'dataroot' => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(__DIR__))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro
'dataroot' => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(dirname(__FILE__)))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro
'dbtype' => empty($distro->dbtype) ? $defaultdb : $distro->dbtype, // let distro skip dbtype selection
'dbhost' => empty($distro->dbhost) ? 'localhost' : $distro->dbhost, // let distros set dbhost
'dbname' => 'moodle',
@@ -267,7 +272,6 @@ list($options, $unrecognized) = cli_get_params(
);
$interactive = empty($options['non-interactive']);
$skipdatabase = $options['skip-database'];
// set up language
$lang = clean_param($options['lang'], PARAM_SAFEDIR);
@@ -393,6 +397,7 @@ if ($interactive) {
$CFG->wwwroot = $wwwroot;
$CFG->httpswwwroot = $CFG->wwwroot;
//We need dataroot before lang download
$CFG->dataroot = $options['dataroot'];
if ($interactive) {
@@ -443,7 +448,6 @@ if ($interactive) {
}
}
$CFG->tempdir = $CFG->dataroot.'/temp';
$CFG->backuptempdir = $CFG->tempdir.'/backup';
$CFG->cachedir = $CFG->dataroot.'/cache';
$CFG->localcachedir = $CFG->dataroot.'/localcache';
@@ -515,105 +519,100 @@ if ($interactive) {
$database = $databases[$CFG->dbtype];
// We cannot do any validation until all DB connection data is provided.
$hintdatabase = '';
do {
echo $hintdatabase;
// Ask for db host.
if ($interactive) {
cli_separator();
cli_heading(get_string('databasehost', 'install'));
if ($options['dbhost'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbhost']);
} else {
$prompt = get_string('clitypevalue', 'admin');
}
$CFG->dbhost = cli_input($prompt, $options['dbhost']);
// ask for db host
if ($interactive) {
cli_separator();
cli_heading(get_string('databasehost', 'install'));
if ($options['dbhost'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbhost']);
} else {
$CFG->dbhost = $options['dbhost'];
$prompt = get_string('clitypevalue', 'admin');
}
$CFG->dbhost = cli_input($prompt, $options['dbhost']);
// Ask for db name.
if ($interactive) {
cli_separator();
cli_heading(get_string('databasename', 'install'));
if ($options['dbname'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbname']);
} else {
$prompt = get_string('clitypevalue', 'admin');
}
$CFG->dbname = cli_input($prompt, $options['dbname']);
} else {
$CFG->dbhost = $options['dbhost'];
}
// ask for db name
if ($interactive) {
cli_separator();
cli_heading(get_string('databasename', 'install'));
if ($options['dbname'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbname']);
} else {
$CFG->dbname = $options['dbname'];
$prompt = get_string('clitypevalue', 'admin');
}
$CFG->dbname = cli_input($prompt, $options['dbname']);
// Ask for db prefix.
if ($interactive) {
cli_separator();
cli_heading(get_string('dbprefix', 'install'));
//TODO: solve somehow the prefix trouble for oci.
if ($options['prefix'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['prefix']);
} else {
$prompt = get_string('clitypevalue', 'admin');
}
$CFG->prefix = cli_input($prompt, $options['prefix']);
} else {
$CFG->dbname = $options['dbname'];
}
// ask for db prefix
if ($interactive) {
cli_separator();
cli_heading(get_string('dbprefix', 'install'));
//TODO: solve somehow the prefix trouble for oci
if ($options['prefix'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['prefix']);
} else {
$CFG->prefix = $options['prefix'];
$prompt = get_string('clitypevalue', 'admin');
}
$CFG->prefix = cli_input($prompt, $options['prefix']);
// Ask for db port.
if ($interactive) {
cli_separator();
cli_heading(get_string('databaseport', 'install'));
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbport']);
$CFG->dboptions['dbport'] = (int) cli_input($prompt, $options['dbport']);
} else {
$CFG->prefix = $options['prefix'];
}
// ask for db port
if ($interactive) {
cli_separator();
cli_heading(get_string('databaseport', 'install'));
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbport']);
$CFG->dboptions['dbport'] = (int)cli_input($prompt, $options['dbport']);
} else {
$CFG->dboptions['dbport'] = (int)$options['dbport'];
}
if ($CFG->dboptions['dbport'] <= 0) {
$CFG->dboptions['dbport'] = '';
}
// ask for db socket
if ($CFG->ostype === 'WINDOWS') {
$CFG->dboptions['dbsocket'] = '';
} else if ($interactive and empty($CFG->dboptions['dbport'])) {
cli_separator();
cli_heading(get_string('databasesocket', 'install'));
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbsocket']);
$CFG->dboptions['dbsocket'] = cli_input($prompt, $options['dbsocket']);
} else {
$CFG->dboptions['dbsocket'] = $options['dbsocket'];
}
// ask for db user
if ($interactive) {
cli_separator();
cli_heading(get_string('databaseuser', 'install'));
if ($options['dbuser'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbuser']);
} else {
$CFG->dboptions['dbport'] = (int) $options['dbport'];
}
if ($CFG->dboptions['dbport'] <= 0) {
$CFG->dboptions['dbport'] = '';
$prompt = get_string('clitypevalue', 'admin');
}
$CFG->dbuser = cli_input($prompt, $options['dbuser']);
// Ask for db socket.
if ($CFG->ostype === 'WINDOWS') {
$CFG->dboptions['dbsocket'] = '';
} else if ($interactive and empty($CFG->dboptions['dbport'])) {
cli_separator();
cli_heading(get_string('databasesocket', 'install'));
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbsocket']);
$CFG->dboptions['dbsocket'] = cli_input($prompt, $options['dbsocket']);
} else {
$CFG->dboptions['dbsocket'] = $options['dbsocket'];
}
// Ask for db user.
if ($interactive) {
cli_separator();
cli_heading(get_string('databaseuser', 'install'));
if ($options['dbuser'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbuser']);
} else {
$prompt = get_string('clitypevalue', 'admin');
}
$CFG->dbuser = cli_input($prompt, $options['dbuser']);
} else {
$CFG->dbuser = $options['dbuser'];
}
// Ask for db password.
if ($interactive) {
cli_separator();
cli_heading(get_string('databasepass', 'install'));
} else {
$CFG->dbuser = $options['dbuser'];
}
// ask for db password
if ($interactive) {
cli_separator();
cli_heading(get_string('databasepass', 'install'));
do {
if ($options['dbpass'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['dbpass']);
} else {
@@ -621,118 +620,110 @@ do {
}
$CFG->dbpass = cli_input($prompt, $options['dbpass']);
if (function_exists('distro_pre_create_db')) { // Hook for distros needing to do something before DB creation.
$distro = distro_pre_create_db($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix,
array('dbpersist' => 0, 'dbport' => $CFG->dboptions['dbport'], 'dbsocket' => $CFG->dboptions['dbsocket']),
$distro);
if (function_exists('distro_pre_create_db')) { // Hook for distros needing to do something before DB creation
$distro = distro_pre_create_db($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbport'=>$CFG->dboptions['dbport'], 'dbsocket'=>$CFG->dboptions['dbsocket']), $distro);
}
$hintdatabase = install_db_validate($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix,
array('dbpersist' => 0, 'dbport' => $CFG->dboptions['dbport'], 'dbsocket' => $CFG->dboptions['dbsocket']));
$hint_database = install_db_validate($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbport'=>$CFG->dboptions['dbport'], 'dbsocket'=>$CFG->dboptions['dbsocket']));
} while ($hint_database !== '');
} else {
$CFG->dbpass = $options['dbpass'];
$hintdatabase = install_db_validate($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix,
array('dbpersist' => 0, 'dbport' => $CFG->dboptions['dbport'], 'dbsocket' => $CFG->dboptions['dbsocket']));
if ($hintdatabase !== '') {
cli_error(get_string('dbconnectionerror', 'install'));
}
} else {
$CFG->dbpass = $options['dbpass'];
$hint_database = install_db_validate($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbport'=>$CFG->dboptions['dbport'], 'dbsocket'=>$CFG->dboptions['dbsocket']));
if ($hint_database !== '') {
cli_error(get_string('dbconnectionerror', 'install'));
}
} while ($hintdatabase !== '');
}
// If --skip-database option is provided, we do not need to ask for site fullname, shortname, adminuser, adminpass, adminemail.
// These fields will be requested during the database install part.
if (!$skipdatabase) {
// Ask for fullname.
if ($interactive) {
cli_separator();
cli_heading(get_string('fullsitename', 'moodle'));
// ask for fullname
if ($interactive) {
cli_separator();
cli_heading(get_string('fullsitename', 'moodle'));
if ($options['fullname'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['fullname']);
} else {
$prompt = get_string('clitypevalue', 'admin');
}
do {
$options['fullname'] = cli_input($prompt, $options['fullname']);
} while (empty($options['fullname']));
if ($options['fullname'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['fullname']);
} else {
if (empty($options['fullname'])) {
$a = (object)['option' => 'fullname', 'value' => $options['fullname']];
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
}
// Ask for shortname.
if ($interactive) {
cli_separator();
cli_heading(get_string('shortsitename', 'moodle'));
if ($options['shortname'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['shortname']);
} else {
$prompt = get_string('clitypevalue', 'admin');
}
do {
$options['shortname'] = cli_input($prompt, $options['shortname']);
} while (empty($options['shortname']));
} else {
if (empty($options['shortname'])) {
$a = (object)['option' => 'shortname', 'value' => $options['shortname']];
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
}
// Ask for admin user name.
if ($interactive) {
cli_separator();
cli_heading(get_string('cliadminusername', 'install'));
if (!empty($options['adminuser'])) {
$prompt = get_string('clitypevaluedefault', 'admin', $options['adminuser']);
} else {
$prompt = get_string('clitypevalue', 'admin');
}
do {
$options['adminuser'] = cli_input($prompt, $options['adminuser']);
} while (empty($options['adminuser']) or $options['adminuser'] === 'guest');
} else {
if ((empty($options['adminuser']) || $options['adminuser'] === 'guest')) {
$a = (object)['option' => 'adminuser', 'value' => $options['adminuser']];
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
}
// Ask for admin user password.
if ($interactive) {
cli_separator();
cli_heading(get_string('cliadminpassword', 'install'));
$prompt = get_string('clitypevalue', 'admin');
do {
$options['adminpass'] = cli_input($prompt);
} while (empty($options['adminpass']) or $options['adminpass'] === 'admin');
} else {
if ((empty($options['adminpass']) or $options['adminpass'] === 'admin')) {
$a = (object)['option' => 'adminpass', 'value' => $options['adminpass']];
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
}
// Ask for the admin email address.
if ($interactive) {
cli_separator();
cli_heading(get_string('cliadminemail', 'install'));
$prompt = get_string('clitypevaluedefault', 'admin', $options['adminemail']);
$options['adminemail'] = cli_input($prompt, $options['adminemail']);
}
// Validate that the address provided was an e-mail address.
if (!empty($options['adminemail']) && !validate_email($options['adminemail'])) {
$a = (object)['option' => 'adminemail', 'value' => $options['adminemail']];
do {
$options['fullname'] = cli_input($prompt, $options['fullname']);
} while (empty($options['fullname']));
} else {
if (empty($options['fullname'])) {
$a = (object)array('option'=>'fullname', 'value'=>$options['fullname']);
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
}
// ask for shortname
if ($interactive) {
cli_separator();
cli_heading(get_string('shortsitename', 'moodle'));
if ($options['shortname'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['shortname']);
} else {
$prompt = get_string('clitypevalue', 'admin');
}
do {
$options['shortname'] = cli_input($prompt, $options['shortname']);
} while (empty($options['shortname']));
} else {
if (empty($options['shortname'])) {
$a = (object)array('option'=>'shortname', 'value'=>$options['shortname']);
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
}
// ask for admin user name
if ($interactive) {
cli_separator();
cli_heading(get_string('cliadminusername', 'install'));
if (!empty($options['adminuser'])) {
$prompt = get_string('clitypevaluedefault', 'admin', $options['adminuser']);
} else {
$prompt = get_string('clitypevalue', 'admin');
}
do {
$options['adminuser'] = cli_input($prompt, $options['adminuser']);
} while (empty($options['adminuser']) or $options['adminuser'] === 'guest');
} else {
if (empty($options['adminuser']) or $options['adminuser'] === 'guest') {
$a = (object)array('option'=>'adminuser', 'value'=>$options['adminuser']);
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
}
// ask for admin user password
if ($interactive) {
cli_separator();
cli_heading(get_string('cliadminpassword', 'install'));
$prompt = get_string('clitypevalue', 'admin');
do {
$options['adminpass'] = cli_input($prompt);
} while (empty($options['adminpass']) or $options['adminpass'] === 'admin');
} else {
if (empty($options['adminpass']) or $options['adminpass'] === 'admin') {
$a = (object)array('option'=>'adminpass', 'value'=>$options['adminpass']);
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
}
// Ask for the admin email address.
if ($interactive) {
cli_separator();
cli_heading(get_string('cliadminemail', 'install'));
$prompt = get_string('clitypevaluedefault', 'admin', $options['adminemail']);
$options['adminemail'] = cli_input($prompt);
}
// Validate that the address provided was an e-mail address.
if (!empty($options['adminemail']) && !validate_email($options['adminemail'])) {
$a = (object) array('option' => 'adminemail', 'value' => $options['adminemail']);
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
// Ask for the upgrade key.
if ($interactive) {
cli_separator();
@@ -751,27 +742,23 @@ if ($options['upgradekey'] !== '') {
$CFG->upgradekey = $options['upgradekey'];
}
// The user does not also need to pass agree-license when --skip-database is provided as the user will need to accept
// the license again in the database install part.
if (!$skipdatabase) {
if ($interactive) {
if (!$options['agree-license']) {
cli_separator();
cli_heading(get_string('copyrightnotice'));
echo "Moodle - Modular Object-Oriented Dynamic Learning Environment\n";
echo get_string('gpl3')."\n\n";
echo get_string('doyouagree')."\n";
$prompt = get_string('cliyesnoprompt', 'admin');
$input = cli_input($prompt, '', array(get_string('clianswerno', 'admin'), get_string('cliansweryes', 'admin')));
if ($input == get_string('clianswerno', 'admin')) {
exit(1);
}
}
} else {
if (!$options['agree-license'] && !$skipdatabase) {
cli_error(get_string('climustagreelicense', 'install'));
if ($interactive) {
if (!$options['agree-license']) {
cli_separator();
cli_heading(get_string('copyrightnotice'));
echo "Moodle - Modular Object-Oriented Dynamic Learning Environment\n";
echo get_string('gpl3')."\n\n";
echo get_string('doyouagree')."\n";
$prompt = get_string('cliyesnoprompt', 'admin');
$input = cli_input($prompt, '', array(get_string('clianswerno', 'admin'), get_string('cliansweryes', 'admin')));
if ($input == get_string('clianswerno', 'admin')) {
exit(1);
}
}
} else {
if (!$options['agree-license']) {
cli_error(get_string('climustagreelicense', 'install'));
}
}
// Finally we have all info needed for config.php
@@ -819,14 +806,8 @@ if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
cli_error(get_string('pluginschecktodo', 'admin'));
}
if (!$skipdatabase) {
if (!$options['skip-database']) {
install_cli_database($options, $interactive);
// This needs to happen at the end to ensure it occurs after all caches
// have been purged for the last time.
// This will build a cached version of the current theme for the user
// to immediately start browsing the site.
require_once($CFG->libdir.'/upgradelib.php');
upgrade_themes();
} else {
echo get_string('cliskipdatabase', 'install')."\n";
}
+14 -23
View File
@@ -56,19 +56,23 @@ Options:
--agree-license Indicates agreement with software license.
--fullname=STRING Name of the site
--shortname=STRING Name of the site
--summary=STRING The summary to be displayed on the front page
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/install_database.php --lang=cs --adminpass=soMePass123 --agree-license
";
// Check that PHP is of a sufficient version as soon as possible.
require_once(__DIR__.'/../../lib/phpminimumversionlib.php');
moodle_require_minimum_php_version();
// Check that PHP is of a sufficient version
if (version_compare(phpversion(), "5.4.4") < 0) {
$phpversion = phpversion();
// do NOT localise - lang strings would not work here and we CAN NOT move it after installib
fwrite(STDERR, "Moodle 2.7 or later requires at least PHP 5.4.4 (currently using version $phpversion).\n");
fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
exit(1);
}
// Nothing to do if config.php does not exist
$configfile = __DIR__.'/../../config.php';
$configfile = dirname(dirname(dirname(__FILE__))).'/config.php';
if (!file_exists($configfile)) {
fwrite(STDERR, 'config.php does not exist, can not continue'); // do not localize
fwrite(STDERR, "\n");
@@ -83,6 +87,11 @@ require_once($CFG->libdir.'/installlib.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/componentlib.class.php');
// make sure no tables are installed yet
if ($DB->get_tables() ) {
cli_error(get_string('clitablesexist', 'install'));
}
$CFG->early_install_lang = true;
get_string_manager(true);
@@ -97,7 +106,6 @@ list($options, $unrecognized) = cli_get_params(
'adminemail' => '',
'fullname' => '',
'shortname' => '',
'summary' => '',
'agree-license' => false,
'help' => false
),
@@ -106,22 +114,12 @@ list($options, $unrecognized) = cli_get_params(
)
);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
// We show help text even if tables are installed.
if ($options['help']) {
echo $help;
die;
}
// Make sure no tables are installed yet.
if ($DB->get_tables() ) {
cli_error(get_string('clitablesexist', 'install'));
}
if (!$options['agree-license']) {
cli_error('You have to agree to the license. --help prints out the help'); // TODO: localize
}
@@ -185,12 +183,5 @@ if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
install_cli_database($options, true);
// This needs to happen at the end to ensure it occurs after all caches
// have been purged for the last time.
// This will build a cached version of the current theme for the user
// to immediately start browsing the site.
require_once($CFG->libdir.'/upgradelib.php');
upgrade_themes();
echo get_string('cliinstallfinished', 'install')."\n";
exit(0); // 0 means success
-55
View File
@@ -1,55 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* CLI script to kill all user sessions without asking for confirmation.
*
* @package core
* @subpackage cli
* @copyright 2017 Alexander Bias <alexander.bias@uni-ulm.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
list($options, $unrecognized) = cli_get_params(array('help' => false), array('h' => 'help'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized), 2);
}
if ($options['help']) {
$help =
"Kill all Moodle sessions
Options:
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/kill_all_sessions.php
";
echo $help;
exit(0);
}
\core\session\manager::kill_all_sessions();
exit(0);
+11 -128
View File
@@ -24,7 +24,7 @@
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
if ($DB->get_dbfamily() !== 'mysql') {
@@ -53,7 +53,7 @@ Options:
-h, --help Print out this help
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci
\$ sudo -u www-data /usr/bin/php admin/cli/mysql_collation.php --collation=utf8_general_ci
";
if (!empty($options['collation'])) {
@@ -64,71 +64,6 @@ if (!empty($options['collation'])) {
cli_error("Error: collation '$collation' is not available on this server!");
}
$collationinfo = explode('_', $collation);
$charset = reset($collationinfo);
$engine = strtolower($DB->get_dbengine());
// Do checks for utf8mb4.
if (strpos($collation, 'utf8mb4') === 0) {
// Do we have the right engine?
if ($engine !== 'innodb' && $engine !== 'xtradb') {
cli_error("Error: '$collation' requires InnoDB or XtraDB set as the engine.");
}
// Are we using Barracuda?
if ($DB->get_row_format() != 'Barracuda') {
// Try setting it here.
try {
$DB->execute("SET GLOBAL innodb_file_format=Barracuda");
} catch (dml_exception $e) {
cli_error("Error: '$collation' requires the file format to be set to Barracuda.
An attempt was made to change the format, but it failed. Please try doing this manually.");
}
echo "GLOBAL SETTING: innodb_file_format changed to Barracuda\n";
}
// Is one file per table being used?
if (!$DB->is_file_per_table_enabled()) {
try {
$DB->execute("SET GLOBAL innodb_file_per_table=1");
} catch (dml_exception $e) {
cli_error("Error: '$collation' requires the setting 'innodb_file_per_table' be set to 'ON'.
An attempt was made to change the format, but it failed. Please try doing this manually.");
}
echo "GLOBAL SETTING: innodb_file_per_table changed to 1\n";
}
// Is large prefix set?
if (!$DB->is_large_prefix_enabled()) {
try {
$DB->execute("SET GLOBAL innodb_large_prefix=1");
} catch (dml_exception $e) {
cli_error("Error: '$collation' requires the setting 'innodb_large_prefix' be set to 'ON'.
An attempt was made to change the format, but it failed. Please try doing this manually.");
}
echo "GLOBAL SETTING: innodb_large_prefix changed to 1\n";
}
}
$sql = "SHOW VARIABLES LIKE 'collation_database'";
if (!$dbcollation = $DB->get_record_sql($sql)) {
cli_error("Error: Could not access collation information on the database.");
}
$sql = "SHOW VARIABLES LIKE 'character_set_database'";
if (!$dbcharset = $DB->get_record_sql($sql)) {
cli_error("Error: Could not access character set information on the database.");
}
if ($dbcollation->value !== $collation || $dbcharset->value !== $charset) {
// Try to convert the DB.
echo "Converting database to '$collation' for $CFG->wwwroot:\n";
$sql = "ALTER DATABASE `$CFG->dbname` DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation";
try {
$DB->change_database_structure($sql);
} catch (exception $e) {
cli_error("Error: Tried to alter the database with no success. Please try manually changing the database
to the new collation and character set and then run this script again.");
}
echo "DATABASE CONVERTED\n";
}
echo "Converting tables and columns to '$collation' for $CFG->wwwroot:\n";
$prefix = $DB->get_prefix();
$prefix = str_replace('_', '\\_', $prefix);
@@ -145,25 +80,12 @@ if (!empty($options['collation'])) {
$skipped++;
} else {
try {
$DB->change_database_structure("ALTER TABLE `$table->name` CONVERT TO CHARACTER SET $charset COLLATE $collation");
echo "CONVERTED\n";
$converted++;
} catch (ddl_exception $e) {
$result = mysql_set_row_format($table->name, $charset, $collation, $engine);
if ($result) {
echo "CONVERTED\n";
$converted++;
} else {
// We don't know what the problem is. Stop the conversion.
cli_error("Error: Tried to convert $table->name, but there was a problem. Please check the details of this
table and try again.");
die();
}
}
$DB->change_database_structure("ALTER TABLE $table->name DEFAULT COLLATE = $collation");
echo "CONVERTED\n";
$converted++;
}
$sql = "SHOW FULL COLUMNS FROM `$table->name` WHERE collation IS NOT NULL";
$sql = "SHOW FULL COLUMNS FROM $table->name WHERE collation IS NOT NULL";
$rs2 = $DB->get_recordset_sql($sql);
foreach ($rs2 as $column) {
$column = (object)array_change_key_case((array)$column, CASE_LOWER);
@@ -174,36 +96,22 @@ if (!empty($options['collation'])) {
continue;
}
// Check for utf8mb4 collation.
$rowformat = $DB->get_row_format_sql($engine, $collation);
if ($column->type === 'tinytext' or $column->type === 'mediumtext' or $column->type === 'text' or $column->type === 'longtext') {
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
$default = (!is_null($column->default) and $column->default !== '') ? "DEFAULT '$column->default'" : '';
// primary, unique and inc are not supported for texts
$sql = "ALTER TABLE `$table->name`
MODIFY COLUMN $column->field $column->type
CHARACTER SET $charset
COLLATE $collation $notnull $default";
$sql = "ALTER TABLE $table->name MODIFY COLUMN $column->field $column->type COLLATE $collation $notnull $default";
$DB->change_database_structure($sql);
} else if (strpos($column->type, 'varchar') === 0) {
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
$default = !is_null($column->default) ? "DEFAULT '$column->default'" : '';
if ($rowformat != '') {
$sql = "ALTER TABLE `$table->name` $rowformat";
$DB->change_database_structure($sql);
}
$sql = "ALTER TABLE `$table->name`
MODIFY COLUMN $column->field $column->type
CHARACTER SET $charset
COLLATE $collation $notnull $default";
// primary, unique and inc are not supported for texts
$sql = "ALTER TABLE $table->name MODIFY COLUMN $column->field $column->type COLLATE $collation $notnull $default";
$DB->change_database_structure($sql);
} else {
echo "ERROR (unknown column type: $column->type)\n";
$errors++;
$error++;
continue;
}
echo "CONVERTED\n";
@@ -272,9 +180,7 @@ function mysql_get_collations() {
global $DB;
$collations = array();
$sql = "SHOW COLLATION
WHERE Collation LIKE 'utf8\_%' AND Charset = 'utf8'
OR Collation LIKE 'utf8mb4\_%' AND Charset = 'utf8mb4'";
$sql = "SHOW COLLATION WHERE Collation LIKE 'utf8\_%' AND Charset = 'utf8'";
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $collation) {
$collations[$collation->collation] = $collation->collation;
@@ -303,26 +209,3 @@ function mysql_get_column_collations($tablename) {
$rs->close();
return $collations;
}
function mysql_set_row_format($tablename, $charset, $collation, $engine) {
global $DB;
$sql = "SELECT row_format
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = DATABASE() AND table_name = ?";
$rs = $DB->get_record_sql($sql, array($tablename));
if ($rs) {
if ($rs->row_format == 'Compact' || $rs->row_format == 'Redundant') {
$rowformat = $DB->get_row_format_sql($engine, $collation);
// Try to convert to compressed format and then try updating the collation again.
$DB->change_database_structure("ALTER TABLE `$tablename` $rowformat");
$DB->change_database_structure("ALTER TABLE `$tablename` CONVERT TO CHARACTER SET $charset COLLATE $collation");
} else {
// Row format may not be the problem. Can not diagnose problem. Send fail reply.
return false;
}
} else {
return false;
}
return true;
}
+3 -3
View File
@@ -25,7 +25,7 @@
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require(dirname(__FILE__).'/../../config.php');
require_once($CFG->libdir . '/clilib.php');
if ($DB->get_dbfamily() !== 'mysql') {
@@ -158,7 +158,7 @@ if (!empty($options['info'])) {
}
foreach ($fixtables as $table) {
$DB->change_database_structure("ALTER TABLE `{$prefix}$table` ROW_FORMAT=Compressed");
$DB->change_database_structure("ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed");
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT) . " ... Compressed\n";
}
@@ -189,7 +189,7 @@ if (!empty($options['info'])) {
echo "SET GLOBAL innodb_file_per_table=1;\n";
echo "SET GLOBAL innodb_file_format=Barracuda;\n";
foreach ($fixtables as $table) {
echo "ALTER TABLE `{$prefix}$table` ROW_FORMAT=Compressed;\n";
echo "ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed;\n";
}
echo "\n";
exit(0);
+1 -1
View File
@@ -26,7 +26,7 @@
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
if ($DB->get_dbfamily() !== 'mysql') {
+8 -31
View File
@@ -15,8 +15,6 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* CLI script to purge caches without asking for confirmation.
*
* @package core
* @subpackage cli
* @copyright 2011 David Mudrak <david@moodle.com>
@@ -25,19 +23,10 @@
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php');
$longoptions = [
'help' => false,
'muc' => false,
'theme' => false,
'lang' => false,
'js' => false,
'filter' => false,
'other' => false
];
list($options, $unrecognized) = cli_get_params($longoptions, ['h' => 'help']);
list($options, $unrecognized) = cli_get_params(array('help' => false), array('h' => 'help'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
@@ -45,32 +34,20 @@ if ($unrecognized) {
}
if ($options['help']) {
// The indentation of this string is "wrong" but this is to avoid a extra whitespace in console output.
$help = <<<EOF
Invalidates Moodle internal caches
Specific caches can be defined (alone or in combination) using arguments. If none are specified,
all caches will be purged.
$help =
"Invalidates all Moodle internal caches
Options:
-h, --help Print out this help
--muc Purge all MUC caches (includes lang cache)
--theme Purge theme cache
--lang Purge language string cache
--js Purge JavaScript cache
--filter Purge text filter cache
--other Purge all file caches and other miscellaneous caches (may include MUC
if using cachestore_file).
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/purge_caches.php
EOF;
\$sudo -u www-data /usr/bin/php admin/cli/purge_caches.php
";
echo $help;
exit(0);
}
purge_caches(array_filter($options));
purge_all_caches();
exit(0);
exit(0);
+11 -38
View File
@@ -26,26 +26,13 @@
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
// Define the input options.
$longparams = array(
'help' => false,
'username' => '',
'password' => '',
'ignore-password-policy' => false
);
$shortparams = array(
'h' => 'help',
'u' => 'username',
'p' => 'password',
'i' => 'ignore-password-policy'
);
// now get cli options
list($options, $unrecognized) = cli_get_params($longparams, $shortparams);
list($options, $unrecognized) = cli_get_params(array('help'=>false),
array('h'=>'help'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
@@ -60,43 +47,29 @@ There are no security checks here because anybody who is able to
execute this file may execute any PHP too.
Options:
-h, --help Print out this help
-u, --username=username Specify username to change
-p, --password=newpassword Specify new password
--ignore-password-policy Ignore password policy when setting password
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/reset_password.php
\$sudo -u www-data /usr/bin/php admin/cli/reset_password.php --username=rosaura --password=jiu3jiu --ignore-password-policy
";
echo $help;
die;
}
if ($options['username'] == '' ) {
cli_heading('Password reset');
$prompt = "Enter username (manual authentication only)";
$username = cli_input($prompt);
} else {
$username = $options['username'];
}
cli_heading('Password reset');
$prompt = "Enter username (manual authentication only)";
$username = cli_input($prompt);
if (!$user = $DB->get_record('user', array('auth'=>'manual', 'username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
cli_error("Can not find user '$username'");
}
if ($options['password'] == '' ) {
$prompt = "Enter new password";
$password = cli_input($prompt);
} else {
$password = $options['password'];
}
$prompt = "Enter new password";
$password = cli_input($prompt);
$errmsg = '';//prevent eclipse warning
if (!$options['ignore-password-policy'] ) {
if (!check_password_policy($password, $errmsg, $user)) {
cli_error(html_to_text($errmsg, 0));
}
if (!check_password_policy($password, $errmsg)) {
cli_error(html_to_text($errmsg, 0));
}
$hashedpassword = hash_internal_user_password($password);
-109
View File
@@ -1,109 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This script allows to restore a course from CLI.
*
* @package core
* @subpackage cli
* @copyright 2020 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', 1);
require(__DIR__ . '/../../config.php');
require_once($CFG->libdir . '/clilib.php');
require_once($CFG->dirroot . "/backup/util/includes/restore_includes.php");
list($options, $unrecognized) = cli_get_params([
'file' => '',
'categoryid' => '',
'showdebugging' => false,
'help' => false,
], [
'f' => 'file',
'c' => 'categoryid',
's' => 'showdebugging',
'h' => 'help',
]);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help'] || !($options['file']) || !($options['categoryid'])) {
$help = <<<EOL
Restore backup into provided category.
Options:
-f, --file=STRING Path to the backup file.
-c, --categoryid=INT ID of the category to restore too.
-s, --showdebugging Show developer level debugging information
-h, --help Print out this help.
Example:
\$sudo -u www-data /usr/bin/php admin/cli/restore_backup.php --file=/path/to/backup/file.mbz --categoryid=1\n
EOL;
echo $help;
exit(0);
}
if ($options['showdebugging']) {
set_debugging(DEBUG_DEVELOPER, true);
}
if (!$admin = get_admin()) {
print_error('noadmins');
}
if (!file_exists($options['file'])) {
print_error('filenotfound');
}
if (!$category = $DB->get_record('course_categories', ['id' => $options['categoryid']], 'id')) {
print_error('invalidcategoryid');
}
$backupdir = "restore_" . uniqid();
$path = $CFG->tempdir . DIRECTORY_SEPARATOR . "backup" . DIRECTORY_SEPARATOR . $backupdir;
cli_heading(get_string('extractingbackupfileto', 'backup', $path));
$fp = get_file_packer('application/vnd.moodle.backup');
$fp->extract_to_pathname($options['file'], $path);
cli_heading(get_string('preprocessingbackupfile'));
try {
list($fullname, $shortname) = restore_dbops::calculate_course_names(0, get_string('restoringcourse', 'backup'),
get_string('restoringcourseshortname', 'backup'));
$courseid = restore_dbops::create_new_course($fullname, $shortname, $category->id);
$rc = new restore_controller($backupdir, $courseid, backup::INTERACTIVE_NO,
backup::MODE_GENERAL, $admin->id, backup::TARGET_NEW_COURSE);
$rc->execute_precheck();
$rc->execute_plan();
$rc->destroy();
} catch (Exception $e) {
cli_heading(get_string('cleaningtempdata'));
fulldelete($path);
print_error('generalexceptionmessage', 'error', '', $e->getMessage());
}
cli_heading(get_string('restoredcourseid', 'backup', $courseid));
exit(0);
-168
View File
@@ -1,168 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* CLI task execution.
*
* @package core
* @subpackage cli
* @copyright 2014 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__ . '/../../config.php');
require_once("$CFG->libdir/clilib.php");
require_once("$CFG->libdir/cronlib.php");
list($options, $unrecognized) = cli_get_params(
[
'help' => false,
'list' => false,
'execute' => false,
'showsql' => false,
'showdebugging' => false,
'force' => false,
], [
'h' => 'help',
'f' => 'force',
]
);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help'] or (!$options['list'] and !$options['execute'])) {
$help =
"Scheduled cron tasks.
Options:
--execute=\\some\\task Execute scheduled task manually
--list List all scheduled tasks
--showsql Show sql queries before they are executed
--showdebugging Show developer level debugging information
-h, --help Print out this help
-f, --force Execute task even if cron is disabled
Example:
\$sudo -u www-data /usr/bin/php admin/cli/scheduled_task.php --execute=\\core\\task\\session_cleanup_task
";
echo $help;
die;
}
if ($options['showdebugging'] || !empty($CFG->showcrondebugging)) {
set_debugging(DEBUG_DEVELOPER, true);
}
if ($options['showsql'] || !empty($CFG->showcronsql)) {
$DB->set_debug(true);
}
if ($options['list']) {
cli_heading("List of scheduled tasks ($CFG->wwwroot)");
$shorttime = get_string('strftimedatetimeshort');
$tasks = \core\task\manager::get_all_scheduled_tasks();
echo str_pad(get_string('scheduledtasks', 'tool_task'), 50, ' ') . ' ' . str_pad(get_string('runpattern', 'tool_task'), 17, ' ')
. ' ' . str_pad(get_string('lastruntime', 'tool_task'), 40, ' ') . get_string('nextruntime', 'tool_task') . "\n";
foreach ($tasks as $task) {
$class = '\\' . get_class($task);
$schedule = $task->get_minute() . ' '
. $task->get_hour() . ' '
. $task->get_day() . ' '
. $task->get_day_of_week() . ' '
. $task->get_month() . ' '
. $task->get_day_of_week();
$nextrun = $task->get_next_run_time();
$lastrun = $task->get_last_run_time();
$plugininfo = core_plugin_manager::instance()->get_plugin_info($task->get_component());
$plugindisabled = $plugininfo && $plugininfo->is_enabled() === false && !$task->get_run_if_component_disabled();
if ($plugindisabled) {
$nextrun = get_string('plugindisabled', 'tool_task');
} else if ($task->get_disabled()) {
$nextrun = get_string('taskdisabled', 'tool_task');
} else if ($nextrun > time()) {
$nextrun = userdate($nextrun);
} else {
$nextrun = get_string('asap', 'tool_task');
}
if ($lastrun) {
$lastrun = userdate($lastrun);
} else {
$lastrun = get_string('never');
}
echo str_pad($class, 50, ' ') . ' ' . str_pad($schedule, 17, ' ') .
' ' . str_pad($lastrun, 40, ' ') . ' ' . $nextrun . "\n";
}
exit(0);
}
if ($execute = $options['execute']) {
if (!$task = \core\task\manager::get_scheduled_task($execute)) {
mtrace("Task '$execute' not found");
exit(1);
}
if (moodle_needs_upgrading()) {
mtrace("Moodle upgrade pending, cannot execute tasks.");
exit(1);
}
if (!get_config('core', 'cron_enabled') && !$options['force']) {
mtrace('Cron is disabled. Use --force to override.');
exit(1);
}
\core\task\manager::scheduled_task_starting($task);
// Increase memory limit.
raise_memory_limit(MEMORY_EXTRA);
// Emulate normal session - we use admin account by default.
cron_setup_user();
// Execute the task.
\core\local\cli\shutdown::script_supports_graceful_exit();
$cronlockfactory = \core\lock\lock_config::get_lock_factory('cron');
if (!$cronlock = $cronlockfactory->get_lock('core_cron', 10)) {
mtrace('Cannot obtain cron lock');
exit(129);
}
if (!$lock = $cronlockfactory->get_lock('\\' . get_class($task), 10)) {
$cronlock->release();
mtrace('Cannot obtain task lock');
exit(130);
}
$task->set_lock($lock);
if (!$task->is_blocking()) {
$cronlock->release();
} else {
$task->set_cron_lock($cronlock);
}
cron_run_inner_scheduled_task($task);
}
-183
View File
@@ -1,183 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* CLI script to uninstall plugins.
*
* @package core
* @subpackage cli
* @copyright 2018 Dmitrii Metelkin <dmitriim@catalyst-au.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__ . '/../../config.php');
require_once($CFG->libdir . '/clilib.php');
require_once($CFG->libdir . '/adminlib.php');
$help = "Command line tool to uninstall plugins.
Options:
-h --help Print this help.
--show-all Displays a list of all installed plugins.
--show-contrib Displays a list of all third-party installed plugins.
--show-missing Displays a list of plugins missing from disk.
--purge-missing Uninstall all missing from disk plugins.
--plugins=<plugin name> A comma separated list of plugins to be uninstalled. E.g. mod_assign,mod_forum
--run Execute uninstall. If this option is not set, then the script will be run in a dry mode.
--showsql Show sql queries before they are executed.
--showdebugging Show developer level debugging information.
Examples:
# php uninstall_plugins.php --show-all
Prints tab-separated list of all installed plugins.
# php uninstall_plugins.php --show-contrib
Prints tab-separated list of all third-party installed plugins.
# php uninstall_plugins.php --show-missing
Prints tab-separated list of all missing from disk plugins.
# php uninstall_plugins.php --purge-missing
A dry run of uninstalling all missing plugins.
# php uninstall_plugins.php --purge-missing --run
Run uninstall of all missing plugins.
# php uninstall_plugins.php --plugins=mod_assign,mod_forum
A dry run of uninstalling mod_assign and mod_forum plugins.
# php uninstall_plugins.php --plugins=mod_assign,mod_forum --run
Run uninstall for mod_assign and mod_forum plugins.
";
list($options, $unrecognised) = cli_get_params([
'help' => false,
'show-all' => false,
'show-contrib' => false,
'show-missing' => false,
'purge-missing' => false,
'plugins' => false,
'run' => false,
'showsql' => false,
'showdebugging' => false,
], [
'h' => 'help'
]);
if ($unrecognised) {
$unrecognised = implode(PHP_EOL.' ', $unrecognised);
cli_error(get_string('cliunknowoption', 'core_admin', $unrecognised));
}
if ($options['help']) {
cli_writeln($help);
exit(0);
}
if ($options['showdebugging']) {
set_debugging(DEBUG_DEVELOPER, true);
}
if ($options['showsql']) {
$DB->set_debug(true);
}
$pluginman = core_plugin_manager::instance();
$plugininfo = $pluginman->get_plugins();
if ($options['show-all'] || $options['show-missing'] || $options['show-contrib']) {
foreach ($plugininfo as $type => $plugins) {
foreach ($plugins as $name => $plugin) {
if ($options['show-contrib'] && $plugin->is_standard()) {
continue;
}
$pluginstring = $plugin->component . "\t" . $plugin->displayname;
if ($options['show-all'] || $options['show-contrib']) {
cli_writeln($pluginstring);
} else {
if ($plugin->get_status() === core_plugin_manager::PLUGIN_STATUS_MISSING) {
cli_writeln($pluginstring);
}
}
}
}
exit(0);
}
if ($options['purge-missing']) {
foreach ($plugininfo as $type => $plugins) {
foreach ($plugins as $name => $plugin) {
if ($plugin->get_status() === core_plugin_manager::PLUGIN_STATUS_MISSING) {
$pluginstring = $plugin->component . "\t" . $plugin->displayname;
if ($pluginman->can_uninstall_plugin($plugin->component)) {
if ($options['run']) {
cli_writeln('Uninstalling: ' . $pluginstring);
$progress = new progress_trace_buffer(new text_progress_trace(), true);
$pluginman->uninstall_plugin($plugin->component, $progress);
$progress->finished();
cli_write($progress->get_buffer());
} else {
cli_writeln('Will be uninstalled: ' . $pluginstring);
}
} else {
cli_writeln('Can not be uninstalled: ' . $pluginstring);
}
}
}
}
exit(0);
}
if ($options['plugins']) {
$components = explode(',', $options['plugins']);
foreach ($components as $component) {
$plugin = $pluginman->get_plugin_info($component);
if (is_null($plugin)) {
cli_writeln('Unknown plugin: ' . $component);
} else {
$pluginstring = $plugin->component . "\t" . $plugin->displayname;
if ($pluginman->can_uninstall_plugin($plugin->component)) {
if ($options['run']) {
cli_writeln('Uninstalling: ' . $pluginstring);
$progress = new progress_trace_buffer(new text_progress_trace(), true);
$pluginman->uninstall_plugin($plugin->component, $progress);
$progress->finished();
cli_write($progress->get_buffer());
} else {
cli_writeln('Will be uninstalled: ' . $pluginstring);
}
} else {
cli_writeln('Can not be uninstalled: ' . $pluginstring);
}
}
}
exit(0);
}
cli_writeln($help);
exit(0);
+10 -62
View File
@@ -38,32 +38,24 @@ if (function_exists('opcache_reset') and !isset($_SERVER['REMOTE_ADDR'])) {
define('CLI_SCRIPT', true);
define('CACHE_DISABLE_ALL', true);
require(__DIR__.'/../../config.php');
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
require_once($CFG->libdir.'/clilib.php'); // cli only functions
require_once($CFG->libdir.'/environmentlib.php');
// now get cli options
$lang = isset($SESSION->lang) ? $SESSION->lang : $CFG->lang;
list($options, $unrecognized) = cli_get_params(
array(
'non-interactive' => false,
'allow-unstable' => false,
'help' => false,
'lang' => $lang,
'verbose-settings' => false,
'is-pending' => false,
'help' => false
),
array(
'h' => 'help'
)
);
if ($options['lang']) {
$SESSION->lang = $options['lang'];
}
$interactive = empty($options['non-interactive']);
if ($unrecognized) {
@@ -82,15 +74,6 @@ Options:
--non-interactive No interactive questions or confirmations
--allow-unstable Upgrade even if the version is not marked as stable yet,
required in non-interactive mode.
--lang=CODE Set preferred language for CLI output. Defaults to the
site language if not set. Defaults to 'en' if the lang
parameter is invalid or if the language pack is not
installed.
--verbose-settings Show new settings values. By default only the name of
new core or plugin settings are displayed. This option
outputs the new values as well as the setting name.
--is-pending If an upgrade is needed it exits with an error code of
2 so it distinct from other types of errors.
-h, --help Print out this help
Example:
@@ -119,10 +102,6 @@ if (!moodle_needs_upgrading()) {
cli_error(get_string('cliupgradenoneed', 'core_admin', $newversion), 0);
}
if ($options['is-pending']) {
cli_error(get_string('cliupgradepending', 'core_admin'), 2);
}
// Test environment first.
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
if (!$envstatus) {
@@ -135,27 +114,17 @@ if (!$envstatus) {
exit(1);
}
// Make sure there are no files left over from previous versions.
if (upgrade_stale_php_files_present()) {
cli_problem(get_string('upgradestalefiles', 'admin'));
// Stale file info contains HTML elements which aren't suitable for CLI.
$upgradestalefilesinfo = get_string('upgradestalefilesinfo', 'admin', get_docs_url('Upgrading'));
cli_error(strip_tags($upgradestalefilesinfo));
}
// Test plugin dependencies.
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed, $CFG->branch)) {
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
cli_error(get_string('pluginschecktodo', 'admin'));
}
$a = new stdClass();
$a->oldversion = $oldversion;
$a->newversion = $newversion;
if ($interactive) {
$a = new stdClass();
$a->oldversion = $oldversion;
$a->newversion = $newversion;
echo cli_heading(get_string('databasechecking', '', $a)) . PHP_EOL;
}
@@ -204,30 +173,9 @@ upgrade_noncore(true);
// log in as admin - we need doanything permission when applying defaults
\core\session\manager::set_user(get_admin());
// Apply default settings and output those that have changed.
cli_heading(get_string('cliupgradedefaultheading', 'admin'));
$settingsoutput = admin_apply_default_settings(null, false);
// apply all default settings, just in case do it twice to fill all defaults
admin_apply_default_settings(NULL, false);
admin_apply_default_settings(NULL, false);
foreach ($settingsoutput as $setting => $value) {
if ($options['verbose-settings']) {
$stringvlaues = array(
'name' => $setting,
'defaultsetting' => var_export($value, true) // Expand objects.
);
echo get_string('cliupgradedefaultverbose', 'admin', $stringvlaues) . PHP_EOL;
} else {
echo get_string('cliupgradedefault', 'admin', $setting) . PHP_EOL;
}
}
// This needs to happen at the end to ensure it occurs after all caches
// have been purged for the last time.
// This will build a cached version of the current theme for the user
// to immediately start browsing the site.
upgrade_themes();
echo get_string('cliupgradefinished', 'admin', $a)."\n";
echo get_string('cliupgradefinished', 'admin')."\n";
exit(0); // 0 means success
-84
View File
@@ -1,84 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Content bank and its plugins settings.
*
* @package core
* @subpackage contentbank
* @copyright 2020 Amaia Anabitarte <amaia@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$name = required_param('name', PARAM_PLUGIN);
$syscontext = context_system::instance();
$PAGE->set_url('/admin/contentbank.php');
$PAGE->set_context($syscontext);
require_admin();
require_sesskey();
$return = new moodle_url('/admin/settings.php', array('section' => 'managecontentbanktypes'));
$plugins = core_plugin_manager::instance()->get_plugins_of_type('contenttype');
$sortorder = array_flip(array_keys($plugins));
if (!isset($plugins[$name])) {
print_error('contenttypenotfound', 'error', $return, $name);
}
switch ($action) {
case 'disable':
if ($plugins[$name]->is_enabled()) {
set_config('disabled', 1, 'contentbank_'. $name);
}
break;
case 'enable':
if (!$plugins[$name]->is_enabled()) {
unset_config('disabled', 'contentbank_'. $name);
}
break;
case 'up':
if ($sortorder[$name]) {
$currentindex = $sortorder[$name];
$seq = array_keys($plugins);
$seq[$currentindex] = $seq[$currentindex - 1];
$seq[$currentindex - 1] = $name;
set_config('contentbank_plugins_sortorder', implode(',', $seq));
}
break;
case 'down':
if ($sortorder[$name] < count($sortorder) - 1) {
$currentindex = $sortorder[$name];
$seq = array_keys($plugins);
$seq[$currentindex] = $seq[$currentindex + 1];
$seq[$currentindex + 1] = $name;
set_config('contentbank_plugins_sortorder', implode(',', $seq));
}
break;
}
core_plugin_manager::reset_caches();
$cache = cache::make('core', 'contentbank_enabled_extensions');
$cache->purge();
$cache = cache::make('core', 'contentbank_context_extensions');
$cache->purge();
redirect($return);
+2 -1
View File
@@ -32,7 +32,8 @@ $syscontext = context_system::instance();
$PAGE->set_url('/admin/courseformats.php');
$PAGE->set_context($syscontext);
require_admin();
require_login();
require_capability('moodle/site:config', $syscontext);
require_sesskey();
$return = new moodle_url('/admin/settings.php', array('section' => 'manageformats'));
-61
View File
@@ -1,61 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Allows the admin to enable, disable and uninstall custom fields
*
* @package core_admin
* @copyright 2018 Daniel Neis Araujo
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$customfieldname = required_param('field', PARAM_PLUGIN);
$syscontext = context_system::instance();
$PAGE->set_url('/admin/customfields.php');
$PAGE->set_context($syscontext);
require_admin();
require_sesskey();
$return = new moodle_url('/admin/settings.php', array('section' => 'managecustomfields'));
$customfieldplugins = core_plugin_manager::instance()->get_plugins_of_type('customfield');
$sortorder = array_flip(array_keys($customfieldplugins));
if (!isset($customfieldplugins[$customfieldname])) {
print_error('customfieldnotfound', 'error', $return, $customfieldname);
}
switch ($action) {
case 'disable':
if ($customfieldplugins[$customfieldname]->is_enabled()) {
set_config('disabled', 1, 'customfield_'. $customfieldname);
core_plugin_manager::reset_caches();
}
break;
case 'enable':
if (!$customfieldplugins[$customfieldname]->is_enabled()) {
unset_config('disabled', 'customfield_'. $customfieldname);
core_plugin_manager::reset_caches();
}
break;
}
redirect($return);
-81
View File
@@ -1,81 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Lets users manage data formats
*
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @copyright 2016 Brendan Heywood (brendan@catalyst-au.net)
* @package core
* @subpackage dataformat
*/
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$name = required_param('name', PARAM_PLUGIN);
$syscontext = context_system::instance();
$PAGE->set_url('/admin/dataformats.php');
$PAGE->set_context($syscontext);
require_admin();
require_sesskey();
$return = new moodle_url('/admin/settings.php', array('section' => 'managedataformats'));
$plugins = core_plugin_manager::instance()->get_plugins_of_type('dataformat');
$sortorder = array_flip(array_keys($plugins));
if (!isset($plugins[$name])) {
print_error('courseformatnotfound', 'error', $return, $name);
}
switch ($action) {
case 'disable':
if ($plugins[$name]->is_enabled()) {
set_config('disabled', 1, 'dataformat_'. $name);
core_plugin_manager::reset_caches();
}
break;
case 'enable':
if (!$plugins[$name]->is_enabled()) {
unset_config('disabled', 'dataformat_'. $name);
core_plugin_manager::reset_caches();
}
break;
case 'up':
if ($sortorder[$name]) {
$currentindex = $sortorder[$name];
$seq = array_keys($plugins);
$seq[$currentindex] = $seq[$currentindex - 1];
$seq[$currentindex - 1] = $name;
set_config('dataformat_plugins_sortorder', implode(',', $seq));
}
break;
case 'down':
if ($sortorder[$name] < count($sortorder) - 1) {
$currentindex = $sortorder[$name];
$seq = array_keys($plugins);
$seq[$currentindex] = $seq[$currentindex + 1];
$seq[$currentindex + 1] = $name;
set_config('dataformat_plugins_sortorder', implode(',', $seq));
}
break;
}
redirect($return);
+2 -5
View File
@@ -15,7 +15,8 @@ $confirm = optional_param('confirm', 0, PARAM_BOOL);
$PAGE->set_url('/admin/editors.php', array('action'=>$action, 'editor'=>$editor));
$PAGE->set_context(context_system::instance());
require_admin();
require_login();
require_capability('moodle/site:config', context_system::instance());
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageeditors";
@@ -46,7 +47,6 @@ switch ($action) {
// remove from enabled list
$key = array_search($editor, $active_editors);
unset($active_editors[$key]);
add_to_config_log('editor_visibility', '1', '0', $editor);
break;
case 'enable':
@@ -54,7 +54,6 @@ switch ($action) {
if (!in_array($editor, $active_editors)) {
$active_editors[] = $editor;
$active_editors = array_unique($active_editors);
add_to_config_log('editor_visibility', '0', '1', $editor);
}
break;
@@ -67,7 +66,6 @@ switch ($action) {
$fsave = $active_editors[$key];
$active_editors[$key] = $active_editors[$key + 1];
$active_editors[$key + 1] = $fsave;
add_to_config_log('editor_position', $key, $key + 1, $editor);
}
}
break;
@@ -81,7 +79,6 @@ switch ($action) {
$fsave = $active_editors[$key];
$active_editors[$key] = $active_editors[$key - 1];
$active_editors[$key - 1] = $fsave;
add_to_config_log('editor_position', $key, $key - 1, $editor);
}
}
break;
+2 -1
View File
@@ -35,7 +35,8 @@ $confirm = optional_param('confirm', 0, PARAM_BOOL);
$PAGE->set_url('/admin/enrol.php');
$PAGE->set_context(context_system::instance());
require_admin();
require_login();
require_capability('moodle/site:config', context_system::instance());
require_sesskey();
$enabled = enrol_get_plugins(true);
File diff suppressed because it is too large Load Diff
+6 -2
View File
@@ -22,12 +22,16 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../config.php');
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir . '/adminlib.php');
$action = optional_param('action', '', PARAM_ALPHA);
$filterpath = optional_param('filterpath', '', PARAM_PLUGIN);
require_login();
$systemcontext = context_system::instance();
require_capability('moodle/site:config', $systemcontext);
admin_externalpage_setup('managefilters');
// Clean up bogus filter states first.
@@ -214,7 +218,7 @@ function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow,
// Re-order.
$updown = '';
$spacer = $OUTPUT->spacer();
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" />';
if ($state->active != TEXTFILTER_DISABLED) {
if (!$isfirstrow) {
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up'), '', array('class' => 'iconsmall')));
+25 -84
View File
@@ -29,9 +29,14 @@ if (!file_exists('../config.php')) {
die();
}
// Check that PHP is of a sufficient version as soon as possible.
require_once(__DIR__.'/../lib/phpminimumversionlib.php');
moodle_require_minimum_php_version();
// Check that PHP is of a sufficient version as soon as possible
if (version_compare(phpversion(), '5.4.4') < 0) {
$phpversion = phpversion();
// do NOT localise - lang strings would not work here and we CAN NOT move it to later place
echo "Moodle 2.7 or later requires at least PHP 5.4.4 (currently using version $phpversion).<br />";
echo "Please upgrade your server software or install older Moodle version.";
die();
}
// make sure iconv is available and actually works
if (!function_exists('iconv')) {
@@ -96,12 +101,6 @@ if (function_exists('opcache_invalidate')) {
// indirectly calls the protected init() method is good here.
core_component::get_core_subsystems();
if (is_major_upgrade_required() && isloggedin()) {
// A major upgrade is required.
// Terminate the session and redirect back here before anything DB-related happens.
redirect_if_major_upgrade_required();
}
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
@@ -226,7 +225,7 @@ if (!core_tables_exist()) {
}
if (empty($confirmrelease)) {
require_once($CFG->libdir.'/environmentlib.php');
list($envstatus, $environmentresults) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
$strcurrentrelease = get_string('currentrelease');
$PAGE->navbar->add($strcurrentrelease);
@@ -235,13 +234,13 @@ if (!core_tables_exist()) {
$PAGE->set_cacheable(false);
$output = $PAGE->get_renderer('core', 'admin');
echo $output->install_environment_page($maturity, $envstatus, $environmentresults, $release);
echo $output->install_environment_page($maturity, $envstatus, $environment_results, $release);
die();
}
// check plugin dependencies
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed, $CFG->branch)) {
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
$PAGE->navbar->add(get_string('pluginscheck', 'admin'));
$PAGE->set_title($strinstallation);
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
@@ -316,11 +315,6 @@ if (!$cache and $version > $CFG->version) { // upgrade
$testsite = 'behat';
}
if (isset($CFG->themerev)) {
// Store the themerev to restore after purging caches.
$themerev = $CFG->themerev;
}
// We purge all of MUC's caches here.
// Caches are disabled for upgrade by CACHE_DISABLE_ALL so we must set the first arg to true.
// This ensures a real config object is loaded and the stores will be purged.
@@ -330,11 +324,6 @@ if (!$cache and $version > $CFG->version) { // upgrade
// We then purge the regular caches.
purge_all_caches();
if (isset($themerev)) {
// Restore the themerev
set_config('themerev', $themerev);
}
$output = $PAGE->get_renderer('core', 'admin');
if (upgrade_stale_php_files_present()) {
@@ -358,9 +347,9 @@ if (!$cache and $version > $CFG->version) { // upgrade
echo $output->upgrade_confirm_page($a->newversion, $maturity, $testsite);
die();
} else if (empty($confirmrelease)) {
} else if (empty($confirmrelease)){
require_once($CFG->libdir.'/environmentlib.php');
list($envstatus, $environmentresults) = check_moodle_environment($release, ENV_SELECT_RELEASE);
list($envstatus, $environment_results) = check_moodle_environment($release, ENV_SELECT_RELEASE);
$strcurrentrelease = get_string('currentrelease');
$PAGE->navbar->add($strcurrentrelease);
@@ -368,7 +357,7 @@ if (!$cache and $version > $CFG->version) { // upgrade
$PAGE->set_heading($strcurrentrelease);
$PAGE->set_cacheable(false);
echo $output->upgrade_environment_page($release, $envstatus, $environmentresults);
echo $output->upgrade_environment_page($release, $envstatus, $environment_results);
die();
} else if (empty($confirmplugins)) {
@@ -508,9 +497,8 @@ if (!$cache and $version > $CFG->version) { // upgrade
} else {
// Always verify plugin dependencies!
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed, $CFG->branch)) {
echo $output->unsatisfied_dependencies_page($version, $failed, new moodle_url($PAGE->url,
array('confirmplugincheck' => 0)));
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
die();
}
unset($failed);
@@ -534,10 +522,7 @@ if (!$cache and $branch <> $CFG->branch) { // Update the branch
if (!$cache and moodle_needs_upgrading()) {
$PAGE->set_url(new moodle_url($PAGE->url, array(
'confirmrelease' => $confirmrelease,
'confirmplugincheck' => $confirmplugins,
)));
$PAGE->set_url(new moodle_url($PAGE->url, array('confirmplugincheck' => $confirmplugins)));
check_upgrade_key($upgradekeyhash);
@@ -547,21 +532,7 @@ if (!$cache and moodle_needs_upgrading()) {
$pluginman = core_plugin_manager::instance();
$output = $PAGE->get_renderer('core', 'admin');
if (empty($confirmrelease)) {
require_once($CFG->libdir . '/environmentlib.php');
list($envstatus, $environmentresults) = check_moodle_environment($release, ENV_SELECT_RELEASE);
$strcurrentrelease = get_string('currentrelease');
$PAGE->navbar->add($strcurrentrelease);
$PAGE->set_title($strcurrentrelease);
$PAGE->set_heading($strcurrentrelease);
$PAGE->set_cacheable(false);
echo $output->upgrade_environment_page($release, $envstatus, $environmentresults);
die();
} else if (!$confirmplugins) {
if (!$confirmplugins) {
$strplugincheck = get_string('plugincheck');
$PAGE->navbar->add($strplugincheck);
@@ -700,10 +671,9 @@ if (!$cache and moodle_needs_upgrading()) {
// Make sure plugin dependencies are always checked.
$failed = array();
if (!$pluginman->all_plugins_ok($version, $failed, $CFG->branch)) {
if (!$pluginman->all_plugins_ok($version, $failed)) {
$output = $PAGE->get_renderer('core', 'admin');
echo $output->unsatisfied_dependencies_page($version, $failed, new moodle_url($PAGE->url,
array('confirmplugincheck' => 0)));
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
die();
}
unset($failed);
@@ -718,7 +688,6 @@ if (!$cache and moodle_needs_upgrading()) {
if (during_initial_install()) {
set_config('rolesactive', 1); // after this, during_initial_install will return false.
set_config('adminsetuppending', 1);
set_config('registrationpending', 1); // Remind to register site after all other setup is finished.
// we need this redirect to setup proper session
upgrade_finished("index.php?sessionstarted=1&amp;lang=$CFG->lang");
}
@@ -821,7 +790,7 @@ $SESSION->admin_critical_warning = ($insecuredataroot==INSECURE_DATAROOT_ERROR);
$adminroot = admin_get_root();
// Check if there are any new admin settings which have still yet to be set
if (any_new_admin_settings($adminroot)) {
if (any_new_admin_settings($adminroot)){
redirect('upgradesettings.php');
}
@@ -834,20 +803,14 @@ if (isset($SESSION->pluginuninstallreturn)) {
}
}
// If site registration needs updating, redirect.
\core\hub\registration::registration_reminder('/admin/index.php');
// Everything should now be set up, and the user is an admin
// Print default admin page with notifications.
$errorsdisplayed = defined('WARN_DISPLAY_ERRORS_ENABLED');
$lastcron = get_config('tool_task', 'lastcronstart');
// We make the assumption that at least one schedule task should run once per day.
$lastcron = $DB->get_field_sql('SELECT MAX(lastruntime) FROM {task_scheduled}');
$cronoverdue = ($lastcron < time() - 3600 * 24);
$lastcroninterval = get_config('tool_task', 'lastcroninterval');
$expectedfrequency = $CFG->expectedcronfrequency ?? MINSECS;
$croninfrequent = !$cronoverdue && ($lastcroninterval > ($expectedfrequency + MINSECS) || $lastcron < time() - $expectedfrequency);
$dbproblems = $DB->diagnose();
$maintenancemode = !empty($CFG->maintenance_enabled);
@@ -883,29 +846,9 @@ if ($updateschecker->enabled()) {
$buggyiconvnomb = (!function_exists('mb_convert_encoding') and @iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'€') !== '100€');
//check if the site is registered on Moodle.org
$registered = \core\hub\registration::is_registered();
$registered = $DB->count_records('registration_hubs', array('huburl' => HUB_MOODLEORGHUBURL, 'confirmed' => 1));
// Check if there are any cache warnings.
$cachewarnings = cache_helper::warnings();
// Check if there are events 1 API handlers.
$eventshandlers = $DB->get_records_sql('SELECT DISTINCT component FROM {events_handlers}');
$themedesignermode = !empty($CFG->themedesignermode);
$mobileconfigured = !empty($CFG->enablemobilewebservice);
$invalidforgottenpasswordurl = !empty($CFG->forgottenpasswordurl) && empty(clean_param($CFG->forgottenpasswordurl, PARAM_URL));
// Check if a directory with development libraries exists.
if (empty($CFG->disabledevlibdirscheck) && (is_dir($CFG->dirroot.'/vendor') || is_dir($CFG->dirroot.'/node_modules'))) {
$devlibdir = true;
} else {
$devlibdir = false;
}
// Check if the site is being foced onto ssl.
$overridetossl = !empty($CFG->overridetossl);
// Check if moodle campaign content setting is enabled or not.
$showcampaigncontent = !isset($CFG->showcampaigncontent) || $CFG->showcampaigncontent;
// Encourage admins to enable the user feedback feature if it is not enabled already.
$showfeedbackencouragement = empty($CFG->enableuserfeedback);
admin_externalpage_setup('adminnotifications');
@@ -913,6 +856,4 @@ $output = $PAGE->get_renderer('core', 'admin');
echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed, $cronoverdue, $dbproblems,
$maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb,
$registered, $cachewarnings, $eventshandlers, $themedesignermode, $devlibdir,
$mobileconfigured, $overridetossl, $invalidforgottenpasswordurl, $croninfrequent,
$showcampaigncontent, $showfeedbackencouragement);
$registered, $cachewarnings);
-85
View File
@@ -24,8 +24,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Return a list of page types
* @param string $pagetype current page type
@@ -39,86 +37,3 @@ function admin_page_type_list($pagetype, $parentcontext, $currentcontext) {
);
return $array;
}
/**
* File serving.
*
* @param stdClass $course The course object.
* @param stdClass $cm The cm object.
* @param context $context The context object.
* @param string $filearea The file area.
* @param array $args List of arguments.
* @param bool $forcedownload Whether or not to force the download of the file.
* @param array $options Array of options.
* @return void|false
*/
function core_admin_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
global $CFG;
if (in_array($filearea, ['logo', 'logocompact'])) {
$size = array_shift($args); // The path hides the size.
$itemid = clean_param(array_shift($args), PARAM_INT);
$filename = clean_param(array_shift($args), PARAM_FILE);
$themerev = theme_get_revision();
if ($themerev <= 0) {
// Normalise to 0 as -1 doesn't place well with paths.
$themerev = 0;
}
// Extract the requested width and height.
$maxwidth = 0;
$maxheight = 0;
if (preg_match('/^\d+x\d+$/', $size)) {
list($maxwidth, $maxheight) = explode('x', $size);
$maxwidth = clean_param($maxwidth, PARAM_INT);
$maxheight = clean_param($maxheight, PARAM_INT);
}
$lifetime = 0;
if ($itemid > 0 && $themerev == $itemid) {
// The itemid is $CFG->themerev, when 0 or less no caching. Also no caching when they don't match.
$lifetime = DAYSECS * 60;
}
// Anyone, including guests and non-logged in users, can view the logos.
$options = ['cacheability' => 'public'];
// Check if we've got a cached file to return. When lifetime is 0 then we don't want to cached one.
$candidate = $CFG->localcachedir . "/core_admin/$themerev/$filearea/{$maxwidth}x{$maxheight}/$filename";
if (file_exists($candidate) && $lifetime > 0) {
send_file($candidate, $filename, $lifetime, 0, false, false, '', false, $options);
}
// Find the original file.
$fs = get_file_storage();
$filepath = "/{$context->id}/core_admin/{$filearea}/0/{$filename}";
if (!$file = $fs->get_file_by_hash(sha1($filepath))) {
send_file_not_found();
}
// No need for resizing, but if the file should be cached we save it so we can serve it fast next time.
if (empty($maxwidth) && empty($maxheight)) {
if ($lifetime) {
file_safe_save_content($file->get_content(), $candidate);
}
send_stored_file($file, $lifetime, 0, false, $options);
}
// Proceed with the resizing.
$filedata = $file->resize_image($maxwidth, $maxheight);
if (!$filedata) {
send_file_not_found();
}
// If we don't want to cached the file, serve now and quit.
if (!$lifetime) {
send_content_uncached($filedata, $filename);
}
// Save, serve and quit.
file_safe_save_content($filedata, $candidate);
send_file($candidate, $filename, $lifetime, 0, false, false, '', false, $options);
}
send_file_not_found();
}
+57
View File
@@ -0,0 +1,57 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Allows admin to configure licenses.
*/
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/licenselib.php');
require_login();
require_capability('moodle/site:config', context_system::instance());
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=managelicenses";
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$license = optional_param('license', '', PARAM_SAFEDIR);
////////////////////////////////////////////////////////////////////////////////
// process actions
if (!confirm_sesskey()) {
redirect($returnurl);
}
$return = true;
switch ($action) {
case 'disable':
license_manager::disable($license);
break;
case 'enable':
license_manager::enable($license);
break;
default:
break;
}
if ($return) {
redirect ($returnurl);
}
+1 -1
View File
@@ -27,7 +27,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../config.php');
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
-96
View File
@@ -1,96 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file is used to display a categories sub categories, external pages, and settings.
*
* @package admin
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../config.php');
require_once("{$CFG->libdir}/adminlib.php");
$contextid = required_param('id', PARAM_INT);
$confirm = optional_param('confirm', null, PARAM_INT);
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
$PAGE->set_url('/admin/lock.php', ['id' => $contextid]);
list($context, $course, $cm) = get_context_info_array($contextid);
$parentcontext = $context->get_parent_context();
if ($parentcontext && !empty($parentcontext->locked)) {
// Can't make changes to a context whose parent is locked.
throw new \coding_exception('Not sure how you got here');
}
if ($course) {
$isfrontpage = ($course->id == SITEID);
} else {
$isfrontpage = false;
$course = $SITE;
}
require_login($course, false, $cm);
require_capability('moodle/site:managecontextlocks', $context);
$PAGE->set_pagelayout('admin');
$PAGE->navigation->clear_cache();
$a = (object) [
'contextname' => $context->get_context_name(),
];
if (null !== $confirm && confirm_sesskey()) {
$context->set_locked(!empty($confirm));
if ($context->locked) {
$lockmessage = get_string('managecontextlocklocked', 'admin', $a);
} else {
$lockmessage = get_string('managecontextlockunlocked', 'admin', $a);
}
if (empty($returnurl)) {
$returnurl = $context->get_url();
} else {
$returnurl = new moodle_url($returnurl);
}
redirect($returnurl, $lockmessage);
}
$heading = get_string('managecontextlock', 'admin');
$PAGE->set_title($heading);
$PAGE->set_heading($heading);
echo $OUTPUT->header();
if ($context->locked) {
$confirmstring = get_string('confirmcontextunlock', 'admin', $a);
$target = 0;
} else {
$confirmstring = get_string('confirmcontextlock', 'admin', $a);
$target = 1;
}
$confirmurl = new \moodle_url($PAGE->url, ['confirm' => $target]);
if (!empty($returnurl)) {
$confirmurl->param('returnurl', $returnurl);
}
echo $OUTPUT->confirm($confirmstring, $confirmurl, $context->get_url());
echo $OUTPUT->footer();
+1 -1
View File
@@ -29,7 +29,7 @@
*/
// Security check.
if (!file_exists(__DIR__.'/mailout-debugger.enable')) {
if (!file_exists(dirname(__FILE__).'/mailout-debugger.enable')) {
mdie("Disabled.");
}
$tmpdir=sys_get_temp_dir(); // default
-78
View File
@@ -1,78 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Enrol config manipulation script.
*
* @package core
* @subpackage media
* @copyright 2016 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('NO_OUTPUT_BUFFERING', true);
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$media = required_param('media', PARAM_PLUGIN);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$PAGE->set_url('/admin/media.php');
$PAGE->set_context(context_system::instance());
require_admin();
require_sesskey();
$plugins = core_plugin_manager::instance()->get_plugins_of_type('media');
$sortorder = array_values(\core\plugininfo\media::get_enabled_plugins());
$return = new moodle_url('/admin/settings.php', array('section' => 'managemediaplayers'));
if (!array_key_exists($media, $plugins)) {
redirect($return);
}
switch ($action) {
case 'disable':
$plugins[$media]->set_enabled(false);
break;
case 'enable':
$plugins[$media]->set_enabled(true);
break;
case 'up':
if (($pos = array_search($media, $sortorder)) > 0) {
$tmp = $sortorder[$pos - 1];
$sortorder[$pos - 1] = $sortorder[$pos];
$sortorder[$pos] = $tmp;
\core\plugininfo\media::set_enabled_plugins($sortorder);
}
break;
case 'down':
if ((($pos = array_search($media, $sortorder)) !== false) && ($pos < count($sortorder) - 1)) {
$tmp = $sortorder[$pos + 1];
$sortorder[$pos + 1] = $sortorder[$pos];
$sortorder[$pos] = $tmp;
\core\plugininfo\media::set_enabled_plugins($sortorder);
}
break;
}
redirect($return);
+30 -110
View File
@@ -21,134 +21,54 @@
* @copyright 2011 Lancaster University Network Services Limited
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../config.php');
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->dirroot . '/message/lib.php');
require_once($CFG->libdir.'/adminlib.php');
// This is an admin page.
// This is an admin page
admin_externalpage_setup('managemessageoutputs');
// Fetch processors.
$allprocessors = get_message_processors();
$processors = array_filter($allprocessors, function($processor) {
return $processor->enabled;
});
$disabledprocessors = array_filter($allprocessors, function($processor) {
return !$processor->enabled;
});
// Require site configuration capability
require_capability('moodle/site:config', context_system::instance());
// Fetch message providers.
$providers = get_message_providers();
// Fetch the manage message outputs interface.
$preferences = get_message_output_default_preferences();
// Get the submitted params
$disable = optional_param('disable', 0, PARAM_INT);
$enable = optional_param('enable', 0, PARAM_INT);
if (($form = data_submitted()) && confirm_sesskey()) {
$newpreferences = array();
// Prepare default message outputs settings.
foreach ($providers as $provider) {
$componentproviderbase = $provider->component.'_'.$provider->name;
$disableprovidersetting = $componentproviderbase.'_disable';
$providerdisabled = false;
if (!isset($form->$disableprovidersetting)) {
$providerdisabled = true;
$newpreferences[$disableprovidersetting] = 1;
} else {
$newpreferences[$disableprovidersetting] = 0;
}
$headingtitle = get_string('managemessageoutputs', 'message');
foreach (array('permitted', 'loggedin', 'loggedoff') as $setting) {
$value = null;
$componentprovidersetting = $componentproviderbase.'_'.$setting;
if ($setting == 'permitted') {
// If we deal with permitted select element, we need to create individual
// setting for each possible processor. Note that this block will
// always be processed first after entring parental foreach iteration
// so we can change form values on this stage.
foreach ($processors as $processor) {
$value = '';
if (isset($form->{$componentprovidersetting}[$processor->name])) {
$value = $form->{$componentprovidersetting}[$processor->name];
}
// Ensure that loggedin loggedoff options are set correctly for this permission.
if (($value == 'disallowed') || $providerdisabled) {
// It might be better to unset them, but I can't figure out why that cause error.
$form->{$componentproviderbase.'_loggedin'}[$processor->name] = 0;
$form->{$componentproviderbase.'_loggedoff'}[$processor->name] = 0;
} else if ($value == 'forced') {
$form->{$componentproviderbase.'_loggedin'}[$processor->name] = 1;
$form->{$componentproviderbase.'_loggedoff'}[$processor->name] = 1;
}
// Record the site preference.
$newpreferences[$processor->name.'_provider_'.$componentprovidersetting] = $value;
}
} else {
$newsettings = array();
if (property_exists($form, $componentprovidersetting)) {
// We must be processing loggedin or loggedoff checkboxes.
// Store defained comma-separated processors as setting value.
// Using array_filter eliminates elements set to 0 above.
$newsettings = array_keys(array_filter($form->{$componentprovidersetting}));
}
// Let's join existing setting values for disabled processors.
$property = 'message_provider_'.$componentprovidersetting;
if (property_exists($preferences, $property)) {
$existingsetting = $preferences->$property;
foreach ($disabledprocessors as $disable) {
if (strpos($existingsetting, $disable->name) > -1) {
$newsettings[] = $disable->name;
}
}
}
$value = join(',', $newsettings);
if (empty($value)) {
$value = null;
}
}
if ($setting != 'permitted') {
// We have already recoded site preferences for 'permitted' type.
$newpreferences['message_provider_'.$componentprovidersetting] = $value;
}
}
if (!empty($disable) && confirm_sesskey()) {
if (!$processor = $DB->get_record('message_processors', array('id'=>$disable))) {
print_error('outputdoesnotexist', 'message');
}
// Update database.
$transaction = $DB->start_delegated_transaction();
// Save processors enabled/disabled status.
foreach ($allprocessors as $processor) {
$enabled = isset($form->{$processor->name});
if ($enabled != $processor->enabled) {
add_to_config_log($processor->name, $processor->enabled, $enabled, 'core');
}
\core_message\api::update_processor_status($processor, $enabled);
}
foreach ($newpreferences as $name => $value) {
$old = isset($preferences->$name) ? $preferences->$name : '';
if ($old != $value) {
add_to_config_log($name, $old, $value, 'core');
}
set_config($name, $value, 'message');
}
$transaction->allow_commit();
$DB->set_field('message_processors', 'enabled', '0', array('id'=>$processor->id)); // Disable output
core_plugin_manager::reset_caches();
}
if (!empty($enable) && confirm_sesskey()) {
if (!$processor = $DB->get_record('message_processors', array('id'=>$enable))) {
print_error('outputdoesnotexist', 'message');
}
$DB->set_field('message_processors', 'enabled', '1', array('id'=>$processor->id)); // Enable output
core_plugin_manager::reset_caches();
}
if ($disable || $enable) {
$url = new moodle_url('message.php');
redirect($url);
}
// Page settings
$PAGE->set_context(context_system::instance());
$PAGE->requires->js_init_call('M.core_message.init_defaultoutputs');
// Grab the renderer
$renderer = $PAGE->get_renderer('core', 'message');
// Display the page.
// Display the manage message outputs interface
$processors = get_message_processors();
$messageoutputs = $renderer->manage_messageoutputs($processors);
// Display the page
echo $OUTPUT->header();
echo $renderer->manage_messageoutput_settings($allprocessors, $processors, $providers, $preferences);
echo $OUTPUT->heading($headingtitle);
echo $messageoutputs;
echo $OUTPUT->footer();
+4 -2
View File
@@ -2,7 +2,7 @@
// Allows the admin to control user logins from remote moodles.
require_once(__DIR__ . '/../../config.php');
require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
@@ -12,6 +12,8 @@ $page = optional_param('page', 0, PARAM_INT);
$perpage = optional_param('perpage', 30, PARAM_INT);
$action = trim(strtolower(optional_param('action', '', PARAM_ALPHA)));
require_login();
admin_externalpage_setup('ssoaccesscontrol');
if (!extension_loaded('openssl')) {
@@ -148,7 +150,7 @@ foreach ($columns as $column) {
} else {
$columndir = $dir == "ASC" ? "DESC" : "ASC";
$columnicon = $dir == "ASC" ? "down" : "up";
$columnicon = " " . $OUTPUT->pix_icon('t/' . $columnicon, get_string('sort'));
$columnicon = " <img src=\"" . $OUTPUT->pix_url('t/' . $columnicon) . "\" alt=\"\" />";
}
$headings[$column] = "<a href=\"?sort=$column&amp;dir=$columndir&amp;\">".$string[$column]."</a>$columnicon";
}
+6 -1
View File
@@ -27,13 +27,18 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__.'/../../config.php');
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir . '/adminlib.php');
$step = optional_param('step', 'verify', PARAM_ALPHA);
$hostid = required_param('hostid', PARAM_INT);
require_login();
$context = context_system::instance();
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
$mnet = get_mnet_environment();
$PAGE->set_url('/admin/mnet/delete.php');
+3 -1
View File
@@ -2,14 +2,16 @@
// Allows the admin to configure mnet stuff
require(__DIR__.'/../../config.php');
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
require_login();
admin_externalpage_setup('net');
$context = context_system::instance();
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
$site = get_site();
$mnet = get_mnet_environment();
+1 -1
View File
@@ -156,7 +156,7 @@ class mnet_review_host_form extends moodleform {
if ($mnet_peer && !empty($mnet_peer->deleted)) {
$radioarray = array();
$radioarray[] = $mform->createElement('static', 'deletedinfo', '',
$OUTPUT->container(get_string('deletedhostinfo', 'mnet'), 'alert alert-warning'));
$OUTPUT->container(get_string('deletedhostinfo', 'mnet'), 'deletedhostinfo'));
$radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('yes'), 1);
$radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('no'), 0);
$mform->addGroup($radioarray, 'radioar', get_string('deleted'), array(' ', ' '), false);
+5 -1
View File
@@ -27,11 +27,15 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__.'/../../config.php');
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot.'/mnet/lib.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/mnet/peer_forms.php');
require_login();
$context = context_system::instance();
require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');
/// Initialize variables.
$hostid = optional_param('hostid', 0, PARAM_INT);
+5 -1
View File
@@ -24,15 +24,19 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__.'/../../config.php');
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot . '/' . $CFG->admin .'/mnet/profilefields_form.php');
$mnet = get_mnet_environment();
require_login();
$hostid = required_param('hostid', PARAM_INT);
$mnet_peer = new mnet_peer();
$mnet_peer->set_id($hostid);
$context = context_system::instance();
require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');
admin_externalpage_setup('mnetpeers');
$form = new mnet_profile_form(null, array('hostid' => $hostid));
+4 -1
View File
@@ -25,13 +25,16 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__.'/../../config.php');
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/services_form.php');
$mnet = get_mnet_environment();
require_login();
admin_externalpage_setup('mnetpeers');
$context = context_system::instance();
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
$hostid = required_param('hostid', PARAM_INT);
+5 -1
View File
@@ -12,7 +12,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package mnet
*/
require(__DIR__.'/../../config.php');
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once $CFG->dirroot.'/mnet/xmlrpc/client.php';
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
@@ -21,8 +21,12 @@ if ($CFG->mnet_dispatcher_mode === 'off') {
print_error('mnetdisabled', 'mnet');
}
require_login();
admin_externalpage_setup('mnettestclient');
$context = context_system::instance();
require_capability('moodle/site:config', $context);
error_reporting(DEBUG_ALL);
echo $OUTPUT->header();
+5 -1
View File
@@ -1,12 +1,16 @@
<?php
// Allows the admin to configure services for remote hosts
require(__DIR__.'/../../config.php');
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
require_login();
admin_externalpage_setup('trustedhosts');
$context = context_system::instance();
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
if (!extension_loaded('openssl')) {
echo $OUTPUT->header();
+6 -12
View File
@@ -49,7 +49,6 @@
array($module->id));
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
redirect(new moodle_url('/admin/modules.php'));
}
if (!empty($show) and confirm_sesskey()) {
@@ -67,7 +66,6 @@
array($module->id));
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
redirect(new moodle_url('/admin/modules.php'));
}
echo $OUTPUT->header();
@@ -89,18 +87,14 @@
$table->set_attribute('class', 'admintable generaltable');
$table->setup();
$pluginmanager = core_plugin_manager::instance();
foreach ($modules as $module) {
$plugininfo = $pluginmanager->get_plugin_info('mod_'.$module->name);
$status = $plugininfo->get_status();
if ($status === core_plugin_manager::PLUGIN_STATUS_MISSING) {
if (!file_exists("$CFG->dirroot/mod/$module->name/lib.php")) {
$strmodulename = '<span class="notifyproblem">'.$module->name.' ('.get_string('missingfromdisk').')</span>';
$missing = true;
} else {
// took out hspace="\10\", because it does not validate. don't know what to replace with.
$icon = "<img src=\"" . $OUTPUT->image_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />";
$icon = "<img src=\"" . $OUTPUT->pix_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />";
$strmodulename = $icon.' '.get_string('modulename', $module->name);
$missing = false;
}
@@ -123,8 +117,8 @@
$count = -1;
}
if ($count>0) {
$countlink = $OUTPUT->action_link(new moodle_url('/course/search.php', ['modulelist' => $module->name]),
$count, null, ['title' => $strshowmodulecourse]);
$countlink = "<a href=\"{$CFG->wwwroot}/course/search.php?modulelist=$module->name" .
"&amp;sesskey=".sesskey()."\" title=\"$strshowmodulecourse\">$count</a>";
} else if ($count < 0) {
$countlink = get_string('error');
} else {
@@ -136,11 +130,11 @@
$class = '';
} else if ($module->visible) {
$visible = "<a href=\"modules.php?hide=$module->name&amp;sesskey=".sesskey()."\" title=\"$strhide\">".
$OUTPUT->pix_icon('t/hide', $strhide) . '</a>';
"<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strhide\" /></a>";
$class = '';
} else {
$visible = "<a href=\"modules.php?show=$module->name&amp;sesskey=".sesskey()."\" title=\"$strshow\">".
$OUTPUT->pix_icon('t/show', $strshow) . '</a>';
"<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strshow\" /></a>";
$class = 'dimmed_text';
}
if ($module->name == "forum") {
+2 -15
View File
@@ -28,19 +28,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../config.php');
$error = optional_param('error', '', PARAM_RAW);
if ($error) {
$message = optional_param('error_description', '', PARAM_RAW);
if ($message) {
$SESSION->loginerrormsg = $message;
redirect(new moodle_url(get_login_url()));
} else {
$SESSION->loginerrormsg = $error;
redirect(new moodle_url(get_login_url()));
}
}
require_once(dirname(dirname(__FILE__)).'/config.php');
// The authorization code generated by the authorization server.
$code = required_param('code', PARAM_RAW);
@@ -54,6 +42,5 @@ if (isset($params['sesskey']) and confirm_sesskey($params['sesskey'])) {
$redirecturl->param('oauth2code', $code);
redirect($redirecturl);
} else {
$SESSION->loginerrormsg = get_string('invalidsesskey', 'error');
redirect(new moodle_url(get_login_url()));
print_error('invalidsesskey');
}
+1 -1
View File
@@ -8,7 +8,7 @@
echo $OUTPUT->header();
echo '<div class="phpinfo text-ltr">';
echo '<div class="phpinfo">';
ob_start();
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES + INFO_VARIABLES);

Some files were not shown because too many files have changed in this diff Show More