Compare commits

..

1377 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) ff63a3ad58 Moodle release 2.3.3 2012-11-09 19:35:55 +01:00
Dan Poltawski ce44bf4441 weekly release 2.3.2+ 2012-11-09 17:58:34 +08:00
Dan Poltawski 53118fe1ea Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-11-09 17:53:20 +08:00
Aparup Banerjee 60c7fc96b2 Merge branch 'WIP-MDL-35512-M23' of git://github.com/nadavkav/moodle into MOODLE_23_STABLE 2012-11-09 14:15:07 +08:00
Aparup Banerjee 3d9514b363 Merge branch 'MDL-35510_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-11-09 14:11:42 +08:00
Aparup Banerjee 79d86ffcdb Merge branch 'MDL-35571_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-11-09 10:27:32 +08:00
AMOS bot c4d19c8789 Automatically generated installer lang files 2012-11-09 00:38:56 +00:00
Dan Poltawski b99ee21bfc Merge branch 'MDL-35349_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2012-11-08 18:55:10 +08:00
Dan Poltawski bc7fdb4279 Merge branch 'w45_MDL-36196_m23_vercheck' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-11-08 15:13:18 +08:00
Dan Poltawski 282183647b Merge branch 'MDL-36051_23' of git://github.com/rlorenzo/moodle into MOODLE_23_STABLE 2012-11-08 15:10:06 +08:00
Aparup Banerjee edd4257a1a Merge branch 'MDL-27824_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-11-08 13:32:27 +08:00
Rossiani Wijaya a46405df3a MDL-27824 course categories: remove trailing whitespace 2012-11-08 12:32:01 +08:00
Rossiani Wijaya 9bc298d287 MDL-27824 course categories: change isset() to empty() 2012-11-08 12:31:03 +08:00
Rossiani Wijaya 74b266a332 MDL-27824 course categories: Added @todo comments to remove the temporary fix 2012-11-08 12:31:03 +08:00
Rossiani Wijaya eabdc81c40 MDL-27824 - course category: add check test for ->coursesperpage value. 2012-11-08 12:31:03 +08:00
Dan Poltawski 6211ff4c12 Merge branch 'MDL-36422-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-11-08 11:08:06 +08:00
Frederic Massart 8a73556f8d MDL-36422 question: Fixed malformed HTML in manual marking 2012-11-08 10:26:44 +08:00
Rex Lorenzo 3bcff38015 MDL-36051 - Quick Grading in Assignment module does not turn on in some circumstances
* Fixed bug with quick grading when file submission is turned off
2012-11-07 16:28:02 -08:00
Mark Nelson d8e550e4ac MDL-33791 Portfolio: Fixed security issue with passing file paths. 2012-11-08 00:26:40 +01:00
Mary Evans 845cfc3389 MDL-36197 theme_fusion: Fix for "Your progress" overlaps completion tracking checkbox 2012-11-08 11:33:49 +13:00
Sam Hemelryk 62d543748d Merge branch 'MDL-36271_m23' of https://github.com/markn86/moodle into MOODLE_23_STABLE 2012-11-08 11:06:58 +13:00
Nadav Kavalerchik a5b62b8f31 MDL-35249 - Move Grading popmenu "userid" column after "scale" column (workaround)
Conflicts:

	mod/assign/gradingtable.php
2012-11-08 11:00:49 +13:00
Adrian Greeve 9b025da732 MDL-35558 mod_data: Show only own entries while there are required pending. 2012-11-07 19:50:15 +01:00
Petr Škoda da427d1e51 MDL-36196 hardcode the required PHP version in installer 2012-11-07 13:04:51 +01:00
Eloy Lafuente (stronk7) f87d5a71ef NOBUG: Trivial whitespace fix to quickly fix ongoing CI status. 2012-11-07 11:51:24 +01:00
Dan Poltawski 48fb811b4c Merge branch 'MDL-36092-MOODLE_23_STABLE' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-11-07 16:56:19 +08:00
Dan Poltawski e4224a5ae1 Merge branch 'MDL-36346_23' of git://github.com/pauln/moodle into MOODLE_23_STABLE 2012-11-07 09:27:53 +08:00
Paul Nicholls c4851e8085 MDL-36346 - YUI2 SWF vulnerability, part 2 2012-11-07 14:09:20 +13:00
AMOS bot 04678efd11 Automatically generated installer lang files 2012-11-07 00:36:31 +00:00
Andrew Davis 84fad57f1c MDL-35762 core_grade: altered the code that determines whether an activity is visible on the user report 2012-11-06 16:42:00 +01:00
Andrew Robert Nicols 3a8714c3c6 MDL-36023 AJAX Fix reference to chooserdiaogue jumplink 2012-11-06 10:16:28 +00:00
Dan Poltawski cb2829dea3 Merge branch 'MDL-36346_23' of git://github.com/pauln/moodle into MOODLE_23_STABLE 2012-11-06 16:20:14 +08:00
David Mudrák 77283f1812 MDL-36266 Improve update notification message subject 2012-11-06 11:59:48 +08:00
Paul Nicholls c43e6006e7 MDL-36346 - YUI2 SWF vulnerability 2012-11-06 14:55:48 +13:00
Dan Poltawski 2dab9d1943 Merge branch 'wip-MDL-36379-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-11-06 09:50:23 +08:00
Dan Poltawski 485ddbd611 Merge branch 'MDL-36347_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-11-06 09:42:11 +08:00
Dan Poltawski aafded3f42 Merge branch 'MDL-36023-MOODLE_23_STABLE' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-11-06 09:36:08 +08:00
Sam Hemelryk e3ac126161 MDL-36379 user_view: fixed issue with page layout when editing was on 2012-11-06 14:01:30 +13:00
Petr Škoda 89fbf2e874 MDL-35381 limit teachers to do permissions checks of enrolled users only 2012-11-06 00:49:25 +01:00
Sam Hemelryk b733b0ac71 Merge branch 'MDL-31629-MOODLE_23_STABLE' of git://github.com/micaherne/moodle into MOODLE_23_STABLE 2012-11-06 10:08:31 +13:00
Dan Poltawski a7e956b403 MDL-34527 - fix trailing whitespace 2012-11-05 13:27:35 +08:00
Dan Poltawski 44999a9ed2 Merge branch 'wip-MDL-34527-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-11-05 13:25:18 +08:00
Dan Poltawski f7c197eddb Merge branch 'WIP-MDL-36069-M23' of git://github.com/nadavkav/moodle into MOODLE_23_STABLE 2012-11-05 11:31:55 +08:00
Sam Hemelryk f9e009a744 MDL-21625 question: Fixed phpdocs 2012-11-05 16:29:38 +13:00
Sam Hemelryk 18f6238b88 Merge branch 'MDL-21625_b_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-11-05 16:27:30 +13:00
Dan Poltawski 906ad7d27a Merge branch 'MDL-33621_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-11-05 11:12:41 +08:00
Dan Poltawski df79fff95b Merge branch 'wip-mdl-35787-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-11-05 10:58:59 +08:00
Sam Hemelryk a82535f068 Merge branch 'MDL-36107b-23' of git://github.com/srynot4sale/moodle into MOODLE_23_STABLE 2012-11-05 15:07:00 +13:00
Tim Hunt 917cea604c MDL-36347 quiz: formchangechecker should not obstruct auto-submit.
When the quiz time limit runs out, the quiz should be submitted
automatically, withouth formchangechecker popping up a dialogue.
2012-11-03 22:34:53 +11:00
Mark Nelson 4aaac325f2 MDL-35349 paypal: Fixing return page so that it now declares page context 2012-11-02 15:33:59 +08:00
Dan Poltawski 0d79d96566 Merge branch 'w42_MDL-35469_m23_geckover' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-11-02 12:07:16 +08:00
Sam Hemelryk 561bd396c1 MDL-34527 forum: Fixed up a couple of SQL queries causing issues in Oracle. 2012-11-02 10:49:43 +13:00
Nadav Kavalerchik c4b521116f MDL-36069 - Right align TEXTAREA "Format selector" listbox, when in RTL mode (theme/standard) 2012-11-01 20:18:04 +02:00
Nadav Kavalerchik 152dbe5d52 MDL-35512 - Two left pointing arrows appear after clicking "left indent activity/resource" arrow, when in RTL mode 2012-11-01 20:12:37 +02:00
Andrew Robert Nicols 37ceb6cbed MDL-36092 Course/AJAX Ensure that dropdown resource pickers are shown when JS is disabled 2012-11-01 07:51:33 +00:00
Mark Nelson 1139dff6ef MDL-36271 feedback: Fixed variable typo 2012-11-01 15:47:26 +08:00
Dan Poltawski d402e05ba7 weekly release 2.3.2+ 2012-11-01 14:16:33 +08:00
Dan Poltawski 87ea3f04df Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-11-01 14:13:50 +08:00
Dan Poltawski 35ce18a8b1 Merge branch 'MDL-36315_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2012-11-01 10:03:19 +08:00
Eloy Lafuente (stronk7) 391f8b395a MDL-36315 backup: reduce the DST tests failing-window
This reduces the period of time that some of the unit tests
for calculate_next_automated_backup() are failing right now
(from 1week to just some hours around the DST changes).

Note it's not the final solution because they will still fail
when New_York or Brussels DST changes are about to happen, but
to get this completely fixed we'll need to wait to switch from
current custom TZ/DST support to PHP built-in one.
2012-11-01 02:42:08 +01:00
AMOS bot f1c3b5b3b3 Automatically generated installer lang files 2012-11-01 00:36:39 +00:00
Eloy Lafuente (stronk7) b5b882df60 MDL-36304 - Left align "marked out of" in RTL Q preview
Credit goes to Nadav Kavalerchik for fixing it @ MDL-36033
2012-10-31 19:33:39 +01:00
Adam Olley 93efeb5352 MDL-36130: mod_assign: migrate logs when migrating from mod_assignment 2012-10-31 14:52:47 +08:00
Dan Poltawski 881d1d8aed Merge branch 'MDL-28235-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-10-31 13:42:23 +08:00
Frederic Massart 9740e053f2 MDL-28235 form: Removed reference to unexisting close button in help popup 2012-10-31 13:00:12 +08:00
Frederic Massart b27daf9e73 MDL-28235 form: Removed close icon of help icon popups 2012-10-31 13:00:08 +08:00
Frederic Massart d0d6d5fc72 MDL-28235 form: Help button popup close accessibility improved
AMOS BEGIN
 CPY [close,editor],[close,form]
AMOS END
2012-10-31 13:00:08 +08:00
Dan Poltawski 5aa4e27404 Merge branch 'wip-mdl-29762-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-10-31 10:50:53 +08:00
Aparup Banerjee 046c9872a6 Merge branch 'MDL-31708-moodle23' of git://github.com/StudiUM/moodle into MOODLE_23_STABLE 2012-10-31 10:05:26 +08:00
AMOS bot edf170c341 Automatically generated installer lang files 2012-10-31 00:36:35 +00:00
Sam Hemelryk ee8c1abcea Merge branch 'MDL-31934_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-10-31 10:15:29 +13:00
Mary Evans 3fd76b3de5 MDL-31934 mod/forum: Added CSS fix to mod/forum/styles.css for unread forumposts also reversed a previous commit in theme/base/core.css. 2012-10-30 11:43:09 +00:00
Dan Poltawski 6f7eeb3775 Merge branch 'wip-MDL-32326-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-10-30 13:40:33 +08:00
Sam Hemelryk 3b6796e0f4 Merge branch 'MDL-28235-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-10-30 17:36:45 +13:00
Dan Poltawski 59d01f93cd Merge branch 'wip-mdl-35489-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-10-30 12:11:52 +08:00
Sam Hemelryk aa7d8ef61f Merge branch 'MDL-35889-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-10-30 15:48:49 +13:00
Dan Poltawski c64d22325e Merge branch 'MDL-36015_23' of git://git.catalyst.net.nz/moodle-r2 into MOODLE_23_STABLE 2012-10-30 10:19:26 +08:00
Dan Poltawski 33abc6e173 Merge branch 'wip-mdl-35910-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-10-30 10:00:21 +08:00
Andrew Robert Nicols 272dfda3cf MDL-35959 Correct footer for M.core.dialogue 2012-10-30 13:33:42 +13:00
Sam Hemelryk e61d57b5c1 Merge branch 'WIP-MDL-36070-M23' of git://github.com/nadavkav/moodle into MOODLE_23_STABLE
Conflicts:
	mod/quiz/styles.css
2012-10-30 13:02:07 +13:00
Sam Hemelryk 1d6d520a5a Merge branch 'MDL-36076_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-30 12:59:12 +13:00
Michael Aherne 41db2a5afc MDL-36101 auth_shibboleth Show appropriate error message for suspended accounts 2012-10-30 12:55:26 +13:00
Sam Hemelryk 3b5513528e Merge branch 'MDL-36103_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-30 12:51:44 +13:00
Charles Fulton 33407de5b6 MDL-36105 grades: use consistent icon classs 2012-10-30 12:34:54 +13:00
Sam Hemelryk efd2f83e4a Merge branch 'wip-mdl-36131-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-10-30 12:24:19 +13:00
Sam Hemelryk b9697365a1 Merge branch 'MDL-36137_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-10-30 12:16:50 +13:00
Dan Poltawski 6b0ada1e6e Merge branch 'm23_MDL-35215' of git://github.com/totara/moodle into MOODLE_23_STABLE 2012-10-29 15:33:53 +08:00
Dan Poltawski c2ef0e4982 Merge branch 'MDL-34363_m23' of git://github.com/merrill-oakland/moodle into MOODLE_23_STABLE 2012-10-29 15:21:48 +08:00
Dan Poltawski 35776aab75 Merge branch 'WIP-MDL-36033-M23' of git://github.com/nadavkav/moodle into MOODLE_23_STABLE 2012-10-29 14:59:57 +08:00
Dan Poltawski 9416bcf43d Merge branch 'wip-MDL-36075_MOODLE_23_STABLE' of git://github.com/jason-platts/moodle into MOODLE_23_STABLE 2012-10-29 14:57:24 +08:00
Dan Poltawski 80311cabde Merge branch 'MDL-35880-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-10-29 14:35:28 +08:00
Dan Poltawski 418a22905c Merge branch 'MDL-34837-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-10-29 13:55:14 +08:00
Dan Poltawski ff203527e7 Merge branch 'MDL-35297_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2012-10-29 09:54:12 +08:00
AMOS bot c777ad2785 Automatically generated installer lang files 2012-10-28 00:34:02 +00:00
AMOS bot 502821bbcc Automatically generated installer lang files 2012-10-27 00:34:37 +00:00
Andrew Robert Nicols 238d0ca1cd MDL-35836 Rewrite doctonewwindow handling to use delegation instead of individual events 2012-10-26 09:10:45 +08:00
Andrew Robert Nicols 8516492cc4 MDL-36023 AJAX Move the instantiation of the dialogue to display time 2012-10-26 09:09:13 +08:00
Andrew Robert Nicols 1754dc2cb6 MDL-35836 Rewrite doctonewwindow handling to use delegation instead of individual events 2012-10-26 09:08:54 +08:00
AMOS bot 9b5de362cf Automatically generated installer lang files 2012-10-25 00:34:52 +00:00
Eloy Lafuente (stronk7) 8be3d5ab03 MDL-35297 book: replay some steps lost when book landed to core
This commit replays, conditionally, all the upgrade steps from
MOODLE_19_STABLE to MOODLE_23_STABLE in the mod_book activity. That
guarentees that any site using the mod_book before landing to core,
no matter if it was the latest or an outdated one will upgrade
perfectly to the expected current version.

As a general rule, everytime one contrib plugin lands to core, its
complete upgrade code must be kept, at least until the core version
that introduced it, is out completely from the upgrade requirement
conditions.

In this case, with the missing upgrade code being added to 2.4, it
will be safe to delete the upgrade steps once 2.5 (or upwards) become
a requirement. Never always.

Conflicts:
	mod/book/version.php
2012-10-21 17:58:10 +08:00
Mary Evans db16ec2753 MDL-31934 theme_base: Adds highlight color to unread forum posts. 2012-10-21 01:39:30 +01:00
AMOS bot 691b9c81cb Automatically generated installer lang files 2012-10-20 00:34:52 +00:00
AMOS bot 8434e7de85 Merge branch 'MOODLE_23_STABLE' into install_23_STABLE 2012-10-20 00:34:51 +00:00
Mary Evans cd2ae155de MDL-36137 theme_magazine: changed forum and description info from center to left aligned. 2012-10-19 23:49:16 +01:00
Mary Evans d5fd21b6ef MDL-35571 theme_magazine: RTL fixes - WIKI title headings, ajax frontpage category/course chooser, right align logo, left align course name, left align login & user info. 2012-10-19 22:29:47 +01:00
Eloy Lafuente (stronk7) 98197952cc weekly release 2.3.2+ (fix!) 2012-10-19 19:56:32 +08:00
Rajesh Taneja 8648334966 MDL-36131 AJAX: Conditional activities will behave same as in non-ajax mode 2012-10-19 17:15:43 +08:00
Tim Hunt 2878842742 MDL-36103 tablelib: links to user profiles are wrong in courses. 2012-10-19 16:50:58 +08:00
Nadav Kavalerchik 00c7657edf MDL-36033 - Left align Numeric value fields in Calculated and Numeric question, when in RTL mode 2012-10-19 10:24:46 +02:00
Nadav Kavalerchik 44da3c50fe MDL-36070 - Points label hides UP and Down ordering arrows and Delete Icon on Quiz edit page, in RTL mode (theme/standard) 2012-10-19 10:20:54 +02:00
Rajesh Taneja ea67a0679d MDL-35910 Assignment 2.2: Fixed included files in assignment zip.
If Marking button is enabled, assignment is open and is not finalized, then don't add file to zip
2012-10-19 16:09:52 +08:00
Rossiani Wijaya 75441ef5b2 MDL-21625 Question bank: fixing whitespace 2012-10-19 15:46:09 +08:00
Aaron Barnes 3a15a7519c MDL-36107 scorm: Fix non-static method call 2012-10-19 18:55:39 +13:00
Rossiani Wijaya d2d17341e8 MDL-21625 Question bank: Add accessibility to table layout for viewing question list 2012-10-19 13:32:11 +08:00
AMOS bot 09725180cf Automatically generated installer lang files 2012-10-19 00:35:15 +00:00
Mary Evans c8ee9dde60 MDL-35510 theme_mymobile: RTL fixes for course and category names in style/jmobile11_rtl.css 2012-10-18 15:49:41 +01:00
Gilles-Philippe Leblanc e2694e9dd6 MDL-31708 wiki: Wiki 2.0 non-group member can see edit option in navigation block 2012-10-18 08:51:51 -04:00
Aparup Banerjee b1c5155cbc weekly release 2.3.3+ 2012-10-18 19:43:28 +08:00
Aparup Banerjee 1025a9123f Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-10-18 19:21:29 +08:00
Rajesh Taneja 4e15f69cb1 MDL-35489 users: Check added before using form data 2012-10-18 17:23:41 +08:00
David Tang c034e59bee MDL-31629 auth_shibboleth Use correct language string location 2012-10-18 08:53:11 +01:00
AMOS bot dd5e3ac222 Automatically generated installer lang files 2012-10-18 00:34:55 +00:00
Tim Hunt db05d59534 MDL-36076 qtype multichoice: validation fails on '0' answer. 2012-10-17 13:55:52 +08:00
Aparup Banerjee dde33d64a2 Merge branch 'MDL-28965-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-10-17 10:40:03 +08:00
AMOS bot 6ab522802f Automatically generated installer lang files 2012-10-17 00:34:38 +00:00
Jason Platts 9081825ea3 MDL-36075 Forms: Date selector in forms errors in IE7 2012-10-16 12:09:51 +01:00
Sam Hemelryk 777354509d Merge branch 'MDL-35412-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-10-16 17:41:31 +08:00
Frederic Massart 456352585a MDL-35412 phpunit: date_format_string() is case insensitive 2012-10-16 17:21:37 +08:00
Frederic Massart 335636f55d MDL-35412 core: Moving get_string out of if statement 2012-10-16 17:21:36 +08:00
Frederic Massart 98268916ff MDL-35171 Forms: Date selector always gets UTF-8 strings 2012-10-16 17:21:36 +08:00
Dan Poltawski ac2b4fb66a Merge branch 'wip-mdl-30691-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-10-16 16:27:51 +08:00
Dan Poltawski e191c71d55 MDL-34228 - version.php - bump for new capability 2012-10-16 16:20:12 +08:00
Dan Poltawski 9d53135aaf Merge branch 'MDL-34228-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2012-10-16 16:19:33 +08:00
Dan Poltawski 48a8f1c7a0 Merge branch 'wip-mdl-27309-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-10-16 14:59:15 +08:00
Dan Poltawski 760cab0695 Merge branch 'wip-mdl-32218-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-10-16 14:35:37 +08:00
Ankit Agarwal 16ab3642e7 MDL-35880 user: Adding a heading to profile edit page 2012-10-16 14:18:44 +08:00
Sam Hemelryk 1ffbad6404 MDL-33857 fixed up whitespace 2012-10-16 13:32:46 +08:00
Sam Hemelryk 4740c0a64f Merge branch 'wip-MDL-33857-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2012-10-16 13:31:31 +08:00
Rajesh Taneja 672bea4cfe MDL-29762 Blocks: Modified checks to show image in html block 2012-10-16 11:38:54 +08:00
Sam Hemelryk c35fa27c89 Merge branch 'MDL-35198-MOODLE_23_STABLE' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2012-10-16 11:23:02 +08:00
Dan Poltawski d50d615d7f Merge branch 'MDL-33815_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-10-16 11:09:06 +08:00
Adrian Greeve 0c09da65ce MDL-35265 - blog - Update code for removing orphaned blog association data.
Conflicts:
	version.php
2012-10-16 10:55:49 +08:00
Dan Poltawski 6244126d6d Merge branch 'wip-MDL-32184-s23' of http://github.com/phalacee/moodle into MOODLE_23_STABLE 2012-10-16 10:46:49 +08:00
Sam Hemelryk 52d2556ee5 Merge branch 'MDL-35664-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-10-16 10:42:42 +08:00
Sam Hemelryk 86606ad75d Merge branch 'MDL-35892-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-10-16 10:31:51 +08:00
Dan Poltawski 25ba0f4839 MDL-21801 - mod_lesson: version bump
To reflect the new (ppt-less) state
2012-10-16 10:30:31 +08:00
Dan Poltawski a83497790f Merge branch 'MDL-21801_b_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-10-16 10:30:00 +08:00
Sam Hemelryk 5004ad85b7 Merge branch 'MDL-35726-m23' of git://github.com/netspotau/moodle-mod_assign into MOODLE_23_STABLE 2012-10-16 10:16:19 +08:00
Adrian Greeve caa0e70577 MDL-25275 - mod/data - Added a check box to eliminate date searches if desired. 2012-10-16 10:09:24 +08:00
Mark Nielsen 6e763244ed MDL-34837 backup: Restore does not fail when some courses have the same name 2012-10-15 17:19:37 +08:00
Mark Nielsen 46ba9fded8 MDL-33621 rating: fixed view help error for global scale rating 2012-10-15 16:52:17 +08:00
Dan Poltawski 59d9b1b99d Merge branch 'w42_MDL-35854_m23_usergenerator' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-10-15 16:03:59 +08:00
Dan Poltawski 2558abe170 Merge branch 'w42_MDL-35917_m23_cohortdoc' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-10-15 15:59:15 +08:00
Aparup Banerjee 60e1dfd078 Merge branch 'MDL-31010-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-10-15 15:53:40 +08:00
Aparup Banerjee 226398e7d0 Merge branch 'MDL-35986' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-10-15 14:16:06 +08:00
Dan Poltawski 0f46bd4550 Merge branch 'wip-MDL-35661-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2012-10-15 13:31:22 +08:00
Ankit Agarwal 4981d12420 MDL-35889 blocks: Adding a legend to the fieldset 2012-10-15 11:24:13 +08:00
Frederic Massart 4f977aea5e MDL-35892 repository: prepare_listing recursively prepares the data 2012-10-15 09:46:00 +08:00
Frederic Massart 82525f5963 MDL-35664 filepicker: Filepicker knows about the current path and uses it 2012-10-15 09:45:59 +08:00
AMOS bot 887d6e175e Automatically generated installer lang files 2012-10-15 00:34:57 +00:00
Eloy Lafuente (stronk7) 6738413b33 weekly release 2.3.2+ 2012-10-15 00:20:33 +02:00
Eloy Lafuente (stronk7) 92e9c3d09f Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-10-15 00:07:39 +02:00
Eloy Lafuente (stronk7) 8d800a1b8e Revert "MDL-31968 Make NTLM REMOTE_USER format configurable by the admin"
This reverts commit af861e14dc.

Note that MDL-31968 will be in charge of backporting this to stables
if everything goes well under master (once MDL-31968 is tested and closed)
2012-10-14 23:22:08 +02:00
Petr Škoda b66c3031f6 MDL-35917 fix cohort phpdocs
Credit goes to Brian Kremer, thanks!
2012-10-13 17:55:59 +02:00
Petr Škoda a4848f6ef7 MDL-35469 test for the new Gecko user agent handling 2012-10-13 10:00:05 +02:00
Petr Škoda ad7d20c380 MDL-35469 fix Gecko based browser checks
The problem is that latest firefox versions stopped using dates because they lost the meaning over the time.
2012-10-13 10:00:05 +02:00
Petr Škoda 7358b1742f MDL-35854 fix username generator
This eliminates infinite loop and also fixes potentially invalid email derived from usernames created from unicode first/last name.
2012-10-13 09:56:48 +02:00
Mary Evans cc3f17d86d MDL-35986 theme_canvas: add custommenu and block-region to layout files general.php, frontpage.php and report.php to fix regression in theme/serenity since MDL-33110. 2012-10-12 22:57:39 +01:00
Damyon Wiese 0e8aa5027e MDL-35726: Use a different form identifier for each form when using "Save and next"
This prevents a bug where the next student feedback will default to the values that
were on the last submitted form. This is a similar case to having multiple instances
of the same form on the same page - each one needs a unique identifier to distinguish
between them. In this case I include the $rownum which changes as you go to each student
in the list.
2012-10-12 12:07:19 +08:00
Jonathan Harker 84b3cbab33 MDL-36015 lib/bennu: use static functions correctly. 2012-10-12 13:34:19 +13:00
Eloy Lafuente (stronk7) f2c33d0b69 Merge branch 'MDL-35858-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-10-12 02:18:03 +02:00
Rossiani Wijaya 696527c0fe MDL-21801 Lesson Module: Removing import power point functionality 2012-10-11 16:11:58 +08:00
Rossiani Wijaya 2c484717e1 MDL-33815 Online Users block: Add query condition to filter out deleted users and lastaccess date greater than now 2012-10-11 16:06:00 +08:00
Ankit Agarwal 0cb1a22cba MDL-28965 administration: Updating description string for the setting navshowallcourses 2012-10-11 14:25:45 +08:00
Ankit Agarwal 437637a11d MDL-31010 comments: setup_course should update if passed courseid is different from the cached one 2012-10-11 10:58:26 +08:00
Eloy Lafuente (stronk7) 5ba6db698d Merge branch 'MDL-35715-MOODLE_23_STABLE' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-10-11 01:54:17 +02:00
Aparup Banerjee ca93b3af4e Merge branch 'MDL-35231_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-10-10 13:03:23 +08:00
Aparup Banerjee 1778232f45 Merge branch 'w41_MDL-35839_m23_enroldeletecleanup' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-10-10 10:32:02 +08:00
AMOS bot c5c735f00e Automatically generated installer lang files 2012-10-10 00:34:20 +00:00
Simon Coggins d01c6b269b MDL-35581 lib: Help popups misaligned for right-to-left languages 2012-10-10 08:56:29 +13:00
Eloy Lafuente (stronk7) 86b1d0eb5f MDL-35898 test reset: Tidyup comment 2012-10-09 11:59:46 +02:00
Eloy Lafuente (stronk7) 5553d3d60f Merge branch 'w41_MDL-35898_m23_coursereset' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-10-09 11:58:35 +02:00
Aparup Banerjee aedc642091 MDL-35587 fixed up whitespaces 2012-10-09 16:36:20 +08:00
Aparup Banerjee e72606c83f Merge branch 'MDL-35587_23' of git://github.com/rlorenzo/moodle into MOODLE_23_STABLE 2012-10-09 16:28:49 +08:00
Frederic Massart ad87b3a2cc MDL-35858 question: Fixed display of feedback in cloze questions 2012-10-09 16:13:33 +08:00
Petr Škoda e22cff45ab MDL-35898 include static course caches in test resets 2012-10-09 10:10:19 +02:00
Rajesh Taneja 18f9ad377f MDL-35787 Mnet: If student role is not defined then throw error 2012-10-09 15:35:04 +08:00
Rajesh Taneja add569ebe0 MDL-35787 Mnet: fixed php strict standards warnings 2012-10-09 15:35:03 +08:00
Aparup Banerjee 50cef6aa36 Merge branch 'wip-MDL-30754-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-10-09 14:32:31 +08:00
Aparup Banerjee 976a9da987 Merge branch 'WIP-MDL-35724-M23_quiz' of git://github.com/nadavkav/moodle into MOODLE_23_STABLE 2012-10-09 14:11:32 +08:00
Aparup Banerjee 34983250b1 Merge branch 'MDL-35776_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-09 11:53:43 +08:00
Aparup Banerjee ae48ff8a17 Merge branch 'MDL-35837-M23' of git://github.com/nadavkav/moodle into MOODLE_23_STABLE 2012-10-09 10:25:33 +08:00
Rajesh Taneja 8715a53d90 MDL-30691 Adminstration: Added css to break long word in filter table 2012-10-09 10:02:45 +08:00
AMOS bot 5364f9c7cd Automatically generated installer lang files 2012-10-09 00:34:42 +00:00
Eloy Lafuente (stronk7) f5ba035015 Merge branch 'wip-MDL-26348-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-10-09 01:38:22 +02:00
Eloy Lafuente (stronk7) 5cb3d27681 Merge branch 'MDL-35141-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2012-10-09 00:47:11 +02:00
Eloy Lafuente (stronk7) 57ca2e4375 Merge branch 'wip-mdl-35397-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-10-09 00:40:14 +02:00
Eloy Lafuente (stronk7) 2689298c8f Merge branch 'MDL-35395_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-09 00:26:49 +02:00
Iñaki Arenaza af861e14dc MDL-31968 Make NTLM REMOTE_USER format configurable by the admin
Signed-off-by: Iñaki Arenaza <iarenaza@mondragon.edu>
2012-10-09 00:17:35 +02:00
Eloy Lafuente (stronk7) 859d840627 Merge branch 'MDL-34794_M23' of git://github.com/raymondAntonio/moodle into MOODLE_23_STABLE 2012-10-09 00:08:26 +02:00
Eloy Lafuente (stronk7) 8b1cb823de Merge branch 'wip-mdl-35047-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-10-08 23:57:11 +02:00
Eloy Lafuente (stronk7) 3e0e4917d8 Merge branch 'w41_MDL-35382_m23_reordertest' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-10-08 23:54:51 +02:00
Eloy Lafuente (stronk7) 7516f96676 Merge branch 'MDL-35519_book_cancel_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-10-08 23:08:02 +02:00
Eloy Lafuente (stronk7) 2ed34366f6 Revert "MDL-34894 course ws unit tests: fix windows problem."
This reverts commit 40d651bbbb.

With MDL-35714, each test gets gc_collect_cycles() called, so
no need to call it "manually".
2012-10-08 22:54:33 +02:00
Eloy Lafuente (stronk7) 85b1e97857 Merge branch 'w41_MDL-35714_m23_testgc' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-10-08 22:52:12 +02:00
Nadav Kavalerchik aae3d3445e MDL-35724 - Move Question Marks block to the left (Question Bank page),in RTL mode 2012-10-08 11:35:59 +02:00
Nadav Kavalerchik 92bff8685c MDL-35724 - Right align "Question Type" label in Quiz Editing page, when in RTL mode 2012-10-08 11:35:58 +02:00
Aparup Banerjee c116bd70a0 Merge branch '23STABLE-wip-MDL-35694' of git://github.com/jennymgray/moodle into MOODLE_23_STABLE 2012-10-08 17:26:45 +08:00
Aparup Banerjee e4feb70b66 Merge branch 'WIP-MDL-35723-M23_quiz' of git://github.com/nadavkav/moodle into MOODLE_23_STABLE 2012-10-08 17:16:12 +08:00
Aparup Banerjee 785bc3bca9 Merge branch 'w41_MDL-35739_m23_cliinstall' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-10-08 17:06:43 +08:00
Aparup Banerjee e7afca9468 Merge branch 'wip-MDL-34448-MOODLE_23_STABLE' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2012-10-08 15:28:37 +08:00
Adrian Greeve 768a2ceafd MDL-34448 - mod/data - Fixing separate groups viewing all entries. 2012-10-08 14:50:27 +08:00
Marina Glancy 2741c017cb MDL-35661 local plugins do not have general settings URL 2012-10-08 11:34:10 +08:00
Sam Hemelryk cafabb5fd0 Merge branch 'MDL-35634-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-10-08 11:36:21 +13:00
Davo Smith cd2a0bf715 MDL-35288 drag and drop upload - adjust error message text when attempting to upload a folder 2012-10-08 11:19:48 +13:00
Sam Hemelryk fff33fd66d Merge branch 'MDL-35211_M23' of git://github.com/kordan/moodle into MOODLE_23_STABLE 2012-10-08 11:02:33 +13:00
Sam Hemelryk 30939d2a9a Merge branch 'MDL-35763-m23' of git://github.com/netspotau/moodle-mod_assign into MOODLE_23_STABLE 2012-10-08 10:44:18 +13:00
Sam Hemelryk 8c2eca7d16 Merge branch 'MDL-33646-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-10-08 10:22:06 +13:00
Sam Hemelryk f605b97aa4 Merge branch 'MDL-35667_extra_credit_loop_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-10-08 10:15:37 +13:00
Sam Hemelryk b855945836 Merge branch 'MDL-35730_23' of https://github.com/aolley/moodle into MOODLE_23_STABLE 2012-10-08 10:06:12 +13:00
Sam Hemelryk f062a78344 MDL-32326 dock: Clarified use of CSS rotation 2012-10-08 09:45:27 +13:00
Didier Raboud 67728fe717 MDL-30754: Make sure to always display breadcrumbs when browsing categories. 2012-10-08 09:37:37 +13:00
Sam Hemelryk 77957668cc MDL-26348 tool_customlang: Fixed up SQL causing issues in Oracle 2012-10-08 09:22:24 +13:00
Petr Škoda e9c9610f8b MDL-35739 show langs on separate lines in CLI installer
This fixes column width issues and compatibility with RTL languages.
2012-10-07 21:04:57 +02:00
Petr Škoda 6f0f18a4d4 MDL-35839 fix invalid enrol instance delete cleanup 2012-10-06 19:26:37 +02:00
Nadav Kavalerchik 26d2edcc82 MDL-35245 - Missing scrollbar in Activity Chooser, when in RTL mode 2012-10-06 13:45:33 +02:00
Petr Skoda f31ee1292a MDL-35382 fix random course test failures 2012-10-06 13:28:27 +02:00
Petr Škoda 2104c9fdc3 MDL-35714 run gc before test reset 2012-10-06 10:04:32 +02:00
AMOS bot 7c6d4ed0a7 Automatically generated installer lang files 2012-10-06 00:34:00 +00:00
Mary Evans 33b59af020 MDL-35231 theme_serenity: fixed misalignment and styling of mod/assignment/action/edit by updating custommenu css in theme/serenity/style/core.css 2012-10-06 01:31:19 +01:00
Tim Hunt eccf42746c MDL-35395 formslib: a method to disable formchangechecker for a form. 2012-10-05 17:45:07 +01:00
Eloy Lafuente (stronk7) 562dbe408e weekly release 2.3.2+ 2012-10-05 13:38:50 +02:00
Eloy Lafuente (stronk7) 035997329a Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-10-05 13:33:02 +02:00
Eloy Lafuente (stronk7) 4abc5a1a2c Revert "MDL-34257 quiz 'secure' mode: PAGE initialisation order issues."
This reverts commit d205afe662.
2012-10-05 13:10:06 +02:00
Dan Poltawski db8e84ae1a Revert "MDL-33117 grade: added some smarts to the user report method inject_rowspans() to deal with activity conditional availability"
This reverts commit 60b6b6280b.
2012-10-05 16:20:52 +08:00
Jenny Gray 077fde5dc5 MDL-35694 logs: extend course log report downloads with action url 2012-10-05 09:05:18 +01:00
Jason Fowler 8cfc92afdd MDL-32184 - Course - Fixing incorrect redirect when toggling course edit while inside an activity -- Patch provided by Kanika Goyal 2012-10-05 15:27:51 +08:00
Ankit Agarwal 5747c6bccd MDL-33646 book: Adding a notice instead of error when there is no content in the book 2012-10-05 13:41:44 +08:00
sam marshall 5c3cb55b5d MDL-34228 Completion: Add capability that controls if a user is shown in reports 2012-10-04 10:51:29 +01:00
Rajesh Taneja d1085311c9 MDL-32218 Blocks: allowblockstodock is also checked for region dock status 2012-10-04 17:27:05 +08:00
Dan Poltawski 5e6f2cda64 Merge branch 'MDL-35767-MOODLE_23_STABLE' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-10-04 16:57:57 +08:00
Ruslan Kabalin e6b958d4db MDL-35767 Fix missing target event group check
Prevent interfering between items from different groups (and no groups)
2012-10-04 09:52:38 +01:00
Rajesh Taneja 90c6925bdb MDL-27309 Blocks: command node is taken from dockitem during restore 2012-10-04 15:26:22 +08:00
AMOS bot 0a1c7a188a Automatically generated installer lang files 2012-10-04 00:35:00 +00:00
Tim Hunt 13815377b5 MDL-35776 user ajax: fix sort order in chrome.
It seems that Chrome orders fields of objects in order of array key.
Therefore we must stop using user.id in the PHP arrays, and instead
ensure that we use sequential numbers.

This commit fixes the enrol UI.
2012-10-03 19:14:47 +01:00
Tim Hunt ea29e3141a MDL-35776 user ajax: fix sort order in chrome.
It seems that Chrome orders fields of objects in order of array key.
Therefore we must stop using user.id in the PHP arrays, and instead
ensure that we use sequential numbers.

This commit fixes the user selector.

Conflicts:
	user/selector/module.js
	user/selector/search.php
2012-10-03 19:14:41 +01:00
Frederic Massart 1c409bfe80 MDL-35634 course: Restored alt attribute on module icons 2012-10-03 17:04:16 +08:00
Andrew Davis 113f51d7c9 MDL-35519 mod_book: fixed the cancel import redirect URL 2012-10-03 12:48:36 +08:00
Damyon Wiese 36c7b8665f MDL-35763: Add ignoredirty class to drop down lists in assignment grading options form. 2012-10-03 11:57:25 +08:00
Dan Poltawski aaed6d7800 Merge branch 'MDL-35754-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-10-03 10:26:22 +08:00
Frederic Massart 1e5b1d6dad MDL-35754 libraries: openpopup() does not fail when window name is not set 2012-10-03 09:58:31 +08:00
Eloy Lafuente (stronk7) a8d7f5cf15 Merge branch 'MDL-35744_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-03 00:40:35 +02:00
Sam Hemelryk c67ed6adfe Merge branch 'MDL-33829_23' of https://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-10-03 10:07:16 +13:00
Sam Hemelryk 9289c14e0c Merge branch 'MDL-35654_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-10-03 09:53:11 +13:00
Nadav Kavalerchik 1c1455f29a MDL-35723 - Align to center the "Quiz Feedback" label,when in RTL mode 2012-10-02 21:49:10 +02:00
Eloy Lafuente (stronk7) 9228a5d347 Merge branch 'm23_MDL-35227' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-10-02 21:40:58 +02:00
Eloy Lafuente (stronk7) fc0f1c3cbc Merge branch 'm23_MDL-35557' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-10-02 20:28:13 +02:00
Tim Hunt db1052ce5c MDL-35744 quiz: fix review options for Never submitted attempts 2012-10-02 15:53:59 +01:00
Eloy Lafuente (stronk7) 0a7db801f3 Merge branch 'm23_MDL-35562' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-10-02 15:59:09 +02:00
Ruslan Kabalin 1a2b345232 MDL-35715 course dragdrop Fix the ability to drag back to the empty section 2012-10-02 14:55:48 +01:00
Frederic Massart 80f497ea40 MDL-28235 form: Removed close icon of help icon popups 2012-10-02 14:36:30 +08:00
Frederic Massart bbb553e077 MDL-28235 form: Help button popup close accessibility improved
AMOS BEGIN
 CPY [close,editor],[close,form]
AMOS END
2012-10-02 14:36:30 +08:00
Rajesh Taneja 08363c5c80 MDL-35047 tool_xmldb: Added missing strings for xmldb 2012-10-02 14:21:01 +08:00
Dan Poltawski 845cc02904 Merge branch 'MDL-34570-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-10-02 13:57:00 +08:00
Rajesh Taneja 5735b5a2ac MDL-35397 Administration: changed link for 'many other contributors'
Previously 'many other contributors' was pointing to http://docs.moodle.org/dev/Credits
now, it will point to http://moodle.org/dev.
2012-10-02 13:43:47 +08:00
Adam Olley 8c4fcc0e1a enrol_manual: Set context correctly in manual enrolment user selector 2012-10-02 14:59:58 +09:30
Dan Poltawski d9cada0a9d Merge branch 'MDL-35370_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-02 12:09:36 +08:00
Dan Poltawski d0154d2996 Merge branch 'MDL-35693_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-02 11:47:57 +08:00
Dan Poltawski 05ab3435c0 Merge branch 'MDL-35665' of git://github.com/raymondAntonio/moodle into MOODLE_23_STABLE 2012-10-02 11:45:32 +08:00
Dan Poltawski 09e49e5c6e Merge branch 'MDL-35698_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-02 11:40:23 +08:00
Dan Poltawski 8aaf7adccb Merge branch 'WIP-MDL-35708-M23_quiz' of git://github.com/nadavkav/moodle into MOODLE_23_STABLE 2012-10-02 11:36:56 +08:00
Dan Poltawski e1361139d9 Merge branch 'w40_MDL-35619_m23_otheravatars' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-10-02 10:41:58 +08:00
Dan Poltawski 373d3178e4 Merge branch 'MDL-35680_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-02 09:52:35 +08:00
Jody Steele bda487868e MDL-33933 mod_forum: fix incorrect capability check 2012-10-02 09:44:19 +08:00
Dan Poltawski 2cbbf5d829 Merge branch 'MDL-33117_grade_display_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-10-02 09:33:09 +08:00
Eloy Lafuente (stronk7) 54dd6ee750 MDL-35669 gravatar amend and complete gravatar tests. 2012-10-02 01:35:50 +02:00
Eloy Lafuente (stronk7) ba804c9ea9 MDL-35669 gravatar Fix secure image urls. 2012-10-02 01:35:40 +02:00
Sam Hemelryk 577777cf03 Merge branch 'm23_MDL-35472' of git://github.com/totara/moodle into MOODLE_23_STABLE 2012-10-02 11:10:24 +13:00
Sam Hemelryk 500ade05cb Merge branch 'MDL-34257_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-02 10:45:51 +13:00
Michael Aherne 30c9794aec MDL-35669 gravatar Provide default image URL to Gravatar 2012-10-01 23:44:31 +02:00
Sam Hemelryk 4891199f10 Merge branch 'MDL-30885_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-02 10:31:08 +13:00
Sam Hemelryk 50b252cdde Merge branch 'MDL-35547_23' of git://github.com/enovation/moodle into MOODLE_23_STABLE 2012-10-02 10:15:30 +13:00
Eloy Lafuente (stronk7) 50e8e4d00b Merge branch 'MDL-34931-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-10-01 13:37:12 +02:00
Eloy Lafuente (stronk7) aa63be7f5f Merge branch 'MDL-35637_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE 2012-10-01 13:19:22 +02:00
Eloy Lafuente (stronk7) 4df574f9e5 Merge branch 'wip-MDL-34234-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-10-01 13:10:06 +02:00
Jerome Mouneyrac b843f7aee2 MDL-34971 PHPunit test: user/externallib.php 2012-10-01 12:56:41 +02:00
Eloy Lafuente (stronk7) 198178ff2a Merge branch 'MDL-35644-MOODLE_23_STABLE' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2012-10-01 12:46:26 +02:00
Eloy Lafuente (stronk7) 35e19e2acd Merge branch 'MDL-34894_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-10-01 11:08:14 +02:00
Petr Škoda 50675bf549 MDL-35619 fix invalid avatars on other users page 2012-10-01 09:51:12 +02:00
Andrew Davis 7ad8f46848 MDL-35667 core_grade: added a new test for grade_category::apply_limit_rules() 2012-10-01 12:59:49 +08:00
Andrew Davis 410d0dc243 MDL-31782 core_grade: fixed a potential infinite loop 2012-10-01 12:59:27 +08:00
Nadav Kavalerchik af277cc994 MDL-35708 - Right align user's information in quiz attempt review page , when in RTL mode (theme/standard & base) 2012-09-30 23:53:01 +02:00
Sam Hemelryk 194e79536e MDL-34234 course: Fixed notice causing issues in JS when upgrade settings for 2.3+ not run 2012-10-01 09:57:58 +13:00
Tomasz Muras d0bb10027b MDL-35547 Fetch more sub-categories with one SQL query. 2012-09-30 19:29:54 +02:00
Tomasz Muras 2ade1b52f9 MDL-35547 Detect loops in question categories. 2012-09-30 19:29:53 +02:00
Tomasz Muras 24d9d1811f MDL-35547 Detect question category pointing to itself as a parent. 2012-09-30 19:29:52 +02:00
Andrew Davis 88852071b5 MDL-33829 mod_glossary: added some smarts so glossary entries with an image in their description are classed as richhtml instead of plainhtml 2012-09-30 11:11:29 +08:00
Jason Fowler d695785710 MDL-33829 - Glossary - Adding Rich Portfolio Export support 2012-09-30 11:11:29 +08:00
Tim Hunt 2d04a1fe31 MDL-35698 quiz cron: group overrides not computed correctly
Thanks to Matt Petro for finding the bug in this monster SQL statement.
2012-09-29 09:37:20 +01:00
AMOS bot 6b7cd710cd Automatically generated installer lang files 2012-09-29 00:34:18 +00:00
Tim Hunt 0222cd9545 MDL-35693 question engine: set id when saving a new question_attempt 2012-09-28 15:29:57 +01:00
Raymond Wijaya 10839ace75 MDL-34794_M23: Add reset course feature in mod_assign (new assignment) 2012-09-28 16:25:55 +08:00
Raymond Wijaya b865c07b69 MDL-35665: Cherry-pick MDL-35389 : Fix an error when changing locked state of a assignment is changed 2012-09-28 12:30:30 +08:00
Andrew Davis 60b6b6280b MDL-33117 grade: added some smarts to the user report method inject_rowspans() to deal with activity conditional availability 2012-09-28 12:14:45 +08:00
Frederic Massart d3187c299a MDL-34570 Accessibility: Adding labels on text inputs and selects to questions 2012-09-28 11:39:32 +08:00
Rossiani Wijaya daa3c5ff1b MDL-34570 accessibility compliance for question: edit string label 2012-09-28 11:39:32 +08:00
Frederic Massart 7765e94f5e MDL-34931 core_grade: Fixed grades hidden when activity is hidden 2012-09-28 11:39:20 +08:00
Mary Evans 14a695f607 MDL-35654 theme_anomaly: Added custom menu renderer to aid RTL styling of menu 2012-09-28 02:57:54 +01:00
Dan Marsden 31fabbdbaa MDL-35562 enrol_database: enrolment_sync - don't halt sync on failed search for course. 2012-09-28 09:07:29 +12:00
Dan Marsden add494f1af MDL-35557 enrol/database: use distinct call when getting list of courses that should be added. 2012-09-28 09:05:52 +12:00
Dan Marsden 860c7e82bd MDL-35227 SCORM: set completion in correct location. 2012-09-28 09:03:54 +12:00
Tim Hunt 28c9348405 MDL-35680 user selector: more usable when queries are slow.
The problem is to do when you pause a bit, so a search starts, and then
type a bit more before the search finishes. It was behaving like this:

1. Type a bit, then pause.
2. First search request sent.
3. Type a bit more, then pause.
4. Second search request sent.
5. First search request completes.
6. You try to select one result.
7. Second search request comples, overwriting what you are selecting.

This fix works by cancelling the first request before sending the
second.
2012-09-27 19:10:41 +01:00
Tim Hunt 40d651bbbb MDL-34894 course ws unit tests: fix windows problem.
This fixes a weird windows-only failure, as explained in the tracker
issue.
2012-09-27 18:59:50 +01:00
Tim Hunt 022a3555d1 MDL-30885 quiz: use formchangechecker during quiz attempts.
To avoid the possiblity of dataloss if a student tries to navigate away
having changed some answers.
2012-09-27 14:15:37 +01:00
Tim Hunt f0f2014316 MDL-35620 question engine: should distinguish NULL and 0.
This only matters in an obscure edge case, but it is an edge case we hit
with one of the OU question types.

This load data code is processing the results of a LEFT JOIN, so is_null
is the correct logic.
2012-09-27 12:35:55 +01:00
Tim Hunt ad1a52e07c MDL-35370 cloze qtype: distinguish wrong & unanswered subqs
This affects the subquestions that appear as an embedded text input box.

There are three cases:
1. Input for subq left blank
2. Input for subq was wrong, and matched by a * wildcard.
3. Input for subq was wrong, and did not match any answer.

2. and 3. should look identical, apart from any feedback in case 2.

1. is different. The state should be displayed as "Not answered" even
though the mark for this part is still shown as 0.

There are some new unit tests for these cases.

Also, we slighly improve handling of , for decimal point in multianswer,
although there are still issues.

While working on this, I made some minor clean-ups in shortanswer and
numerical qtypes.
2012-09-27 12:35:35 +01:00
Tim Hunt d205afe662 MDL-34257 quiz 'secure' mode: PAGE initialisation order issues. 2012-09-27 12:34:51 +01:00
Dan Poltawski 9273bd1abb weekly release 2.3.2+ 2012-09-27 18:51:24 +08:00
Dan Poltawski 11d19d4cfb Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-09-27 18:47:34 +08:00
Jerome Mouneyrac 786b831653 MDL-35198 replace key_exists by array_key_exists 2012-09-27 15:34:48 +08:00
Mark Nelson 40755f9584 MDL-35637 group: Fix form submission error that occurs when GD version is not set. 2012-09-27 11:58:47 +08:00
Dan Poltawski 12f9c36df8 Revert "MDL-32184 - Course - Fixing incorrect redirect when toggling course edit while inside an activity -- Patch provided by Kanika Goyal"
This reverts commit a1db00dd1a.
2012-09-27 11:32:02 +08:00
AMOS bot 66652c60c0 Automatically generated installer lang files 2012-09-27 00:34:44 +00:00
Nadav Kavalerchik 20a1f8a9c5 MDL-35481 - Invert "search option" listbox "open" arrow, when in RTL mode (page: manual user course registration ) and Personal Blog page 2012-09-27 00:10:37 +02:00
Nadav Kavalerchik 2a8690dab5 MDL-35246 - Invert all action arrows in Question Bank categories management, when in RTL mode 2012-09-26 23:54:10 +02:00
Nadav Kavalerchik 68164ad218 MDL-35527 - Left justify CLOSE button on modal dialog boxes, when in RTL mode 2012-09-26 21:50:46 +02:00
Eloy Lafuente (stronk7) 249d073058 MDL-35578 - Also justify email2, used in signup 2012-09-26 19:49:26 +02:00
Nadav Kavalerchik 3147b59c8a MDL-35578 - Left justify LTR Form input fields (email, idnumber, url, phone...), when in RTL mode 2012-09-26 19:37:43 +02:00
Dan Poltawski 0a99c77ede Merge branch 'wip-MDL-35276-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2012-09-26 15:21:36 +08:00
Marina Glancy 25878bcd22 MDL-35276 fix redirect to course/section pages 2012-09-26 15:17:14 +08:00
Jerome Mouneyrac 3f676aa5bd MDL-35644 user_get_details: admin should be able to see description 2012-09-26 14:29:21 +08:00
Sam Hemelryk 41a5203c2a Merge branch 'wip-MDL-35276-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2012-09-26 15:13:33 +12:00
Marina Glancy 583c0cf67f MDL-35276 fix redirect to course/section pages 2012-09-26 10:58:03 +08:00
Jason Fowler f0f3338000 MDL-34476 - Blocks - Fixing context issue 2012-09-26 14:40:24 +12:00
Sam Hemelryk 678e90a080 Merge branch 'MDL-34573_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-09-26 10:10:23 +12:00
Sam Hemelryk 1172c2bd2f Merge branch 'wip-MDL-34476-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2012-09-26 08:32:52 +12:00
Sam Hemelryk 792a3c4ea9 MDL-31976 course: Better alt for edit section icon 2012-09-26 08:24:06 +12:00
Sam Hemelryk 4c6962068a Merge branch 'MDL-31976-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-26 08:20:37 +12:00
Dan Poltawski 2d39f72b59 Merge branch 'MDL-34328-MOODLE_23_STABLE-2' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-09-25 16:37:32 +08:00
Dan Poltawski 790ad23dd6 Merge branch 'MDL-34778_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-09-25 13:43:34 +08:00
Dan Poltawski 00d62e135d Merge branch 'MDL-35252_M23' of git://github.com/raymondAntonio/moodle into MOODLE_23_STABLE 2012-09-25 13:14:45 +08:00
Dan Poltawski 700bbb5fb9 Merge branch 'MDL-34571_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-09-25 13:11:10 +08:00
Raymond Wijaya ff61f14c04 MDL-35252: Fix a bug that creates unneccessary rows in grade_grades table when unchecking 'overridden' check box in gradebook update 2012-09-25 12:19:07 +08:00
Dan Poltawski 125759ddf4 Merge branch 'MDL-35202-m23' of git://github.com/netspotau/moodle-mod_assign into MOODLE_23_STABLE 2012-09-25 11:43:05 +08:00
Dan Poltawski df87119b5a Merge branch 'MDL-35321-MOODLE_23_STABLE' of git://github.com/micaherne/moodle into MOODLE_23_STABLE 2012-09-25 11:32:34 +08:00
Nadav Kavalerchik a2b837e5be MDL-35576 - Right padding is missing on Date field/element, when in RTL mode (minor fix) 2012-09-25 01:17:28 +02:00
Nadav Kavalerchik 2bb3259fc3 MDL-35537 - Right align registration text on login page, when in RTL mode 2012-09-25 00:36:37 +02:00
Sam Hemelryk 6b69bf463a MDL-34607 files: post integration version bump 2012-09-25 09:56:11 +12:00
Sam Hemelryk 8a7cc012fd Merge branch 'MDL-34607-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-25 09:52:00 +12:00
Sam Hemelryk fd0758da1b Merge branch 'MDL-35375-m23' of git://github.com/netspotau/moodle-mod_assign into MOODLE_23_STABLE 2012-09-25 09:23:27 +12:00
Dan Poltawski 675c2b8543 Merge branch 'wip-MDL-32184-s23' of http://github.com/phalacee/moodle into MOODLE_23_STABLE 2012-09-24 15:36:04 +08:00
Dan Poltawski 7e0deaf3fd Merge branch 'MDL-26940-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-24 15:32:31 +08:00
Frederic Massart fede879cf2 MDL-31499 Javascript: Handle invalid window names in openpopup 2012-09-24 15:24:30 +08:00
Jason Fowler a1db00dd1a MDL-32184 - Course - Fixing incorrect redirect when toggling course edit while inside an activity -- Patch provided by Kanika Goyal 2012-09-24 15:04:06 +08:00
Dan Poltawski bb6b275906 Merge branch 'wip-MDL-35542-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2012-09-24 14:37:49 +08:00
Damyon Wiese b666bddae2 MDL-35375: Ensure the assignment grading table is always sorted by at least one unique column
Conflicts:

	mod/assign/gradingtable.php
2012-09-24 12:38:24 +08:00
Sam Hemelryk e1a809b36f Merge branch 'MDL-35312-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-24 15:53:48 +12:00
Sam Hemelryk 1e112f8801 Merge branch 'MDL-35517_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2012-09-24 15:21:28 +12:00
Ruslan Kabalin 3e8d7ca16e MDL-35442 Add settings and uninstall link for local plugins 2012-09-24 11:19:50 +08:00
Dan Poltawski daccc92d9e Merge branch 'MDL-35242-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-24 11:08:18 +08:00
Sam Hemelryk 3c6510c106 Merge branch 'MDL-30889-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-09-24 15:05:44 +12:00
Sam Hemelryk 91cb7bdab5 Merge branch 'MDL-35398-m23' of git://github.com/netspotau/moodle-mod_assign into MOODLE_23_STABLE 2012-09-24 15:03:26 +12:00
Damyon Wiese 2b7024847d MDL-35427: Remove resetting of $_POST - use $mform->setConstant to force update to rownum instead.
Conflicts:

	mod/assign/locallib.php
2012-09-24 15:02:17 +12:00
Rex Lorenzo e36ab38642 MDL-35587 - Display grouping name for Drag and Dropped resources 2012-09-23 01:15:11 -07:00
Andrew Robert Nicols cffbc80ac7 MDL-34328 Correct usage of e.drop when catching missed drag/drop events 2012-09-21 15:25:29 +01:00
Paul Nicholls 3f6970bf92 MDL-34328: block dragdrop - disallow dragging from show/hide and dock icons
Tell the YUI drag/drop delegate that the show/hide and dock icons are not valid drag handles.  Otherwise, a drag can be initiated by showing or hiding a block (probably not from docking one, but better safe than sorry).  Not strictly related to MDL-34328, but likely to be encountered whilst testing - and closely related to another patch for MDL-34328.

Note that the "invalid" config option for the delegate takes a string - not an array - but can have multiple selectors separated by commas.
2012-09-21 15:25:29 +01:00
Paul Nicholls 65c8ccc02e MDL-34328: block dragdrop - performance rewrite
Use YUI's DragDrop delegates for block dragdrop - one per block region - rather than initialising a Drag object for each individual block.
2012-09-21 15:25:29 +01:00
Paul Nicholls a573a5157e MDL-34328: course section "toolboxes" - performance rewrite
Use YUI event delegation to handle events in course section "toolboxes" (visibility and highlight toggles) rather than attaching event handlers to each individual button we care about.  Also remove the (now unused) replace_button() function.
2012-09-21 15:25:29 +01:00
Paul Nicholls e4db46b4d9 MDL-34328: course resource "toolboxes" - performance rewrite
Use YUI event delegation to handle events in course resource "toolboxes" (sets of editing icons) rather than attaching event handlers to each individual button we care about.  Don't waste time setting the CSS cursor to what it already is, use .all() rather than replace_button() if we just need the node.

Section toolboxes could probably also be done this way to some extent, but the payoff may not be worth the effort - they're so minimal that they don't tend to cause issues.
2012-09-21 15:25:29 +01:00
Paul Nicholls 99cd723af5 MDL-34328: course dragdrop - performance rewrite
Use YUI's DragDrop delegates for course dragdrop, rather than initialising a Drag object for each individual section and each individual activity/resource.  Also, clone a single drag handle for activities/resources, rather than repeatedly creating a whole new one with the same parameters for each activity/resource.
2012-09-21 15:25:28 +01:00
Jason Fowler 94167a2dee MDL-34476 - Course Completeion, Blocks - Allowing teachers to access the Full Course Report from the Course Completion Block -- Initial patch provided by Nadav Kavalerchik 2012-09-21 15:21:18 +08:00
Ankit Agarwal 7cdb725081 MDL-30889 calendar: Adding focus and blur events to calendar renderer 2012-09-21 14:34:51 +08:00
Frederic Massart 05daea0f6d MDL-31976 Accessbility: Action icons on course page do not need title attributes 2012-09-21 11:30:51 +08:00
Frederic Massart 6b15d50a60 MDL-35312 Web Services: Fixed typo in capability of course update 2012-09-21 09:57:45 +08:00
Frederic Massart aa57854075 MDL-35242 Web Services: Removed translation causing error in add_to_log 2012-09-21 09:57:34 +08:00
Frederic Massart 7ae2136b3f MDL-34607 Folder: Remove any sort order during upgrade 2012-09-21 09:56:52 +08:00
Frederic Massart 7be6c09db5 MDL-34607 File API: Removed ordering by sortorder in area tree 2012-09-21 09:56:52 +08:00
AMOS bot 58f8b73f26 Automatically generated installer lang files 2012-09-21 00:34:52 +00:00
Michael Aherne 7ab5b064a6 MDL-35321 course sections Enable reset of grouping access 2012-09-20 16:22:29 +01:00
Eloy Lafuente (stronk7) 2974030611 MDL-35517 course: Handle non-existing $course->maxbytes on course creation. 2012-09-20 10:20:21 +02:00
Marina Glancy a7783bf260 MDL-35542 Fixed a bug when trying to directly link to a file from Dropbox 2012-09-20 15:50:28 +08:00
Marina Glancy 093825d81e MDL-35001 added unit test for function convert_to_array() 2012-09-20 15:50:12 +08:00
Marina Glancy 7116aca6af MDL-35001 removed cycle detection from convert_to_array because it causes error in data 2012-09-20 15:50:11 +08:00
Marina Glancy ed7e6a7356 MDL-33857 Increase performance of queries for Server files repository (small improvements) 2012-09-20 15:49:01 +08:00
Dan Poltawski c366bea3cf weekly release 2.3.2+ 2012-09-20 14:10:34 +08:00
Dan Poltawski 33672ace5f Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-09-20 14:05:52 +08:00
AMOS bot 5fc1b61a88 Automatically generated installer lang files 2012-09-20 00:34:31 +00:00
Eloy Lafuente (stronk7) 2ed38452aa MDL-33166 forum: fetch cmid to be used by capability checks. 2012-09-19 21:42:14 +02:00
Dan Poltawski ed78617491 Merge branch 'wip-mdl-30833-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-09-19 09:52:18 +08:00
AMOS bot 9b65e5841e Automatically generated installer lang files 2012-09-19 00:34:24 +00:00
Eloy Lafuente (stronk7) b04027c0cf MDL-33166 Forum: whitespace fix 2012-09-19 00:53:05 +02:00
Eloy Lafuente (stronk7) e6084683c8 Merge branch 'wip-mdl-33166-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-09-19 00:39:08 +02:00
Simon Coggins 119b5fdc8b MDL-35472: Prevent html tags appearing in page titles
Only a problem when formatstringstriptags is disabled
2012-09-19 09:07:33 +12:00
Eloy Lafuente (stronk7) b437a680d2 Merge branch 'MDL-33198-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-09-18 20:06:03 +02:00
Eloy Lafuente (stronk7) 631aedabb4 Merge branch 'w38_MDL-32572_m23_authdbduplicates' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-09-18 19:51:38 +02:00
Petr Škoda 88fbc9a7ef MDL-32572 fix notice when changing internal auth_db passwords 2012-09-18 13:18:18 +02:00
Petr Škoda 3f22e75663 MDL-32572 skip problematic users in auth_db sync 2012-09-18 12:41:07 +02:00
Rajesh Taneja 9ac00a5394 MDL-30833 Accessibility: Added aria-expanded attribute on navigation nodes 2012-09-18 17:29:00 +08:00
Petr Škoda 45a6d31c4f MDL-32572 always lookpup passwords only in records from current auth plugin
This bug should not be creating any problems thanks to our design of login process, but it should be fixed anyway.
2012-09-18 10:38:29 +02:00
Damyon Wiese ce86eb4d08 MDL-35202: Allow for language files that contain non-ascii for actions in assignment 2012-09-18 15:27:58 +08:00
Dan Poltawski 85aa469960 Merge branch 'MDL-30909-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-18 15:08:00 +08:00
Frederic Massart 6d3249780b MDL-30909 Accessibility: Improved access to reply form in forums 2012-09-18 14:57:20 +08:00
Damyon Wiese 97b53d6c05 MDL-35398: Quick grading feedback is now pushed to the gradebook 2012-09-18 14:54:01 +08:00
Dan Poltawski bb67dc33e1 Merge branch 'wip-mdl-30831-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-09-18 14:51:33 +08:00
Ankit Agarwal ec5c45c4ed MDL-33198 book: Adding h tags to book title to increase accessibility 2012-09-18 09:46:21 +08:00
Ankit Agarwal 58ee763bfb MDL-33198 book: Adding h tags to book titles to increase accessibility while printing a book 2012-09-18 09:46:21 +08:00
Dan Poltawski 05165a7f60 Merge branch 'm23_MDL-34644' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-09-18 09:27:19 +08:00
Eloy Lafuente (stronk7) 0671db29ce Merge branch 'MDL-32688-m23' of git://github.com/itamart/moodle into MOODLE_23_STABLE 2012-09-18 01:53:50 +02:00
Eloy Lafuente (stronk7) c59d51b67d Merge branch 'MDL-35419_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-09-18 01:28:46 +02:00
Eloy Lafuente (stronk7) b050380df1 Merge branch 'MDL-32230-23' of https://github.com/mackensen/moodle into MOODLE_23_STABLE 2012-09-18 01:20:45 +02:00
Eloy Lafuente (stronk7) 0f5c4b8397 Merge branch 'MDL-34841_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-09-18 01:15:31 +02:00
Eloy Lafuente (stronk7) a0a02f4e0d Merge branch 'w38_MDL-35129_m23_dbmigration' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-09-18 01:12:34 +02:00
David Mudrák 1530136c20 MDL-35344 Ignore available updates info with invalid format
Previously when the server response validation had failed, the property
available_update_checker::recentresponse was left as NULL. This caused
problems in available_update_checker::compare_responses() that expects
proper arrays passed.

This patch makes invalid data being ignored by setting the property to
an empty array as if no data have been fetched yet. A debugging message
is thrown so the admins will be able to diagnose eventual problems in
the future.
2012-09-17 18:04:17 +02:00
Dan Poltawski 07a145dcfc Merge branch 'MDL-33982-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-17 16:03:35 +08:00
Dan Poltawski 947d7759bb Merge branch 'MDL-35376_23' of git://github.com/rlorenzo/moodle into MOODLE_23_STABLE 2012-09-17 12:47:53 +08:00
Dan Poltawski 4edc94cbf3 Merge branch 'MDL-30847_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-09-17 12:40:02 +08:00
Rossiani Wijaya 83fbe988f0 MDL-34571 accessibility compliance for report: Add label to select and input text form 2012-09-17 12:15:05 +08:00
Rossiani Wijaya 7a054265dc MDL-34778 enrol: add a space 2012-09-17 12:14:22 +08:00
Rossiani Wijaya b7f0b0b12b MDL-34778 accessibility compliance for enrol: add label tag for input text 2012-09-17 12:14:20 +08:00
Dan Poltawski 614ac18b11 Merge branch 'MDL-34975-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-17 11:59:51 +08:00
Dan Poltawski 8673ce8201 Merge branch 'MDL-35374_23' of git://github.com/rlorenzo/moodle into MOODLE_23_STABLE 2012-09-17 11:47:35 +08:00
Dan Poltawski 7056f36f3c Merge branch 'w38_MDL-35454_m23_bogusmaxsize' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-09-17 11:44:45 +08:00
Dan Poltawski bde7deec36 Merge branch 'MDL-35163-MOODLE_23_STABLE' of git://github.com/micaherne/moodle into MOODLE_23_STABLE 2012-09-17 10:51:40 +08:00
Rajesh Taneja 29a33233fc MDL-30831 Accessibility: Added aria role and attributes to dock block 2012-09-17 10:13:18 +08:00
Rex Lorenzo fd7255ace0 MDL-33166 Forum: Adding capability mod/forum:allowforcesubscribe
Conflicts:

	mod/forum/version.php
2012-09-17 10:07:28 +08:00
Frederic Massart 8e977618f8 MDL-34975 Accessibility: Collapsible areas captions can be clicked to expand/collapse 2012-09-17 09:45:36 +08:00
Frederic Massart befd59097b MDL-33982 TinyMCE: Media preview supports external URLs 2012-09-17 09:44:44 +08:00
David Monllao e4c9460c0b MDL-30847 core Adding ARIA attribute to help windows 2012-09-17 09:27:11 +08:00
Petr Škoda 28ac357f86 MDL-35454 ignore invalid $custombytes in get_max_upload_sizes()
This fixes installation and phpunit init regression.
2012-09-17 00:08:36 +02:00
Eric Merrill 1077bf7086 MDL-35411 assign Include plugin (submission/feedback) info, even when there is no user data.
assign_plugin_config data was only included in backups/imports if user data was included in
the backup. This patch moves it out with the standard structure of the assign backup.
2012-09-16 17:57:26 -04:00
Petr Škoda fe5a985c0e MDL-35129 implement new export_table_recordset()
This is necessary because MySQL get_recordset_sql() stores the data in memory, unfortunately the alternative resultset iteration blocks concurrent access - that is why we need new method for export.
2012-09-15 12:03:24 +02:00
Petr Škoda 250b340003 MDL-35129 add missing recordset closing in db transfer 2012-09-14 23:54:56 +02:00
Itamar Tzadok e7f72fb5d6 MDL-32688 My Moodle - Fixed fatal error in guest access to My Moodle 2012-09-14 15:12:17 -04:00
Eloy Lafuente (stronk7) 32efb09e62 weekly release 2.3.2+ 2012-09-14 19:10:43 +02:00
Eloy Lafuente (stronk7) b5b8aac98a Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-09-14 19:03:20 +02:00
Michael Aherne 6b3177344d MDL-35163 quiz Make quiz report options available to attempts form 2012-09-14 10:17:17 +01:00
Eloy Lafuente (stronk7) b92083421c Revert "MDL-32125 mod_forum: updating subscription mode not reflected"
This reverts commit b4271570c6.
2012-09-14 10:38:17 +02:00
Eloy Lafuente (stronk7) 77393dec21 Revert "MDL-32125 mod_forum: updating subscription mode not reflected"
This reverts commit fa501712c7.
2012-09-14 10:38:12 +02:00
AMOS bot 9844498b0a Automatically generated installer lang files 2012-09-14 00:34:18 +00:00
Tim Hunt c21f901559 MDL-35419 question manual grading: valdiation must handle 0,5
Yet another , as decimal separator issue!

To fix this nicely, I refactored some code into question_utils.
2012-09-13 16:40:02 +01:00
Simon Coggins a698454089 MDL-34644 SCORM fix completion when only completion on view is selected. 2012-09-13 14:39:12 +12:00
AMOS bot b3557ac52d Automatically generated installer lang files 2012-09-13 00:34:33 +00:00
Kanika Goyal fa501712c7 MDL-32125 mod_forum: updating subscription mode not reflected 2012-09-13 11:27:48 +12:00
Kanika Goyal b4271570c6 MDL-32125 mod_forum: updating subscription mode not reflected 2012-09-13 11:27:47 +12:00
Sam Hemelryk 77ef5e06f9 Merge branch 'wip-mdl-30667-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-09-13 11:18:20 +12:00
Sam Hemelryk cdf30c74d8 Merge branch 'MDL-29872_c_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-09-13 11:12:47 +12:00
Tim Hunt 5df0a6b47e MDL-34841 error importing questions with long names.
The problem was with the non-UTF-8-safe way that a question name
was being constructed from the question text.

I have done a proper fix with methods in the base class to
carefully construct a question name that is reasonable, and
which will fit in the database column. Then I have changed all
importers to use the new methods.

I also remembered not to break the lesson in the process.
2012-09-12 17:38:40 +01:00
Eloy Lafuente (stronk7) bd390545b1 Merge branch 'MDL-34082_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-09-12 17:20:48 +02:00
Tim Hunt b06143c5c2 MDL-34082 course restrict modules: typo in MDL-19125 upgrade code. 2012-09-12 16:15:38 +01:00
David Monllao 7737d24b92 MDL-35264 mod_chat Bigger frame for text input 2012-09-12 14:54:16 +08:00
Sam Hemelryk 561cbb8967 Merge branch 'wip-MDL-34223-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2012-09-12 10:33:35 +12:00
Sam Hemelryk bdd6847fc2 Merge branch 'MDL-30829-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-12 10:27:54 +12:00
Rex Lorenzo 102d0bd05b MDL-35376 - Shortcut/alias not working for Private file repo 2012-09-11 14:24:02 -07:00
Rex Lorenzo 6b43759eff MDL-35374 - Cannot delete blocks off frontpage 2012-09-11 12:28:18 -07:00
Eloy Lafuente (stronk7) 6588886965 Merge branch 'MDL-34984_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-09-11 16:30:44 +02:00
Jason Fowler e0c567c3be MDL-29463 - Chat - Change socket_setopt to socket_set_options 2012-09-11 14:49:33 +08:00
Sam Hemelryk d5e317882d Merge branch 'MDL-35190-MOODLE_23_STABLE' of git://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2012-09-11 16:45:45 +12:00
Frederic Massart ceed31ad6b MDL-34765 Course: Fixed missing argument in course reordering 2012-09-11 16:41:37 +12:00
Sam Hemelryk 6ab9c3e2ad Merge branch 'MDL-34765-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-11 15:31:20 +12:00
Sam Hemelryk bbd89d7b10 Merge branch 'MDL-30018_23' of https://github.com/stronk7/moodle into MOODLE_23_STABLE 2012-09-11 15:21:59 +12:00
Sam Hemelryk 08153276ac Merge branch 'MDL-10259_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-09-11 15:18:40 +12:00
Sam Hemelryk d27a76c3e3 Merge branch 'MDL-30857_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-09-11 15:10:48 +12:00
Sam Hemelryk 6d661aa2f1 Merge branch 'm23_MDL-34755' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-09-11 15:02:26 +12:00
Marina Glancy 1ab628b72e MDL-34223 increased performance in forum_get_file_info() for admins 2012-09-11 10:48:21 +08:00
Marina Glancy c84b70456a MDL-33857 Increase performance of queries for Server files repository
- file_info class now has new methods get_non_empty_children and count_non_empty_children; added default implementation;
- all core classes extending file_info have their implementation of those methods;
- class repository_local_file used for caching get_children() results is removed;
- class repository_local rewritten to use new methods from file_info;
- added caching of retrieved modules in file_browser::get_file_info_context_module() - this query is slow and executed multiple times on big servers
2012-09-11 10:48:13 +08:00
Eloy Lafuente (stronk7) 11a3dd0c0e Merge branch 'MDL-35134_23' of git://github.com/pauln/moodle into MOODLE_23_STABLE 2012-09-11 02:50:29 +02:00
Eloy Lafuente (stronk7) a59f0f25cd Merge branch 'm23_MDL-35156' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-09-11 02:48:22 +02:00
Eloy Lafuente (stronk7) 35eb1a0f0c Merge branch 'MDL-35171_m23' of git://github.com/merrill-oakland/moodle into MOODLE_23_STABLE 2012-09-11 02:44:56 +02:00
Eloy Lafuente (stronk7) 7189c6102f MDL-34338 mod_folder: delete unused $browser var. 2012-09-11 02:20:17 +02:00
Eloy Lafuente (stronk7) 2e4678332a Merge branch 'wip-MDL-34338-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2012-09-11 02:19:48 +02:00
Sam Hemelryk cb3a1e355b Merge branch 'm23_MDL-35255' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-09-11 12:10:55 +12:00
Raymond Wijaya cfe32be822 MDL-34660: Fix SQL error in assignments module with Oracle Database I by replacing 'offline' with 'nosubmissions' 2012-09-11 02:08:54 +02:00
Sam Hemelryk 654338074e Merge branch 'MDL-34916_M23' of git://github.com/kordan/moodle into MOODLE_23_STABLE 2012-09-11 12:06:14 +12:00
Eloy Lafuente (stronk7) c0eee4898a Merge branch 'm23_MDL-35123' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-09-11 02:03:10 +02:00
Eloy Lafuente (stronk7) 3a3120e206 Merge branch 'm23_MDL-35208' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-09-11 01:57:21 +02:00
Eloy Lafuente (stronk7) f34cb5797c Merge branch 'MDL-35257' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-09-11 01:53:35 +02:00
Eloy Lafuente (stronk7) 8146d3f12d Merge branch 'w37_MDL-35270_m23_oracohort' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-09-11 01:48:55 +02:00
Sam Hemelryk 74fae5244c Merge branch 'MDL-27786-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-09-11 11:15:25 +12:00
Sam Hemelryk 1595c976dd Merge branch 'MDL-33374-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-09-11 11:10:26 +12:00
Sam Hemelryk 5a05aa9633 Merge branch 'MDL-35007-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-09-11 11:07:25 +12:00
David Mudrák babf5f522e MDL-35272 Fix typo in qformat_blackboard_six.php
Credit goes to German Valero for spotting and reporting this.
2012-09-11 01:03:22 +02:00
Adrian Greeve 919105e5d1 MDL-32785 - lib - Ignorning hard frozen fields when submitting data. 2012-09-11 10:48:07 +12:00
Charles Fulton cc17d246e4 MDL-32230 block_rss_client: remove extra cleaning step 2012-09-10 12:31:39 -07:00
Eloy Lafuente (stronk7) ab88177b5e Merge branch 'w37_MDL-35289_m23_tinymcelangs' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-09-10 19:53:24 +02:00
Eloy Lafuente (stronk7) f58585807c Merge branch 'MDL-35343_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-09-10 16:41:56 +02:00
Tim Hunt 817fcbb549 MDL-35343 JavaScript visible in multichoice choice feedback.
Also, Match correct answer, and calculated multi and multianswer
feedback.
2012-09-10 13:08:14 +01:00
Frederic Massart 5371fa1928 MDL-30829 Accessibility: Docking a block disables the accessible anchors 2012-09-10 17:22:17 +08:00
Aparup Banerjee 6c990952c9 Merge branch 'MDL-34944-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-09-10 17:15:31 +08:00
Aparup Banerjee 1b1c35541a Merge branch 'MDL-35223-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-09-10 17:00:47 +08:00
David Monllao 360769aa0f MDL-30857 block_community Removing comments hardcoded height 2012-09-10 15:00:46 +08:00
Aparup Banerjee 49d9947914 Merge branch 'MDL-35264_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-09-10 14:39:01 +08:00
Aparup Banerjee 4ad7bc830e Merge branch 'MDL-27398_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-09-10 14:30:57 +08:00
David Monllao 799de15145 MDL-27398 mod_chat Removing PAGE references 2012-09-10 14:10:26 +08:00
David Monllao f4dfb810c8 MDL-27398 mod_chat Adding file basic doc 2012-09-10 14:10:26 +08:00
David Monllao c8cac02c99 MDL-27398 mod_chat Removing deprecated calls and moving dependencies
Credit to Jorge Villalon
2012-09-10 14:10:18 +08:00
David Monllao 879c31c1ba MDL-27398 mod_chat Adding CLI_SCRIPT to chat daemon
Credit to Jorge Villalon
2012-09-10 14:09:57 +08:00
Aparup Banerjee 9111b11b7b Merge branch 'MDL-34068_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-09-10 13:42:36 +08:00
Eloy Lafuente (stronk7) 8722439751 MDL-30018 restore: better answer matching. Credit goes to Tyler Bannister, thanks!
On backup, contents are cleaned to be safe utf8. That was leading to
some matching problems on restore against not cleaned DB contents (for
already existing questions). This commit adds one fallback method to
perform the match against cleaned DB contents.
2012-09-09 20:30:02 +02:00
Eloy Lafuente (stronk7) 7413ce9896 Moodle 2.3.2 release 2012-09-09 16:23:09 +02:00
Petr Škoda bafffec181 MDL-35270 fix ambiguously defined column
Credit goes to Sara Arjona, thanks.
2012-09-08 10:49:49 +02:00
AMOS bot f84f35dda1 Merge branch 'MOODLE_23_STABLE' into install_23_STABLE 2012-09-08 00:34:44 +00:00
Petr Škoda 9cd1f8ffe6 MDL-35289 add missing charmap usage info string 2012-09-07 10:30:24 +02:00
Rossiani Wijaya cd029574b6 MDL-29872 Dropbox repository: add message handler to filepicker header and add message to logout from dropbox.
When user clicked on logout button from dropbox repository, it will also logging them out from dropbox site through a popup window
2012-09-07 15:44:08 +08:00
Rossiani Wijaya 14d15f125e MDL-34573 - add label for search tag input text 2012-09-07 15:43:44 +08:00
Rossiani Wijaya 2afda054e8 MDL-34573 Tag: update label for suggested tag 2012-09-07 15:43:44 +08:00
Rossiani Wijaya 5c0c094f3c MDL-34573 accessibility compliance for tag: Add forform input text and select tag 2012-09-07 15:43:43 +08:00
Rossiani Wijaya 689a3bcd17 MDL-34984 admin setting: fixed labeling and shortname display for admin setting 2012-09-07 15:43:09 +08:00
Frederic Massart d37de5e0df MDL-34765 Course: Re-sorting courses uses natural order 2012-09-07 14:13:50 +08:00
David Monllao a08d03a2c0 MDL-34068 mod_chat Sending text/html headers when sending the messages frame output for the first time 2012-09-07 12:11:11 +08:00
David Monllao a2d928b143 MDL-35264 mod_chat Changing the input frame of chat daemon method to a embedded page layout 2012-09-07 12:08:15 +08:00
David Monllao 2904faa0eb MDL-10259 core Adding a search courses box if there are too many courses 2012-09-07 11:29:44 +08:00
Dan Poltawski bd916ad1ee MDL-35257 lib: if $CFG->logguests is disabled, avoid some log actions
This is for performance, else there can be great contention on the guest
user record as we've seen on moodle.org.
2012-09-07 10:24:50 +08:00
Ankit Agarwal e81507f6b6 MDL-27786 calendar: Changing the eventname string for accessibility 2012-09-07 10:22:02 +08:00
Ankit Agarwal 800abd6faf MDL-33374 profile: Use correct text for buttons when creating a new user 2012-09-07 10:19:34 +08:00
Ankit Agarwal bb7f95f830 MDL-34944 book: Implementing reset framework for book 2012-09-07 10:17:13 +08:00
Ankit Agarwal 41b997b1ff MDL-35007 book: Adding rule to parse links to book chapters from 1.9 backups
Conflicts:

	mod/book/version.php
2012-09-07 10:13:09 +08:00
Ankit Agarwal 6d89ac64ab MDL-35223 book: use chapter names in page titles 2012-09-07 10:09:52 +08:00
Marina Glancy f4671476ff MDL-34338: renderer for mod_folder should not use file_info 2012-09-07 09:36:19 +08:00
Eloy Lafuente (stronk7) 71e12dc963 weekly release 2.3.1+ 2012-09-07 02:38:46 +02:00
AMOS bot ba1d10c500 Automatically generated installer lang files 2012-09-07 00:35:10 +00:00
Eloy Lafuente (stronk7) 662fe4b7d6 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-09-07 02:18:16 +02:00
Eloy Lafuente (stronk7) ce077202d0 Merge branch 'MDL-34945-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-06 20:12:09 +02:00
Eloy Lafuente (stronk7) d98c8fcb8e Merge branch 'MDL-34985_m23' of git://github.com/merrill-oakland/moodle into MOODLE_23_STABLE 2012-09-06 20:07:45 +02:00
Eloy Lafuente (stronk7) 9d2926a4e9 MDL-6424 - blocks - Add missing global vars. 2012-09-06 19:45:00 +02:00
Adrian Greeve 155fd3f64b MDL-6424 - blocks - Adding a warning screen when the user clicks the delete link.
Conflicts:
	lib/blocklib.php
2012-09-06 19:44:40 +02:00
Dan Marsden fa3a1652bf MDL-35123 SCORM: cleaner version of get_last_attempt and get_last_completed_attempt, fixes support for MS Sql driver 2012-09-06 18:45:43 +12:00
Jerome Mouneyrac a66863c357 MDL-35190 random failures in course externallib test 2012-09-06 11:30:43 +08:00
Eloy Lafuente (stronk7) e02955dd79 Merge branch 'MDL-35034-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-06 01:18:40 +02:00
Eloy Lafuente (stronk7) 3f4e07ef3c MDL-29662 quiz overrides: use proper course value (was php notice). 2012-09-05 18:02:16 +02:00
Eloy Lafuente (stronk7) 9569ba7ed8 Merge branch 'w36_MDL-35077_m23_stats' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-09-05 13:13:31 +02:00
Petr Škoda e4e29fd35e MDL-35077 do not show link to system stats report if stats disabled 2012-09-05 10:02:07 +02:00
Aparup Banerjee 69a52e7c4f Merge branch 'MDL-35089_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2012-09-05 15:08:38 +08:00
Aparup Banerjee a334d8f967 MDL-26504 blog: fixed SQL to add explicit casting
Conflicts:

	lib/db/upgrade.php
	version.php
2012-09-05 10:31:06 +08:00
Dan Marsden 4d48a65159 MDL-35255 mod_assign plagiarism api shift update_status call to after header has been printed. 2012-09-05 12:45:52 +12:00
Eloy Lafuente (stronk7) 3ac8fa663a Merge branch 'MDL-34997-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-05 00:52:43 +02:00
Aparup Banerjee 4ec133b8e6 Merge branch 'wip-mdl-34537-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-09-04 17:32:51 +08:00
Frederic Massart 7c4fc5b50b MDL-34945 Repository: Creating an instance requires the user to have the permission to view it 2012-09-04 16:17:25 +08:00
Kordan e765d3c396 MDL-34916 theme_formal_white: added support for relative path of logos 2012-09-04 09:49:51 +02:00
Kordan 2f9ac3fe1e MDL-35211 theme_formal_white: updated descriptions involved in MDL-34916 2012-09-04 09:11:01 +02:00
Andrew Davis c62ccd747c MDL-26504 blog: added upgrade code to remove orphan external blog posts
Conflicts:
	lib/db/upgrade.php
	version.php
2012-09-04 13:56:27 +08:00
Andrew Davis fb1b0bc05e MDL-26504 blog: made it delete external blog posts when the external blog is deleted 2012-09-04 13:53:48 +08:00
Sam Hemelryk df4e81835a Merge branch 'MDL-30022_message_duplicate_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-09-04 16:50:23 +12:00
Tim Lock d8a640728c MDL-35092: Add proxy support to enrol/paypal IPN 2012-09-04 10:56:41 +08:00
Simon Coggins b91833db8a MDL-34755 SCORM: pop-up not loading in IE7/IE8 compat mode 2012-09-04 13:12:34 +12:00
Eloy Lafuente (stronk7) 31ae0e5984 Merge branch 'wip-mdl-34606-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-09-04 02:09:25 +02:00
Eloy Lafuente (stronk7) 3dafe46b2b Merge branch 'MDL-34633-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-04 01:54:04 +02:00
Eloy Lafuente (stronk7) 5f015b62d4 Merge branch 'MDL-29662_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-09-04 01:14:18 +02:00
Eloy Lafuente (stronk7) 2b567e3687 Merge branch 'MDL-27818_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-09-04 01:07:51 +02:00
Dan Marsden 70c2ec0ba2 MDL-35208 mod_choice: respect order of options when running backup 2012-09-04 11:02:15 +12:00
Eloy Lafuente (stronk7) 8a716e2362 Merge branch 'MDL-33306_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-09-04 00:30:59 +02:00
Eloy Lafuente (stronk7) 20182f8670 Merge branch 'MDL-33812-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-04 00:20:17 +02:00
Eloy Lafuente (stronk7) 99e6bd4799 Merge branch 'MDL-34725-strict-standards_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2012-09-04 00:06:23 +02:00
Eloy Lafuente (stronk7) 0af2fd2e05 Merge branch 'w36_MDL-34097_m23_environment' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-09-04 00:00:38 +02:00
Eloy Lafuente (stronk7) 2cdf1a4650 Merge branch 'MDL-28346-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-09-03 20:02:13 +02:00
Eloy Lafuente (stronk7) 0cae56b42e Merge branch 'w36_MDL-35077_m23_stats' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-09-03 17:54:03 +02:00
Eloy Lafuente (stronk7) b9d24254bd Merge branch 'MDL-35133_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-09-03 17:47:50 +02:00
Eloy Lafuente (stronk7) a31d7a0ed3 Merge branch 'w36_MDL-35168_m23_yuipath' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-09-03 17:16:17 +02:00
Eloy Lafuente (stronk7) e815aa8e04 Merge branch 'w36_MDL-35145_m23_guestdelete' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-09-03 16:18:15 +02:00
Aparup Banerjee e78698c606 Merge branch 'MDL-35151_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-09-03 19:23:52 +08:00
Aparup Banerjee a2bdb0b02c Merge branch 'MDL-35180_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-09-03 17:38:07 +08:00
Aparup Banerjee 90c499dbca Merge branch 'w36_MDL-35080_m23_weirdtables' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-09-03 17:12:32 +08:00
Rajesh Taneja 2f2242efa2 MDl-30667 Course: Maxbytes list will show current value, if it's lower then maxbytes 2012-09-03 14:44:23 +08:00
Frederic Massart 82bf5b10b9 MDL-34633 Repository: Flickr supports small images 2012-09-03 14:19:47 +08:00
Frederic Massart 668ba1e922 MDL-35101 Repository: Public Flickr fails when the picture has no license 2012-09-03 14:18:16 +08:00
Jean-Philippe Gaudreau 3d5df93b80 MDL-34997 - Allow shortened url youtu.be and y2u.be for Youtube filter 2012-09-03 14:12:03 +08:00
Frederic Massart 3bae0b5916 MDL-28346 Backup: Backup does not fail when a file is missing 2012-09-03 14:11:37 +08:00
Frederic Massart 16ee63b4b8 MDL-28346 Backup: Restore does not fail when a file is missing 2012-09-03 14:11:37 +08:00
Frederic Massart 397afd71c3 MDL-28346 Backup: Added new status 'warning' for backup result 2012-09-03 14:11:37 +08:00
Frederic Massart c128731d19 MDL-35034 Repository: Google Docs does not fail when download is restricted 2012-09-03 14:11:12 +08:00
Frederic Massart 640f8eed6d MDL-33812 Backup: Added some upgrade information about the changes 2012-09-03 14:10:59 +08:00
Frederic Massart 2fd679c5e1 MDL-33812 Backup: Revert MDL-33521 2012-09-03 14:10:59 +08:00
Frederic Massart 905185dca4 MDL-33812 Backup: Respect of backup_auto_keep 2012-09-03 14:10:58 +08:00
Dan Marsden 43b135e598 MDL-35156 remove references to non-existant options 2012-09-03 12:42:26 +12:00
Sam Hemelryk 8169e2f46b Merge branch 'MDL-35109-available-updates_23' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2012-09-03 12:28:18 +12:00
Sam Hemelryk 3d1cbc0df3 Merge branch 'MDL-31496_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-09-03 12:20:25 +12:00
Sam Hemelryk b739e2d71a MDL-26822 user: Minor improvements post integration 2012-09-03 11:41:24 +12:00
Sam Hemelryk bcbfd02574 Merge branch 'MDL-26882-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-09-03 11:26:07 +12:00
Sam Hemelryk f38508168f Merge branch 'wip-MDL-34318-MOODLE_23_STABLE' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE 2012-09-03 10:12:37 +12:00
Sam Hemelryk 9f66e64390 Merge branch 'MDL-30020c-23' of git://github.com/srynot4sale/moodle into MOODLE_23_STABLE 2012-09-03 09:52:20 +12:00
Mary Evans 47045e82b0 MDL-35180 theme_afterburner: fixes IE9 compatibility view bug 2012-09-02 16:00:29 +01:00
Petr Škoda e235de5ef5 MDL-34097 keep current requirements for Moodle 2.4 2012-09-02 11:53:45 +02:00
AMOS bot a49ea30654 Automatically generated installer lang files 2012-09-02 00:32:45 +00:00
Mary Evans f4f8cf9a2d MDL-35151 theme_anomaly: removed CSS selectors (.forumpost .content p) from style/general.php thus allowing YUI CSS to style paragraphs as normal. 2012-09-01 23:25:40 +01:00
Petr Škoda 9817f08400 MDL-35080 skip views and weird tables in mysql structure upgrades 2012-09-01 16:23:44 +02:00
Eric Merrill e0b818cde0 MDL-35171 formslib Updating date config array to fix problems with month jumping.
Based on https://bugs.php.net/bug.php?id=49115, if you request a month, but do not
specify a date, it will use your current date, which may be beyon a date in the month
requested, causing the return of the next month. This patch specifies the date (1st).
2012-09-01 10:14:51 -04:00
Petr Škoda 45f9c2db5f MDL-35145 add basic unit tests for delete_user() 2012-09-01 14:15:36 +02:00
Petr Škoda 3fe8ae9bb9 MDL-35145 add extra delete_user() parameter validation
We do not want to delete local admins and guest account, we need to validate the supplied parameter is valid $user record and refetch it from database.
2012-09-01 14:15:28 +02:00
Petr Škoda 58520c062d MDL-35168 fix yui combo path disclosure 2012-09-01 12:39:59 +02:00
Petr Škoda 0a898cbc46 MDL-35077 fix stats report navigation links 2012-08-31 14:17:45 +02:00
Eloy Lafuente (stronk7) 98157832bf weekly release 2.3.1+ 2012-08-31 11:35:54 +02:00
Eloy Lafuente (stronk7) 6e6f74da2f Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-08-31 11:27:25 +02:00
Eloy Lafuente (stronk7) 4c6b8659f9 MDL-35147 lesson qformat import: Dirty hack to support array questiontext structures. 2012-08-31 02:59:49 +02:00
Tim Hunt 5d22b22274 MDL-27818 question bank: multilang category names don't work. 2012-08-30 22:45:51 +01:00
Tim Hunt fd126f94aa MDL-35133 accesslib: context_module::get_context_name should format_string
Otherwise activites with multilang names are displayed badly.
2012-08-30 22:44:20 +01:00
Eloy Lafuente (stronk7) f1f174e2bf Merge branch 'MDL-35147_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-30 20:12:31 +02:00
Eloy Lafuente (stronk7) a1db53480c Merge branch 'MDL-31244_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-30 18:32:04 +02:00
Tim Hunt 5fe6d41245 MDL-35147 lesson: fix regression from MDL-25492.
I really wish someone would fix lesson to use the question bank.
2012-08-30 13:12:00 +01:00
sam marshall d6d63941d7 MDL-35141 Filelib: No icon for epub filetype 2012-08-30 12:20:44 +01:00
Ankit Agarwal 4d7a664ee7 MDL-26882 profile: Applying cap check (site:viewuseridentity) to email field in user profile 2012-08-30 15:36:26 +08:00
Ankit Agarwal 74c0b55029 MDL-26882 profile: Apllying the cap check site:viewuseridentity to user profile 2012-08-30 15:36:20 +08:00
David Monllao 21415acd5a MDL-35119 tool_assignmentupgrade Changing onsubmit form for onclick button 2012-08-30 15:01:17 +08:00
Adrian Greeve edd2686c8b MDL-32108 - navigation - After logging in the user is directed to mysite instead of site home.
Thanks to lurii Kucherov for this patch.
2012-08-30 11:58:14 +08:00
Aparup Banerjee bc67dfdb9a Merge branch 'MDL-35010_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2012-08-30 10:43:38 +08:00
Paul Nicholls 130dd42130 MDL-35134: course/format/weeks: remove trailing comma in object definition
IE doesn't like trailing commas in object (or array) definitions, and will cease processing JavaScript when it hits one.
2012-08-30 11:25:35 +12:00
Tim Hunt c8f9a0b63a MDL-29662 quiz overrides: update dates during course reset.
Also, fix duplicate SQL clause in similar code in lib,
and fix error when saving overrides.
2012-08-29 18:43:00 +01:00
Tim Hunt 3b5245cd6b MDL-33306 qtype multichoice: fix display of right answer.
Also, fix  higlighing of last edited question in the qeustion bank, when
it co-incides with a grey row.
2012-08-29 17:46:59 +01:00
David Mudrák 160133ce24 MDL-34725 Make the signatures of process_legacy_element() method consistent
The patch fixes the missing parameter type declaration in all subclasses
of the moodle1_workshopform_handler class.
2012-08-29 15:33:22 +02:00
Eloy Lafuente (stronk7) a51eaaac45 Merge branch 'wip-mdl-30121-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-08-29 12:15:14 +02:00
Eloy Lafuente (stronk7) 3afd86559e Merge branch 'wip-MDL-34290-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2012-08-29 12:11:22 +02:00
Aparup Banerjee accaf1d277 Merge branch 'wip-mdl-31623-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-08-29 16:57:09 +08:00
Aparup Banerjee fd3e329d94 Merge branch 'MDL-31959_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-29 15:33:43 +08:00
Aparup Banerjee 913dd6d630 Merge branch 'MDL-34952_23' of git://github.com/grabs/moodle into MOODLE_23_STABLE 2012-08-29 13:27:05 +08:00
Marina Glancy 074455a6f5 MDL-34290 repository_filesystem: do not store files in moodle filepool unless images 2012-08-29 13:12:07 +08:00
Dan Poltawski 7fa4cd1617 MDL-34290 using moodleform cast to int in dropbox repository settings 2012-08-29 13:12:07 +08:00
Marina Glancy 0707372b03 MDL-34290 Added timeout to googledocs request to download a file 2012-08-29 13:12:06 +08:00
Marina Glancy 3dce698981 MDL-34290, MDL-33416 prepare to deprecate fields files.referencelastsync and referencelifetime 2012-08-29 13:12:06 +08:00
Marina Glancy 29ea4e9c56 MDL-34290 Auto synchronise newly created references when possible 2012-08-29 13:12:06 +08:00
Marina Glancy a7f53f09f3 MDL-34665 Dropbox displays thumbnails and return info about file size and date last modified 2012-08-29 13:12:05 +08:00
Marina Glancy f8dea58be9 MDL-34290 remove class cache_file as not used
in fact we have moodle filepool that can work perfectly for caching files, no need to create new class and storage
2012-08-29 13:12:05 +08:00
Marina Glancy 56e41718da MDL-34290 repository_dropbox reference handling
- When Dropbox file is inserted by reference, the shared link is created and stored
- Added a function to fix old references (containing access_key/secret) with the proper ones
- Added support for external links in Dropbox (FILE_EXTERNAL), using the shared link API
- Make sure that repository::get_link() receives reference and not source (other repositories than Dropbox have those fields identical)
- Function get_file_by_reference respects request timeouts, downloads only images (for thumbnail generation),
- Function get_file respects request timeout
- do not use cache_file class (content is cached in moodle filepool if needed)
- added parameter for maximum size of files to cache
- added 'Manage' link for Filepicker
- added user name to
- added user name (if different from current) to 'Original' field
- added/corrected phpdocs
2012-08-29 13:12:04 +08:00
Marina Glancy 1d168fbd5f MDL-34290 oauthlib_helper support for POST request 2012-08-29 13:12:04 +08:00
Marina Glancy a6b0ac5362 MDL-34290 Allow to have several requests to the same instance of oauth_helper 2012-08-29 13:12:04 +08:00
Marina Glancy 120300fb99 MDL-34290 repository_equella: do not download files when not needed
repository_equella::get_file_by_reference respects request timeouts, downloads only images (for thumbnail generation),
does not use cache_file class (content is cached in moodle filepool if needed);
also repository_equella has counter of unsuccessfull connect attempts and do not perform any more if 3 failed
(within one request)
2012-08-29 13:12:03 +08:00
Marina Glancy a5fe04b62b MDL-34290 repository_boxnet, boxlib use request timeouts
boxlib receives additional argument as request timeout
repository_boxnet::get_file_by_reference respects request timeouts and downloads file into moodle only if it is image
also some improvements to repository_boxnet source display functions;
also do not cache result of request in retrieving of listing, user is unable to see the new files he added to box.
2012-08-29 13:12:03 +08:00
Marina Glancy 9001c7242e MDL-34290 repository API: add repository function to import referenced file
it must be independed from sync_external_file because sync often does not actually download contents, it is used just to retrieve
the size of the file. Besides the timeouts for get_file and sync requests are very different.

Also add option to send_stored_file() to ignore reference and send cached contents
2012-08-29 13:12:03 +08:00
Marina Glancy 22fa5d9a7c MDL-34290 repository_filesystem add original info function and reduce ref lifetime 2012-08-29 13:12:02 +08:00
Marina Glancy e53394ba0b MDL-34290 repository API: add timeout to get_file and throw exception
- get_file should have a request timeout and throw an exception with the details (i.e. timeout reached) if download can
not be completed
- corrected phpdocs
2012-08-29 13:12:02 +08:00
Marina Glancy 56e7d14f26 MDL-34290 repository API: do not confuse source and reference
make sure that repository function get_file_source_info receives as argument the source of the file,
and get_file receives a reference;
reference is a value of DB field files_reference.reference and result of get_file_reference(source).
Fix dropbox as the only repository that have different values in those fields;
also added information about user in dropbox reference and original
2012-08-29 13:12:01 +08:00
Marina Glancy c9fa5b1c05 MDL-34290 repository API: allow get_file_by_reference return only filesize
we want to allow repositories to perform quick synchronisation, without downloading the file. In this case they return
only filesize, without the contenthash
2012-08-29 13:12:01 +08:00
Marina Glancy 3af509d6d4 MDL-34290 class oauth_helper, added API to pass options to curl (such as timeout) 2012-08-29 13:12:01 +08:00
Marina Glancy 26aaa7e835 MDL-34290 update all references after the source is changed
- When several records in {files} have the same record in {files_reference} and the synchronisation is performed, we need to update
all records in {files} so all files know if source is changed and that sync was performed;
- also when local moodle file content is changed we immediately update all files referencing to it (therefore sync of references
to the local files is unnecessary);
2012-08-29 13:12:00 +08:00
Marina Glancy 2e0b5fef48 MDL-34290 curl class: add functions to return error code and to download one file 2012-08-29 13:12:00 +08:00
Eloy Lafuente (stronk7) f3d5fb4dec Merge branch 'MDL-29598_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-08-28 23:23:50 +02:00
David Mudrák 903d13c0c2 MDL-35109 Fix available_update_checker::cron_has_fresh_fetch()
For the purpose of cron based fetching, recently fetched data are valid
for 24 hours.
2012-08-28 22:56:18 +02:00
David Mudrák b0e5b3b63b MDL-35109 Improve unittests for cron based fetching of available updates
The expected behaviour is as follows:

* If the recently fetched data is older than 48 hours, it is considered
  as outdated and the new fetch is executed
* else, if the recently fetched data is younger than 24 hours, it is
  considered as fresh enough and no fetch is executed
* else, if the current time is after 01:00 AM plus a certain offset
  (which is randomly generated for each site), the fetch is
  executed.
2012-08-28 22:52:31 +02:00
Eloy Lafuente (stronk7) 5e143a271c Merge branch 'MDL-34250_23' of github.com:stronk7/moodle into MOODLE_23_STABLE 2012-08-28 20:44:49 +02:00
Eloy Lafuente (stronk7) ffbe597ef1 MDL-34250 navigation: Always look for correct parent context.
Conflicts:
	lib/navigationlib.php
2012-08-28 20:41:21 +02:00
Eloy Lafuente (stronk7) 56c5e1db1b MDL-25492 bb6 import: bump version after big changes. 2012-08-28 20:15:18 +02:00
Eloy Lafuente (stronk7) ed29fa1274 Merge branch 'MDL-25492_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2012-08-28 20:08:19 +02:00
Eloy Lafuente (stronk7) faf4ba4774 Merge branch 'MDL-34192_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2012-08-28 14:44:30 +02:00
Eloy Lafuente (stronk7) d8e6e58ec5 MDL-34192 mod_assign: prevent ambiguous column use for Oracle.
Credit goes to Raymond Antonio from NetSpot.
2012-08-28 14:18:54 +02:00
Aparup Banerjee 4eb3f12797 Merge branch 'MDL-31837_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-28 17:04:19 +08:00
Aparup Banerjee 6ec3ae6f14 Merge branch 'MDL-32464_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-28 16:54:31 +08:00
Adrian Greeve 339057063c MDL-34318 - blog - Removal of blog associations from the database on delete.
Thanks to Erik Lundberg for this patch.
2012-08-28 15:54:01 +08:00
Eloy Lafuente (stronk7) b884cf2a74 MDL-35089 conditionals: detected one place missing sectioncache
Thanks to MDL-34936 and unit tests this was discovered like 2 new
places calling to get_fast_modinfo() without the sectioncache
column contents. Potential performance problem, leading to
reseting and recalculation of caches all the time.
2012-08-28 01:41:41 +02:00
Aaron Barnes f0c1bcf5a2 MDL-30020 blocks/completion: Some criteria do not display complete
Also includes a spruce up of the code
2012-08-28 11:40:37 +12:00
Eloy Lafuente (stronk7) 3860f948af Merge branch 'MDL-34406_fullname_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-08-27 20:03:52 +02:00
Eloy Lafuente (stronk7) 9507653269 Merge branch 'MDL-34430_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-27 18:51:01 +02:00
Eloy Lafuente (stronk7) 79a6a832d7 Merge branch 'MDL-34993_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-27 18:35:54 +02:00
Eloy Lafuente (stronk7) eec3a5d48d Merge branch 'm23_MDL-34994' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-08-27 18:20:44 +02:00
Eloy Lafuente (stronk7) e9c306f10e Merge branch 'MDL-35026_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-27 17:54:20 +02:00
Eloy Lafuente (stronk7) b14d76c59f Merge branch 'MDL-35003_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-27 17:51:24 +02:00
Eloy Lafuente (stronk7) 8f93d94ab2 Merge branch 'MDL-35023_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-27 16:33:39 +02:00
Eloy Lafuente (stronk7) b6cd7017c0 Merge branch 'MDL-35038_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-27 16:25:30 +02:00
Eloy Lafuente (stronk7) f9033600cc Merge branch 'MDL-35048_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-08-27 16:20:37 +02:00
Eloy Lafuente (stronk7) 473285edde Merge branch 'MDL-35055_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-27 16:16:46 +02:00
Aparup Banerjee 48ee721e2f Merge branch 'MDL-31633-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-08-27 17:26:41 +08:00
Rajesh Taneja acff486664 MDl-34606 Administration: id for clear button is set properly, and disabled on page load 2012-08-27 15:15:29 +08:00
Aparup Banerjee 42122854fc Merge branch 'MDL-34936-MOODLE_23_STABLE-1' of git://github.com/andrewnicols/moodle into MOODLE_23_STABLE 2012-08-27 14:20:30 +08:00
Rajesh Taneja 339c954913 MDL-34537 Enrolments: Assign alternative odd and even class to manual enrol popup 2012-08-27 14:16:06 +08:00
Aparup Banerjee 7c3fa05126 Merge branch 'MDL-34996_23' of git://github.com/grabs/moodle into MOODLE_23_STABLE 2012-08-27 13:46:50 +08:00
AMOS bot 3342bb835c Automatically generated installer lang files 2012-08-27 00:32:46 +00:00
Aaron Barnes aac67f6384 MDL-32386 completion: Fix incorrect method parameters 2012-08-27 11:19:26 +12:00
Mary Evans b710f91ed9 MDL-35048 theme_formal_white: removed p {margin:0} from style/formal_white.css which was causing a regression in some areas of theme 2012-08-26 20:49:27 +01:00
Andreas Grabs 441fa9c71d MDL-34996 - Improve help text for Feedback dependancies 2012-08-24 23:07:17 +02:00
Andreas Grabs fdc57a14bd MDL-34952 - change get_info() to public access 2012-08-24 21:55:07 +02:00
Tim Hunt a129b76cc3 MDL-32464 qformat multianswer: fix missing include.
Also, add a sample file that can be used for testing, and add a unit
test to verify this is working.
2012-08-24 16:56:52 +01:00
Andrew Robert Nicols 409eab3510 MDL-34936 Warn if the sectioncache property is missing in a get_fast_modinfo call 2012-08-24 15:40:13 +01:00
Tim Hunt 4d0a7e2b1f MDL-35055 question import: slight error with the Match grades option.
Even in the 'Error if grade not listed case', it was applying a small
tolerance. In the case of a fuzzy match, it was returning the inexact
grade from the import file, rather than the precise grade that Moodle
was expecting.

That causes problems when the editing form is displayed, because the
value from the database does not match any of the available options, so
the grade is changed to 0%.
2012-08-24 15:37:38 +01:00
Jean-Michel Vedrine cc0188c21c MDL-25492 Blackboard V6+ question import is broken. 2012-08-24 13:52:05 +02:00
Ankit Agarwal 9fc95b6558 MDL-31633 grades: Fixing incorrect redirect when trying to edit grade letters from admin settings 2012-08-24 14:59:18 +08:00
Tim Lock e24b125a3a MDL-31623 Course: Course reset bypass modules, which are removed 2012-08-24 10:59:46 +08:00
Rajesh Taneja bdbdd72cdb MDL-30121 Assignment 2.2: Draft submission files will not be included in zip, if activity is open 2012-08-24 10:54:19 +08:00
David Monllao b7da14f1c6 MDL-29598 backup Avoid possible future duplicate grade letters
More info in restore_activity_grades_structure_step->process_grade_letter() comments
2012-08-24 08:55:37 +08:00
Justin Filip 44ec173ea8 MDL-29598 backup Check whether a grade_letters record exists before trying to insert a new record 2012-08-24 08:55:37 +08:00
Tim Hunt 6009d1a32e MDL-35038 quiz reports: clarify the API changes docs.
Also re-organise the file to put the most recent changes at the top.
2012-08-23 19:15:34 +01:00
M Kassaei 99aaad063e MDL-35038 quiz reports: document the API changes in 2.3. 2012-08-23 19:15:33 +01:00
Tim Hunt 765e7564cc MDL-35026 qtype multianswer: misnamed string.
AMOS BEGIN
 MOV [questionnadded,qtype_multianswer],[questionsadded,qtype_multianswer]
AMOS END
2012-08-23 19:15:15 +01:00
Tim Hunt 07eca71195 MDL-35023 qtype calculated: fix strict syntax problem. 2012-08-23 19:14:55 +01:00
Tim Hunt 872e445a48 MDL-35003 questions: remove stray full stop after correct answer.
In a few situations, this full stop makes things a bit more grammatical,
but there are many other situations where it causes problems. So, on
balance we will remove it.
2012-08-23 19:14:38 +01:00
Tim Hunt 7f8d657531 MDL-34993 questions: convert numeric fields to float on load.
NUMBER(X,Y) typically come back from the DB as strings. If you don't
convert them to float, then when you display them, it appears as
1.0000000, which is not normally what you want.

Also, increase the size of the field on the edit form, so if you
question does have default mark 0.1234567, you can see that!
2012-08-23 19:14:19 +01:00
Tim Hunt ff43c30f0a MDL-31837 numerical tolerance: better handling of very small tolerances.
The changes between Moodle 1.9 and 2.1 made the marking of very small
answers like 10^-20 almost impossible. This change fixes it.

This fix is almost entirely due the the careful research of Pierre
Pichet, who carefully testing various proposals, and worked out that
this one seemed best.
2012-08-23 18:59:15 +01:00
Tim Hunt 35a95edba4 MDL-31244, MDL-25063 algebra filter: fix common false positives.
There are two well-known cases where the algebra filter messes up input
that is obviously not meant for the algebra filter:

1. Copy and paste of unified diffs.

2. @@PLUGINFILE@@ tokens in the HTML that are due to be replaced by the
files API.

This fix detects these two cases, and just stops the algebra filter from
replacing them.
2012-08-23 18:58:57 +01:00
Eloy Lafuente (stronk7) bac15e5782 weekly release 2.3.1+ 2012-08-23 19:25:40 +02:00
Eloy Lafuente (stronk7) 3330b54c2c Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-08-23 19:18:40 +02:00
Andrew Davis 78c2fa5cab MDL-30022 message: made the messaging history display code able to deal with multiple messages with the same timecreated value 2012-08-23 11:56:05 +08:00
AMOS bot 23bb88d28d Automatically generated installer lang files 2012-08-23 00:34:21 +00:00
Eloy Lafuente (stronk7) 4b7b1aae4d MDL-31957 Course reset: Add missing global 2012-08-23 02:12:39 +02:00
Tim Hunt 49e77191cc MDL-34430 qtype essay: upgrade from MDL-31393 needs a progress bar. 2012-08-22 22:15:36 +01:00
Jean-Michel Vedrine 9832fde1c0 MDL-34738 fix for the problem found during testing : dat files not accepted on some servers 2012-08-22 16:38:08 +02:00
Eloy Lafuente (stronk7) 364666f371 Merge branch 'MDL-34444' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-08-22 11:14:38 +02:00
Dan Poltawski e1269d87d4 MDL-34444 - actually display the title, just don't link it..
Don't worry, i'm going on holiday, so i'll be away from this git repo
for a while to prevent any more mess.
2012-08-22 17:10:38 +08:00
Eloy Lafuente (stronk7) a701525345 Merge branch 'MDL-34444' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-08-22 10:49:30 +02:00
Dan Poltawski ccce6a7e33 MDL-34444 course - don't show to 'unavaibile' sections title
Instead we just show the availability info in the index page,
this makes the navigation etc much simpler.
2012-08-22 16:40:43 +08:00
Dan Poltawski 29beeefc70 Revert "MDL-34444 course: show section availability info"
Turns out this change was just wrong, we shouldn't be allowing linking
to unaavilable sections. Just show the availability information on the
'index page'

This reverts commit 87a31bb5d8.
2012-08-22 16:37:36 +08:00
Eloy Lafuente (stronk7) 996e735693 MDL-35010 availability: fix sometimes missing fieldset 2012-08-22 09:47:44 +02:00
Eloy Lafuente (stronk7) 6c475847fb Merge branch 'MDL-34444' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-08-22 08:40:02 +02:00
Dan Poltawski 363b35f221 Merge branch 'w34_MDL-34864_m23_enrolcat' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-22 14:28:03 +08:00
Petr Škoda f813d99296 MDL-34864 fix role names regression 2012-08-22 08:08:24 +02:00
Dan Poltawski e03a03a4a9 Merge branch 'MDL-35000_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-22 10:32:01 +08:00
Dan Poltawski a4241511ed MDL-34870 enrol_cohort - don't need to do useless work 2012-08-22 10:03:10 +08:00
Dan Poltawski fb4e6948d0 Merge branch 'MDL-34870_23' of git://github.com/aolley/moodle into MOODLE_23_STABLE 2012-08-22 09:52:58 +08:00
Dan Poltawski 70dc5add7d Merge branch 'MDL-34733_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-22 09:16:18 +08:00
Eloy Lafuente (stronk7) f16751f856 Merge branch 'wip-mdl-32759-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-08-22 02:34:04 +02:00
Eloy Lafuente (stronk7) 69be24a776 Merge branch 'MDL-34702_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-22 02:11:07 +02:00
Eloy Lafuente (stronk7) b74390e38b Merge branch 'MDL-34795-23' of git://github.com/srynot4sale/moodle into MOODLE_23_STABLE 2012-08-22 02:05:17 +02:00
Eloy Lafuente (stronk7) e464af4462 Merge branch 'w34_MDL-34864_m23_enrolcat' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-22 01:58:35 +02:00
Eloy Lafuente (stronk7) ea438c8d7b Merge branch 'w34_MDL-34776_m23_notinsql' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-22 01:56:06 +02:00
Eloy Lafuente (stronk7) bae745aa57 MDL-34866 whitespace fix 2012-08-22 01:50:53 +02:00
Eloy Lafuente (stronk7) 0547143fad Merge branch 'MDL-34866_23' of git://github.com/rlorenzo/moodle into MOODLE_23_STABLE 2012-08-22 01:50:19 +02:00
Dan Marsden 2b062ed6a6 MDL-34994 mod_choice: fix restore of user responses - use correct optionid 2012-08-22 09:04:35 +12:00
Eloy Lafuente (stronk7) 864ca7d700 Merge branch 'w34_MDL-34893_m23_phpunitparams' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-21 21:18:44 +02:00
Tim Hunt fa0ed51c0a MDL-35000 quiz: Complete activity report broken by bad require.
Fix the stupid error that caused this. Also, make all the other
require_once calls in the file consistent.
2012-08-21 18:03:14 +01:00
Tim Hunt d7b7aff004 MDL-34733 quiz 'secure' mode: finish review link broken in previews
Here, we use a nasty hack to fix the problem on stable branches without
an API change.
2012-08-21 12:05:52 +01:00
Juho Viitasalo 1923720566 Changed two notification to output correctly 2012-08-21 15:36:34 +08:00
Dan Poltawski 5a566ceac7 Merge branch 'MDL-34691_assign_overdue_by_23' of https://github.com/SWiT/moodle into MOODLE_23_STABLE 2012-08-21 14:37:10 +08:00
Dan Poltawski 82157094e5 Merge branch 'MDL-32705_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-21 12:37:54 +08:00
Dan Poltawski 115ad6cc9e Merge branch 'MDL-34569_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-21 12:35:14 +08:00
Eric Merrill 35870a76db MDL-34363 gradebook Adding check to prevent incorrect override when a blank feedback is submitted. 2012-08-21 00:26:55 -04:00
Dan Poltawski f6376dcbae Merge branch 'w34_MDL-34901_m23_useraccess' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-21 12:02:25 +08:00
Dan Poltawski ed22220593 Merge branch 'MDL-34742-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-08-21 11:59:30 +08:00
Dan Poltawski 8172f3b2d3 MDL-34808 qformat_examview - increment version 2012-08-21 11:05:58 +08:00
Dan Poltawski b02734b77d Merge branch 'MDL-34808_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2012-08-21 11:00:49 +08:00
Raymond Wijaya 8c74ab8623 MDL-34887: Add hyperlinks to names in the Assignment's grading table 2012-08-21 10:58:09 +08:00
David Monllao b16b42e9e2 MDL-31496 mod_data Replacing inline styles for CSS classes in templates and browse view 2012-08-21 10:49:03 +08:00
David Monllao d1e338c98b MDL-31496 mod_data Replacing inline styles for CSS classes in text inputs 2012-08-21 10:49:03 +08:00
David Monllao 108dd3376c MDL-31496 mod_data Replacing inline styles for CSS classes in search containers 2012-08-21 10:49:03 +08:00
David Monllao a415852d2b MDL-31496 mod_data Replacing inline styles for CSS classes in textarea elements 2012-08-21 10:49:03 +08:00
Dan Poltawski b747690361 MDL-34738 qformat_blackboard - increment version number 2012-08-21 09:55:50 +08:00
Dan Poltawski d73f22d94e Merge branch 'MDL-34738_23' of git://github.com/jmvedrine/moodle into MOODLE_23_STABLE 2012-08-21 09:42:12 +08:00
Eloy Lafuente (stronk7) 181884b480 Merge branch 'MDL-34941-MOODLE_23_STABLE' of https://github.com/mouneyrac/moodle into MOODLE_23_STABLE 2012-08-21 02:43:10 +02:00
Eloy Lafuente (stronk7) 9b7738c8fb Merge branch 'w34_MDL-34912_m23_description' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-21 02:39:58 +02:00
Eloy Lafuente (stronk7) a130109013 Merge branch 'MDL-34889_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-21 02:25:28 +02:00
Eloy Lafuente (stronk7) ac97fc2122 Merge branch 'MDL-34810_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-21 01:36:36 +02:00
Eloy Lafuente (stronk7) 9da82e9ba3 Merge branch 'MDL-29847_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-21 01:28:50 +02:00
Eloy Lafuente (stronk7) 0c6800e771 Merge branch 'MDL-31957-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_STABLE 2012-08-21 01:23:05 +02:00
Eric Merrill 2d0a11ee94 MDL-34985 gradebook Fixing issue where default parent in Full View Add Category could be inconsistent.
Turns out the correct default was already computed, but was not being applied to the setting.
2012-08-20 17:13:10 -04:00
Eloy Lafuente (stronk7) 3dd2dce1cb Merge branch 'w34_MDL-34959_m23_gmapsv3' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-20 20:30:27 +02:00
Eloy Lafuente (stronk7) 1c5f24e089 Merge branch 'w34_MDL-34868_m23_gmapsv2' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-20 20:18:03 +02:00
Eloy Lafuente (stronk7) 331d346e8f Merge branch 'MDL-34756-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-08-20 16:35:20 +02:00
Eloy Lafuente (stronk7) 8ee474b89e Merge branch 'MDL-28531-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-08-20 16:28:21 +02:00
Jason Ilicic 3f7df55d1c MDL-34529: Fixed ordering of course sections when performing import/restore by adding the sort parameter. 2012-08-20 14:00:26 +02:00
Nathan Mares c6d7689621 MDL-34372: Fix query in backup_cron_helper so it works on Postgres 8.3
Amended by stronk7@moodle.org to use uppercase SQL keywords.
2012-08-20 13:28:37 +02:00
Jean-Michel Vedrine 2e941f3356 MDL-34808 load sample xml file from fixtures in tests 2012-08-20 10:47:31 +02:00
Dan Poltawski bab65024ad Merge branch 'MDL-33362-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-08-20 16:01:21 +08:00
Dan Poltawski dcf82e6079 Merge branch 'MDL-34779-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-08-20 15:59:00 +08:00
Jean-Michel Vedrine f3ad0ed27d MDL-34738 load sample dat file in tests 2012-08-20 09:52:53 +02:00
Michael de Raadt b8cc020064 MDL-34779 settings: Updating lang string corrposnding to the fullnamedisplay setting 2012-08-20 15:44:42 +08:00
Dan Poltawski fc08030d8e Merge branch 'w34_MDL-34873_m23_tagstrict' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-20 15:21:26 +08:00
Dan Poltawski 21fcca106d Merge branch 'MDL-34957_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-08-20 14:23:28 +08:00
Dan Poltawski 7bb562cdf0 Merge branch 'MDL-34937_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-20 14:19:30 +08:00
Raymond Wijaya ae21b71925 MDL-34377: Fix: assignments overview page shows a unset due date as Epoch and counts draft submissions 2012-08-20 14:11:59 +08:00
Ankit Agarwal 9ff0c0bb84 MDL-33362 book: Parse links to book modules from 1.9 backups 2012-08-20 12:59:19 +08:00
Dan Poltawski 0ec0602415 Merge branch 'MDL-34535-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-08-20 12:06:56 +08:00
Dan Poltawski e013292e25 Merge branch 'wip-MDL-31810-stable23' of git://github.com/phalacee/moodle into MOODLE_23_STABLE 2012-08-20 12:01:32 +08:00
Dan Poltawski f6aabcf0ed Merge branch 'wip-mdl-31734-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-08-20 11:57:21 +08:00
Dan Poltawski 67f0e8fe87 Merge branch 'MDL-30405-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-08-20 11:39:59 +08:00
Dan Poltawski 854bec4500 Merge branch 'MDL-30370_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-08-20 11:22:26 +08:00
Frederic Massart 70746c433c MDL-34756 Unit Tests: Move backup helper tests 2012-08-20 10:26:16 +08:00
Andrew Davis 39e39bd437 MDL-34406 message: removed an unnecessary string creation 2012-08-20 10:13:53 +08:00
Petr Škoda db6842cca3 MDL-34893 use standard options in Hint_ResultPrinter
This is a very nasty hack!
2012-08-19 22:10:37 +02:00
Petr Škoda 7e84ef4fea MDL-34959 add Google Maps API V3 support 2012-08-19 19:53:06 +02:00
Petr Škoda 778947cd65 MDL-34868 update deprecated Google maps API V2 key info 2012-08-19 18:21:37 +02:00
Jean-Michel Vedrine 1ff3389a54 MDL-34808 qformat examview Add phpunit tests to examview import format 2012-08-19 16:35:21 +02:00
Petr Škoda cf1cb68662 MDL-34901 fix user login times handling 2012-08-19 15:33:59 +02:00
Petr Škoda 123f7f534e MDL-34873 fix multiple E_STRICT tag related problems 2012-08-19 11:19:48 +02:00
Mary Evans c74b1ee8d9 MDL-34957 theme_base: made small change to custommenu CSS in style/core.css to fix vertical arrow overlap in menu item 2012-08-19 01:45:34 +01:00
AMOS bot 9fe39511e2 Automatically generated installer lang files 2012-08-19 00:31:36 +00:00
Petr Škoda 245197ee2d MDL-34864 bump up enrol category sync version 2012-08-18 11:48:05 +02:00
Petr Škoda 3c50224079 MDL-34864 add enrol_category unit tests for sync 2012-08-18 11:47:58 +02:00
Petr Škoda 259aecb26b MDL-34864 improve enrol_category phpdocs 2012-08-18 11:47:47 +02:00
Petr Škoda a2043a3168 MDL-34864 add verbose option to CLI enrol_category sync 2012-08-18 11:39:42 +02:00
Petr Škoda 3d7f23c5e9 MDL-34864 improve enrol_category sync performance 2012-08-18 11:39:42 +02:00
Jean-Michel Vedrine 8a8dd7d8c8 MDL-34738 qformat blackboard: blackboard format is broken 2012-08-18 10:55:26 +02:00
Petr Škoda e3a5ed9dd7 MDL-34776 improve multiple "NOT IN" enrolment and role related queries 2012-08-18 09:57:02 +02:00
Petr Škoda 71a03114e0 MDL-34912 fix invalid descriptionformat default handling 2012-08-18 09:53:03 +02:00
Tim Hunt 3e6b27698d MDL-29847 question preview: garbage collect old preview data.
This adds cron code which looks for question previews that have not been
touched for more than 24 hours, and deletes them.

We try to delete previews immediately. For example if the user clicks
start again, then we immediately delete their previous preview. However,
we can't do that if they just close the preview window. Hence we need
some cron code to clean up old preview that have got left lying around.

Normally, this code will not have much to do, so it will be very fast,
so we can afford to run it every cron.

This has been implemented in such a way that in future it will be easy
to add other cron code to the question bank.

Sadly, to make this work on MySQL, we require a horrible hack in the
already hacky delete_usage_records_for_mysql function.
2012-08-17 10:53:13 +01:00
sam marshall 40f6697f2e MDL-31957 Course reset: Does not erase activity completion data 2012-08-17 10:39:38 +01:00
Jerome Mouneyrac 7a4f9ba8e0 MDL-34941 correct timestamp range: startdate of external fct create_course PHPunit test 2012-08-17 16:15:56 +08:00
Frederic Massart d190fcd9d9 MDL-28531 Unit Tests: Fixed tests to work with core update 2012-08-17 14:45:03 +08:00
Frederic Massart 68576ef61d MDL-28531 Backup: Automated backups run when they are scheduled 2012-08-17 14:45:03 +08:00
Frederic Massart bc2289cd52 MDL-34648 Chat: No more errors when sentence begin with 'To' 2012-08-17 14:44:53 +08:00
Matt Meisberger 054bcf69f6 MDL-34742 - adding ability to move blocks into empty column 2012-08-17 14:44:23 +08:00
Rajesh Taneja a645f67aa5 MDL-31734 Course: removed unused sectiontitle string 2012-08-17 14:33:40 +08:00
Rajesh Taneja bf821575ec MDL-26492 Lesson: lesson_get_user_grades will return grade of all users if userid=0 2012-08-17 14:30:39 +08:00
Rossiani Wijaya 01dbe1fdad MDL-34569 - add label for search wiki input text 2012-08-17 11:33:40 +08:00
Rossiani Wijaya 93dbb62f45 MDL-34569 accessibility compliance for wiki module: Add label for input text and select tag 2012-08-17 11:14:03 +08:00
AMOS bot 16254fffc8 Automatically generated installer lang files 2012-08-17 00:31:50 +00:00
Tim Hunt 20d4ab97c0 MDL-34937 quiz responses reports: attempt grade not shown. 2012-08-16 21:35:44 +01:00
Tim Hunt d1755c12a0 MDL-34702 quiz DB: questiondecimalpoints has wrong default.
Thanks to the folks at UCL for tracking down this problem. It has only
hidden for 2+ years!
2012-08-16 17:35:16 +01:00
Tim Hunt 6247d0a82c MDL-34889 phpunit: progress output in util.php --drop.
It is slow for me, and it is nice to know that something is going on.
2012-08-16 17:00:25 +01:00
Tim Hunt 423030e7dc MDL-34810 question bank: user prefs for some display options
The options that are remembered persistently are
* Also show questions from sub-categories
* Also show old questions
* Show question text in the question list
* Number of questions per page
2012-08-16 16:59:59 +01:00
Eloy Lafuente (stronk7) 7033316dad weekly release 2.3.1+ 2012-08-16 17:26:25 +02:00
Eloy Lafuente (stronk7) 90231b24df Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-08-16 17:22:01 +02:00
Eric Merrill 5c57df4c9d MDL-34376 mod_assign Fixing flaw in previous commit with not defining . 2012-08-16 10:07:31 -04:00
sam marshall 1d075eadd9 MDL-34446 Fix bugs in previous commit 2012-08-16 14:48:15 +08:00
Rossiani Wijaya dc5d4f435a MDL-34563 - change string firstname to lastname and add accesshide class 2012-08-16 14:18:04 +08:00
Rossiani Wijaya 8309268b42 MDL-34563 - removed double labeling and add label for input text 2012-08-16 14:17:50 +08:00
Aparup Banerjee 19ab59bcc0 Merge branch 'MDL-34565_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-16 11:51:35 +08:00
Jason Fowler 44d24d1297 MDL-31810 - Fixing unclosed DIV tags throughout Moodle 2012-08-16 10:43:29 +08:00
Tim Hunt c4f0004a0a MDL-32705 backup ui: add select all/none JavaScript on schema screens 2012-08-15 18:10:45 +01:00
Dan Poltawski cfebb1a538 Merge branch 'MDL-34905_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-15 17:54:02 +08:00
Tim Hunt 2a077c0d1b MDL-34905 quiz: missing global $DB;
This code normally only runs when JS is disabled, which is why this was
not noticed before.
2012-08-15 10:32:56 +01:00
David Monllao 25e77f4f73 MDL-30370 mod_forum - Removing duplicate seleted field in the DB query
Credit to Iñigo Zendegi
2012-08-15 17:02:43 +08:00
Rossiani Wijaya 829f5e876a MDL-34565 - remove duplicate labeling 2012-08-15 16:24:14 +08:00
Damyon Wiese 9bdc95b702 MDL-34583: Assignment upgrade loses comments from onlinetext and offline assignment types. 2012-08-15 03:36:51 +02:00
Eloy Lafuente (stronk7) 4ee439dbc2 Merge branch 'MDL-34862_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-15 03:32:44 +02:00
Eloy Lafuente (stronk7) 91986f84c2 Merge branch 'MDL-34539' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-08-15 03:23:57 +02:00
Eloy Lafuente (stronk7) e154c1b6da Merge branch 'MDL-34885_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-15 03:16:39 +02:00
AMOS bot 9bf629bb64 Automatically generated installer lang files 2012-08-15 00:31:33 +00:00
Eloy Lafuente (stronk7) 833e135533 Merge branch 'MDL-25347_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-08-15 02:04:10 +02:00
Sam Hemelryk 36e6961fa4 Merge branch 'MDL-33640_23' of git://github.com/MaxThrax/moodle into MOODLE_23_STABLE 2012-08-15 11:48:27 +12:00
Sam Hemelryk a9c8c1c951 Merge branch 'MDL-33531_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-08-15 11:22:08 +12:00
Dan Poltawski 02d8fb146d MDL-29192 - clarify email_to_user call 2012-08-15 01:17:32 +02:00
Eloy Lafuente (stronk7) 6c20303ee1 Merge branch 'w33_MDL-34782_m23_mysqlunsigned' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-14 23:10:24 +02:00
Eloy Lafuente (stronk7) 12445b37fc Merge branch 'MDL-34829' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-08-14 22:55:56 +02:00
Eloy Lafuente (stronk7) 428b30ce5e Merge branch 'MDL-34783-MOODLE_23_STABLE-1' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-08-14 22:45:34 +02:00
Rex Lorenzo 90c510cf9d MDL-34866 - Make "course display" default a site configurable option
* Moved COURSE_DISPLAY_SINGLEPAGE and COURSE_DISPLAY_MULTIPAGE constants from courselib to moodlelib.php
* Using course display constants in course default admin setting page
2012-08-14 12:12:47 -07:00
Tim Hunt ba338db5b5 MDL-34885 phpunit: better cygwin detection.
For some reason, on my computer, $_SERVER['SHELL'] was not set, so I
changed the test to also consider $_SERVER['TERM']. This now works for
me.
2012-08-14 14:12:06 +01:00
Aparup Banerjee 38ace2266f Merge branch 'wip-MDL-34748-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2012-08-14 15:30:03 +08:00
Ankit Agarwal 8e017950e9 MDL-34535 message: userto should use is_number instead of is_init 2012-08-14 14:42:11 +08:00
Aparup Banerjee 69e0f5049f Merge branch 'MDL-34563_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-14 14:34:43 +08:00
Rossiani Wijaya 1f65a01980 MDL-34563 - change plural strings and removed colon for accesshide label 2012-08-14 13:58:23 +08:00
Aparup Banerjee 37fbfb0dda Merge branch 'MDL-34565_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-14 13:53:34 +08:00
Dan Poltawski b92d962c3f Merge branch 'MDL-34728_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-14 13:33:08 +08:00
Dan Poltawski 9a77ed006f Merge branch 'MDL-34793_m23' of git://github.com/merrill-oakland/moodle into MOODLE_23_STABLE 2012-08-14 13:25:38 +08:00
Eric Merrill 2a5378d2c6 MDL-34793 mod_assign Fix rendering error that causes student view to break in some cases.
When feedback is switched on for a assignment, and the teacher enters a grade through the gradebook, the student
view would become broken, throwing a coding error. Added check that $status->grade is not empty before passing
to assign_feedback_XXX::is_empty(), as that function expects an object.
2012-08-14 00:40:55 -04:00
Adam Olley 6353a60ed3 MDL-34870: Prevent cohort enrol sync when updating course record 2012-08-14 13:58:41 +09:30
Dan Poltawski e85500a8bf Merge branch 'MDL-34807_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-14 12:08:04 +08:00
Rajesh Taneja d54294de34 MDL-32759 Assignment: Grades will not be scaled for new assignment module, and added warning message for user 2012-08-14 11:40:18 +08:00
Rajesh Taneja b5cbe52bfc MDL-32759 Assignment 2.2: Changing grade for existing assignments will show warning that grades will not be scaled 2012-08-14 11:40:18 +08:00
Dan Poltawski 894446f7fd MDL-34539 course - allow negative section numbers
This gives course format authors more flexibility.

Thanks to Itamar Tzadok for the suggestion.
2012-08-14 11:34:19 +08:00
Rex Lorenzo 5b918d0101 MDL-34866 - Make "course display" default a site configurable option 2012-08-13 16:26:01 -07:00
Aaron Barnes 25e107e5a2 MDL-34795 completion: Add course_completed event 2012-08-14 10:16:40 +12:00
Tim Hunt 94dd25e03b MDL-34862 question preview: improve preview ownership check.
Users should only be able to access their own quetion preview. In the
past, for reasons I can no longer remember, this was enforced
using the session. It is much better to set the question_usage to belong
to the user's context.
2012-08-13 17:44:17 +01:00
Tim Hunt 0a571db22b MDL-34807 question bank: navigation loses place.
The symptom is that where we are now is not shown in the settings
navigation. However, the underlying cause is that question/edit.php is
doing some crazy thing of its own to build $PAGE->url, rather than using
the one returned by question_edit_setup.

Not that this patch itentionally removes the returnurl param. It was
added as part of a big change MDL-20276, which I think just got this
detail wrong. That variable is never used.
2012-08-13 11:29:43 +01:00
Tim Hunt 3350475e36 MDL-34728 forms: woy for other JS to trigger disableIf update.
This was discovered while working on MDL-32705. If some JavaScript (for
example a select all/none link) changes the state of some form fields,
then the disabledIf state of other form elements does not automatically
update.

The existing form JS was so well encapsulated that this was impossible.
This change pokes a hole in the encapsulation, and provides an API
    M.form.updateFormState(formid);
that other bits of JS code can call when necessary.
2012-08-13 11:19:01 +01:00
Rossiani Wijaya ee53ceb3eb MDL-34563 accessibility compliance for data module: Add forform input text and select tag 2012-08-13 15:13:54 +08:00
Rossiani Wijaya 33222ed24a MDL-34565: change to plural strings 2012-08-13 15:12:00 +08:00
Rossiani Wijaya 37102468f7 MDL-34565 accessibility compliance for forum module: Add forform input text and select tag 2012-08-13 15:12:00 +08:00
Marina Glancy ff21775823 MDL-34748 repository_filesystem: Sort files by title by default 2012-08-13 11:57:55 +08:00
sam marshall c5cf1bc090 MDL-34446 Completion report: Add sideways text support to more browsers 2012-08-13 10:44:28 +08:00
Dan Poltawski 78a4cef1e7 Merge branch 'MDL-34376_m23' of git://github.com/merrill-oakland/moodle into MOODLE_23_STABLE 2012-08-13 10:33:16 +08:00
Dan Poltawski abef93f5c9 Merge branch 'MDL-34835_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-08-13 10:20:27 +08:00
Dan Poltawski a572657497 Merge branch 'MDL-34543_m23' of git://github.com/merrill-oakland/moodle into MOODLE_23_STABLE 2012-08-13 10:03:47 +08:00
AMOS bot d077d1a024 Automatically generated installer lang files 2012-08-11 00:31:30 +00:00
Mary Evans d8ceb62387 MDL-34835 theme_fusion: fixed displaced navbar by extending #region-header.inside bottom margin by 70px in style/pagelayout.css 2012-08-10 20:31:57 +01:00
Petr Škoda bd3306f5cd MDL-34782 detect code abusing integer limits in mysql database
It is allowed to store only ranges specified in install.xml, for integers it means number of digits specified in size.
2012-08-10 10:20:27 +02:00
Dan Poltawski ef38e70c41 MDL-34829 course - allow directly linked sections to work.
Even if not in single section mode.
2012-08-10 14:19:45 +08:00
David Monllao 15343304d2 MDL-25347 blog Checking association capability at course and module levels instead of system level 2012-08-10 08:48:57 +08:00
David Monllao 3de32f8558 MDL-33531 backup Added format_string to course shortname 2012-08-10 08:40:18 +08:00
David Monllao 4af5c4ebf5 MDL-33531 backup Avoiding possible Notice 2012-08-10 08:40:18 +08:00
Lorenzo Nicora 203e8d4032 MDL-33531 Fixed the regexp to find old backup files, considering backup_shortname backup option 2012-08-10 08:40:18 +08:00
AMOS bot e9a743d385 Automatically generated installer lang files 2012-08-10 00:31:47 +00:00
Eloy Lafuente (stronk7) e6aac11d94 weekly release 2.3.1+ 2012-08-09 20:51:56 +02:00
Eloy Lafuente (stronk7) 8ff9b91e9f Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-08-09 20:46:02 +02:00
Tim Hunt 4c0d64860a MDL-34590 javascript-static: nuclear option in openpopup
I think we have finally tamed Chrome on all platforms. (Crosses fingers.)
2012-08-09 17:17:36 +02:00
AMOS bot 081889f26b Automatically generated installer lang files 2012-08-09 00:31:36 +00:00
Paul Nicholls 55c91c8760 MDL-33640 - change $templatesinitialized to an array; improve naming and automate use of template
* $templatesinitialized is now an array, so that subsequent calls to initialise_filepicker which request different repositories will include those (and only those) templates which it requires but have not yet been included
* The get_template method has also been renamed to get_upload_template (and the template to "uploadform_" followed by the repository type), since it only applies to upload forms
* If a plugin provides a get_upload_template method, the template it returns will now automatically be used instead of the standard uploadform template when generating an upload form
2012-08-09 09:43:53 +12:00
Eric Merrill 383639a5ef MDL-34376 mod_assign Omit assigns with no due date from print_overview.
Modify assign_print_overview to omit assigns that have no due date set, in line with behaviour
in 2.2 and other tools.
2012-08-08 10:05:19 -04:00
Andrew Robert Nicols 55a2b03ef1 MDL-34783 Retrieve the sectioncache parameter for enrolled courses in the course_overview block
The sectioncache field is used by course_modinfo and without it, the
modinfo cache is repeatedly reset.
2012-08-08 10:54:24 +01:00
Dan Poltawski f37cd67ded Merge branch 'MDL-34575_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-08 12:33:40 +08:00
Paul Nicholls c258605a8d MDL-33640 - Add ability to use custom filepicker templates
Allow repository plugins to register a template by defining a get_template() method, coupled with the ability to request the template be used by create_upload_form() instead of the standard 'uploadform' template.  The template is automatically registered using the plugin's name, and core templates will override any which clash; this also means that a theme can override these templates in a custom renderer if it wants to.
2012-08-08 15:54:42 +12:00
Rossiani Wijaya 25f8e4f241 MDL-34575: fixed string typo and string duplication for label 2012-08-08 11:37:40 +08:00
Dan Marsden 8dc49e14c4 MDL-34656 prevent login form from being shown inside iframe - also prevent wantsurl from being set to loadsco.php which isn't a valid page for initial load. 2012-08-08 02:00:23 +02:00
Eloy Lafuente (stronk7) 7abe8c31a6 Merge branch 'MDL-34704_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-08 01:53:22 +02:00
Eloy Lafuente (stronk7) 02d6791d05 Merge branch 'wip-mdl-30792-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-08-08 01:00:54 +02:00
Charles Fulton ed10bfb2b0 MDL-32023 wiki: remove hard-coded edit string 2012-08-08 00:29:07 +02:00
Charles Fulton c86262ed73 MDL-29129 wiki: fix a hardcoded string 2012-08-07 23:59:17 +02:00
Eric Merrill 4c60068485 MDL-34543 mod_assign Fixing problem where previous feedback does not populate when you re-enter the grading view. add_plugin_grade_elements() was expecting grade object, but was being given grade string. 2012-08-07 10:21:28 -04:00
Tim Hunt 57f9291b23 MDL-34727 restore UI: use checkboxes for userdata.
It was using select menus for the convenience of the code, but the
inconvenience of users.

The way this fix is done is a bit hacky, but it works, makes users'
lives much better, but it would be good if someone would dehackify
this in the future.
2012-08-07 11:38:41 +01:00
Aparup Banerjee e203643539 Merge branch 'm23_MDL-33942' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-08-07 15:58:25 +08:00
Aparup Banerjee 5b74170932 Merge branch 'MDL-34566_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-07 15:07:51 +08:00
Aparup Banerjee 16daaa05b6 Merge branch 'MDL-34564_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-07 14:57:54 +08:00
Aparup Banerjee b21388d6db Merge branch 'MDL-34560_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-07 14:45:46 +08:00
Aparup Banerjee 16a8d4d4ba Merge branch 'MDL-34559_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-07 14:37:05 +08:00
Aparup Banerjee e83629096b Revert "Merge branch 'MDL-28531-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE"
This reverts commit 162510801f, reversing
changes made to 5af69f5282.
2012-08-07 14:27:55 +08:00
Aparup Banerjee 162510801f Merge branch 'MDL-28531-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-08-07 13:58:15 +08:00
Rossiani Wijaya 74b83c18fb MDL-34559: removing accesshide class 2012-08-07 13:36:43 +08:00
Aparup Banerjee 5af69f5282 Merge branch 'MDL-34715-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-08-07 10:42:11 +08:00
Dan Poltawski ec28569e5c Merge branch 'MDL-34562_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-07 10:16:50 +08:00
Dan Poltawski 1089612634 Merge branch 'MDL-34567_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-07 10:03:18 +08:00
Aparup Banerjee 04e428f9ae Merge branch 'MDL-22663-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-08-07 10:00:49 +08:00
Aparup Banerjee b418329b7d Merge branch 'MDL-33022' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-08-07 09:23:48 +08:00
Dan Poltawski 6f74e5b2f6 Merge branch 'wip-MDL-34669-MOODLE_23_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_23_STABLE 2012-08-07 08:48:38 +08:00
Dan Poltawski ebc5b65ab3 MDL-34600 upgrade.php - fix trailing whitespace 2012-08-07 08:43:07 +08:00
Petr Škoda b97532dd8e MDL-34600 fix question table to match install.xml
The oldquestiontextformat was used during previous upgrade and is not necessary any more.
Next time we should add these temporary upgrade columns to install.xml files.
2012-08-07 08:43:06 +08:00
AMOS bot d8ff3aae9f Automatically generated installer lang files 2012-08-07 00:31:55 +00:00
Tomasz Muras 9881439068 MDL-31753 Get correct course ID for Community finder search link. 2012-08-07 02:13:44 +02:00
Eloy Lafuente (stronk7) 9064a9af71 Merge branch 'w32_MDL-34601_m23_wikischema' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-06 21:16:50 +02:00
Kirill Astashov 5f2f276f82 MDL-34669: Fix editor filepicker context bt trying to use page context 2012-08-06 16:58:44 +08:00
Aparup Banerjee 1e778228a8 Merge branch 'MDL-31599-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-08-06 16:43:55 +08:00
Aparup Banerjee b42abe0ffc Merge branch 'MDL-34716' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-08-06 16:38:04 +08:00
Rossiani Wijaya 2ab9801b19 MDL-34562 accessibility compliance for chat module: Add <label> for input text and select tag 2012-08-06 16:26:28 +08:00
Dan Poltawski f70df26e40 Merge branch 'MDL-34561_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-06 15:49:12 +08:00
Rossiani Wijaya ac1bbfa1cd MDL-34561 accessibility compliance for assignment module: add accesshide class 2012-08-06 15:07:52 +08:00
Dan Poltawski 6faa04b522 Merge branch 'MDL-34707_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-06 14:42:13 +08:00
Charles Fulton cf162f9332 MDL-34629 wiki: convert default format value during restore 2012-08-06 14:19:45 +08:00
Dan Poltawski e0a555a3a3 Merge branch 'MDL-34561_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-06 14:08:54 +08:00
Dan Poltawski 0e5acac2d8 Merge branch 'MDL-25983_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-08-06 13:52:55 +08:00
Dan Poltawski efff50c096 Merge branch 'MDL-34259-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-08-06 12:21:41 +08:00
Dan Poltawski e1bc047bdb Merge branch 'MDL-34574_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-06 12:12:29 +08:00
Dan Poltawski ea22072a62 MDL-34575 lang/notes: reorder string to be alphabetical 2012-08-06 12:09:07 +08:00
Dan Poltawski 824dfb24bd Merge branch 'MDL-34575_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-06 12:06:40 +08:00
Dan Poltawski 00cb41c2ba Merge branch 'MDL-34558_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-06 11:54:09 +08:00
Dan Poltawski 61e520aefc Merge branch 'MDL-34557_accessibility_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-08-06 11:49:51 +08:00
Dan Poltawski f7cecf982f Merge branch 'MDL-34705_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-06 11:31:38 +08:00
Dan Poltawski a767fce382 Merge branch 'w32_MDL-34635_m23_selfwelcommultilang' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-06 11:29:30 +08:00
Dan Poltawski cfe10a4698 Merge branch 'MDL-28207-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-08-06 10:40:40 +08:00
Dan Poltawski 01672d5de5 Merge branch 'MDL-34590_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-08-06 10:11:24 +08:00
Dan Poltawski 65e06b77a8 Merge branch 'MDL-34405_m23' of git://github.com/kordan/moodle into MOODLE_23_STABLE 2012-08-06 10:06:24 +08:00
Dan Poltawski 7c4bfa5ec7 Merge branch 'w32_MDL-34585_m23_blogfiles' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-08-06 09:45:56 +08:00
Dan Poltawski d939a4dec8 MDL-28486 - tests: fix broken youtube tests 2012-08-06 09:27:55 +08:00
Sam Hemelryk f52c5f8b6a Merge branch 'MDL-34708_m23' of git://github.com/nebgor/moodle into MOODLE_23_STABLE 2012-08-06 12:05:08 +12:00
Sam Hemelryk a34c42bd5e Merge branch 'MDL-28486-MOODLE_23_STABLE-1' of git://git.luns.net.uk/moodle into MOODLE_23_STABLE 2012-08-06 11:58:45 +12:00
Sam Hemelryk 98aa996a00 Merge branch 'MDL-34658-23' of git://github.com/grabs/moodle into MOODLE_23_STABLE 2012-08-06 11:44:24 +12:00
Andreas Grabs 5f152b5c90 MDL-34670 - undefined variable in feedback templates 2012-08-06 11:36:56 +12:00
Sam Hemelryk 3d84e69328 Merge branch 'MDL-34645_23' of git://github.com/aolley/moodle into MOODLE_23_STABLE 2012-08-06 11:04:57 +12:00
Sam Hemelryk 9d705d4901 Merge branch 'MDL-34647_23' of git://github.com/aolley/moodle into MOODLE_23_STABLE 2012-08-06 10:58:44 +12:00
Aparup Banerjee 2018163468 MDL-34708 Forms library : Fixed incorrect calendar day displayed across timezones. Credit to Matthew Davidson and team at rose-hulman.edu. 2012-08-05 23:32:17 +08:00
Rossiani Wijaya 142b18a835 MDL-34560 accessibility compliance for message: Add label for input text and select tag 2012-08-04 17:03:39 +08:00
AMOS bot abdc9e17fa Automatically generated installer lang files 2012-08-04 00:31:59 +00:00
Tim Hunt e071bc1aa4 MDL-34704 couse, accesslib: improve $CFG->courselistshortnames
1. get_context_name should respect the $CFG->courselistshortnames
setting.

2. When $CFG->courselistshortnames is on, what to display should use a
language string, rather than string concatenation. This makes it
possible for people to configure the display. For example, they might
want 'My first course [M101]' instead of 'M101 My first course'.
2012-08-03 14:43:30 +01:00
Tim Hunt 2963abadf9 MDL-34590 javascript-static: full-screep popups for Chrome.
I have left in both:
1. the code to get the window size correct initially, becuase that seems
sensible; and
2. the subsequent resize (with the setTimeout that Chrome requires,
thanks Jeff Rader for finding that) becuase on Chrome, it gets the size
a bit too big initially, so this correction is necessary.
2012-08-03 13:21:44 +01:00
Andreas Grabs 4d8138c96a MDL-34658 - Saving failed because missing or false values 2012-08-03 12:01:21 +02:00
AMOS bot 7a0664fbb4 Automatically generated installer lang files 2012-08-03 11:45:29 +02:00
Dan Poltawski e1d2c7452b MDL-34716 outcomes: Fix admin tree location 2012-08-03 16:06:54 +08:00
Frederic Massart a602649f8f MDL-22663 Repository: WebDAV supports Digest authentication 2012-08-03 14:03:20 +08:00
Frederic Massart 85a9d23d91 MDL-22663 Repository: WebDAV supports SSL and chunked data 2012-08-03 13:55:07 +08:00
Frederic Massart 3f995bef7a MDL-22663 Repository: Fixed strict standards notices in WebDAV lib 2012-08-03 13:55:01 +08:00
Rossiani Wijaya 1445fd1337 MDL-34575 accessibility compliance for notes: Add form input text and select tag 2012-08-03 13:36:27 +08:00
Rossiani Wijaya 0f9992ca66 MDL-34574 accessibility compliance for mymobile theme: Add forform input text and select tag 2012-08-03 12:01:50 +08:00
Rossiani Wijaya 08e03a695a MDL-34566 accessibility compliance for glossary module: Add forform input text and select tag 2012-08-03 12:01:43 +08:00
Rossiani Wijaya 077e06f621 MDL-34567 accessibility compliance for lesson module: Add forform input text and select tag 2012-08-03 12:01:43 +08:00
Rossiani Wijaya d0d9c135e1 MDL-34564 accessibility compliance for feedback module: Add forform input text and select tag 2012-08-03 12:01:41 +08:00
Rossiani Wijaya 519adbc684 MDL-34561 accessibility compliance for assignment module: Add forform input text and select tag 2012-08-03 12:01:38 +08:00
Rossiani Wijaya aa15bd56d6 MDL-34559 accessibility compliance for grade: Add forform input text and select tag 2012-08-03 12:01:36 +08:00
Rossiani Wijaya f81c3a32f0 MDL-34558 accessibility compliance for filter: Add forform input text and select tag 2012-08-03 12:01:35 +08:00
Rossiani Wijaya daeee0afae MDL-34557 accessibility compliance for enrol: Add forform input text and select tag 2012-08-03 12:01:34 +08:00
Rajesh Taneja 6ecbacac00 MDL-30792 Files API: Cleaner approach to get maxbytes size in filepicker 2012-08-03 11:36:38 +08:00
Rajesh Taneja d3e1371030 MDL-30792 Files API: maxbytes will be set by get_max_upload_file_size if less then 0 or greater then max moodle limit 2012-08-03 11:36:32 +08:00
Frederic Massart e9ec895d92 MDL-28531 Backup: Automated backups run when they are scheduled 2012-08-03 09:30:27 +08:00
Frederic Massart 6ce946c561 MDL-34259 Lesson: True/false questions don't break on missing answer 2012-08-03 09:23:23 +08:00
Frederic Massart 84af4013c1 MDL-28207 Course: Showing/hiding/marking a section respect capabilities 2012-08-03 09:21:29 +08:00
Tim Hunt 7d45268bc6 MDL-34707 backup UI: only include the JS once. 2012-08-02 18:48:03 +01:00
Tim Hunt 46c770079d MDL-34705 role assignments list: should link to contexts.
This will make Admin's lives a bit easier.
2012-08-02 18:15:50 +01:00
Petr Škoda 3a933cdf10 MDL-34585 fix broken blog file access control 2012-08-02 09:58:50 +02:00
Petr Škoda 137bd7a8b5 MDL-34601 drop legacy wiki upgrade tables
Next time please keep db in sync with install.xml at all times.
2012-08-02 09:56:05 +02:00
Dan Marsden 605d6ffcf4 MDL-33942 Grading method: Marking Guide - check for $cm before using - may not exist if the course is being deleted. 2012-08-02 19:51:24 +12:00
Petr Škoda 56eda1f10a MDL-34635 support multilang in self enrol course welcome message
Includes also new help string for the custom multilang placeholders by Helen Foster.
2012-08-02 09:39:20 +02:00
David Monllao 4a5e1f9d4b MDL-25983 enrol_imsenterprise Importing the course summary when adding new courses 2012-08-02 15:34:42 +08:00
Dan Poltawski 02814bfc18 weekly release 2.3.1+ 2012-08-02 14:38:49 +08:00
Dan Poltawski 709efab527 MDL-31599 block_news - incorrect RSS feed for guest user
Was previously using the userid 0, rather than guest to use
authenticated RSS feed.

Thanks to Paul Verrall at LUNS for helping me debug this.
2012-08-02 11:11:29 +08:00
Dan Marsden c91dc553e5 MDL-33022 mod_form: set correct groupid when editing an existing post 2012-08-02 10:47:23 +08:00
Matt Switlik 8b9416de53 MDL-34691 assign: Time remaining "Assignment is overdue" was incorrectly being displayed when a student viewed a submitted assignment after the due date. 2012-08-01 17:07:02 -04:00
Petr Škoda b093fd5e5a MDL-34368 fix another validuntil condition 2012-08-01 15:06:55 +08:00
Dan Poltawski 4486aa99be MDL-34444 course: Dont display links to hidden sections
This is what happens when you dont use the navigation api
2012-08-01 10:31:46 +08:00
Dan Poltawski 87a31bb5d8 MDL-34444 course: show section availability info
When available, rather than a capability error.
2012-08-01 10:31:16 +08:00
Sam Hemelryk 90105eb95a Merge branch 'MDL-34534-MOODLE_23_STABLE' of https://github.com/micaherne/moodle into MOODLE_23_STABLE 2012-08-01 13:21:03 +12:00
Dan Poltawski 06d38548b1 MDL-34599 mod_quiz: optional $thispage & $nextpage
The previous change making the params required was a regression.
2012-08-01 09:06:54 +08:00
Charles Fulton b44ae5fb0a MDL-29909 wiki: do not show groups when no groups present 2012-08-01 12:40:02 +12:00
Dan Poltawski 633ed1edae Merge branch 'MDL-32791_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-31 17:46:20 +08:00
Dan Poltawski 07cf0887fd Merge branch 'MDL-34599_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-31 17:42:50 +08:00
Rossiani Wijaya 0fa95a3c97 MDL-34556 accessibility compliance for course: Add forform input text and select tag 2012-07-31 17:17:15 +08:00
Rossiani Wijaya 81ff28e7e6 MDL-34555 accessibility compliance for calendar: Add forform input text and select tag 2012-07-31 17:11:06 +08:00
Rossiani Wijaya 8291579200 MDL-34554 accessibility compliance for blocks: Add forform input text and select tag 2012-07-31 17:05:13 +08:00
Rossiani Wijaya 61e3665a15 MDL-34553 accessibility compliance for authentication: Add forform input text and select tag 2012-07-31 16:55:38 +08:00
Rossiani Wijaya 4233aac1e3 MDL-34552 accessibility compliance for admin: Add forform input text and select tag 2012-07-31 16:34:22 +08:00
Andrew Robert Nicols 548b7112a2 MDL-28486 Force use of SSL for all youtube and vimeo embeds
If a page is served over SSL (https), then any content loaded from non-SSL
sources (e.g. http://youtube.com/) will cause errors to show in the
browser. To prevent this, it's best to use the SSL equivelants where they
exist (e.g. https://youtube.com/).

Unfortunately, it isn't possible to accurately determine whether the
current page is loaded over an SSL connection or not in Moodle.

Since including content from an external SSL site on a non-SSL moodle page
does not lead to browser warnings, but non-SSL external content on an SSL
moodle page does, we always use SSL where available.

Note: This does not lead to any additional processing requirements for the
moodle site.
2012-07-31 09:27:00 +01:00
Aparup Banerjee 971937e7d0 MDL-34650 added MDLs to todo comment and deprecation comment.
(also triggering an amos script here for the other MDL-34650 commit)

AMOS BEGIN
  CPY [minute,form],[minute,core]
  CPY [month,form],[month,core]
  CPY [options,editor],[options,core]
  CPY [selectacourse,backup],[selectacourse,core]
AMOS END
2012-07-31 15:40:07 +08:00
Aparup Banerjee 28557dc456 MDL-34650 typo correction 2012-07-31 13:23:55 +08:00
Aparup Banerjee 4a5780ffde Merge branch 'MDL-34650_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-07-31 13:20:24 +08:00
Sam Hemelryk acb533009f Merge branch 'MDL-34528_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-07-31 16:49:31 +12:00
Sam Hemelryk 3c3cf6daac Merge branch 'MDL-32499_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-07-31 16:29:51 +12:00
Sam Hemelryk fe2ff1e8a0 Merge branch 'MDL-32931_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-07-31 16:18:50 +12:00
Sam Hemelryk dddd0d7a38 Merge branch 'MDL-32827-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-07-31 16:15:59 +12:00
Rossiani Wijaya 2a336b5ef1 MDL-34650 - accessibility compliance: Add <label> for form input text and select tag 2012-07-31 12:09:18 +08:00
Dan Poltawski 1de0c00eb6 Merge branch 'MDL-25953-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-07-31 12:01:56 +08:00
Ankit Agarwal 669f274735 MDL-32827 calendar: update eventtype of broken event in bulk instead of doing it one by one 2012-07-31 11:24:15 +08:00
Dan Poltawski 3fb4392ee0 Merge branch 'MDL-34624_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-07-31 11:10:36 +08:00
Dan Poltawski 8bf442dc73 Merge branch 'MDL-34532_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-31 10:43:10 +08:00
Dan Poltawski 472b9a46ab Merge branch 'MDL-34255_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-07-31 10:31:49 +08:00
Jerome Mouneyrac 1b158ee8c9 MDL-33869 user_get_user_details: add support for 'Show user identity' fields set by administrator 2012-07-31 10:26:22 +08:00
Crafton Williams 2a3a22a46d MDL-33869 user_get_user_details: allow return of idnumber 2012-07-31 10:25:21 +08:00
Dan Poltawski 89babfaefa Merge branch 'm23_MDL-34440' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-07-31 10:07:05 +08:00
Adam Olley 5aba3d6df9 MDL-34647: admintool: uploaduser enrolments now obey enrolperiod directive 2012-07-31 11:36:57 +09:30
Adam Olley 10813a0c78 MDL-34645: enrol_manual: enrolment init to pass default duration setting 2012-07-31 11:10:41 +09:30
Dan Poltawski c04ddf28f8 Merge branch 'MDL-34483_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-31 09:12:23 +08:00
Sam Hemelryk d4533f6215 Merge branch 'MDL-34494_m23' of git://github.com/kordan/moodle into MOODLE_23_STABLE 2012-07-31 12:43:32 +12:00
Sam Hemelryk eec3d1869d Merge branch 'MDL-28568_noncontact_warning_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-07-31 12:00:42 +12:00
Tim Hunt 0b7dfe12ed MDL-34483 qformat_examview: Commit example file.
Supplied by Rick Jerz.
2012-07-30 11:57:29 +01:00
Fred Woolard 7ae8f60489 MDL-34440 Site registration failing with mysqli 2012-07-30 20:06:22 +12:00
Dan Poltawski 46895999f0 Merge branch 'mdl34368' of https://bitbucket.org/ngmares/moodle into MOODLE_23_STABLE 2012-07-30 15:49:12 +08:00
Dan Poltawski b700c34f14 Merge branch 'MDL-34507-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-07-30 14:04:54 +08:00
Dan Poltawski 1ab970d492 Merge branch 'MDL-34589_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-30 13:55:50 +08:00
Nadav Kavalerchik db8e600a23 MDL-34513 - RTL Theme fixes for Moodle 2 (theme/mymobile)
+ Right align frontpage course list
+ right align activity and resource titles
+ Two Columns on/off slider fix
+ Right align content in Blocks
+ Fix checkbox question types in quiz
+ Right align titles of fields in Forms
+ minor ui tweaks
2012-07-30 13:52:58 +08:00
Dan Poltawski c5b133f790 Merge branch 'MDL-33537_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-07-30 13:46:33 +08:00
Dan Poltawski acbbf4157d Merge branch 'w31_MDL-34538_m23_validatefloats' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-30 12:35:10 +08:00
Dan Poltawski af433c5b52 Merge branch 'MDL-31509_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-30 12:15:49 +08:00
Andrew Robert Nicols ca4548c1c2 MDL-34433 Check for existence of e and e.target in set_form_changed
This is required for cases when code directly calls set_form_changed as
happens with the filepicker.
2012-07-30 12:09:50 +08:00
Dan Poltawski 7c52ee5027 Merge branch 'wip-mdl-34239-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-07-30 12:05:25 +08:00
Dan Poltawski 6fe575509e Merge branch 'MDL-34519_23_course_reset_patch' of git://github.com/rlorenzo/moodle into MOODLE_23_STABLE 2012-07-30 11:57:41 +08:00
Mary Evans f785edd9e2 MDL-34528 theme_canvas: Removed redundent exclude stylesheet configurations from CANVAS theme 2012-07-29 21:42:04 +01:00
kordan dacc63f1ae MDL-34494 theme_formal_white: replaced old style core_renderer::MAIN_CONTENT_TOKEN with $OUTPUT->main_content() 2012-07-29 16:40:29 +02:00
kordan 899fe64867 MDL-34405 theme_formal_white: added background for quiz overview 2012-07-29 15:59:54 +02:00
Mary Evans 0e3c86746f MDL-34624 theme_base: added background-color to style/admin.css for role edit default 2012-07-29 14:54:00 +01:00
Tim Hunt d1d989ce13 MDL-31509 quiz outcomes: let people associate quizzes with outcomes.
The quiz does not really support outcomes, but even so in 1.9 you could
select outcomes on the quiz edit form, and apparently this was useful to
some people, therefore we should re-enable it.
2012-07-27 18:09:49 +01:00
Petr Škoda 009933e28c MDL-34538 fix PARAM_FLOAT validation 2012-07-27 18:45:43 +02:00
Petr Škoda f2fd3f3138 MDL-34538 add float validation tests 2012-07-27 18:45:43 +02:00
Tim Hunt de53bada57 MDL-32791 quiz db: clean up garbage data that was causing problems.
Melinda Kraft reported having rows in their quiz_question_instances
table which caused various problems. These rows are meaningless, so I
have done a DB upgrade step to clean them up, which should deal with the
bad side-effets they were causing.
2012-07-27 16:45:04 +01:00
Jean-Michel Vedrine e3f79e9347 MDL-34483 qformat_examview: handle more questions.
These fixes come from testing with the example file supplied by Rick
Jerz.
2012-07-27 12:20:13 +01:00
Jean-Michel Vedrine 0940ba1f16 MDL-34483 qformat_examview: clean the code to make codechecker happy 2012-07-27 12:20:11 +01:00
Jean-Michel Vedrine 53f2f306dd MDL-34483 qformat_examview: changes required to make it basically work. 2012-07-27 12:20:10 +01:00
Tim Hunt a361ff5645 MDL-34599 quiz attempts: more robust if page number out of range.
Rather than throwing an exception, we should just show the first/last
page of the quiz if the page number is out-of-range.
2012-07-27 11:43:40 +01:00
Rajesh Taneja def687a6a2 MDL-34239 Blog: Editing blog associated with module will be keep it's association 2012-07-27 14:01:47 +08:00
Ankit Agarwal 41499f832b MDL-32827 calendar: Bumping the version 2012-07-27 11:50:37 +08:00
Ankit Agarwal 0bdf18a7c9 MDL-32827 calendar: Added logic to handle calendar events with empty eventtypes during restore 2012-07-27 11:49:20 +08:00
Ankit Agarwal fcda7dbb89 MDL-32827 calendar: Fixining calender entries with no eventtype 2012-07-27 11:47:50 +08:00
Frederic Massart df9b10e10a MDL-25953 Repository: Amazon S3 supports sub directories 2012-07-27 10:52:16 +08:00
Frederic Massart b3b35530f9 MDL-25953 Repository: Updated Amazon S3 library 2012-07-27 10:52:16 +08:00
Frederic Massart 9480023733 MDL-34507 Repository: Better support for 'any' accepted filetypes 2012-07-27 10:16:30 +08:00
David Monllao e8790310bb MDL-32931 mod_forum Polishing patch and taking into account courses without previous accesses 2012-07-27 09:23:18 +08:00
Tom Lanyon 3b6573536c MDL-32931 mod_forum Change forum overview to avoid use of (potentially large and slow ) log table. 2012-07-27 09:23:18 +08:00
David Monllao 2011579b26 MDL-32499 gradingform_rubric Avoid backup/restore of rubric fillings without an existing criteria 2012-07-27 09:22:02 +08:00
Tim Hunt 59b983a5d9 MDL-34589 quiz report graphs: PHP5.4 issue with unset($array[$float]).
Thanks to Matthew Davidson for diagnosing the problem.
2012-07-26 18:55:17 +01:00
Tim Hunt 40ae563bee MDL-34532 quiz reports: error when showing users without attempts.
We were not checking if attempt state was null before trying to convert it to a string.
2012-07-26 10:09:45 +01:00
Aparup Banerjee 6975216336 weekly release 2.3.1+ 2012-07-26 14:25:58 +08:00
Rossiani Wijaya ffdccab055 MDL-34255 group calendar events: fixed adding group calendar event for students 2012-07-26 14:23:39 +08:00
Aparup Banerjee 33405ffbd0 Merge branch 'install_23_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_23_STABLE 2012-07-26 13:59:33 +08:00
AMOS bot 993a4b8f5c Automatically generated installer lang files 2012-07-26 00:31:43 +00:00
Michael Aherne a11b507f50 MDL-34534 Backport activity chooser default setting to 2.3 stable 2012-07-25 12:15:21 +01:00
Dan Poltawski 8d9dd85d97 Merge branch 'MDL-13629_droplow_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-07-25 12:29:47 +08:00
Dan Poltawski c54a83d8bd MDL-34441 dbtransfer - do not attempt migration if moodle is not installed. 2012-07-25 11:29:04 +08:00
Dan Poltawski c237be89fb MDL-34441 tool_dbtranfer - fix codechecker warnings
Since we were so close to perfection.
2012-07-25 10:51:21 +08:00
Dan Poltawski 55bf451676 Merge branch 'w30_MDL-34441_m23_dbtransfer' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-25 10:51:15 +08:00
Sam Hemelryk 5986099daa Merge branch 'w30_MDL-34475_m23_saveondefault' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-25 11:13:16 +12:00
Sam Hemelryk ea268875fb Merge branch 'MDL-27083-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-07-25 09:18:19 +12:00
Rex Lorenzo f1631871b8 MDL-34519 - Course reset not protected by proper capability 2012-07-24 12:03:52 -07:00
Aparup Banerjee 81fa4095f2 MDL-26969 assignment : clarified phpdoc and fixed whitespace. 2012-07-24 16:40:46 +08:00
Aparup Banerjee 34cdc31ec8 Merge branch 'MDL-26969_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-07-24 16:40:42 +08:00
Dan Poltawski 51609ef88a Merge branch 'MDL-34484_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-24 15:40:26 +08:00
Dan Poltawski 73a418e3c2 Merge branch 'w30_MDL-34129_m23_enrolinfo' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-24 13:41:45 +08:00
AMOS bot 2902afd555 Automatically generated installer lang files 2012-07-24 00:31:53 +00:00
Petr Škoda e2ecc7c6cc MDL-34475 add default value to xmldb_field hash calculation 2012-07-23 21:36:39 +02:00
Tim Hunt 53e2f1aad8 MDL-34484 unit tests: stop phpunit using testcase names as class names 2012-07-23 11:10:38 +01:00
Aparup Banerjee bb9b19a7fd MDL-34449 phpdoc typo correction 2012-07-23 16:40:30 +08:00
Aparup Banerjee 8e711c3af0 Merge branch 'w30_MDL-34449_m23_layoutmaddness' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-23 16:40:11 +08:00
Dan Poltawski 326bbf9ba6 Merge branch 'MDL-34379_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-23 14:14:08 +08:00
Dan Poltawski cf1479bb2f Merge branch 'MDL-34351_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-23 14:09:34 +08:00
Dan Poltawski b165e64edc Merge branch 'MDL-34251_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-23 14:02:07 +08:00
Dan Poltawski cb9fdb814d Merge branch 'MDL-34226_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-23 13:53:58 +08:00
Rajesh Taneja e4f2ea1a42 MDL-34148 Blog: Fixed variable name used for saving module name
Updated Erik's patch to match coding style
2012-07-23 13:45:54 +08:00
Erik Lundberg 5147d726b2 MDL-34148: Instead of using the module name from the filesystem, the blog menu now fetches the module name with get_string(). 2012-07-23 13:45:54 +08:00
Dan Poltawski 96647229fc Merge branch 'wip-MDL-34404-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-07-23 13:26:12 +08:00
Dan Poltawski 7ccdba8821 Merge branch 'w30_MDL-34396_m23_loginhttpsspell' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-23 12:20:05 +08:00
Frederic Massart 82a0137aa5 MDL-27083 Questions: Orphaned questions are adopted on upgrade
Conflicts:

	version.php
2012-07-23 11:58:56 +08:00
Rossiani Wijaya 60a1365d28 MDL-26969 Assignment module - upload: fixed get_submission() return value to nothing when param is set to false. 2012-07-23 11:27:28 +08:00
Aparup Banerjee 3e7788eebe Merge branch 'MDL-32665_chat_popup_23' of git://github.com/andyjdavis/moodle into MOODLE_23_STABLE 2012-07-23 10:21:44 +08:00
Dan Poltawski fd59a1780b Merge branch 'MDL-34451_23' of git://github.com/merrill-oakland/moodle into MOODLE_23_STABLE 2012-07-23 09:22:48 +08:00
Sam Hemelryk 4094913d53 Merge branch 'MDL-34412_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-07-23 12:42:12 +12:00
Sam Hemelryk f945ffb908 Merge branch 'MDL-34370_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-07-23 12:39:59 +12:00
Marina Glancy e7a3fe032f MDL-34428 Private files repository should have a 'manage' link 2012-07-23 12:37:57 +12:00
Sam Hemelryk 6fcebf2424 Merge branch 'MDL-33560-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-07-23 12:25:20 +12:00
Sam Hemelryk 9d1594b04b Merge branch 'MDL-31516_grade_comma_decsep_moodle23' of git://github.com/StudiUM/moodle into MOODLE_23_STABLE 2012-07-23 12:19:58 +12:00
Marina Glancy 9ff506d165 MDL-34221 disabledIf support for filemanager and filepicker elements 2012-07-23 12:08:49 +12:00
Davo Smith 252bd1871b MDL-34221 Filepicker - disableIf now prevents drag and drop upload 2012-07-23 12:08:49 +12:00
Davo Smith 548f536a00 MDL-33927 Filemanager - enforce the maxfiles limit on form submission 2012-07-23 12:01:24 +12:00
Sam Hemelryk 2372ccb774 Merge branch 'MDL-29563_23' of https://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-07-23 11:49:39 +12:00
Sam Hemelryk 4ad0926a30 Merge branch 'MDL-34427' of git://github.com/jasonilicic/moodle into MOODLE_23_STABLE 2012-07-23 11:40:07 +12:00
Sam Hemelryk f315e3e184 Merge branch 'm23_MDL-34374' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-07-23 11:38:09 +12:00
Sam Hemelryk 93c3b29893 Merge branch 'm23_MDL-34233' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE 2012-07-23 11:26:50 +12:00
Damyon Wiese c8ac7e7938 MDL-34313: Deleting assignfeedback plugins deletes config for assignsubmission_plugin instead. 2012-07-23 11:22:36 +12:00
Damyon Wiese 943036314f MDL-34272: Assignment module displays all assignments on my moodle instead of just open ones 2012-07-23 11:20:55 +12:00
Damyon Wiese 145a300b73 MDL-34256: Grading table shows users with no submissions with "requires grading" filter
Also hide the filters completely if there are no submission plugins enabled (offline assignment).
2012-07-23 11:09:46 +12:00
Damyon Wiese 392ee02d6c MDL-2283: Display number of assignment submissions that need grading in the grading summary 2012-07-23 10:55:27 +12:00
Sam Hemelryk 28ea78bf7a Merge branch 'MDL-34265-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-07-23 10:39:45 +12:00
Andrew Robert Nicols 7fac90712b MDL-34322 Don't display empty navigation nodes which have no link 2012-07-23 09:43:27 +12:00
Sam Hemelryk 5b37ed3dda MDL-34243 completion: Fixed up call to completion_criteria::factory that was passing object 2012-07-23 09:38:57 +12:00
Aaron Barnes a6fa8a7265 MDL-34243 completion: get_criteria() incorrectly passing object 2012-07-23 09:38:57 +12:00
Mary Evans b843a44e16 MDL-34370 theme_fusion: added CSS in style/core.css to enable weeks to be moved when editing 2012-07-22 21:38:40 +01:00
Petr Škoda 38e269ead9 MDL-34441 bump up version to trigger cache purging 2012-07-22 21:02:14 +02:00
Petr Škoda de25ddd331 MDL-34441 add CLI database migration script 2012-07-22 20:57:07 +02:00
Petr Škoda 7b293e0126 MDL-34441 add maintenance mode to db migration and improve lang strings 2012-07-22 20:57:06 +02:00
Petr Škoda 56db97bb5c MDL-34441 scroll to the bottom when db migration finished 2012-07-22 20:57:06 +02:00
Petr Škoda 05e4341165 MDL-34441 rewrite log display actions after db migration 2012-07-22 20:57:05 +02:00
Petr Škoda 0dd05d20b9 MDL-34441 improve error handling when migrating databases 2012-07-22 20:57:05 +02:00
Petr Škoda 9134f9aa9c MDL-34441 prevent mysqli::close() notice after failed mysql driver connect 2012-07-22 20:57:04 +02:00
Petr Škoda c8e5d9c9eb MDL-34441 show db transfer in experimental section
DB export and import is not ready yet, sorry.
2012-07-22 20:57:04 +02:00
Petr Škoda 937777f3fe MDL-34441 fix switched lang strings 2012-07-22 20:57:03 +02:00
Petr Škoda 6b986b7b6a MDL-34441 always use proper charset in htmlspecialchars() calls 2012-07-22 20:57:03 +02:00
Petr Škoda 4b195fe9e9 MDL-34441 cleanup dtl related phpdocs and minor style improvements 2012-07-22 20:57:02 +02:00
Eric Merrill a14ef47b44 MDL-34451 quiz Fixed problem where attempt page is updated for ALL attempts, not just current. 2012-07-22 12:23:11 -04:00
Petr Škoda 1c005cbf12 MDL-34449 lazy load theme layout otpions
This should allow us to switch page layout on admin pages and elsewhere before $OUTPUT->header() call.
2012-07-22 15:34:23 +02:00
Petr Škoda 7c87df674e MDL-34129 show course info on enrolment page 2012-07-21 21:34:07 +02:00
Luke Tucker ab706cc971 MDL-34396 Ensure TinyMCE editor spell checking works on pages with $PAGE->https_required() 2012-07-21 20:29:50 +02:00
Mary Evans 8545a5cc54 MDL-34412 theme_afterburner: defined #EEE as background-color in afterburner_styles.css for filemanager and filepicker input, select, button & textarea 2012-07-20 23:52:02 +01:00
David Monllao e0cf9e280a MDL-33537 gradingform_rubric Adding the definition when retrieving grading instances
Credit to Sam Chaffee
2012-07-20 14:56:00 +08:00
Jason Ilicic 1cb637e42a MDL-34427: Corrected language string when not allowed to enter the chat room. 2012-07-20 14:45:32 +09:30
Tim Hunt 2894157f15 MDL-34351 quiz cron: one broken overdue attempt should not kill cron
It seems that sometimes trying to process an overdue quiz attempt can
throw an exception. In that case, we need to catch it and report it
nicely, and then carry on processing the rest of the attempts, rather
than just killing the whole of cron processing.

Also, there may be garbage quiz attempts where the associated quiz or
course has been deleted. Skip those too.
2012-07-19 15:24:15 +01:00
Tim Hunt 013c74d058 MDL-34379 quiz reports: timetaken 'open' for never submitted attempts 2012-07-19 12:46:49 +01:00
Tim Hunt 2d7cbf5923 MDL-34251 question engine: possible infinite loop loading usages
In the case where either a question_attempt had not steps, or a
question_usage had not question_attempts, the load_from_records methods
could get stuck in an infinite loop.

This fix ensures that does not happen, with unit tests to verify it. At
the same time, I noticed an error in the existing tests, which this
patch fixes.
2012-07-19 12:46:24 +01:00
Tim Hunt 0288eb2151 MDL-34226 multianswer qtype: basic unit test.
This verifies the previous fix, and gets rid of a rather embarassing TODO.
2012-07-19 12:46:12 +01:00
Tim Hunt 0656c0a403 MDL-34226 multichoice qtype: correct is_complete_response for multianswer
The multianswer qtype uses the multi-choice one, and the way it does its
responses array breaks an assumption that multi-choice was making.
2012-07-19 12:46:11 +01:00
Andrew Davis 36e22a820c MDL-28568 message: added a warning message when the user is about to message someone who cant reply 2012-07-19 17:07:00 +08:00
Sam Hemelryk 62145412bb MDL-33448 javascript: Added caching for the YUI instance used for debug in get_string 2012-07-19 20:22:37 +12:00
Ankit Agarwal 8119fbd7bd MDL-34265 SCORM: Removing sorting from unsortable columns 2012-07-19 15:58:36 +08:00
Dan Marsden 001ff67298 MDL-34233 SCORM backup - change to using set_source_sql to preserve order of records in backup. 2012-07-19 19:40:02 +12:00
David Monllao da2104aa0e MDL-29563 course Throwing an exception instead of a message 2012-07-19 15:35:20 +08:00
David Monllao e2bf940699 MDL-29563 course Hide duplication button in activities without backup2 support - Credit to Mark Nielsen 2012-07-19 15:35:20 +08:00
Dan Poltawski 9592f5dea8 weekly release 2.3.1+ 2012-07-19 13:45:56 +08:00
Dan Poltawski 05551bceed Merge branch 'install_23_STABLE' of git://github.com/amosbot/moodle into MOODLE_23_STABLE 2012-07-19 13:42:05 +08:00
Dan Marsden fece4fd648 MDL-34374 SCORM prevent skipview being set to always when used inside a SCORM course format. 2012-07-19 09:05:07 +12:00
Andrew Davis dec465b3e9 MDL-32665 mod_chat: disabled popup notifications in the chat windows 2012-07-18 19:08:01 +08:00
Andrew Davis cfe170e430 MDL-13629 grade: added some unit tests to clarify the handling of droplow and improved apply_limit_rules() 2012-07-18 09:14:59 +08:00
Damyon Wiese 617c624732 MDL-32948: Improved help for "Require students click submit button" setting
Describes the effect of changing this setting after students have submitted.
2012-07-18 10:20:08 +12:00
Damyon Wiese 00cfd8bc94 MDL-34217: Swap short and long text for setting in assignment module 2012-07-18 10:13:20 +12:00
Andrew Robert Nicols 8a172fa7cf MDL-33874 Don't warn about focussed form fields with the ignoredirty class 2012-07-18 09:35:12 +12:00
Frederic Massart a64fbc87b6 MDL-33767 Course: General section displays its title when required 2012-07-17 22:28:13 +08:00
Frederic Massart 483d768bc0 MDL-33767 Course: The actions on default section redirect to the correct section 2012-07-17 22:28:01 +08:00
Jean-Philippe Gaudreau 35cf43cb42 MDL-31516 Fixing grade_edit_tree::format_number 2012-07-17 09:03:17 -04:00
Nathan Mares 371d354ab3 MDL-34368: Fix broken query in so tokens are correctly checked against the linked service 2012-07-17 19:11:57 +10:00
Frederic Massart 23371805ea MDL-33560 Enrol: Enrol password can be unmasked 2012-07-17 16:49:31 +08:00
Juan Leyva 3240c7100e MDL-34083 Fixing the param type also after deleting the invalid option 2012-07-17 13:12:39 +08:00
Juan Leyva 574cc949cd MDL-34083 Deleted user_files from backup options 2012-07-17 13:12:36 +08:00
Sam Hemelryk 07cb7e3d34 Merge branch 'MDL-33575_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-07-17 15:50:08 +12:00
Rossiani Wijaya b6e65b5312 MDL-33575 choice module: add label to checkbox element when privacy of results is set to publish full results 2012-07-17 10:17:43 +08:00
AMOS bot b27d56ea6f Automatically generated installer lang files 2012-07-17 00:31:47 +00:00
David Monllaó e52f82253e MDL-30876 filter_mediaplugin Wrapping the style sheets access with try & catch
Conflicts:

	lib/javascript-static.js
2012-07-17 12:21:07 +12:00
Dan Poltawski 00714e72ea Merge branch 'MDL-34187_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-16 15:57:31 +08:00
Aparup Banerjee 5f3d7b1949 MDL-26587 Question : fixed restoring shortanswer where answers are missing due to data error in mbz file. 2012-07-16 15:51:11 +08:00
Dan Poltawski 4923e18d75 Merge branch 'MDL-23219_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-16 14:32:54 +08:00
Dan Poltawski e0bc694514 Merge branch 'wip-mdl-30798-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-07-16 14:26:08 +08:00
Rajesh Taneja 021bea1240 MDL-30798 Blog: link param for entries about this course link is fixed 2012-07-16 14:11:47 +08:00
Dan Poltawski 24527f63bb Merge branch 'MDL-31622-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-07-16 11:34:21 +08:00
Dan Poltawski d835681e35 Merge branch 'MDL-34211' of git://github.com/appalachianstate/moodle into MOODLE_23_STABLE 2012-07-16 11:15:55 +08:00
Dan Poltawski 4da22142bc Merge branch 'w29_MDL-34271_m23_mysqlcollation' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-16 11:00:56 +08:00
Dan Poltawski 8242298e4b Merge branch 'MDL-34164_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-16 10:05:51 +08:00
Marina Glancy ae8e49e8de MDL-34213 fixed mistype causing wrong link in some browsers 2012-07-16 09:55:05 +08:00
Sam Hemelryk 5320640ccd Merge branch 'MDL-33624-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-07-16 13:50:56 +12:00
Dan Poltawski 28fc596d03 MDL-33624 lang - remove incosistent use of placeholder 2012-07-16 09:45:11 +08:00
Davo Smith f8e493faff MDL-34214 Course dndupload - removed unneeded classes from preview element 2012-07-16 12:05:54 +12:00
Sam Hemelryk ac98ad6189 Merge branch 'MDL-26145_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-07-16 11:57:35 +12:00
Sam Hemelryk 8f87d57c47 Merge branch 'MDL-28155_23' of git://github.com/dmonllao/moodle into MOODLE_23_STABLE 2012-07-16 11:50:23 +12:00
Sam Hemelryk 828a42c37d Merge branch 'MDL-32310-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-07-16 11:00:57 +12:00
Sam Hemelryk d479ce3bef Merge branch 'MDL-34153-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-07-16 10:44:01 +12:00
Sam Hemelryk f30998190f Merge branch 'MDL-34240-23' of git://github.com/danpoltawski/moodle into MOODLE_23_STABLE 2012-07-16 10:37:42 +12:00
Sam Hemelryk ff8ab720f0 Merge branch 'MDL-34072' of git://github.com/appalachianstate/moodle into MOODLE_23_STABLE 2012-07-16 10:10:54 +12:00
Damyon Wiese 66681a5192 MDL-34258: Plagiarism API now returns strings so mod_assign needs these updates 2012-07-16 09:58:06 +12:00
Charles Fulton 4b791f1d17 MDL-27563 shibboleth: set context on login page 2012-07-16 09:39:43 +12:00
Barbara Ramiro b831bcc2be MDL-33841 Min-height set to remove unnecessary scrollbar on tree and list view 2012-07-16 09:35:44 +12:00
Ashley Holman bf79f77357 MDL-34309: Fix broken postgres unix sockets in core_adodb_testcase::test_read_table 2012-07-16 09:33:01 +12:00
Andrew Robert Nicols e7bf0155f7 MDL-33874 Allow form fields to be ignored by the formchangechecker 2012-07-16 09:26:11 +12:00
Sam Hemelryk bac9070359 Merge branch 'MDL-33788b-23' of git://github.com/srynot4sale/moodle into MOODLE_23_STABLE 2012-07-16 09:18:46 +12:00
AMOS bot beae8b9888 Automatically generated installer lang files 2012-07-15 00:32:02 +00:00
Tim Hunt 04de7affb6 MDL-34164 quiz reports: only try to show graphs if GD is installed.
if (empty($CFG->gdversion)) { seems to be the common idiom for this.
I refactored the graph output into the renderer, to avoid having to
duplicate that test three times.
2012-07-14 09:21:00 +01:00
Tim Hunt e9879c02c6 MDL-34257 quiz 'secure' window: does not close automatically. 2012-07-13 18:03:51 +01:00
Tim Hunt 7bef3664b8 MDL-23219 check permissions: show relevant role-assignments.
Adding this list of role assignments should make it much easier for
admins to work out why, when the permissions shown in the check
permisisons page are now what they expect.

I thought about making the links go more directly to, for example, the
assign roles pages for each context, but because of things like
enrolments in courses that is hard. It is only two clicks to go to the
context, then click the right link in the settings block there.

I also re-orderd some of the code in check.php to try to get all the DB
code before all the output code.
2012-07-13 15:21:17 +01:00
Dan Poltawski 881118184a MDL-34240 - google plugins: switch to PARAM_RAW_TRIMMED
This ensures the client credentials which are entered are trimmed
as users are finding problems with bad pastes.
2012-07-13 10:09:39 +08:00
Frederic Massart 7397acb145 MDL-31622 Forms: Date selector supports i18n 2012-07-13 08:57:29 +08:00
AMOS bot a3db6afa39 Automatically generated installer lang files 2012-07-13 00:32:23 +00:00
Fred Woolard fd626c4109 MDL-34072: Adjust SQL for Oracle. Remove subquery alias altogether. 2012-07-12 10:54:59 -04:00
Fred Woolard eab8660e8f MDL-34211 Use the $table_name argument to check against $metatables key values 2012-07-12 10:54:10 -04:00
Petr Škoda 3eb9ebb3c8 MDL-34271 add new cli tool for mysql collation conversions 2012-07-12 14:41:28 +02:00
Petr Škoda 41e8883ea8 MDL-34271 use the same collation when adding new tables or columns 2012-07-12 14:41:28 +02:00
Petr Škoda 7ec63b27d0 MDL-34271 cleanup mysql engine hack before adding similar collation hack 2012-07-12 14:41:27 +02:00
Dan Poltawski 3b52187e25 weekly release 2.3.1+ 2012-07-12 15:57:26 +08:00
Dan Poltawski f7d874c76f Merge branch 'install_23_STABLE' of git://github.com/amosbot/moodle into MOODLE_23_STABLE 2012-07-12 15:50:04 +08:00
Sam Hemelryk 9f7f501c0a Revert "MDL-33575 choice module: add label to checkbox element when privacy of results is set to publish full results"
This reverts commit f19cd42709.
2012-07-12 18:21:00 +12:00
Dan Poltawski 476f72e9bf MDL-34153 mod_forum: create RFC-2822 compliant message-ids 2012-07-12 14:16:52 +08:00
Paul Nicholls 074236eee7 MDL-32582 - filter/multimedia: MP3 Flow Player doesn't work in Chrome if empty stylesheets are present 2012-07-12 13:40:43 +08:00
AMOS bot 294c228272 Automatically generated installer lang files 2012-07-12 00:32:25 +00:00
David Monllao c465776d28 MDL-28155 mod_assignment Using the this object instead of a string 2012-07-11 15:13:34 +08:00
Dan Poltawski 4697c46706 Merge branch 'w28_MDL-34175_m23_admin' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-11 14:51:07 +08:00
Petr Škoda df7799d989 MDL-34175 one more hardcoded /admin/ in mnet 2012-07-11 08:48:04 +02:00
AMOS bot 89375aac4c Automatically generated installer lang files 2012-07-10 20:33:18 +02:00
Petr Skoda 229aabf7c6 MDL-33712 add support for unique moodle tags in tinymce 2012-07-10 15:56:11 +08:00
Marina Glancy d6571ad763 MDL-33950 Correctly initialise repository and check access in js and non-js filepicker 2012-07-10 14:57:46 +08:00
Marina Glancy 95991122ab MDL-33473,MDL-33950,MDL-33837 Allow non-js filepicker to pick files from moodle repositories
- MDL-33473 actually make non-js filepicker to work with local repositories
- MDL-33950 validate that file is accessible
- MDL-33837 when picking a server file marked as main, do not make it main in current filearea
2012-07-10 14:57:41 +08:00
Marina Glancy db81525850 MDL-33950 check if source file is accessible in repository_ajax.php
- repository::copy_to_area() does not check access any more, and repository_recent::copy_to_area() is unnecessary
- added repository::file_is_accessible() that checks access to the picked file (regardless of accessibility of the file it is referencing to)
2012-07-10 14:57:35 +08:00
Sun Zhigang 7073fa4c4a MDL-28155 mod_assignment - Fix an ugly hack
Show download all link for any assignment types which implement
the download_submissions() method
2012-07-10 13:00:13 +08:00
Dan Poltawski b2e5a60773 MDL-34159 - add comment lost from previous commit 2012-07-10 12:58:46 +08:00
Dan Poltawski 57c7815213 Merge branch 'w28_MDL-34159_m23_wherelist' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-10 12:56:07 +08:00
Petr Škoda 95896749a5 MDL-33617 add new index to improve perf of enrol related role_assignments
Conflicts:

	version.php
2012-07-10 15:49:38 +12:00
Petr Škoda c8b7088463 MDL-33887 delay string fetching in PAGE->requires->string_for_js() till page footer
This should resolve problems with language switching such as when forcing course language.
2012-07-10 15:08:26 +12:00
Michael Aherne c82d7fc832 MDL-34156 Remove subselect from slow query 2012-07-10 10:53:40 +08:00
Dan Poltawski 1f34fa79c2 Merge branch 'w28_MDL-34147_m23_cygwin' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-10 10:31:24 +08:00
Dan Poltawski 806129b06e Merge branch 'MDL-34171_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-10 09:25:22 +08:00
Petr Škoda eb88700a56 MDL-34155 use course visibility default when creator does not have moodle/course:visibility 2012-07-10 12:49:14 +12:00
Sam Hemelryk 3ca82ed605 Merge branch 'w28_MDL-34175_m23_admin' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-10 12:43:42 +12:00
Dan Marsden 6b8399df5e MDL-34198 SCORM remove unecessary get_records call 2012-07-10 08:34:42 +08:00
Marina Glancy 68ea10b079 MDL-33444 Upload repository can specify custom label for filepicker 2012-07-10 12:31:12 +12:00
Marina Glancy 2eb66f3500 MDL-34139 filemanager select-file dialogue should update file on Enter 2012-07-10 12:24:08 +12:00
Sam Hemelryk bd75b67885 Merge branch 'MDL-29470-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-07-10 12:09:26 +12:00
Sam Hemelryk 3936796042 Merge branch 'MDL-32297-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-07-10 12:05:33 +12:00
Davo Smith b43bb8da94 MDL-34107 Upload repository - do not add a dot to files without an extension 2012-07-10 11:47:48 +12:00
Dan Poltawski 898010f1aa MDL-34061 mod_resource: filter settings weren't coming from defaults 2012-07-10 11:40:33 +12:00
Charles Fulton d563d48694 MDL-27800 admin: make front page restore link consistent 2012-07-10 11:32:31 +12:00
Dan Poltawski 0dd189d59d Merge branch 'MDL-18301-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-07-09 14:27:15 +08:00
Dan Poltawski d6cf442059 Merge branch 'MDL-32057_23' of git://github.com/aolley/moodle into MOODLE_23_STABLE 2012-07-09 14:14:13 +08:00
Dan Poltawski 2bf17d606b Merge branch 'w28_MDL-34046_m23_stalefiles' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-09 13:50:16 +08:00
Dan Poltawski 1583e17c65 Merge branch 'MDL-33030_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-07-09 13:42:32 +08:00
Dan Poltawski d85083312c Merge branch 'wip-mdl-29969-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-07-09 13:39:18 +08:00
Dan Poltawski 1e838c4e30 Merge branch 'MDL-34077-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-07-09 13:37:34 +08:00
Gilles-Philippe Leblanc 65ab8112a3 MDL-33822 SCORM Interactions report - fix formatting of empty cells. 2012-07-09 17:24:29 +12:00
Dan Poltawski 9309b2dba8 MDL-17395 auth_email: clarify description 2012-07-09 17:19:41 +12:00
Barbara Ramiro b002b36ed3 MDL-33795 Increased file picker width and height 2012-07-09 17:14:12 +12:00
David Balch d36249d6d6 MDL-34143 Add file type information for .mdb .accdb (MS Access databases) 2012-07-09 13:05:40 +08:00
Aaron Barnes 48bdd52172 MDL-33788 completion: SQL optimisation 2012-07-09 15:36:52 +12:00
Dan Poltawski 41bb2c3a59 Merge branch 'wip-mdl-33943-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-07-09 11:35:02 +08:00
Ankit Agarwal 918f6d2c34 MDL-27831 calendar: Removing reduntand control icons in delete.php 2012-07-09 11:31:12 +08:00
Dan Poltawski 3a429ca204 Merge branch 'MDL-33885-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE 2012-07-09 10:31:52 +08:00
Ruslan Kabalin d212244375 MDL-33890 Make course blocks less theme dependant
This fix checks that the empty block region is actaually the standard one, so
it can be hidden. The blocks move operating area is not resticted to page
content any more.
2012-07-09 10:02:34 +08:00
Sam Hemelryk f19cd42709 MDL-33575 choice module: add label to checkbox element when privacy of results is set to publish full results 2012-07-09 10:56:28 +12:00
Sam Hemelryk 9bf1621fbc Merge branch 'MDL-30816_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-07-09 10:28:45 +12:00
Dan Poltawski aacf3222df MDL-33514 - rss: also exclude suspended users feeds
Thanks Petr!
2012-07-09 10:24:41 +12:00
Dan Poltawski 6b4c491cb4 MDL-33514 - rss: only retrieve RSS feeds for valid users 2012-07-09 10:24:40 +12:00
Tim Hunt 69a600a067 MDL-34171 qformat_gift: Fix edge case with special character escaping.
We need to escape \ on export, because it is un-escaped on import.
2012-07-06 10:48:20 +01:00
David Monllao 25afd64b0f MDL-26145 mod_chat Talk feature not working correctly 2012-07-06 16:16:00 +08:00
Petr Škoda fe6d428185 MDL-34046 improve mixed files upgrade error
Credit goes to Gordon Bateson.
2012-07-06 08:01:02 +02:00
Petr Škoda 880f8e7b84 MDL-34147 use cygwin style paths in phpunit hints 2012-07-06 07:59:04 +02:00
Petr Škoda 6128bf9d25 MDL-34159 improve where_clause_list performance 2012-07-06 07:57:20 +02:00
Petr Škoda 93f3eb63d1 MDL-34175 a few more renamed admin fixes 2012-07-06 07:56:00 +02:00
Petr Škoda 79406900b5 MDL-34175 automatically fix admin JS links 2012-07-06 07:56:00 +02:00
Frederic Massart 0408a48010 MDL-33885 Blog: Added maxlength rule to subject field 2012-07-06 13:16:34 +08:00
Frederic Massart 2dd2bd7ead MDL-18301 Gradebook: Added feature for components to control grade visibility 2012-07-06 09:53:54 +08:00
Sam Hemelryk f2867a8672 Moodle 2.3.1 release 2012-07-06 11:27:47 +12:00
Sam Hemelryk 62e9e694b7 weekly release 2.3+ 2012-07-06 10:04:54 +12:00
AMOS bot b24e6ed930 Automatically generated installer lang files 2012-07-06 09:53:08 +12:00
AMOS bot 50b1caaf86 Automatically generated installer lang files 2012-07-06 09:53:08 +12:00
AMOS bot 2ddf3ffcd2 Automatically generated installer lang files 2012-07-06 09:53:08 +12:00
Eloy Lafuente (stronk7) b73a7519c4 Revert "MDL-33303 Filepicker: resized to match HTML editor and made resizable"
This reverts commit e5c2bbd0f7.
2012-07-05 23:22:05 +02:00
David Balch 2425229c88 MDL-34063 XHTML files should use the HTML icon, not the markup icon 2012-07-05 18:34:55 +02:00
Eloy Lafuente (stronk7) 353580b0e3 Merge branch 'MDL-33453-reference' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2012-07-05 17:07:22 +02:00
Eloy Lafuente (stronk7) 4539b33788 Revert "MDL-30912 - lib - A tidy up of the submit url jump functions for greater ease with accessability."
This reverts commit a1a00aeee7.
2012-07-05 16:10:37 +02:00
Marina Glancy 9b47ec7bb3 MDL-33746 make folder view look like filemanager tree view 2012-07-05 14:36:28 +02:00
Tim Hunt b9c20952a3 MDL-34065 questions: also fix two typos in comments.
Amended to change 2 accordin => according
2012-07-05 13:50:21 +02:00
Tim Hunt e819ff4263 MDL-34065 lib: improve two debugging messages.
If the string passed to get_string is empty, say that. Don't say that it
contains illegal characters.

When relying on the __call magic in plugin_renderer_base, when the
method cannot be found, include the right class name in the error
message.
2012-07-05 13:50:14 +02:00
Rossiani Wijaya a2af7fd407 MDL-30816 Choice module: add format_string() for choice name. 2012-07-05 12:20:20 +08:00
Rossiani Wijaya 34e0b4a71e MDL-30816 choice module: fixed accessibility for responses table and make it easier for screenreader to read it 2012-07-05 12:19:57 +08:00
Frederic Massart 8fb4b73f55 MDL-29470 Backup: fixed unexpected next automated backup date 2012-07-05 10:13:33 +08:00
Tim Hunt b20b1c32bf MDL-34145 postgres driver: fix get_tables perf on <= 9.0
The query of the information_schema view seems to be painfully slow on
older versions of postgres (2000ms instead of 20ms). Therefore, it is
worth detecting that case, and using a more postgres specific feedback.
This is particularly important for 2.3+ unit tests.

Thanks to Petr Skoda for his help with this.
2012-07-05 03:41:08 +02:00
Frederic Massart 684806305e MDL-29470 Backup: unit tests for next automated backup date 2012-07-05 09:37:21 +08:00
Sam Hemelryk 1e9130ae6e MDL-33770 webservices: Fixed error with core_group_create_groups when no enrolment key provided 2012-07-05 09:22:35 +12:00
Tim Hunt c57fa60f3d MDL-32062 question engine: fixup tests that this change broke.
The test data was wrong, and was triggering the work-around code that
MDL-32062 introduced. I fixed the test data.

Also, I fixed one of the tests, that had been broken.
2012-07-04 19:24:48 +08:00
Dan Poltawski 617d260dd7 MDL-34035 - fix typo in comment
Thanks Sam!
2012-07-04 10:39:48 +08:00
Tim Hunt b86a48c5b9 MDL-34035 help links: allow other types of URL for plugins.
For third-parth plugins, in can be helpful if the 'More help' links in
help pop-ups (the ones that come from $string['..._link'] string in the
language file) can go to other places.

This change support two other sorts of URL in addition to the standard
'course/editing' type of link that goes to MoodelDocs.

You can use absolute URLs, starting http:// or https:///

You can use a link starting %%WWWROOT%%, and that token is replaced by
$CFG->wwwroot to make the link.
2012-07-04 10:39:42 +08:00
Barbara Ramiro a2c2ab3e1a MDL-33542, MDL-33542 Select dialogue details aligned
And loading gif smaller
2012-07-04 10:25:09 +08:00
Eloy Lafuente (stronk7) bbe378a63e Merge branch 'w27_MDL-33876_m23_delenrol' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-04 04:16:05 +02:00
Marina Glancy 9d5ced06c1 MDL-34047 repository URL downloader must say that it returns only images 2012-07-04 09:51:51 +08:00
Sam Hemelryk 6019d2b2f3 Merge branch 'MDL-32614_23' of git://github.com/stronk7/moodle into MOODLE_23_STABLE 2012-07-04 13:15:03 +12:00
Eloy Lafuente (stronk7) ccef7fe8d0 MDL-32614 lti: on restore, clean any typeid to convert the tool to selfcontained.
This is known to be imperfect, awaiting for MDL-34161 to fix the whole thing. Also,
unrelated, there are some basiclti => lti replacements.
2012-07-04 02:15:02 +02:00
Chris Scribner f2b7928df7 MDL-32614: Removing code which disassociated LTI instances from their tool types upon restore. 2012-07-04 02:14:56 +02:00
Dan Poltawski 9f6f18d2c2 MDL-31692 mod_lti - ensure that various mforms are used properly
* typesettings.php and instructor_edit_tool_type.php are tided
   up properly to ensure proper use for form data
* An incorrect PARAM type is corrected for typename
2012-07-04 10:08:13 +12:00
Sam Hemelryk 848fc30a2d Merge branch 'MDL-32062_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-04 09:53:51 +12:00
sam marshall 8530aac4a8 MDL-33466: Group restriction should hide activity even with 'show availability' option
This is a modified version of fix by Luke Tucker at NetSpot - thanks.
2012-07-04 09:38:08 +12:00
Jonathan Harker 3bcca35591 MDL-27125 better manage file handles when downloading multiple files.
Based on Dongsheng Cai's branch: s11_MDL-27125_curl_file_handler_master
2012-07-04 09:33:12 +12:00
Kevin Wiliarty e3f4094ac8 MDL-33749 follow redirects for URL downloader 2012-07-04 08:34:55 +12:00
Sam Hemelryk 7df86db31d Merge branch 'wip-mdl-32787-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE 2012-07-04 08:26:03 +12:00
Eloy Lafuente (stronk7) b41f914927 Merge branch 'wip-MDL-33303-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-07-03 16:18:41 +02:00
sam marshall a5f68fb2c2 MDL-33426 Completion: Multilang activity names wrong in alt/title 2012-07-03 16:08:57 +02:00
Rajesh Taneja 28f23328c5 MDL-32787 user: rule required for custom profile fields applies to all users editing own profile 2012-07-03 13:48:18 +08:00
Frederic Massart 3e1648723f MDL-33828 Portfolio: prevent notices while exporting to portfolios 2012-07-03 16:35:48 +12:00
sam marshall 60a72a03b2 MDL-33937 Paged course view: Allows view of sections that are not visible 2012-07-03 12:30:10 +08:00
Dan Poltawski 741543e9a7 Merge branch 'master_MDL-33938' of git://github.com/danmarsden/moodle into MOODLE_23_STABLE
Conflicts:
	mod/scorm/db/upgrade.php
2012-07-03 12:18:29 +08:00
Adrian Greeve a1a00aeee7 MDL-30912 - lib - A tidy up of the submit url jump functions for greater ease with accessability. 2012-07-03 12:12:19 +08:00
Frederic Massart 9152878ed3 MDL-30903 Accessibility: user profile page uses table headers 2012-07-03 11:51:19 +08:00
Dan Poltawski 81b2147092 Merge branch 'MDL-34008_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-03 11:47:23 +08:00
Dan Poltawski e570ee4b63 Merge branch 'w27_MDL-34036_m23_bulkrole' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-03 11:40:14 +08:00
Sam Hemelryk 0afd953daf Merge branch 'w27_MDL-34115_m23_arrayofarrayssort' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-03 15:15:18 +12:00
Dan Poltawski f224fd9498 Merge branch 'MDL-30883_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-03 11:01:44 +08:00
Jason Fowler 69b2bab32e MDL-33957 - Installation - Fixing field lengths so they are long enough for data entry, and don't distort page rendering 2012-07-03 14:58:55 +12:00
Dan Poltawski f95e28e0ff Merge branch 'w27_MDL-34123_m23_newpasslang' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-03 10:39:17 +08:00
Marina Glancy f5cd2c6ef1 MDL-33837 picking file from server files should not copy 'Main file' property 2012-07-03 10:24:43 +08:00
Sam Hemelryk 10ff22d6f6 Merge branch 'MDL-33987_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-07-03 14:11:40 +12:00
ISHIKAWA Takayuki d0d407f0bb MDL-33757 gradebook: Adding support to sort userlist by email address 2012-07-03 09:45:26 +08:00
Damyon Wiese 8ad459ed58 MDL-33499: Display final grade on the grading form with a link to the grader report
AMOS BEGIN
 CPY [currentgrade,mod_assignment],[currentgrade,mod_assign]
AMOS END
2012-07-03 02:28:49 +02:00
Eloy Lafuente (stronk7) cf5b51af0e Merge branch 'wip-MDL-33521-m23' of git://github.com/samhemelryk/moodle into MOODLE_23_STABLE 2012-07-03 01:59:22 +02:00
Adam Olley b653107b96 MDL-32057: Fix cohort enrolment css for ie7 2012-07-03 09:23:33 +09:30
Jerome Mouneyrac 18c264790a MDL-33770 Web service: create_groups should not require enrolmentkey 2012-07-03 11:49:30 +12:00
Frederic Massart 7523da44fc MDL-33814 Output renderers: table cell objects are only created when needed 2012-07-03 11:36:43 +12:00
Frederic Massart bd9ecafba9 MDL-33796 Glossary: removed unused missing string 2012-07-03 01:05:19 +02:00
Davo Smith 5200c254a1 MDL-34029 update mod/upgrade.txt to include course drag and drop upload 2012-07-03 10:55:48 +12:00
Dan Poltawski 3d43075cfd MDL-9214 - improve comment for custom login instructions 2012-07-03 10:47:21 +12:00
Dan Poltawski 5df543a60e MDL-32286 - fix ambigious english string 2012-07-03 10:42:57 +12:00
Dan Poltawski bed1c4a943 MDL-33990 - yui2: remove 2 uncessary requirements
We no longer use yui2 logger and connection in set_user_prefs
2012-07-03 10:37:10 +12:00
Sam Hemelryk 66ff4c0a06 MDL-34014 cssoptimiser: Fixed some aweful spelling 2012-07-03 10:34:13 +12:00
Dan Poltawski 9ea8065f1c MDL-34014 lang - fix CSS optimiser spelling errors 2012-07-03 10:32:45 +12:00
Dan Poltawski eadad29dc9 MDL-34022 lang - the html editor supports all browsers we support
So remove misleading 'some browers only'
2012-07-03 10:30:38 +12:00
Dan Poltawski e068b3dbe3 MDL-34033 lang - ammend configenableajax
Now better reflects its functionality.
2012-07-03 10:27:57 +12:00
Damyon Wiese 5809f6912b MDL-33848: Prevent file listings in the assignment module having an ugly border 2012-07-03 10:21:19 +12:00
Matthew G. Switlik 815aecf6c7 MDL-28151 resource: prevent cropping of large images 2012-07-03 10:14:04 +12:00
Tim Hunt 15d8babd1a MDL-23813 glossary filter: add missing YUI dependency
Fix found by Huy Hoang. I am just making a commit.
2012-07-02 23:52:48 +02:00
Aparup Banerjee a78e4e9147 MDL-23254 Authentication : used httpswwwroot as root url during authentication procedure where $PAGE->https_required() is specified. 2012-07-03 09:42:42 +12:00
Dan Poltawski d9edd25111 MDL-34081 dml: mssql driver was using case insensitve sql 2012-07-02 21:08:18 +02:00
Eloy Lafuente (stronk7) 1a76bbe2e4 MDL-34121 bump versions to efectively get the upgrade performed.
Conflicts:
	version.php
2012-07-02 18:18:22 +02:00
Eloy Lafuente (stronk7) af63cc85df Merge branch 'w27_MDL-34121_m23_killbackupmess' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-02 18:16:54 +02:00
Marina Glancy dff8438e50 MDL-33948 mod_forum correctly passes files options to file_save_draft_area_files() 2012-07-02 17:44:43 +08:00
Marina Glancy ec3fe6e123 MDL-33948 file_save_draft_area_files() validates if references are allowed and allows unlimited file size 2012-07-02 17:44:38 +08:00
Andrew Robert Nicols 770cee9696 MDL-33916 Add unit tests to ensure that is_enrolled returns correctly 2012-07-02 17:36:55 +08:00
Andrew Robert Nicols 1db89f5e6a MDL-33916 Ensure that capabilities are checked for cached user enrolments 2012-07-02 17:36:51 +08:00
Dan Poltawski 5c1b768aec MDL-31802 - navigation: add a comment about session reduction 2012-07-02 17:30:21 +08:00
Dan Poltawski f2b4305c8e Merge branch 'MDL-31802_23' of git://github.com/aolley/moodle into MOODLE_23_STABLE 2012-07-02 17:24:56 +08:00
Marina Glancy 502ecc4c9f MDL-34117 Correctly pass accepted_types to dnduploader 2012-07-02 17:10:02 +08:00
Dan Poltawski 34c10b84fb Merge branch 'w27_MDL-34120_m23_delpass' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-02 16:48:28 +08:00
Dan Poltawski f09dcd4b6d Merge branch 'w27_MDL-34125_m23_tablename' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-02 16:46:27 +08:00
Tim Hunt 2b1b2017a6 MDL-34109 quiz cron: timelimit are timeclose of 0 are special.
If the timelimit or timeclose of a quiz are 0, this means 'no
restriction', rather than '1970' or '0 seconds'. We need to handle these
special cases correctly in the code that looks for quiz attempts that
might be in the wrong state.
2012-07-02 16:44:35 +08:00
Tim Hunt 592443f4e1 MDL-34109 quiz cron: change whitespace before applying the fix.
This commit just changes the white-space, but does not change any of the
actual code. This is so that the commit I am about to make, which will
change the code, will be easier to understand.
2012-07-02 16:44:29 +08:00
Dan Poltawski dabab94b6e Merge branch 'w27_MDL-34045_m23_idnumber' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-02 16:34:17 +08:00
Dan Poltawski 039089f3aa Merge branch 'MDL-34025_m23' of https://github.com/markn86/moodle into MOODLE_23_STABLE 2012-07-02 16:28:12 +08:00
Rossiani Wijaya 41c548bb23 MDL-33030 Lesson module: fixed progress bar 2012-07-02 16:20:40 +08:00
Dan Poltawski 9cb942820c Merge branch 'MDL-33924_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-02 16:19:19 +08:00
Dan Marsden 0ba1ee1dd2 MDL-33914 SCORM show scrollbar on TOC if too long. 2012-07-02 16:14:23 +08:00
Dan Marsden 7debccbdee MDL-33835 Marking Guide - set currentfocus var to the first criteria comment to avoid JS errors. 2012-07-02 16:10:26 +08:00
Dan Poltawski 9a211c853d Merge branch 'MDL-33780_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE 2012-07-02 16:07:32 +08:00
Marina Glancy ed8cab855e MDL-33721 show loading icon after file has been selected in filepicker, prevent clicking select button twice 2012-07-02 16:00:21 +08:00
Dan Poltawski 6253f69246 Merge branch 'm23_MDL-33053_AICC_flattened_TOC' of git://github.com/scara/moodle into MOODLE_23_STABLE 2012-07-02 15:50:18 +08:00
Dan Poltawski 49ac5deff6 Merge branch 'MDL-32605-m23' of git://github.com/ankitagarwal/moodle into MOODLE_23_STABLE 2012-07-02 15:45:59 +08:00
Andrew Davis 6737eda426 MDL-25476 messages: switched some notification emails to come from the support contact instead of admin 2012-07-02 15:41:29 +08:00
Frederic Massart c7132d7c93 MDL-9073 Glossary: uncategorised entries are printable 2012-07-02 15:34:06 +08:00
Kanika Goyal d9b9bfd288 MDL-31203 mod_forum: advanced search posts must be newer older than date, reverts date 2012-07-02 15:24:10 +08:00
Rossiani Wijaya ec70cf6ef1 fixed the ->spacer <br> param 2012-07-02 15:20:43 +08:00
Mark Nielsen a6b0b36cdc fixed undefined variable 2012-07-02 15:20:37 +08:00
Rajesh Taneja a8380712bb MDL-33943 tool_replace: Hardcoded strings replaced with lang strings 2012-07-02 15:18:41 +08:00
Dan Poltawski 3e839bd513 Merge branch 'MDL-31987_assignment_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE 2012-07-02 15:12:47 +08:00
Dan Poltawski 8633142f53 Merge branch 'MDL-34019-pluginlib-notice' of git://github.com/mudrd8mz/moodle into MOODLE_23_STABLE 2012-07-02 15:02:37 +08:00
Tim Hunt 564b878840 MDL-34054 quiz reports: missing context.
quiz_report_should_show_grades needs to know the context, so pass it
through.
2012-07-02 14:57:29 +08:00
Dan Poltawski c3f59e043c MDL-33995 - unit tests: fix class name collision 2012-07-02 14:52:57 +08:00
Rossiani Wijaya 4b0e6f38fa MDL-31987 Assignment module: fixed upgrade version 2012-07-02 14:51:47 +08:00
Dan Poltawski fb978df0f0 MDL-31987 Assignment module: fix sql for postgres. 2012-07-02 14:49:29 +08:00
Rossiani Wijaya 45353da409 MDL-31987 Assignment module: Assignment count submissions correctly.
For advanced upload assignment, store file count of each submission
into assignment_submissions.numfiles

When counting submissions, if the assignment is open and tracking
drafts, only submissions which has send for marking are counted.
Otherwise, submissions which has numfiles > 0 are counted.

Also change a hardcoded 'submitted' to ASSIGNMENT_STATUS_SUBMITTED.

This patch was originally written by: Sunner Sun <sunner@gmail.com>.

I made some modifation to fixed count_real_submissions() query (ref: MDL-32207) in /mod/assignment/type/upload/assignment.class.php file
2012-07-02 14:49:29 +08:00
Rajesh Taneja 419aed3539 MDL-29969 Administration: Default value for numsections is set to 1 for site frontpage 2012-07-02 14:33:37 +08:00
Jerome Mouneyrac 08641906e1 MDL-33995 Course external PHPunit test + externallib_testcase helper class 2012-07-02 14:13:44 +08:00
Jerome Mouneyrac 6b5ce20c16 MDL-33776 Web services: get_categories - subcategories should be checked against visible/theme keys 2012-07-02 14:13:38 +08:00
Dan Marsden 800fb7533e MDL-33978 SCORM activity completion - don't tiggere completion update state on creation of SCORM 2012-07-02 13:44:35 +08:00
Andrew Davis 789c8b8194 MDL-33686 Repositories: we were accessing a non-existent variable and thus never displaying the maximum number of attachments 2012-07-02 14:53:50 +12:00
Andreas Grabs e9aa190a37 MDL-33932_master - added array_unique() 2012-07-02 14:32:09 +12:00
Andreas Grabs 786ad3511c MDL-33627 - feedback block now show all feedbacks 2012-07-02 14:06:42 +12:00
Sam Hemelryk abfc9e2512 MDL-33521 css: Fixed invalid CSS in core CSS and plugin styles.css files 2012-07-02 11:34:53 +12:00
Frederic Massart e5c2bbd0f7 MDL-33303 Filepicker: resized to match HTML editor and made resizable 2012-07-02 11:34:27 +12:00
Eloy Lafuente (stronk7) 1494f20da3 weekly release 2.3+ 2012-07-02 00:54:05 +02:00
Eloy Lafuente (stronk7) 4fa4a727b4 Merge branch 'MDL-34119_M23' of git://github.com/lazydaisy/moodle into MOODLE_23_STABLE 2012-07-02 00:30:28 +02:00
Sam Hemelryk 4be710795a Merge branch 'MDL-34044-23' of git://github.com/srynot4sale/moodle into MOODLE_23_STABLE 2012-07-02 08:22:35 +12:00
Eloy Lafuente (stronk7) 9ea40f27a0 Merge branch 'w27_MDL-34130_m23_recordsettests' of git://github.com/skodak/moodle into MOODLE_23_STABLE 2012-07-01 22:01:22 +02:00
Petr Škoda 19ba134d3b MDL-34130 prevent some warning in PHPStorm 2012-07-01 21:50:56 +02:00
Petr Škoda d0812ba0e6 MDL-34130 test recordset data is static
We do not want recordset results to be affected by subsequent update or delete queries.
2012-07-01 21:40:37 +02:00
Petr Škoda a2b8856558 MDL-34130 add missing rs close
Thanks Eloy!
2012-07-01 21:40:36 +02:00
Petr Škoda a61e8c8ebe MDL-34130 test interaction of recordsets and transactions 2012-07-01 21:40:36 +02:00
Petr Škoda 1cf431a329 MDL-34130 test nested recordset iteration 2012-07-01 21:40:36 +02:00
Petr Škoda 9ee97228bd MDL-34130 fix data inserts in recordset tests 2012-07-01 21:40:36 +02:00
Petr Škoda 43fb824bd2 MDL-34125 fix regression when deleting activity modules
Credit goes to Gordon Bateson.
2012-07-01 10:05:22 +02:00
Eloy Lafuente (stronk7) 9d774c9445 Merge branch 'MDL-32249c-23' of github.com:srynot4sale/moodle into MOODLE_23_STABLE 2012-07-01 02:14:39 +02:00
Sun Zhigang 8b3d60557c MDL-31201 wiki: fix a hardcoded string 2012-06-30 22:01:08 +02:00
Petr Škoda 134affd943 MDL-34123 use user's lang when sending new emails 2012-06-30 20:46:30 +02:00
Petr Škoda 5df5bcba99 MDL-34036 fix course role user selector 2012-06-30 15:40:30 +02:00
Petr Škoda 93fd7cb10c MDL-34121 drop unused backup tables that were supposed to be dropped long ago
The backup/restore leftovers that referenced these will be dropped in 2.4
2012-06-30 14:00:52 +02:00
Mary Evans 3705a88629 MDL-34119_M23 theme_splash: Added colourswitcher.js and associated code in layout files and lib.php 2012-06-30 12:02:22 +01:00
Petr Škoda 5cb477c4a1 MDL-34120 do not try to create new passwords for incorrectly deleted users
There is still some code that ignores delete_user() and instead hacks the user table directly, skip the borked user records for now when sending new passwords.
2012-06-30 09:07:18 +02:00
Petr Škoda 4aabce216c MDL-33876 skip deleted users in enrol_database sync 2012-06-30 08:44:55 +02:00
Petr Škoda b273b20a7c MDL-34115 fix sorting in blocks admin UI
Comparison of arrays is not locale aware.
2012-06-30 08:34:02 +02:00
Petr Škoda f8e05deb35 MDL-34045 fix invalid idnumber field type in cohort form 2012-06-30 07:57:51 +02:00
Mary Evans 263e8c144c MDL-34119_M23 theme_splash: removed redundant js call in lib.php. Added lang option to config.php + amended lang output in layout files. Added some css to style langmenu + removed redundant loginicon in pagelayout.css 2012-06-30 00:50:34 +01:00
Frederic Massart 3e0b5f78a2 MDL-32297 Forms: Date Picker JS popup is not constraint to parent form 2012-06-29 14:18:59 +08:00
Aparup Banerjee b574c078a6 MDL-34096 Installation : Added 2.3 upgrade line to db upgrade scripts. 2012-06-29 11:37:01 +08:00
Frederic Massart 37817a0cd8 MDL-34077 Repositories: Flickr and Picasa can have custom names 2012-06-28 12:12:32 +08:00
Adam Olley a44c303d63 MDL-31802: Remove section summaries from navigation_cache 2012-06-28 11:03:49 +09:30
Tim Hunt e5ff0d3278 MDL-33924 quiz: incorrect foreign key definition.
Thanks to Jean-Michel Vedrine for spotting this.≈
2012-06-27 08:26:26 +01:00
Mark Nelson faca708484 MDL-34025 - quiz secure window: fix popup closing 2012-06-27 14:31:03 +08:00
Ankit Agarwal fc14c79fc9 MDL-32605 calendar: Fixing the missing parameter for get_string call 2012-06-27 13:34:39 +08:00
Aaron Barnes 2670a3a684 MDL-34044 completion: Fix regression caused by MDL-26626 2012-06-27 11:54:41 +12:00
David Mudrák d81d6ea2c3 MDL-33453 Make it clear what search_references() and search_references_count() are good for
Initially it was not clear enough that these two methods are supposed to
be used for looking for references to a stored_file only. So the docs
comments are improved and unittests added to illustrate the usage.

The patch also removes the unittest for get_references_by_storedfile()
as its usage is already covered in other test methods.
2012-06-26 16:28:30 +02:00
Tim Hunt b0cf55f145 MDL-34008 formslib: repeat_elements replace {no} for submits & buttons 2012-06-26 10:38:50 +01:00
Tim Hunt 5af6c9676e MDL-33780 question import: strip UTF8 BOM
Previously, if there was a byte-order mark at the start of the file, the
import would just break, which was silly. Much better to just strip it
off.
2012-06-26 10:34:19 +01:00
Tim Hunt 225e058685 MDL-30883 question flags: aria attributes for accessibility
Also, update code to use html_writer, and fix pointer style when not
editable.
2012-06-26 10:31:36 +01:00
Tim Hunt 3d348a3cc7 MDL-32062 question engine: fix re-grading attempts from 2.0
The code to upgrade attempts from before Moodle 2.0 to 2.1 created
attempt data that was not exactly the same as a new attempt created in
2.1+. This did not matter very much - revew and the quiz reports all
worked OK - but it broke on re-grade.

These changes detect the problem data in the re-grade code, an apply a
work-around so that the re-grade gives the correct result.
2012-06-26 10:11:37 +01:00
David Mudrák 896f9ae83b MDL-34019 Fix response item key name 2012-06-26 09:12:35 +02:00
Mary Evans 11824b0461 MDL-33987_M23 theme_anomaly: amended some css values to style dock better also removed exclude parent theme stylesheet as it refered to a none existant file in base theme. 2012-06-26 03:40:37 +01:00
Aaron Barnes 9b57d5bc38 MDL-32249 completion: Make grade criteria more consistent
Also, round course grades and remove hardcoded string.

Note: This patch also removes the ability to update the course grade
from the completion interface
2012-06-26 14:12:53 +12:00
17067 changed files with 1195806 additions and 2165805 deletions
-3
View File
@@ -1,3 +0,0 @@
--errors=errors,duplicate-properties
--warnings=known-properties,display-property-grouping,empty-rules,important
--exclude-list=vendor/,lib/editor/tinymce/,lib/yuilib/,theme/bootstrapbase/style/
-4
View File
@@ -1,4 +0,0 @@
**/yui/build/** -diff
**/amd/build/** -diff
theme/bootstrapbase/style/editor.css -diff
theme/bootstrapbase/style/moodle.css -diff
+1 -11
View File
@@ -25,14 +25,4 @@ CVS
/.project
/.buildpath
/.cache
phpunit.xml
# Composer support. Do not ignore composer.json, or composer.lock. These should be shipped by us.
composer.phar
/vendor/
/behat.yml
*/yui/build/*/*-coverage.js
/lib/yuilib/*/build/*/*-coverage.js
# lib/yuilib/version/module/module-coverage.js
/lib/yuilib/*/*/*-coverage.js
atlassian-ide-plugin.xml
/node_modules/
phpunit.xml
-55
View File
@@ -1,55 +0,0 @@
{
"asi": false,
"bitwise": true,
"boss": false,
"browser": true,
"curly": true,
"debug": false,
"eqeqeq": false,
"eqnull": false,
"es5": false,
"esnext": false,
"evil": false,
"expr": false,
"forin": false,
"funcscope": false,
"globalstrict": false,
"immed": true,
"indent": 4,
"iterator": false,
"lastsemic": false,
"latedef": true,
"laxbreak": true,
"laxcomma": false,
"loopfunc": false,
"maxerr": 500,
"maxlen": 132,
"multistr": false,
"newcap": true,
"noarg": true,
"noempty": true,
"nomen": false,
"onecase": false,
"onevar": false,
"passfail": false,
"plusplus": false,
"predef": [
"M",
"define",
"require"
],
"proto": false,
"regexdash": false,
"regexp": false,
"scripturl": false,
"shadow": false,
"smarttabs": false,
"strict": false,
"sub": false,
"supernew": false,
"trailing": true,
"undef": true,
"unused": true,
"white": false,
"yui": true
}
-5
View File
@@ -1,5 +0,0 @@
{
"coverage": false,
"lint": "config",
"clean": true
}
-247
View File
@@ -1,247 +0,0 @@
# PLEASE NOTE: Travis is not currently utilised by the Moodle core integration
# 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: false
language: php
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
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.
# Run unit tests on MySQL
- DB=mysqli TASK=PHPUNIT
# Run CI Tests without running PHPUnit.
- DB=none TASK=CITEST
# Run unit tests on Postgres
- DB=pgsql TASK=PHPUNIT
# Perform an upgrade test too.
- DB=pgsql TASK=UPGRADE
# Run a check for unbuilt files with Grunt.
- DB=none TASK=GRUNT
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
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
- env: DB=mysqli TASK=PHPUNIT
php: 5.4
- env: DB=none TASK=GRUNT
php: 5.4
# Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
- env: DB=pgsql TASK=UPGRADE
php: 7.0
cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm
install:
# 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
# Set the encrypted GITHUB_TOKEN if it's available to raise the API limit.
- if [ -n "$GITHUB_APITOKEN" ]; then composer config github-oauth.github.com $GITHUB_APITOKEN; fi
- echo 'auth.json' >> .git/info/exclude
# 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.
- travis_retry composer install --prefer-dist --no-interaction
before_script:
- >
if [ "$TASK" = 'PHPUNIT' -o "$TASK" = 'UPGRADE' ];
then
# Copy generic configuration in place.
cp config-dist.php config.php ;
# Create the moodledata directory.
mkdir -p "$HOME"/roots/base
# The database name and password.
sed -i \
-e "s%= 'moodle'%= 'travis_ci_test'%" \
-e "s%= 'password'%= ''%" \
config.php ;
# The wwwroot and dataroot.
sed -i \
-e "s%http://example.com/moodle%http://localhost%" \
-e "s%/home/example/moodledata%/home/travis/roots/base%" \
config.php ;
if [ "$DB" = 'pgsql' ];
then
# Postgres-specific setup.
sed -i \
-e "s%= 'username'%= 'postgres'%" \
config.php ;
psql -c 'CREATE DATABASE travis_ci_test;' -U postgres;
fi
if [ "$DB" = 'mysqli' ];
then
# MySQL-specific setup.
sed -i \
-e "s%= 'pgsql'%= 'mysqli'%" \
-e "s%= 'username'%= 'travis'%" \
config.php;
mysql -u root -e 'SET GLOBAL innodb_file_format=barracuda;' ;
mysql -u root -e 'SET GLOBAL innodb_file_per_table=ON;' ;
mysql -e 'CREATE DATABASE travis_ci_test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;' ;
fi
fi
- >
if [ "$TASK" = 'PHPUNIT' ];
then
# Create a directory for the phpunit dataroot.
mkdir -p "$HOME"/roots/phpunit
# The phpunit dataroot and prefix..
sed -i \
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
config.php ;
# Initialise PHPUnit for Moodle.
php admin/tool/phpunit/cli/init.php
fi
- >
if [ "$TASK" = 'GRUNT' ];
then
npm install ;
npm install -g grunt ;
grunt ;
fi
########################################################################
# CI Tests
########################################################################
- >
if [ "$TASK" = 'CITEST' ];
then
# Note - this is deliberately placed in the script section as we
# should not add any code until after phpunit has run.
# The following repositories are required.
# The local_ci repository does the actual checking.
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci
# We need the official upstream for comparison
git remote add upstream https://github.com/moodle/moodle.git;
git fetch upstream MOODLE_31_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`
# Variables required by our linter.
export gitcmd=`which git`;
export gitdir="$TRAVIS_BUILD_DIR";
export phpcmd=`which php`;
fi
########################################################################
# Upgrade test
########################################################################
- >
if [ "$TASK" = 'UPGRADE' ];
then
# We need the official upstream.
git remote add upstream https://github.com/moodle/moodle.git;
# Checkout 27 STABLE branch.
git fetch upstream MOODLE_27_STABLE;
git checkout MOODLE_27_STABLE;
# Perform the upgrade
php admin/cli/install_database.php --agree-license --adminpass=Password --adminemail=admin@example.com --fullname="Upgrade test" --shortname=Upgrade;
# Return to the previous commit
git checkout -;
# Perform the upgrade
php admin/cli/upgrade.php --non-interactive --allow-unstable ;
# The local_ci repository can be used to check upgrade savepoints.
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci ;
fi
script:
- >
if [ "$TASK" = 'PHPUNIT' ];
then
vendor/bin/phpunit;
fi
- >
if [ "$TASK" = 'CITEST' ];
then
bash local/ci/php_lint/php_lint.sh;
fi
- >
if [ "$TASK" = 'GRUNT' ];
then
# 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.
git add . ;
git diff --cached --exit-code ;
fi
########################################################################
# Upgrade test
########################################################################
- >
if [ "$TASK" = 'UPGRADE' ];
then
cp local/ci/check_upgrade_savepoints/check_upgrade_savepoints.php ./check_upgrade_savepoints.php
result=`php check_upgrade_savepoints.php`;
# Check if there are problems
count=`echo "$result" | grep -P "ERROR|WARN" | wc -l` ;
if (($count > 0));
then
echo "$result"
exit 1 ;
fi
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>.
-255
View File
@@ -1,255 +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 */
/**
* @copyright 2014 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Grunt configuration
*/
module.exports = function(grunt) {
var path = require('path'),
tasks = {},
cwd = 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')) {
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'];
/**
* 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.
*/
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]
}
}
});
/**
* 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');
// 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'));
// 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
it's 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 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
-106
View File
@@ -1,106 +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_login();
require_capability('moodle/site:config', context_system::instance());
$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;
}
set_config('antiviruses', implode(',', $activeantiviruses));
core_plugin_manager::reset_caches();
redirect ($returnurl);
+4 -6
View File
@@ -12,13 +12,13 @@ require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_login();
require_capability('moodle/site:config', context_system::instance());
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$returnurl = new moodle_url('/admin/settings.php', array('section'=>'manageauths'));
$PAGE->set_url($returnurl);
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$action = optional_param('action', '', PARAM_ACTION);
$auth = optional_param('auth', '', PARAM_PLUGIN);
get_enabled_auth_plugins(true); // fix the list of enabled auths
@@ -51,8 +51,7 @@ switch ($action) {
if ($auth == $CFG->registerauth) {
set_config('registerauth', '');
}
\core\session\manager::gc(); // Remove stale sessions.
core_plugin_manager::reset_caches();
session_gc(); // remove stale sessions
break;
case 'enable':
@@ -62,8 +61,7 @@ switch ($action) {
$authsenabled = array_unique($authsenabled);
set_config('auth', implode(',', $authsenabled));
}
\core\session\manager::gc(); // Remove stale sessions.
core_plugin_manager::reset_caches();
session_gc(); // remove stale sessions
break;
case 'down':
+13 -23
View File
@@ -64,8 +64,6 @@ 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();
@@ -80,9 +78,6 @@ echo '<p style="text-align: center"><input type="submit" value="' . get_string("
echo "</div>\n";
echo "</form>\n";
$PAGE->requires->string_for_js('unmaskpassword', 'core_form');
$PAGE->requires->yui_module('moodle-auth-passwordunmask', 'M.auth.passwordunmask');
echo $OUTPUT->footer();
exit;
@@ -92,8 +87,8 @@ exit;
// 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;
function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts, $updateopts) {
global $OUTPUT;
echo '<tr><td colspan="3">';
if ($retrieveopts) {
echo $OUTPUT->heading(get_string('auth_data_mapping', 'auth'));
@@ -112,21 +107,14 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
$pluginconfig = get_config("auth/$auth");
// Helptext is on a field with rowspan.
// helptext is on a field with rowspan
if (empty($helptext)) {
$helptext = '&nbsp;';
$helptext = '&nbsp;';
}
// If we have custom fields then merge them with user fields.
if (!empty($customfields)) {
$user_fields = array_merge($user_fields, $customfields);
}
if (!empty($customfields)) {
$customfieldname = $DB->get_records('user_info_field', null, '', 'shortname, name');
}
foreach ($user_fields as $field) {
// Define some vars we'll work with.
// Define some vars we'll work with
if (!isset($pluginconfig->{"field_map_$field"})) {
$pluginconfig->{"field_map_$field"} = '';
}
@@ -140,14 +128,12 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
$pluginconfig->{"field_lock_$field"} = '';
}
// Define the fieldname we display to the user.
// define the fieldname we display to the user
$fieldname = $field;
if ($fieldname === 'lang') {
$fieldname = get_string('language');
} elseif (!empty($customfields) && in_array($field, $customfields)) {
// If custom field then pick name from database.
$fieldshortname = str_replace('profile_field_', '', $fieldname);
$fieldname = $customfieldname[$fieldshortname]->name;
} elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) {
$fieldname = get_string($matches[1]) . ' ' . $matches[2];
} elseif ($fieldname == 'url') {
$fieldname = get_string('webpage');
} else {
@@ -169,6 +155,8 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
echo '<label for="menulockconfig_field_updateremote_'.$field.'">'.get_string('auth_updateremote', 'auth') . '</label>&nbsp;';
echo html_writer::select($updateextoptions, "lockconfig_field_updateremote_{$field}", $pluginconfig->{"field_updateremote_$field"}, false);
echo '<br />';
}
echo '<label for="menulockconfig_field_lock_'.$field.'">'.get_string('auth_fieldlock', 'auth') . '</label>&nbsp;';
echo html_writer::select($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, false);
@@ -187,3 +175,5 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
echo '</tr>';
}
}
+76
View File
@@ -0,0 +1,76 @@
<?php
// block.php - allows admin to edit all local configuration variables for a block
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$blockid = required_param('block', PARAM_INT);
if(!$blockrecord = blocks_get_record($blockid)) {
print_error('blockdoesnotexist', 'error');
}
admin_externalpage_setup('blocksetting'.$blockrecord->name);
$block = block_instance($blockrecord->name);
if($block === false) {
print_error('blockcannotinistantiate', 'error');
}
// Define the data we're going to silently include in the instance config form here,
// so we can strip them from the submitted data BEFORE handling it.
$hiddendata = array(
'block' => $blockid,
'sesskey' => sesskey()
);
/// If data submitted, then process and store.
if ($config = data_submitted()) {
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', 'error');
}
if(!$block->has_config()) {
print_error('blockcannotconfig', 'error');
}
$remove = array_keys($hiddendata);
foreach($remove as $item) {
unset($config->$item);
}
$block->config_save($config);
redirect("$CFG->wwwroot/$CFG->admin/blocks.php", get_string("changessaved"), 1);
exit;
}
/// Otherwise print the form.
$strmanageblocks = get_string('manageblocks');
$strblockname = $block->get_title();
echo $OUTPUT->header();
echo $OUTPUT->heading($strblockname);
echo $OUTPUT->notification('This block still uses an old-style config_global.html file. ' .
'It must be updated by a developer to use a settings.php file.');
echo $OUTPUT->box(get_string('configwarning', 'admin'), 'generalbox boxwidthnormal boxaligncenter');
echo '<br />';
echo '<form method="post" action="block.php">';
echo '<p>';
foreach($hiddendata as $name => $val) {
echo '<input type="hidden" name="'. $name .'" value="'. $val .'" />';
}
echo '</p>';
echo $OUTPUT->box_start();
include($CFG->dirroot.'/blocks/'. $block->name() .'/config_global.html');
echo $OUTPUT->box_end();
echo '</form>';
echo $OUTPUT->footer();
+56 -43
View File
@@ -1,6 +1,6 @@
<?php
// Allows the admin to configure blocks (hide/show, uninstall and configure)
// Allows the admin to configure blocks (hide/show, delete and configure)
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
@@ -11,13 +11,14 @@
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$hide = optional_param('hide', 0, PARAM_INT);
$show = optional_param('show', 0, PARAM_INT);
$delete = optional_param('delete', 0, PARAM_INT);
$unprotect = optional_param('unprotect', 0, PARAM_INT);
$protect = optional_param('protect', 0, PARAM_INT);
/// Print headings
$strmanageblocks = get_string('manageblocks');
$struninstall = get_string('uninstallplugin', 'core_admin');
$strdelete = get_string('delete');
$strversion = get_string('version');
$strhide = get_string('hide');
$strshow = get_string('show');
@@ -36,7 +37,6 @@
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '0', array('id'=>$block->id)); // Hide block
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
@@ -45,7 +45,6 @@
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '1', array('id'=>$block->id)); // Show block
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
@@ -79,6 +78,35 @@
admin_get_root(true, false); // settings not required - only pages
}
if (!empty($delete) && confirm_sesskey()) {
echo $OUTPUT->header();
echo $OUTPUT->heading($strmanageblocks);
if (!$block = blocks_get_record($delete)) {
print_error('blockdoesnotexist', 'error');
}
if (get_string_manager()->string_exists('pluginname', "block_$block->name")) {
$strblockname = get_string('pluginname', "block_$block->name");
} else {
$strblockname = $block->name;
}
if (!$confirm) {
echo $OUTPUT->confirm(get_string('blockdeleteconfirm', '', $strblockname), 'blocks.php?delete='.$block->id.'&confirm=1', 'blocks.php');
echo $OUTPUT->footer();
exit;
} else {
uninstall_plugin('block', $block->name);
$a = new stdClass();
$a->block = $strblockname;
$a->directory = $CFG->dirroot.'/blocks/'.$block->name;
notice(get_string('blockdeletefiles', '', $a), 'blocks.php');
}
}
echo $OUTPUT->header();
echo $OUTPUT->heading($strmanageblocks);
@@ -96,11 +124,10 @@
$table = new flexible_table('admin-blocks-compatible');
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'undeletable', 'settings', 'uninstall'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strprotecthdr, $strsettings, $struninstall));
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'undeletable', 'delete', 'settings'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strprotecthdr, $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('class', 'admintable blockstable generaltable');
$table->set_attribute('id', 'compatibleblockstable');
$table->set_attribute('class', 'compatibleblockstable blockstable generaltable');
$table->setup();
$tablerows = array();
@@ -114,18 +141,17 @@
$blocknames[$blockid] = $blockname;
}
}
core_collator::asort($blocknames);
collatorlib::asort($blocknames);
foreach ($blocknames as $blockid=>$strblockname) {
$block = $blocks[$blockid];
$blockname = $block->name;
$dbversion = get_config('block_'.$block->name, 'version');
if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
$blockobject = false;
$strblockname = '<span class="notifyproblem">'.$strblockname.' ('.get_string('missingfromdisk').')</span>';
$plugin = new stdClass();
$plugin->version = $dbversion;
$plugin->version = $block->version;
} else {
$plugin = new stdClass();
@@ -140,11 +166,7 @@
}
}
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('block_'.$blockname, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
} else {
$uninstall = '';
}
$delete = '<a href="blocks.php?delete='.$blockid.'&amp;sesskey='.sesskey().'">'.$strdelete.'</a>';
$settings = ''; // By default, no configuration
if ($blockobject and $blockobject->has_config()) {
@@ -154,12 +176,8 @@
$settings = '<a href="' . $blocksettings->url . '">' . get_string('settings') . '</a>';
} else if ($blocksettings instanceof admin_settingpage) {
$settings = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksetting'.$block->name.'">'.$strsettings.'</a>';
} else if (!file_exists($CFG->dirroot.'/blocks/'.$block->name.'/settings.php')) {
// If the block's settings node was not found, we check that the block really provides the settings.php file.
// Note that blocks can inject their settings to other nodes in the admin tree without using the default locations.
// This can be done by assigning null to $setting in settings.php and it is a valid case.
debugging('Warning: block_'.$block->name.' returns true in has_config() but does not provide a settings.php file',
DEBUG_DEVELOPER);
} else {
$settings = '<a href="block.php?block='.$blockid.'">'.$strsettings.'</a>';
}
}
@@ -183,17 +201,17 @@
$visible = '';
} else if ($blocks[$blockid]->visible) {
$visible = '<a href="blocks.php?hide='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strhide.'">'.
'<img src="'.$OUTPUT->pix_url('t/hide') . '" class="iconsmall" alt="'.$strhide.'" /></a>';
'<img src="'.$OUTPUT->pix_url('i/hide') . '" class="icon" alt="'.$strhide.'" /></a>';
} else {
$visible = '<a href="blocks.php?show='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strshow.'">'.
'<img src="'.$OUTPUT->pix_url('t/show') . '" class="iconsmall" alt="'.$strshow.'" /></a>';
$class = 'dimmed_text';
'<img src="'.$OUTPUT->pix_url('i/show') . '" class="icon" alt="'.$strshow.'" /></a>';
$class = ' class="dimmed_text"'; // Leading space required!
}
if ($dbversion == $plugin->version) {
$version = $dbversion;
if ($block->version == $plugin->version) {
$version = $block->version;
} else {
$version = "$dbversion ($plugin->version)";
$version = "$block->version ($plugin->version)";
}
if (!$blockobject) {
@@ -201,22 +219,22 @@
$undeletable = '';
} else if (in_array($blockname, $undeletableblocktypes)) {
$undeletable = '<a href="blocks.php?unprotect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strunprotect.'">'.
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="iconsmall" alt="'.$strunprotect.'" /></a>';
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="icon" alt="'.$strunprotect.'" /></a>';
} else {
$undeletable = '<a href="blocks.php?protect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strprotect.'">'.
'<img src="'.$OUTPUT->pix_url('t/lock') . '" class="iconsmall" alt="'.$strprotect.'" /></a>';
'<img src="'.$OUTPUT->pix_url('t/unlock_gray') . '" class="icon" alt="'.$strprotect.'" /></a>';
}
$row = array(
$strblockname,
'<span'.$class.'>'.$strblockname.'</span>',
$blocklist,
$version,
'<span'.$class.'>'.$version.'</span>',
$visible,
$undeletable,
$settings,
$uninstall,
$delete,
$settings
);
$table->add_data($row, $class);
$table->add_data($row);
}
$table->print_html();
@@ -226,8 +244,8 @@
$table = new flexible_table('admin-blocks-incompatible');
$table->define_columns(array('block', 'uninstall'));
$table->define_headers(array($strname, $struninstall));
$table->define_columns(array('block', 'delete'));
$table->define_headers(array($strname, $strdelete));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('class', 'incompatibleblockstable generaltable');
@@ -235,14 +253,9 @@
$table->setup();
foreach ($incompatible as $block) {
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('block_'.$block->name, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
} else {
$uninstall = '';
}
$table->add_data(array(
$block->name,
$uninstall,
'<a href="blocks.php?delete='.$block->id.'&amp;sesskey='.sesskey().'">'.$strdelete.'</a>',
));
}
$table->print_html();
+23 -21
View File
@@ -17,7 +17,7 @@
/**
* This file is used to display a categories sub categories, external pages, and settings.
*
* @since Moodle 2.3
* @since 2.3
* @package admin
* @copyright 2011 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -32,7 +32,7 @@ $adminediting = optional_param('adminedit', -1, PARAM_BOOL);
/// no guest autologin
require_login(0, false);
$PAGE->set_context(context_system::instance());
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
$PAGE->set_url('/admin/category.php', array('category' => $category));
$PAGE->set_pagetype('admin-setting-' . $category);
$PAGE->set_pagelayout('admin');
@@ -67,6 +67,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
$errormsg = get_string('errorwithsettings', 'admin');
$firsterror = reset($adminroot->errors);
}
$adminroot = admin_get_root(true); //reload tree
$settingspage = $adminroot->locate($category, true);
}
@@ -96,26 +97,27 @@ foreach ($settingspage->children as $childpage) {
$outputhtml .= $OUTPUT->heading(html_writer::link($childpage->url, $childpage->visiblename), 3);
} else if ($childpage instanceof admin_settingpage) {
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/settings.php', array('section' => $childpage->name)), $childpage->visiblename), 3);
// If its a settings page and has settings lets display them.
if (!empty($childpage->settings)) {
$outputhtml .= html_writer::start_tag('fieldset', array('class' => 'adminsettings'));
foreach ($childpage->settings as $setting) {
if (empty($setting->nosave)) {
$savebutton = true;
}
$fullname = $setting->get_full_name();
if (array_key_exists($fullname, $adminroot->errors)) {
$data = $adminroot->errors[$fullname]->data;
} else {
$data = $setting->get_setting();
}
$outputhtml .= html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
$outputhtml .= $setting->output_html($data);
}
$outputhtml .= html_writer::end_tag('fieldset');
}
} else if ($childpage instanceof admin_category) {
$outputhtml .= $OUTPUT->heading(html_writer::link(new moodle_url('/'.$CFG->admin.'/category.php', array('category' => $childpage->name)), get_string('admincategory', 'admin', $childpage->visiblename)), 3);
} else {
continue;
}
if (!empty($childpage->settings)) {
$outputhtml .= html_writer::start_tag('fieldset', array('class' => 'adminsettings'));
foreach ($childpage->settings as $setting) {
if (empty($setting->nosave)) {
$savebutton = true;
}
$fullname = $setting->get_full_name();
if (array_key_exists($fullname, $adminroot->errors)) {
$data = $adminroot->errors[$fullname]->data;
} else {
$data = $setting->get_setting();
}
$outputhtml .= html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
$outputhtml .= $setting->output_html($data);
}
$outputhtml .= html_writer::end_tag('fieldset');
}
}
if ($savebutton) {
@@ -155,4 +157,4 @@ echo $outputhtml;
echo html_writer::end_tag('fieldset');
echo html_writer::end_tag('form');
echo $OUTPUT->footer();
echo $OUTPUT->footer();
-111
View File
@@ -1,111 +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 hack is intended for clustered sites that do not want
* to use shared cachedir for component cache.
*
* This file needs to be called after any change in PHP files in dataroot,
* that is before upgrade and install.
*
* @package core
* @copyright 2013 Petr Skoda (skodak) {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
define('ABORT_AFTER_CONFIG', true); // We need just the values from config.php.
define('CACHE_DISABLE_ALL', true); // This prevents reading of existing caches.
define('IGNORE_COMPONENT_CACHE', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
// Now get cli options.
list($options, $unrecognized) = cli_get_params(
array(
'file' => false,
'rebuild' => false,
'print' => false,
'help' => false
),
array(
'h' => 'help'
)
);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized), 2);
}
if (!$options['rebuild'] and !$options['file'] and !$options['print']) {
$help =
"Create alternative component cache file
Options:
-h, --help Print out this help
--rebuild Rebuild \$CFG->alternative_component_cache file
--file=filepath Save component cache to file
--print Print component cache file content
Example:
\$ php admin/cli/rebuild_alternative_component_cache.php --rebuild
";
echo $help;
exit(0);
}
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
$content = core_component::get_cache_content();
if ($options['print']) {
echo $content;
exit(0);
}
if ($options['rebuild']) {
if (empty($CFG->alternative_component_cache)) {
fwrite(STDERR, 'config.php does not contain $CFG->alternative_component_cache setting');
fwrite(STDERR, "\n");
exit(2);
}
$target = $CFG->alternative_component_cache;
} else {
$target = $options['file'];
}
if (!$target) {
fwrite(STDERR, "Invalid target file $target");
fwrite(STDERR, "\n");
exit(1);
}
$bytes = file_put_contents($target, $content);
if (!$bytes) {
fwrite(STDERR, "Error writing to $target");
fwrite(STDERR, "\n");
exit(1);
}
// Success.
echo "File $target was updated\n";
exit(0);
+2 -1
View File
@@ -75,7 +75,8 @@ if (!empty($CFG->showcronsql)) {
$DB->set_debug(true);
}
if (!empty($CFG->showcrondebugging)) {
set_debugging(DEBUG_DEVELOPER, true);
$CFG->debug = DEBUG_DEVELOPER;
$CFG->debugdisplay = true;
}
$starttime = microtime();
-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/>.
/**
* This script allows to do backup.
*
* @package core
* @subpackage cli
* @copyright 2013 Lancaster University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', 1);
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php');
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
// Now get cli options.
list($options, $unrecognized) = cli_get_params(array(
'courseid' => false,
'courseshortname' => '',
'destination' => '',
'help' => false,
), array('h' => 'help'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help'] || !($options['courseid'] || $options['courseshortname'])) {
$help = <<<EOL
Perform backup of the given course.
Options:
--courseid=INTEGER Course ID for backup.
--courseshortname=STRING Course shortname for backup.
--destination=STRING Path where to store backup file. If not set the backup
will be stored within the course backup file area.
-h, --help Print out this help.
Example:
\$sudo -u www-data /usr/bin/php admin/cli/backup.php --courseid=2 --destination=/moodle/backup/\n
EOL;
echo $help;
die;
}
$admin = get_admin();
if (!$admin) {
mtrace("Error: No admin account was found");
die;
}
// Do we need to store backup somewhere else?
$dir = rtrim($options['destination'], '/');
if (!empty($dir)) {
if (!file_exists($dir) || !is_dir($dir) || !is_writable($dir)) {
mtrace("Destination directory does not exists or not writable.");
die;
}
}
// Check that the course exists.
if ($options['courseid']) {
$course = $DB->get_record('course', array('id' => $options['courseid']), '*', MUST_EXIST);
} else if ($options['courseshortname']) {
$course = $DB->get_record('course', array('shortname' => $options['courseshortname']), '*', MUST_EXIST);
}
cli_heading('Performing backup...');
$bc = new backup_controller(backup::TYPE_1COURSE, $course->id, backup::FORMAT_MOODLE,
backup::INTERACTIVE_YES, backup::MODE_GENERAL, $admin->id);
// Set the default filename.
$format = $bc->get_format();
$type = $bc->get_type();
$id = $bc->get_id();
$users = $bc->get_plan()->get_setting('users')->get_value();
$anonymised = $bc->get_plan()->get_setting('anonymize')->get_value();
$filename = backup_plan_dbops::get_default_backup_filename($format, $type, $id, $users, $anonymised);
$bc->get_plan()->get_setting('filename')->set_value($filename);
// Execution.
$bc->finish_ui();
$bc->execute_plan();
$results = $bc->get_results();
$file = $results['backup_destination']; // May be empty if file already moved to target location.
// Do we need to store backup somewhere else?
if (!empty($dir)) {
if ($file) {
mtrace("Writing " . $dir.'/'.$filename);
if ($file->copy_content_to($dir.'/'.$filename)) {
$file->delete();
mtrace("Backup completed.");
} else {
mtrace("Destination directory does not exist or is not writable. Leaving the backup in the course backup file area.");
}
}
} else {
mtrace("Backup completed, the new file is listed in the backup area of the given course");
}
$bc->destroy();
exit(0);
-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/>.
/**
* Validate that the current db structure matches the install.xml files.
*
* @package core
* @copyright 2014 Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @author Petr Skoda <petr.skoda@totaralms.com>
*/
define('CLI_SCRIPT', true);
require(__DIR__ . '/../../config.php');
require_once($CFG->libdir.'/clilib.php');
$help = "Validate database structure
Options:
-h, --help Print out this help.
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/check_database_schema.php
";
list($options, $unrecognized) = cli_get_params(
array(
'help' => false,
),
array(
'h' => 'help',
)
);
if ($options['help']) {
echo $help;
exit(0);
}
if (empty($CFG->version)) {
echo "Database is not yet installed.\n";
exit(2);
}
$dbmanager = $DB->get_manager();
$schema = $dbmanager->get_install_xml_schema();
if (!$errors = $dbmanager->check_database_schema($schema)) {
echo "Database structure is ok.\n";
exit(0);
}
foreach ($errors as $table => $items) {
cli_separator();
echo "$table\n";
foreach ($items as $item) {
echo " * $item\n";
}
}
cli_separator();
exit(1);
-125
View File
@@ -1,125 +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 fixed incorrectly deleted users.
*
* @package core
* @subpackage cli
* @copyright 2013 Marina Glancy
* @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');
// Get cli options.
list($options, $unrecognized) = cli_get_params(
array(
'courses' => false,
'fix' => false,
'help' => false
),
array(
'h' => 'help',
'c' => 'courses',
'f' => 'fix'
)
);
if ($options['help'] || empty($options['courses'])) {
$help =
"Checks and fixes that course modules and sections reference each other correctly.
Compares DB fields course_sections.sequence and course_modules.section
checking that:
- course_sections.sequence contains each module id not more than once in the course
- for each moduleid from course_sections.sequence the field course_modules.section
refers to the same section id (this means course_sections.sequence is more
important if they are different)
- each module in the course is present in one of course_sections.sequence
- section sequences do not contain non-existing course modules
If there are any mismatches, the message is displayed. If --fix is specified,
the records in DB are corrected.
This script may run for a long time on big systems if called for all courses.
Avoid executing the script when another user may simultaneously edit any of the
courses being checked (recommended to run in mainenance mode).
Options:
-c, --courses List courses that need to be checked (comma-separated
values or * for all). Required
-f, --fix Fix the mismatches in DB. If not specified check only and
report problems to STDERR
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/fix_course_sequence.php --courses=*
\$sudo -u www-data /usr/bin/php admin/cli/fix_course_sequence.php --courses=2,3,4 --fix
";
echo $help;
die;
}
$courseslist = preg_split('/\s*,\s*/', $options['courses'], -1, PREG_SPLIT_NO_EMPTY);
if (in_array('*', $courseslist)) {
$where = '';
$params = array();
} else {
list($sql, $params) = $DB->get_in_or_equal($courseslist, SQL_PARAMS_NAMED, 'id');
$where = 'WHERE id '. $sql;
}
$coursescount = $DB->get_field_sql('SELECT count(id) FROM {course} '. $where, $params);
if (!$coursescount) {
cli_error('No courses found');
}
echo "Checking $coursescount courses...\n\n";
require_once($CFG->dirroot. '/course/lib.php');
$problems = array();
$courses = $DB->get_fieldset_sql('SELECT id FROM {course} '. $where, $params);
foreach ($courses as $courseid) {
$errors = course_integrity_check($courseid, null, null, true, empty($options['fix']));
if ($errors) {
if (!empty($options['fix'])) {
// Reset the course cache to make sure cache is recalculated next time the course is viewed.
rebuild_course_cache($courseid, true);
}
foreach ($errors as $error) {
cli_problem($error);
}
$problems[] = $courseid;
} else {
echo "Course [$courseid] is OK\n";
}
}
if (!count($problems)) {
echo "\n...All courses are OK\n";
} else {
if (!empty($options['fix'])) {
echo "\n...Found and fixed ".count($problems)." courses with problems". "\n";
} else {
echo "\n...Found ".count($problems)." courses with problems. To fix run:\n";
echo "\$sudo -u www-data /usr/bin/php admin/cli/fix_course_sequence.php --courses=".join(',', $problems)." --fix". "\n";
}
}
-91
View File
@@ -1,91 +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 fixed incorrectly deleted users.
*
* @package core
* @subpackage cli
* @copyright 2013 Petr Skoda (http://skodak.org)
* @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');
// Now get cli options.
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));
}
if ($options['help']) {
$help =
"Fix incorrectly deleted users.
This scripts detects users that are marked as deleted instead
of calling delete_user().
Deleted users do not have original username, idnumber or email,
we must also delete all roles, enrolments, group memberships, etc.
Please note this script does not delete any public information
such as forum posts.
Options:
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/fix_deleted_users.php
";
echo $help;
die;
}
cli_heading('Looking for sloppy user deletes');
// Look for sloppy deleted users where somebody only flipped the deleted flag.
$sql = "SELECT *
FROM {user}
WHERE deleted = 1 AND email LIKE '%@%' AND username NOT LIKE '%@%'";
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $user) {
echo "Redeleting user $user->id: $user->username ($user->email)\n";
delete_user($user);
}
cli_heading('Deleting all leftovers');
$DB->set_field('user', 'idnumber', '', array('deleted'=>1));
$DB->delete_records_select('role_assignments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('cohort_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('groups_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_enrolments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_preferences', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_info_data', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_lastaccess', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('external_tokens', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('external_services_users', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
exit(0);
@@ -1,103 +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 fixes orphaned question categories.
*
* Orphaned question categories have had their associated context deleted
* but the category itself remains in the database with an invalid context.
*
* @package core
* @subpackage cli
* @copyright 2013 Tyler Bannister (tyler.bannister@remote-learner.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.'/questionlib.php');
$long = array('fix' => false, 'help' => false);
$short = array('f' => 'fix', 'h' => 'help');
// Now get cli options.
list($options, $unrecognized) = cli_get_params($long, $short);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
$help =
"Fix orphaned question categories.
This scripts detects question categories that have had their
context deleted, thus severing them from their original purpose.
This script will find the orphaned categories and delete the unused
questions in each category found. Used questions will not be
deleted, instead they will be moved to a rescue question category.
Options:
-h, --help Print out this help
-f, --fix Fix the orphaned question categories in the DB.
If not specified only check and report problems to STDERR.
Example:
\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php
\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php -f
";
echo $help;
die;
}
cli_heading('Checking for orphaned categories');
$sql = 'SELECT qc.id, qc.contextid, qc.name
FROM {question_categories} qc
LEFT JOIN {context} c ON qc.contextid = c.id
WHERE c.id IS NULL';
$categories = $DB->get_recordset_sql($sql);
$i = 0;
foreach ($categories as $category) {
$i += 1;
echo "Found orphaned category: {$category->name}\n";
if (!empty($options['fix'])) {
echo "Cleaning...";
// One transaction per category.
$transaction = $DB->start_delegated_transaction();
question_category_delete_safe($category);
$transaction->allow_commit();
echo " Done!\n";
}
}
if (($i > 0) && !empty($options['fix'])) {
echo "Found and removed {$i} orphaned question categories\n";
} else if ($i > 0) {
echo "Found {$i} orphaned question categories. To fix, run:\n";
echo "\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php --fix\n";
} else {
echo "No orphaned question categories found.\n";
}
$categories->close();
+25 -161
View File
@@ -36,12 +36,6 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
exit(1);
}
// Force OPcache reset if used, we do not want any stale caches
// when preparing test environment.
if (function_exists('opcache_reset')) {
opcache_reset();
}
$help =
"Command line Moodle installer, creates config.php and initializes database.
Please note you must execute this script with the same uid as apache
@@ -64,24 +58,19 @@ Options:
--dbname=NAME Database name. Default is moodle
--dbuser=USERNAME Database user. Default is root
--dbpass=PASSWORD Database password. Default is blank
--dbport=NUMBER Use database port.
--dbsocket=PATH Use database socket, 1 means default. Available for some databases only.
--dbsocket Use database sockets. Available for some databases only.
--prefix=STRING Table prefix for above database tables. Default is mdl_
--fullname=STRING The fullname of the site
--shortname=STRING The shortname of the site
--summary=STRING The summary to be displayed on the front page
--adminuser=USERNAME Username for the moodle admin account. Default is admin
--adminpass=PASSWORD Password for the moodle admin account,
required in non-interactive mode.
--adminemail=STRING Email address for the moodle admin account.
--upgradekey=STRING The upgrade key to be set in the config.php, leave empty to not set it.
--non-interactive No interactive questions, installation fails if any
problem encountered.
--agree-license Indicates agreement with software license,
required in non-interactive mode.
--allow-unstable Install even if the version is not marked as stable yet,
required in non-interactive mode.
--skip-database Stop the installation before installing the database.
-h, --help Print out this help
Example:
@@ -124,11 +113,10 @@ $olddir = getcwd();
chdir(dirname($_SERVER['argv'][0]));
// Servers should define a default timezone in php.ini, but if they don't then make sure something is defined.
if (!function_exists('date_default_timezone_set') or !function_exists('date_default_timezone_get')) {
fwrite(STDERR, "Timezone functions are not available.\n");
exit(1);
// This is a quick hack. Ideally we should ask the admin for a value. See MDL-22625 for more on this.
if (function_exists('date_default_timezone_set') and function_exists('date_default_timezone_get')) {
@date_default_timezone_set(@date_default_timezone_get());
}
date_default_timezone_set(@date_default_timezone_get());
// make sure PHP errors are displayed - helps with diagnosing of problems
@error_reporting(E_ALL);
@@ -139,24 +127,16 @@ date_default_timezone_set(@date_default_timezone_get());
/** Used by library scripts to check they are being called by Moodle */
define('MOODLE_INTERNAL', true);
// Disables all caching.
define('CACHE_DISABLE_ALL', true);
define('PHPUNIT_TEST', false);
define('IGNORE_COMPONENT_CACHE', true);
// Check that PHP is of a sufficient version
if (version_compare(phpversion(), "5.4.4") < 0) {
if (version_compare(phpversion(), "5.3.2") < 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, "Moodle 2.1 or later requires at least PHP 5.3.2 (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(dirname(__FILE__)));
@@ -166,11 +146,6 @@ $CFG->httpswwwroot = $CFG->wwwroot;
$CFG->docroot = 'http://docs.moodle.org';
$CFG->running_installer = true;
$CFG->early_install_lang = true;
$CFG->ostype = (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) ? 'WINDOWS' : 'UNIX';
$CFG->dboptions = array();
$CFG->debug = (E_ALL | E_STRICT);
$CFG->debugdisplay = true;
$CFG->debugdeveloper = true;
$parts = explode('/', str_replace('\\', '/', dirname(dirname(__FILE__))));
$CFG->admin = array_pop($parts);
@@ -179,48 +154,22 @@ $CFG->admin = array_pop($parts);
//the problem is that we need specific version of quickforms and hacked excel files :-(
ini_set('include_path', $CFG->libdir.'/pear' . PATH_SEPARATOR . ini_get('include_path'));
require_once($CFG->libdir.'/classes/component.php');
require_once($CFG->libdir.'/classes/text.php');
require_once($CFG->libdir.'/classes/string_manager.php');
require_once($CFG->libdir.'/classes/string_manager_install.php');
require_once($CFG->libdir.'/classes/string_manager_standard.php');
require_once($CFG->libdir.'/installlib.php');
require_once($CFG->libdir.'/clilib.php');
require_once($CFG->libdir.'/setuplib.php');
require_once($CFG->libdir.'/textlib.class.php');
require_once($CFG->libdir.'/weblib.php');
require_once($CFG->libdir.'/dmllib.php');
require_once($CFG->libdir.'/moodlelib.php');
require_once($CFG->libdir.'/deprecatedlib.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/componentlib.class.php');
require_once($CFG->dirroot.'/cache/lib.php');
// Register our classloader, in theory somebody might want to replace it to load other hacked core classes.
// Required because the database checks below lead to session interaction which is going to lead us to requiring autoloaded classes.
if (defined('COMPONENT_CLASSLOADER')) {
spl_autoload_register(COMPONENT_CLASSLOADER);
} else {
spl_autoload_register('core_component::classloader');
}
require($CFG->dirroot.'/version.php');
$CFG->target_release = $release;
\core\session\manager::init_empty_session();
global $SESSION;
global $USER;
global $COURSE;
$COURSE = new stdClass();
$COURSE->id = 1;
global $SITE;
$SITE = $COURSE;
define('SITEID', 1);
//Database types
$databases = array('mysqli' => moodle_database::get_driver_instance('mysqli', '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
@@ -250,20 +199,15 @@ list($options, $unrecognized) = cli_get_params(
'dbname' => 'moodle',
'dbuser' => empty($distro->dbuser) ? 'root' : $distro->dbuser, // let distros set dbuser
'dbpass' => '',
'dbport' => '',
'dbsocket' => '',
'dbsocket' => false,
'prefix' => 'mdl_',
'fullname' => '',
'shortname' => '',
'summary' => '',
'adminuser' => 'admin',
'adminpass' => '',
'adminemail' => '',
'upgradekey' => '',
'non-interactive' => false,
'agree-license' => false,
'allow-unstable' => false,
'skip-database' => false,
'help' => false
),
array(
@@ -275,8 +219,7 @@ $interactive = empty($options['non-interactive']);
// set up language
$lang = clean_param($options['lang'], PARAM_SAFEDIR);
$languages = get_string_manager()->get_list_of_translations();
if (array_key_exists($lang, $languages)) {
if (file_exists($CFG->dirroot.'/install/lang/'.$lang)) {
$CFG->lang = $lang;
}
@@ -291,41 +234,28 @@ if ($options['help']) {
}
//Print header
cli_logo();
echo PHP_EOL;
echo get_string('cliinstallheader', 'install', $CFG->target_release)."\n";
//Fist select language
if ($interactive) {
cli_separator();
$languages = get_string_manager()->get_list_of_translations();
// Do not put the langs into columns because it is not compatible with RTL.
$langlist = implode("\n", $languages);
$default = $CFG->lang;
cli_heading(get_string('chooselanguagehead', 'install'));
if (array_key_exists($default, $languages)) {
echo $default.' - '.$languages[$default]."\n";
}
if ($default !== 'en') {
echo 'en - English (en)'."\n";
}
echo '? - '.get_string('availablelangs', 'install')."\n";
cli_heading(get_string('availablelangs', 'install'));
echo $langlist."\n";
$prompt = get_string('clitypevaluedefault', 'admin', $CFG->lang);
$error = '';
do {
echo $error;
$input = cli_input($prompt, $default);
$input = clean_param($input, PARAM_SAFEDIR);
if ($input === '?') {
echo implode("\n", $languages)."\n";
$error = "\n";
if (!file_exists($CFG->dirroot.'/install/lang/'.$input)) {
$error = get_string('cliincorrectvalueretry', 'admin')."\n";
} else {
$input = clean_param($input, PARAM_SAFEDIR);
if (!array_key_exists($input, $languages)) {
$error = get_string('cliincorrectvalueretry', 'admin')."\n";
} else {
$error = '';
}
$error = '';
}
} while ($error !== '');
$CFG->lang = $input;
@@ -359,8 +289,6 @@ if ($interactive) {
}
}
$CFG->directorypermissions = $chmod;
$CFG->filepermissions = ($CFG->directorypermissions & 0666);
$CFG->umaskpermissions = (($CFG->directorypermissions & 0777) ^ 0777);
//We need wwwroot before we test dataroot
$wwwroot = clean_param($options['wwwroot'], PARAM_URL);
@@ -447,9 +375,8 @@ if ($interactive) {
cli_error(get_string('pathserrcreatedataroot', 'install', $a));
}
}
$CFG->tempdir = $CFG->dataroot.'/temp';
$CFG->cachedir = $CFG->dataroot.'/cache';
$CFG->localcachedir = $CFG->dataroot.'/localcache';
$CFG->tempdir = $CFG->dataroot.'/temp';
$CFG->cachedir = $CFG->dataroot.'/cache';
// download required lang packs
if ($CFG->lang !== 'en') {
@@ -565,34 +492,6 @@ if ($interactive) {
$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();
@@ -621,14 +520,14 @@ if ($interactive) {
$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);
$distro = distro_pre_create_db($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbsocket'=>$options['dbsocket']), $distro);
}
$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']));
$hint_database = install_db_validate($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbsocket'=>$options['dbsocket']));
} while ($hint_database !== '');
} 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']));
$hint_database = install_db_validate($database, $CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->prefix, array('dbpersist'=>0, 'dbsocket'=>$options['dbsocket']));
if ($hint_database !== '') {
cli_error(get_string('dbconnectionerror', 'install'));
}
@@ -710,38 +609,6 @@ if ($interactive) {
}
}
// 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();
cli_heading(get_string('upgradekeyset', 'admin'));
if ($options['upgradekey'] !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $options['upgradekey']);
$options['upgradekey'] = cli_input($prompt, $options['upgradekey']);
} else {
$prompt = get_string('clitypevalue', 'admin');
$options['upgradekey'] = cli_input($prompt);
}
}
// Set the upgrade key if it was provided.
if ($options['upgradekey'] !== '') {
$CFG->upgradekey = $options['upgradekey'];
}
if ($interactive) {
if (!$options['agree-license']) {
cli_separator();
@@ -800,17 +667,14 @@ if (!$envstatus) {
}
// Test plugin dependencies.
require_once($CFG->libdir . '/pluginlib.php');
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
if (!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'));
}
if (!$options['skip-database']) {
install_cli_database($options, $interactive);
} else {
echo get_string('cliskipdatabase', 'install')."\n";
}
install_cli_database($options, $interactive);
echo get_string('cliinstallfinished', 'install')."\n";
exit(0); // 0 means success
+4 -18
View File
@@ -29,19 +29,12 @@
*/
define('CLI_SCRIPT', true);
define('CACHE_DISABLE_ALL', true);
// extra execution prevention - we can not just require config.php here
if (isset($_SERVER['REMOTE_ADDR'])) {
exit(1);
}
// Force OPcache reset if used, we do not want any stale caches
// when preparing test environment.
if (function_exists('opcache_reset')) {
opcache_reset();
}
$help =
"Advanced command line Moodle database installer.
Please note you must execute this script with the same uid as apache.
@@ -52,7 +45,6 @@ Options:
--lang=CODE Installation and default site language. Default is en.
--adminuser=USERNAME Username for the moodle admin account. Default is admin.
--adminpass=PASSWORD Password for the moodle admin account.
--adminemail=STRING Email address for the moodle admin account.
--agree-license Indicates agreement with software license.
--fullname=STRING Name of the site
--shortname=STRING Name of the site
@@ -63,10 +55,10 @@ Example:
";
// Check that PHP is of a sufficient version
if (version_compare(phpversion(), "5.4.4") < 0) {
if (version_compare(phpversion(), "5.3.2") < 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, "Moodle 2.1 or later requires at least PHP 5.3.2 (currently using version $phpversion).\n");
fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
exit(1);
}
@@ -103,7 +95,6 @@ list($options, $unrecognized) = cli_get_params(
'lang' => 'en',
'adminuser' => 'admin',
'adminpass' => '',
'adminemail' => '',
'fullname' => '',
'shortname' => '',
'agree-license' => false,
@@ -128,12 +119,6 @@ if ($options['adminpass'] === true or $options['adminpass'] === '') {
cli_error('You have to specify admin password. --help prints out the help'); // TODO: localize
}
// 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));
}
$options['lang'] = clean_param($options['lang'], PARAM_SAFEDIR);
if (!file_exists($CFG->dirroot.'/install/lang/'.$options['lang'])) {
$options['lang'] = 'en';
@@ -175,8 +160,9 @@ if (!$envstatus) {
}
// Test plugin dependencies.
require_once($CFG->libdir . '/pluginlib.php');
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
if (!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'));
}
+10 -46
View File
@@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -15,7 +16,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Enable or disable maintenance mode.
* Enable or disable maintenance mode
*
* @package core
* @subpackage cli
@@ -25,13 +26,12 @@
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once("$CFG->libdir/clilib.php");
require_once("$CFG->libdir/adminlib.php");
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
// Now get cli options.
list($options, $unrecognized) = cli_get_params(array('enable'=>false, 'enablelater'=>0, 'enableold'=>false, 'disable'=>false, 'help'=>false),
// now get cli options
list($options, $unrecognized) = cli_get_params(array('enable'=>false, 'disable'=>false, 'help'=>false),
array('h'=>'help'));
if ($unrecognized) {
@@ -45,14 +45,12 @@ if ($options['help']) {
Current status displayed if not option specified.
Options:
--enable Enable CLI maintenance mode
--enablelater=MINUTES Number of minutes before entering CLI maintenance mode
--enableold Enable legacy half-maintenance mode
--enable Enable maintenance mode
--disable Disable maintenance mode
-h, --help Print out this help
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/maintenance.php
\$sudo -u www-data /usr/bin/php admin/cli/maintenance.php
"; //TODO: localize - to be translated later when everything is finished
echo $help;
@@ -61,52 +59,18 @@ Example:
cli_heading(get_string('sitemaintenancemode', 'admin')." ($CFG->wwwroot)");
if ($options['enablelater']) {
if (file_exists("$CFG->dataroot/climaintenance.html")) {
// Already enabled, sorry.
echo get_string('clistatusenabled', 'admin')."\n";
return 1;
}
$time = time() + ($options['enablelater']*60);
set_config('maintenance_later', $time);
echo get_string('clistatusenabledlater', 'admin', userdate($time))."\n";
return 0;
} else if ($options['enable']) {
if (file_exists("$CFG->dataroot/climaintenance.html")) {
// The maintenance is already enabled, nothing to do.
} else {
enable_cli_maintenance_mode();
}
set_config('maintenance_enabled', 0);
unset_config('maintenance_later');
echo get_string('sitemaintenanceoncli', 'admin')."\n";
exit(0);
} else if ($options['enableold']) {
if ($options['enable']) {
set_config('maintenance_enabled', 1);
unset_config('maintenance_later');
echo get_string('sitemaintenanceon', 'admin')."\n";
exit(0);
} else if ($options['disable']) {
set_config('maintenance_enabled', 0);
unset_config('maintenance_later');
if (file_exists("$CFG->dataroot/climaintenance.html")) {
unlink("$CFG->dataroot/climaintenance.html");
}
echo get_string('sitemaintenanceoff', 'admin')."\n";
exit(0);
}
if (!empty($CFG->maintenance_enabled) or file_exists("$CFG->dataroot/climaintenance.html")) {
if (!empty($CFG->maintenance_enabled)) {
echo get_string('clistatusenabled', 'admin')."\n";
} else if (isset($CFG->maintenance_later)) {
echo get_string('clistatusenabledlater', 'admin', userdate($CFG->maintenance_later))."\n";
} else {
echo get_string('clistatusdisabled', 'admin')."\n";
}
-202
View File
@@ -1,202 +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/>.
/**
* MySQL table row compression tool tool.
*
* @package core
* @copyright 2014 Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @author Petr Skoda <petr.skoda@totaralms.com>
*/
define('CLI_SCRIPT', true);
require(dirname(__FILE__).'/../../config.php');
require_once($CFG->libdir . '/clilib.php');
if ($DB->get_dbfamily() !== 'mysql') {
cli_error('This script is used for MySQL databases only.');
}
$engine = strtolower($DB->get_dbengine());
if ($engine !== 'innodb' and $engine !== 'xtradb') {
cli_error('This script is for MySQL servers using InnoDB or XtraDB engines only.');
}
list($options, $unrecognized) = cli_get_params(
array('help' => false, 'info' => false, 'list' => false, 'fix' => false, 'showsql' => false),
array('h' => 'help', 'i' => 'info', 'l' => 'list', 'f' => 'fix', 's' => 'showsql')
);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
$help =
"Script for detection of row size problems in MySQL InnoDB tables.
By default InnoDB storage table is using legacy Antelope file format
which has major restriction on database row size.
Use this script to detect and fix database tables with potential data
overflow problems.
Options:
-i, --info Show database information
-l, --list List problematic tables
-f, --fix Attempt to fix all tables (requires SUPER privilege)
-s, --showsql Print SQL statements for fixing of tables
-h, --help Print out this help
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/mysql_compressed_rows.php -l
";
/** @var mysql_sql_generator $generator */
$generator = $DB->get_manager()->generator;
$info = $DB->get_server_info();
$filepertable = $DB->get_record_sql("SHOW VARIABLES LIKE 'innodb_file_per_table'");
$filepertable = $filepertable ? $filepertable->value : '';
$fileformat = $DB->get_record_sql("SHOW VARIABLES LIKE 'innodb_file_format'");
$fileformat = $fileformat ? $fileformat->value : '';
$prefix = $DB->get_prefix();
$database = $CFG->dbname;
if (!empty($options['info'])) {
echo "Database version: " . $info['description'] . "\n";
echo "Database name: $database\n";
echo "Database engine: " . $DB->get_dbengine() . "\n";
echo "innodb_file_per_table: $filepertable\n";
echo "innodb_file_format: $fileformat\n";
exit(0);
} else if (!empty($options['list'])) {
$problem = false;
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
$size = $generator->guess_antelope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
}
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT);
echo str_pad($format, 11, ' ', STR_PAD_RIGHT);
if ($format === 'Compact' or $format === 'Redundant') {
$problem = true;
echo " (needs fixing)\n";
} else if ($format !== 'Compressed' and $format !== 'Dynamic') {
echo " (unknown)\n";
} else {
echo "\n";
}
}
if ($problem) {
exit(1);
}
exit(0);
} else if (!empty($options['fix'])) {
$fixtables = array();
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
$size = $generator->guess_antelope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
}
if ($format === 'Compact' or $format === 'Redundant') {
$fixtables[$table] = $table;
}
}
if (!$fixtables) {
echo "No changes necessary\n";
exit(0);
}
if ($filepertable !== 'ON') {
try {
$DB->execute("SET GLOBAL innodb_file_per_table=1");
} catch (dml_exception $e) {
echo "Cannot enable GLOBAL innodb_file_per_table setting, use --showsql option and execute the statements manually.";
throw $e;
}
}
if ($fileformat !== 'Barracuda') {
try {
$DB->execute("SET GLOBAL innodb_file_format=Barracuda");
} catch (dml_exception $e) {
echo "Cannot change GLOBAL innodb_file_format setting, use --showsql option and execute the statements manually.";
throw $e;
}
}
if (!$DB->is_compressed_row_format_supported(false)) {
echo "MySQL server is not compatible with compressed row format.";
exit(1);
}
foreach ($fixtables as $table) {
$DB->change_database_structure("ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed");
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT) . " ... Compressed\n";
}
exit(0);
} else if (!empty($options['showsql'])) {
$fixtables = array();
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
$size = $generator->guess_antelope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
}
if ($format === 'Compact' or $format === 'Redundant') {
$fixtables[$table] = $table;
}
}
if (!$fixtables) {
echo "No changes necessary\n";
exit(0);
}
echo "Copy the following SQL statements and execute them using account with SUPER privilege:\n\n";
echo "USE $database;\n";
echo "SET SESSION sql_mode=STRICT_ALL_TABLES;\n";
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 "\n";
exit(0);
} else {
echo $help;
die;
}
+6 -6
View File
@@ -51,25 +51,25 @@ Options:
Example:
\$sudo -u www-data /usr/bin/php admin/cli/reset_password.php
";
"; //TODO: localize - to be translated later when everything is finished
echo $help;
die;
}
cli_heading('Password reset');
$prompt = "Enter username (manual authentication only)";
cli_heading('Password reset'); // TODO: localize
$prompt = "enter username (manual authentication only)"; // TODO: localize
$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'");
}
$prompt = "Enter new password";
$prompt = "Enter new password"; // TODO: localize
$password = cli_input($prompt);
$errmsg = '';//prevent eclipse warning
if (!check_password_policy($password, $errmsg)) {
cli_error(html_to_text($errmsg, 0));
cli_error($errmsg);
}
$hashedpassword = hash_internal_user_password($password);
@@ -78,4 +78,4 @@ $DB->set_field('user', 'password', $hashedpassword, array('id'=>$user->id));
echo "Password changed\n";
exit(0); // 0 means success.
exit(0); // 0 means success
+6 -26
View File
@@ -29,39 +29,27 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Force OPcache reset if used, we do not want any stale caches
// when detecting if upgrade necessary or when running upgrade.
if (function_exists('opcache_reset') and !isset($_SERVER['REMOTE_ADDR'])) {
opcache_reset();
}
define('CLI_SCRIPT', true);
define('CACHE_DISABLE_ALL', true);
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');
require_once($CFG->libdir.'/pluginlib.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
'help' => false
),
array(
'h' => 'help'
)
);
if ($options['lang']) {
$SESSION->lang = $options['lang'];
}
$interactive = empty($options['non-interactive']);
if ($unrecognized) {
@@ -80,10 +68,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.
-h, --help Print out this help
Example:
@@ -126,7 +110,7 @@ if (!$envstatus) {
// Test plugin dependencies.
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
if (!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'));
}
@@ -166,12 +150,6 @@ if ($interactive) {
}
if ($version > $CFG->version) {
// 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.
// This is the only way we can purge custom caches such as memcache or APC.
// Note: all other calls to caches will still used the disabled API.
cache_helper::purge_all(true);
upgrade_core($version, true);
}
set_config('release', $release);
@@ -181,7 +159,9 @@ set_config('branch', $branch);
upgrade_noncore(true);
// log in as admin - we need doanything permission when applying defaults
\core\session\manager::set_user(get_admin());
$admins = get_admins();
$admin = reset($admins);
session_set_user($admin);
// apply all default settings, just in case do it twice to fill all defaults
admin_apply_default_settings(NULL, false);
-83
View File
@@ -1,83 +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 course formats
*
* @package core_admin
* @copyright 2012 Marina Glancy
* @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);
$formatname = required_param('format', PARAM_PLUGIN);
$syscontext = context_system::instance();
$PAGE->set_url('/admin/courseformats.php');
$PAGE->set_context($syscontext);
require_login();
require_capability('moodle/site:config', $syscontext);
require_sesskey();
$return = new moodle_url('/admin/settings.php', array('section' => 'manageformats'));
$formatplugins = core_plugin_manager::instance()->get_plugins_of_type('format');
$sortorder = array_flip(array_keys($formatplugins));
if (!isset($formatplugins[$formatname])) {
print_error('courseformatnotfound', 'error', $return, $formatname);
}
switch ($action) {
case 'disable':
if ($formatplugins[$formatname]->is_enabled()) {
if (get_config('moodlecourse', 'format') === $formatname) {
print_error('cannotdisableformat', 'error', $return);
}
set_config('disabled', 1, 'format_'. $formatname);
core_plugin_manager::reset_caches();
}
break;
case 'enable':
if (!$formatplugins[$formatname]->is_enabled()) {
unset_config('disabled', 'format_'. $formatname);
core_plugin_manager::reset_caches();
}
break;
case 'up':
if ($sortorder[$formatname]) {
$currentindex = $sortorder[$formatname];
$seq = array_keys($formatplugins);
$seq[$currentindex] = $seq[$currentindex-1];
$seq[$currentindex-1] = $formatname;
set_config('format_plugins_sortorder', implode(',', $seq));
}
break;
case 'down':
if ($sortorder[$formatname] < count($sortorder)-1) {
$currentindex = $sortorder[$formatname];
$seq = array_keys($formatplugins);
$seq[$currentindex] = $seq[$currentindex+1];
$seq[$currentindex+1] = $formatname;
set_config('format_plugins_sortorder', implode(',', $seq));
}
break;
}
redirect($return);
+16 -2
View File
@@ -53,7 +53,7 @@ require_once($CFG->libdir.'/clilib.php');
require_once($CFG->libdir.'/cronlib.php');
// extra safety
\core\session\manager::write_close();
session_get_instance()->write_close();
// check if execution allowed
if (!empty($CFG->cronclionly)) {
@@ -72,10 +72,24 @@ if (!empty($CFG->cronremotepassword)) {
}
// send mime type and encoding
@header('Content-Type: text/plain; charset=utf-8');
if (check_browser_version('MSIE')) {
//ugly IE hack to work around downloading instead of viewing
@header('Content-Type: text/html; charset=utf-8');
echo "<xmp>"; //<pre> is not good enough for us here
} else {
//send proper plaintext header
@header('Content-Type: text/plain; charset=utf-8');
}
// we do not want html markup in emulated CLI
@ini_set('html_errors', 'off');
// execute the cron
cron_run();
// finish the IE hack
if (check_browser_version('MSIE')) {
echo "</xmp>";
}
-82
View File
@@ -1,82 +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_login();
require_capability('moodle/site:config', $syscontext);
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);
+4 -10
View File
@@ -8,18 +8,14 @@ require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$editor = required_param('editor', PARAM_PLUGIN);
$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_login();
require_capability('moodle/site:config', context_system::instance());
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageeditors";
$action = optional_param('action', '', PARAM_ACTION);
$editor = optional_param('editor', '', PARAM_PLUGIN);
// get currently installed and enabled auth plugins
$available_editors = editors_get_available();
if (!empty($editor) and empty($available_editors[$editor])) {
@@ -82,7 +78,6 @@ switch ($action) {
}
}
break;
default:
break;
}
@@ -93,7 +88,6 @@ if (empty($active_editors)) {
}
set_config('texteditors', implode(',', $active_editors));
core_plugin_manager::reset_caches();
if ($return) {
redirect ($returnurl);
+21 -27
View File
@@ -23,12 +23,10 @@
* @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);
$action = required_param('action', PARAM_ACTION);
$enrol = required_param('enrol', PARAM_PLUGIN);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
@@ -36,7 +34,7 @@ $PAGE->set_url('/admin/enrol.php');
$PAGE->set_context(context_system::instance());
require_login();
require_capability('moodle/site:config', context_system::instance());
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
require_sesskey();
$enabled = enrol_get_plugins(true);
@@ -50,7 +48,6 @@ switch ($action) {
case 'disable':
unset($enabled[$enrol]);
set_config('enrol_plugins_enabled', implode(',', array_keys($enabled)));
core_plugin_manager::reset_caches();
$syscontext->mark_dirty(); // resets all enrol caches
break;
@@ -61,7 +58,6 @@ switch ($action) {
$enabled = array_keys($enabled);
$enabled[] = $enrol;
set_config('enrol_plugins_enabled', implode(',', $enabled));
core_plugin_manager::reset_caches();
$syscontext->mark_dirty(); // resets all enrol caches
break;
@@ -97,36 +93,34 @@ switch ($action) {
set_config('enrol_plugins_enabled', implode(',', $enabled));
break;
case 'migrate':
case 'uninstall':
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('enrolments', 'enrol'));
if (get_string_manager()->string_exists('pluginname', 'enrol_'.$enrol)) {
$strplugin = get_string('pluginname', 'enrol_'.$enrol);
} else {
$strplugin = $enrol;
}
$PAGE->set_title($strplugin);
echo $OUTPUT->header();
if (!$confirm) {
$uurl = new moodle_url('/admin/enrol.php', array('action'=>'uninstall', 'enrol'=>$enrol, 'sesskey'=>sesskey(), 'confirm'=>1));
echo $OUTPUT->confirm(get_string('uninstallconfirm', 'enrol', $strplugin), $uurl, $return);
echo $OUTPUT->footer();
exit;
// This may take a long time.
core_php_time_limit::raise();
} else { // Delete everything!!
uninstall_plugin('enrol', $enrol);
$syscontext->mark_dirty(); // resets all enrol caches
// Disable plugin to prevent concurrent cron execution.
unset($enabled[$enrol]);
set_config('enrol_plugins_enabled', implode(',', array_keys($enabled)));
echo $OUTPUT->heading(get_string('uninstallmigrating', 'enrol', 'enrol_'.$enrol));
require_once("$CFG->dirroot/enrol/manual/locallib.php");
enrol_manual_migrate_plugin_enrolments($enrol);
echo $OUTPUT->notification(get_string('success'), 'notifysuccess');
if (!$return = core_plugin_manager::instance()->get_uninstall_url('enrol_'.$enrol, 'manage')) {
$return = new moodle_url('/admin/plugins.php');
$a = new stdClass();
$a->plugin = $strplugin;
$a->directory = "$CFG->dirroot/enrol/$enrol";
echo $OUTPUT->notification(get_string('uninstalldeletefiles', 'enrol', $a), 'notifysuccess');
echo $OUTPUT->continue_button($return);
echo $OUTPUT->footer();
exit;
}
echo $OUTPUT->continue_button($return);
echo $OUTPUT->footer();
exit;
}
+4 -4
View File
@@ -33,7 +33,7 @@ require_once($CFG->libdir.'/environmentlib.php');
require_once($CFG->libdir.'/componentlib.class.php');
// Parameters
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$action = optional_param('action', '', PARAM_ACTION);
$version = optional_param('version', '', PARAM_FILE); //
$extraurlparams = array();
@@ -45,7 +45,7 @@ admin_externalpage_setup('environment', '', $extraurlparams);
// Handle the 'updatecomponent' action
if ($action == 'updatecomponent' && confirm_sesskey()) {
// Create component installer and execute it
if ($cd = new component_installer('https://download.moodle.org',
if ($cd = new component_installer('http://download.moodle.org',
'environment',
'environment.zip')) {
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
@@ -53,7 +53,7 @@ if ($action == 'updatecomponent' && confirm_sesskey()) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new stdClass();
$a->url = 'https://download.moodle.org/environment/environment.zip';
$a->url = 'http://download.moodle.org/environment/environment.zip';
$a->dest = $CFG->dataroot . '/';
print_error($cd->get_error(), 'error', $PAGE->url, $a);
die();
@@ -102,7 +102,7 @@ if ($contents = load_environment_xml()) {
}
// Get the results of the environment check.
list($envstatus, $environment_results) = check_moodle_environment($version, ENV_SELECT_NEWER);
list($envstatus, $environment_results) = check_moodle_environment($version);
// Display the page.
$output = $PAGE->get_renderer('core', 'admin');
+20 -1092
View File
File diff suppressed because it is too large Load Diff
+204 -170
View File
@@ -1,232 +1,261 @@
<?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/>.
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.org //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
// //
// This program 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 2 of the License, or //
// (at your option) any later version. //
// //
// This program 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: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
/**
* Filter management page.
* Processes actions from the admin_setting_managefilters object (defined in
* adminlib.php).
*
* @package core
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package administration
*//** */
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir . '/adminlib.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);
$action = optional_param('action', '', PARAM_ACTION);
$filterpath = optional_param('filterpath', '', PARAM_PATH);
require_login();
$systemcontext = context_system::instance();
require_capability('moodle/site:config', $systemcontext);
require_login();
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $systemcontext);
admin_externalpage_setup('managefilters');
$returnurl = "$CFG->wwwroot/$CFG->admin/filters.php";
admin_externalpage_setup('managefilters');
// Clean up bogus filter states first.
$plugininfos = core_plugin_manager::instance()->get_plugins_of_type('filter');
$filters = array();
$states = filter_get_global_states();
foreach ($states as $state) {
if (!isset($plugininfos[$state->filter]) and !get_config('filter_'.$state->filter, 'version')) {
// Purge messy leftovers after incorrectly uninstalled plugins and unfinished installs.
$DB->delete_records('filter_active', array('filter' => $state->filter));
$DB->delete_records('filter_config', array('filter' => $state->filter));
error_log('Deleted bogus "filter_'.$state->filter.'" states and config data.');
} else {
$filters[$state->filter] = $state;
$filters = filter_get_global_states();
// In case any new filters have been installed, but not put in the table yet.
$fitlernames = filter_get_all_installed();
$newfilters = $fitlernames;
foreach ($filters as $filter => $notused) {
unset($newfilters[$filter]);
}
}
// Add properly installed and upgraded filters to the global states table.
foreach ($plugininfos as $filter => $info) {
if (isset($filters[$filter])) {
continue;
}
/** @var \core\plugininfo\base $info */
if ($info->is_installed_and_upgraded()) {
filter_set_global_state($filter, TEXTFILTER_DISABLED);
$states = filter_get_global_states();
foreach ($states as $state) {
if ($state->filter === $filter) {
$filters[$filter] = $state;
break;
}
/// Process actions ============================================================
if ($action) {
if (!isset($filters[$filterpath]) && !isset($newfilters[$filterpath])) {
throw new moodle_exception('filternotinstalled', 'error', $returnurl, $filterpath);
}
if (!confirm_sesskey()) {
redirect($returnurl);
}
}
}
if ($action) {
require_sesskey();
}
// Process actions.
switch ($action) {
switch ($action) {
case 'setstate':
if (isset($filters[$filterpath]) and $newstate = optional_param('newstate', '', PARAM_INT)) {
if ($newstate = optional_param('newstate', '', PARAM_INTEGER)) {
filter_set_global_state($filterpath, $newstate);
if ($newstate == TEXTFILTER_DISABLED) {
filter_set_applies_to_strings($filterpath, false);
}
unset($newfilters[$filterpath]);
}
break;
case 'setapplyto':
if (isset($filters[$filterpath])) {
$applytostrings = optional_param('stringstoo', false, PARAM_BOOL);
filter_set_applies_to_strings($filterpath, $applytostrings);
}
$applytostrings = optional_param('stringstoo', false, PARAM_BOOL);
filter_set_applies_to_strings($filterpath, $applytostrings);
break;
case 'down':
if (isset($filters[$filterpath])) {
filter_set_global_state($filterpath, $filters[$filterpath]->active, 1);
$oldpos = $filters[$filterpath]->sortorder;
if ($oldpos <= count($filters)) {
filter_set_global_state($filterpath, $filters[$filterpath]->active, $oldpos + 1);
}
}
break;
case 'up':
if (isset($filters[$filterpath])) {
$oldpos = $filters[$filterpath]->sortorder;
filter_set_global_state($filterpath, $filters[$filterpath]->active, -1);
if ($oldpos >= 1) {
filter_set_global_state($filterpath, $filters[$filterpath]->active, $oldpos - 1);
}
}
break;
}
// Reset caches and return.
if ($action) {
reset_text_filters_cache();
core_plugin_manager::reset_caches();
redirect(new moodle_url('/admin/filters.php'));
}
case 'delete':
if (!empty($filternames[$filterpath])) {
$filtername = $filternames[$filterpath];
} else {
$filtername = $filterpath;
}
// Print the page heading.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('filtersettings', 'admin'));
if (substr($filterpath, 0, 4) == 'mod/') {
$mod = basename($filterpath);
$a = new stdClass;
$a->filter = $filtername;
$a->module = get_string('modulename', $mod);
print_error('cannotdeletemodfilter', 'admin', $returnurl, $a);
}
$states = filter_get_global_states();
$stringfilters = filter_get_string_filters();
// If not yet confirmed, display a confirmation message.
if (!optional_param('confirm', '', PARAM_BOOL)) {
$title = get_string('deletefilterareyousure', 'admin', $filtername);
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
$table = new html_table();
$table->head = array(get_string('filter'), get_string('isactive', 'filters'),
get_string('order'), get_string('applyto', 'filters'), get_string('settings'), get_string('uninstallplugin', 'core_admin'));
$table->colclasses = array ('leftalign', 'leftalign', 'centeralign', 'leftalign', 'leftalign', 'leftalign');
$table->attributes['class'] = 'admintable generaltable';
$table->id = 'filterssetting';
$table->data = array();
$linkcontinue = new moodle_url($returnurl, array('action' => 'delete', 'filterpath' => $filterpath, 'confirm' => 1));
$formcancel = new single_button(new moodle_url($returnurl), get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('deletefilterareyousuremessage', 'admin', $filtername), $linkcontinue, $formcancel);
echo $OUTPUT->footer();
exit;
}
$lastactive = null;
foreach ($states as $state) {
if ($state->active != TEXTFILTER_DISABLED) {
$lastactive = $state->filter;
// Do the deletion.
$title = get_string('deletingfilter', 'admin', $filtername);
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
// Delete all data for this plugin.
filter_delete_all_for_filter($filterpath);
$a = new stdClass;
$a->filter = $filtername;
$a->directory = $filterpath;
echo $OUTPUT->box(get_string('deletefilterfiles', 'admin', $a), 'generalbox', 'notice');
echo $OUTPUT->continue_button($returnurl);
echo $OUTPUT->footer();
exit;
}
}
// Iterate through filters adding to display table.
$firstrow = true;
foreach ($states as $state) {
$filter = $state->filter;
if (!isset($plugininfos[$filter])) {
continue;
// Add any missing filters to the DB table.
foreach ($newfilters as $filter => $notused) {
filter_set_global_state($filter, TEXTFILTER_DISABLED);
}
$plugininfo = $plugininfos[$filter];
$applytostrings = isset($stringfilters[$filter]) && $state->active != TEXTFILTER_DISABLED;
$row = get_table_row($plugininfo, $state, $firstrow, $filter == $lastactive, $applytostrings);
$table->data[] = $row;
if ($state->active == TEXTFILTER_DISABLED) {
// Reset caches and return
if ($action) {
reset_text_filters_cache();
redirect($returnurl);
}
/// End of process actions =====================================================
/// Print the page heading.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('filtersettings', 'admin'));
$activechoices = array(
TEXTFILTER_DISABLED => get_string('disabled', 'filters'),
TEXTFILTER_OFF => get_string('offbutavailable', 'filters'),
TEXTFILTER_ON => get_string('on', 'filters'),
);
$applytochoices = array(
0 => get_string('content', 'filters'),
1 => get_string('contentandheadings', 'filters'),
);
$filters = filter_get_global_states();
// In case any new filters have been installed, but not put in the table yet.
$filternames = filter_get_all_installed();
$newfilters = $filternames;
foreach ($filters as $filter => $notused) {
unset($newfilters[$filter]);
}
$stringfilters = filter_get_string_filters();
$table = new html_table();
$table->head = array(get_string('filter'), get_string('isactive', 'filters'),
get_string('order'), get_string('applyto', 'filters'), get_string('settings'), get_string('delete'));
$table->align = array('left', 'left', 'center', 'left', 'left');
$table->width = '100%';
$table->data = array();
$lastactive = null;
foreach ($filters as $filter => $filterinfo) {
if ($filterinfo->active != TEXTFILTER_DISABLED) {
$lastactive = $filter;
}
}
// iterate through filters adding to display table
$firstrow = true;
foreach ($filters as $filter => $filterinfo) {
$applytostrings = isset($stringfilters[$filter]) && $filterinfo->active != TEXTFILTER_DISABLED;
$row = get_table_row($filterinfo, $firstrow, $filter == $lastactive, $applytostrings);
$table->data[] = $row;
if ($filterinfo->active == TEXTFILTER_DISABLED) {
$table->rowclasses[] = 'dimmed_text';
} else {
$table->rowclasses[] = '';
}
$firstrow = false;
}
foreach ($newfilters as $filter => $filtername) {
$filterinfo = new stdClass;
$filterinfo->filter = $filter;
$filterinfo->active = TEXTFILTER_DISABLED;
$row = get_table_row($filterinfo, false, false, false);
$table->data[] = $row;
$table->rowclasses[] = 'dimmed_text';
} else {
$table->rowclasses[] = '';
}
$firstrow = false;
}
echo html_writer::table($table);
echo '<p class="filtersettingnote">' . get_string('filterallwarning', 'filters') . '</p>';
echo $OUTPUT->footer();
die;
echo html_writer::table($table);
echo '<p class="filtersettingnote">' . get_string('filterallwarning', 'filters') . '</p>';
echo $OUTPUT->footer();
/// Display helper functions ===================================================
/**
* Return action URL.
*
* @param string $filterpath
* @param string $action
* @return moodle_url
*/
function filters_action_url($filterpath, $action) {
if ($action === 'delete') {
return core_plugin_manager::instance()->get_uninstall_url('filter_'.$filterpath, 'manage');
}
return new moodle_url('/admin/filters.php', array('sesskey'=>sesskey(), 'filterpath'=>$filterpath, 'action'=>$action));
}
/**
* Construct table record.
*
* @param \core\plugininfo\filter $plugininfo
* @param stdClass $state
* @param bool $isfirstrow
* @param bool $islastactive
* @param bool $applytostrings
* @return array data
*/
function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow, $islastactive, $applytostrings) {
global $OUTPUT;
function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings) {
global $CFG, $OUTPUT, $activechoices, $applytochoices, $filternames; //TODO: this is sloppy coding style!!
$row = array();
$filter = $state->filter;
$active = $plugininfo->is_installed_and_upgraded();
$filter = $filterinfo->filter;
static $activechoices;
static $applytochoices;
if (!isset($activechoices)) {
$activechoices = array(
TEXTFILTER_DISABLED => get_string('disabled', 'core_filters'),
TEXTFILTER_OFF => get_string('offbutavailable', 'core_filters'),
TEXTFILTER_ON => get_string('on', 'core_filters'),
);
$applytochoices = array(
0 => get_string('content', 'core_filters'),
1 => get_string('contentandheadings', 'core_filters'),
);
// Filter name
if (!empty($filternames[$filter])) {
$row[] = $filternames[$filter];
} else {
$row[] = '<span class="error">' . get_string('filemissing', '', $filter) . '</span>';
}
// Filter name.
$displayname = $plugininfo->displayname;
if (!$plugininfo->rootdir) {
$displayname = '<span class="error">' . $displayname . ' - ' . get_string('status_missing', 'core_plugin') . '</span>';
} else if (!$active) {
$displayname = '<span class="error">' . $displayname . ' - ' . get_string('error') . '</span>';
}
$row[] = $displayname;
// Disable/off/on.
$select = new single_select(filters_action_url($filter, 'setstate'), 'newstate', $activechoices, $state->active, null, 'active' . $filter);
// Disable/off/on
$select = new single_select(filters_action_url($filter, 'setstate'), 'newstate', $activechoices, $filterinfo->active, null, 'active' . basename($filter));
$select->set_label(get_string('isactive', 'filters'), array('class' => 'accesshide'));
$row[] = $OUTPUT->render($select);
// Re-order.
// Re-order
$updown = '';
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" />';
if ($state->active != TEXTFILTER_DISABLED) {
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" /> ';
if ($filterinfo->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')));
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up')));
} else {
$updown .= $spacer;
}
if (!$islastactive) {
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down'), '', array('class' => 'iconsmall')));
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down')));
} else {
$updown .= $spacer;
}
@@ -234,20 +263,25 @@ function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow,
$row[] = $updown;
// Apply to strings.
$select = new single_select(filters_action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, $applytostrings, null, 'applyto' . $filter);
$select = new single_select(filters_action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, $applytostrings, null, 'applyto' . basename($filter));
$select->set_label(get_string('applyto', 'filters'), array('class' => 'accesshide'));
$select->disabled = ($state->active == TEXTFILTER_DISABLED);
$select->disabled = $filterinfo->active == TEXTFILTER_DISABLED;
$row[] = $OUTPUT->render($select);
// Settings link, if required.
if ($active and filter_has_global_settings($filter)) {
$row[] = html_writer::link(new moodle_url('/admin/settings.php', array('section'=>'filtersetting'.$filter)), get_string('settings'));
// Settings link, if required
if (filter_has_global_settings($filter)) {
$row[] = '<a href="' . $CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=filtersetting' .
str_replace('/', '',$filter) . '">' . get_string('settings') . '</a>';
} else {
$row[] = '';
}
// Uninstall.
$row[] = html_writer::link(filters_action_url($filter, 'delete'), get_string('uninstallplugin', 'core_admin'));
// Delete
if (substr($filter, 0, 4) != 'mod/') {
$row[] = '<a href="' . filters_action_url($filter, 'delete') . '">' . get_string('delete') . '</a>';
} else {
$row[] = '';
}
return $row;
}
+150
View File
@@ -0,0 +1,150 @@
<?php
/** This expects the output from a command like
* clamscan -r --infected --no-summary <files> 2>&1 | php -d error_log=/path/to/log thisfile.php
* also it's important that the output of clamscan prints the FULL PATH to each infected file, so use absolute paths for area to scan
* also it should be run as root, or whatever the webserver runs as so that it has the right permissions in the quarantine dir etc.
* php -d error_log=/path/to/log thisfile.php will override the default error log for php cli, which is stderr, so if you want this script to just print stuff out, use php thisfile.php instead.
*/
die('TODO: MDL-19380');
$fd = fopen('php://stdin','r');
if (!$fd) {
exit();
}
require_once(dirname(dirname(__FILE__)).'/config.php');
require_once($CFG->libdir.'/eventslib.php');
require_once($CFG->dirroot.'/lib/uploadlib.php'); // contains virus handling stuff.
$site = get_site();
while(!feof($fd)) {
$entry = fgets($fd);
if (strlen(trim($entry)) == 0) {
continue;
}
if (!$file = validate_line($entry)) {
continue;
}
$bits = explode('/',$file);
$a->filename = $bits[count($bits)-1];
if (!$log = $DB->get_record("log", array("module"=>"upload", "info"=>$file, "action"=>"upload"))) {
$a->action = clam_handle_infected_file($file,0,false);
clam_replace_infected_file($file);
notify_admins_unknown($file,$a);
continue;
}
$action = clam_handle_infected_file($file,$log->userid,true);
clam_replace_infected_file($file);
list($ctxselect, $ctxjoin) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
$sql = "SELECT c.id, c.fullname $ctxselect FROM {course} c $ctxjoin WHERE c.id = :courseid";
$course = $DB->get_record_sql($sql, array('courseid' => $log->course));
context_instance_preload($course);
$user = $DB->get_record("user", array("id"=>$log->userid));
$subject = get_string('virusfoundsubject','moodle',format_string($site->fullname));
$a->date = userdate($log->time);
$a->action = $action;
$a->course = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
$a->user = fullname($user);
notify_user($user,$subject,$a);
notify_admins($user,$subject,$a);
}
fclose($fd);
function notify_user($user,$subject,$a) {
if (!$user) {
return false;
}
$body = get_string('virusfoundlater','moodle',$a);
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = get_admin();
$eventdata->userto = $user;
$eventdata->subject = $subject;
$eventdata->fullmessage = $body;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
message_send($eventdata);
}
function notify_admins($user,$subject,$a) {
$admins = get_admins();
$body = get_string('virusfoundlateradmin','moodle',$a);
foreach ($admins as $admin) {
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = $admin;
$eventdata->userto = $admin;
$eventdata->subject = $subject;
$eventdata->fullmessage = $body;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
message_send($eventdata);
}
}
function notify_admins_unknown($file,$a) {
global $site;
$admins = get_admins();
$subject = get_string('virusfoundsubject','moodle',format_string($site->fullname));
$body = get_string('virusfoundlateradminnolog','moodle',$a);
foreach ($admins as $admin) {
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = $admin;
$eventdata->userto = $admin;
$eventdata->subject = $subject;
$eventdata->fullmessage = $body;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
$eventdata->smallmessage = '';
message_send($eventdata);
}
}
function validate_line($line) {
global $CFG;
if (strpos($line,"FOUND") === false) {
return false;
}
$index = strpos($line,":");
$file = substr($line,0,$index);
if (!(strpos($file,$CFG->dataroot) === false)) {
if (!file_exists($file)) {
return false;
}
}
else {
if ($file{0} == "/") {
$file = $CFG->dataroot.$file;
}
else {
$file = $CFG->dataroot."/".$file;
}
if (!file_exists($file)) {
return false;
}
}
// clean up
$file = preg_replace('/\.\//','/',$file);
$file = preg_replace('/\/\//','/',$file);
return $file;
}
+95 -509
View File
@@ -30,10 +30,10 @@ if (!file_exists('../config.php')) {
}
// Check that PHP is of a sufficient version as soon as possible
if (version_compare(phpversion(), '5.4.4') < 0) {
if (version_compare(phpversion(), '5.3.2') < 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 "Moodle 2.1 or later requires at least PHP 5.3.2 (currently using version $phpversion).<br />";
echo "Please upgrade your server software or install older Moodle version.";
die();
}
@@ -45,131 +45,36 @@ if (!function_exists('iconv')) {
die();
}
// Make sure php5-json is available.
if (!function_exists('json_encode') || !function_exists('json_decode')) {
// This also shouldn't happen.
echo 'Moodle requires the json PHP extension. Please install or enable the json extension.';
die();
}
// Make sure xml extension is available.
if (!extension_loaded('xml')) {
echo 'Moodle requires the xml PHP extension. Please install or enable the xml extension.';
die();
}
define('NO_OUTPUT_BUFFERING', true);
if (isset($_POST['upgradekey'])) {
// Before you start reporting issues about the collision attacks against
// SHA-1, you should understand that we are not actually attempting to do
// any cryptography here. This is hashed purely so that the key is not
// that apparent in the address bar itself. Anyone who catches the HTTP
// traffic can immediately use it as a valid admin key.
header('Location: index.php?cache=0&upgradekeyhash='.sha1($_POST['upgradekey']));
die();
}
if ((isset($_GET['cache']) and $_GET['cache'] === '0')
or (isset($_POST['cache']) and $_POST['cache'] === '0')
or (!isset($_POST['cache']) and !isset($_GET['cache']) and empty($_GET['sesskey']) and empty($_POST['sesskey']))) {
// Prevent caching at all cost when visiting this page directly,
// we redirect to self once we known no upgrades are necessary.
// Note: $_GET and $_POST are used here intentionally because our param cleaning is not loaded yet.
// Note2: the sesskey is present in all block editing hacks, we can not redirect there, so enable caching.
define('CACHE_DISABLE_ALL', true);
// Force OPcache reset if used, we do not want any stale caches
// when detecting if upgrade necessary or when running upgrade.
if (function_exists('opcache_reset')) {
opcache_reset();
}
$cache = 0;
} else {
$cache = 1;
}
require('../config.php');
// Invalidate the cache of version.php in any circumstances to help core_component
// detecting if the version has changed and component cache should be reset.
if (function_exists('opcache_invalidate')) {
opcache_invalidate($CFG->dirroot . '/version.php', true);
}
// Make sure the component cache gets rebuilt if necessary, any method that
// indirectly calls the protected init() method is good here.
core_component::get_core_subsystems();
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.'/pluginlib.php'); // available updates notifications
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL); // Core upgrade confirmed?
$confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL); // Core release info and server checks confirmed?
$confirmplugins = optional_param('confirmplugincheck', 0, PARAM_BOOL); // Plugins check page confirmed?
$showallplugins = optional_param('showallplugins', 0, PARAM_BOOL); // Show all plugins on the plugins check page?
$agreelicense = optional_param('agreelicense', 0, PARAM_BOOL); // GPL license confirmed for installation?
$fetchupdates = optional_param('fetchupdates', 0, PARAM_BOOL); // Should check for available updates?
$newaddonreq = optional_param('installaddonrequest', null, PARAM_RAW); // Plugin installation requested at moodle.org/plugins.
$upgradekeyhash = optional_param('upgradekeyhash', null, PARAM_ALPHANUM); // Hash of provided upgrade key.
$installdep = optional_param('installdep', null, PARAM_COMPONENT); // Install given missing dependency (required plugin).
$installdepx = optional_param('installdepx', false, PARAM_BOOL); // Install all missing dependencies.
$confirminstalldep = optional_param('confirminstalldep', false, PARAM_BOOL); // Installing dependencies confirmed.
$abortinstall = optional_param('abortinstall', null, PARAM_COMPONENT); // Cancel installation of the given new plugin.
$abortinstallx = optional_param('abortinstallx', null, PARAM_BOOL); // Cancel installation of all new plugins.
$confirmabortinstall = optional_param('confirmabortinstall', false, PARAM_BOOL); // Installation cancel confirmed.
$abortupgrade = optional_param('abortupgrade', null, PARAM_COMPONENT); // Cancel upgrade of the given existing plugin.
$abortupgradex = optional_param('abortupgradex', null, PARAM_BOOL); // Cancel upgrade of all upgradable plugins.
$confirmabortupgrade = optional_param('confirmabortupgrade', false, PARAM_BOOL); // Upgrade cancel confirmed.
$installupdate = optional_param('installupdate', null, PARAM_COMPONENT); // Install given available update.
$installupdateversion = optional_param('installupdateversion', null, PARAM_INT); // Version of the available update to install.
$installupdatex = optional_param('installupdatex', false, PARAM_BOOL); // Install all available plugin updates.
$confirminstallupdate = optional_param('confirminstallupdate', false, PARAM_BOOL); // Available update(s) install confirmed?
$id = optional_param('id', '', PARAM_TEXT);
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
$confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL);
$confirmplugins = optional_param('confirmplugincheck', 0, PARAM_BOOL);
$showallplugins = optional_param('showallplugins', 0, PARAM_BOOL);
$agreelicense = optional_param('agreelicense', 0, PARAM_BOOL);
$fetchupdates = optional_param('fetchupdates', 0, PARAM_BOOL);
if (!empty($CFG->disableupdateautodeploy)) {
// Invalidate all requests to install plugins via the admin UI.
$newaddonreq = null;
$installdep = null;
$installdepx = false;
$abortupgrade = null;
$abortupgradex = null;
$installupdate = null;
$installupdateversion = null;
$installupdatex = false;
}
// Set up PAGE.
$url = new moodle_url('/admin/index.php');
$url->param('cache', $cache);
if (isset($upgradekeyhash)) {
$url->param('upgradekeyhash', $upgradekeyhash);
}
$PAGE->set_url($url);
unset($url);
// Are we returning from an add-on installation request at moodle.org/plugins?
if ($newaddonreq and !$cache and empty($CFG->disableupdateautodeploy)) {
$target = new moodle_url('/admin/tool/installaddon/index.php', array(
'installaddonrequest' => $newaddonreq,
'confirm' => 0));
if (!isloggedin() or isguestuser()) {
// Login and go the the add-on tool page.
$SESSION->wantsurl = $target->out();
redirect(get_login_url());
}
redirect($target);
}
// Check some PHP server settings
$PAGE->set_url('/admin/index.php');
$PAGE->set_pagelayout('admin'); // Set a default pagelayout
$documentationlink = '<a href="http://docs.moodle.org/en/Installation">Installation docs</a>';
// Check some PHP server settings
if (ini_get_bool('session.auto_start')) {
print_error('phpvaroff', 'debug', '', (object)array('name'=>'session.auto_start', 'link'=>$documentationlink));
}
if (ini_get_bool('magic_quotes_runtime')) {
print_error('phpvaroff', 'debug', '', (object)array('name'=>'magic_quotes_runtime', 'link'=>$documentationlink));
}
if (!ini_get_bool('file_uploads')) {
print_error('phpvaron', 'debug', '', (object)array('name'=>'file_uploads', 'link'=>$documentationlink));
}
@@ -199,6 +104,10 @@ if (!$version or !$release) {
print_error('withoutversion', 'debug'); // without version, stop
}
// Turn off xmlstrictheaders during upgrade.
$origxmlstrictheaders = !empty($CFG->xmlstrictheaders);
$CFG->xmlstrictheaders = false;
if (!core_tables_exist()) {
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
@@ -209,7 +118,7 @@ if (!core_tables_exist()) {
$strinstallation = get_string('installation', 'install');
// remove current session content completely
\core\session\manager::terminate_current();
session_get_instance()->terminate_current();
if (empty($agreelicense)) {
$strlicense = get_string('license');
@@ -240,13 +149,13 @@ if (!core_tables_exist()) {
// check plugin dependencies
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
if (!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);
$output = $PAGE->get_renderer('core', 'admin');
$url = new moodle_url($PAGE->url, array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang));
$url = new moodle_url('/admin/index.php', array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang));
echo $output->unsatisfied_dependencies_page($version, $failed, $url);
die();
}
@@ -279,72 +188,39 @@ if (!core_tables_exist()) {
// Check version of Moodle code on disk compared with database
// and upgrade if possible.
if (!$cache) {
// Do not try to do anything fancy in non-cached mode,
// this prevents themes from fetching data from non-existent tables.
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
}
$stradministration = get_string('administration');
$PAGE->set_context(context_system::instance());
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
if (empty($CFG->version)) {
print_error('missingconfigversion', 'debug');
}
// Detect config cache inconsistency, this happens when you switch branches on dev servers.
if ($CFG->version != $DB->get_field('config', 'value', array('name'=>'version'))) {
if ($version > $CFG->version) { // upgrade
purge_all_caches();
redirect(new moodle_url($PAGE->url), 'Config cache inconsistency detected, resetting caches...');
}
if (!$cache and $version > $CFG->version) { // upgrade
$PAGE->set_url(new moodle_url($PAGE->url, array(
'confirmupgrade' => $confirmupgrade,
'confirmrelease' => $confirmrelease,
'confirmplugincheck' => $confirmplugins,
)));
check_upgrade_key($upgradekeyhash);
// Warning about upgrading a test site.
$testsite = false;
if (defined('BEHAT_SITE_RUNNING')) {
$testsite = 'behat';
}
// 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.
// This is the only way we can purge custom caches such as memcache or APC.
// Note: all other calls to caches will still used the disabled API.
cache_helper::purge_all(true);
// We then purge the regular caches.
purge_all_caches();
$output = $PAGE->get_renderer('core', 'admin');
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
if (upgrade_stale_php_files_present()) {
$PAGE->set_title($stradministration);
$PAGE->set_cacheable(false);
$output = $PAGE->get_renderer('core', 'admin');
echo $output->upgrade_stale_php_files_page();
die();
}
if (empty($confirmupgrade)) {
$a = new stdClass();
$a->oldversion = "$CFG->release (".sprintf('%.2f', $CFG->version).")";
$a->newversion = "$release (".sprintf('%.2f', $version).")";
$a->oldversion = "$CFG->release ($CFG->version)";
$a->newversion = "$release ($version)";
$strdatabasechecking = get_string('databasechecking', '', $a);
$PAGE->set_title($stradministration);
$PAGE->set_heading($strdatabasechecking);
$PAGE->set_cacheable(false);
echo $output->upgrade_confirm_page($a->newversion, $maturity, $testsite);
$output = $PAGE->get_renderer('core', 'admin');
echo $output->upgrade_confirm_page($a->newversion, $maturity);
die();
} else if (empty($confirmrelease)){
@@ -357,6 +233,7 @@ if (!$cache and $version > $CFG->version) { // upgrade
$PAGE->set_heading($strcurrentrelease);
$PAGE->set_cacheable(false);
$output = $PAGE->get_renderer('core', 'admin');
echo $output->upgrade_environment_page($release, $envstatus, $environment_results);
die();
@@ -368,142 +245,33 @@ if (!$cache and $version > $CFG->version) { // upgrade
$PAGE->set_heading($strplugincheck);
$PAGE->set_cacheable(false);
$pluginman = core_plugin_manager::instance();
$reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1));
// Check for available updates.
if ($fetchupdates) {
// No sesskey support guaranteed here, because sessions might not work yet.
$updateschecker = \core\update\checker::instance();
if ($updateschecker->enabled()) {
$updateschecker->fetch();
}
redirect($PAGE->url);
}
// Cancel all plugin installations.
if ($abortinstallx) {
// No sesskey support guaranteed here, because sessions might not work yet.
$abortables = $pluginman->list_cancellable_installations();
if ($abortables) {
if ($confirmabortinstall) {
foreach ($abortables as $plugin) {
$pluginman->cancel_plugin_installation($plugin->component);
}
redirect($PAGE->url);
} else {
$continue = new moodle_url($PAGE->url, array('abortinstallx' => $abortinstallx, 'confirmabortinstall' => 1));
echo $output->upgrade_confirm_abort_install_page($abortables, $continue);
die();
}
}
redirect($PAGE->url);
}
// Cancel single plugin installation.
if ($abortinstall) {
// No sesskey support guaranteed here, because sessions might not work yet.
if ($confirmabortinstall) {
$pluginman->cancel_plugin_installation($abortinstall);
redirect($PAGE->url);
} else {
$continue = new moodle_url($PAGE->url, array('abortinstall' => $abortinstall, 'confirmabortinstall' => 1));
$abortable = $pluginman->get_plugin_info($abortinstall);
if ($pluginman->can_cancel_plugin_installation($abortable)) {
echo $output->upgrade_confirm_abort_install_page(array($abortable), $continue);
die();
}
redirect($PAGE->url);
}
}
// Cancel all plugins upgrades (that is, restore archived versions).
if ($abortupgradex) {
// No sesskey support guaranteed here, because sessions might not work yet.
$restorable = $pluginman->list_restorable_archives();
if ($restorable) {
upgrade_install_plugins($restorable, $confirmabortupgrade,
get_string('cancelupgradehead', 'core_plugin'),
new moodle_url($PAGE->url, array('abortupgradex' => 1, 'confirmabortupgrade' => 1))
);
}
redirect($PAGE->url);
}
// Cancel single plugin upgrade (that is, install the archived version).
if ($abortupgrade) {
// No sesskey support guaranteed here, because sessions might not work yet.
$restorable = $pluginman->list_restorable_archives();
if (isset($restorable[$abortupgrade])) {
$restorable = array($restorable[$abortupgrade]);
upgrade_install_plugins($restorable, $confirmabortupgrade,
get_string('cancelupgradehead', 'core_plugin'),
new moodle_url($PAGE->url, array('abortupgrade' => $abortupgrade, 'confirmabortupgrade' => 1))
);
}
redirect($PAGE->url);
}
// Install all available missing dependencies.
if ($installdepx) {
// No sesskey support guaranteed here, because sessions might not work yet.
$installable = $pluginman->filter_installable($pluginman->missing_dependencies(true));
upgrade_install_plugins($installable, $confirminstalldep,
get_string('dependencyinstallhead', 'core_plugin'),
new moodle_url($PAGE->url, array('installdepx' => 1, 'confirminstalldep' => 1))
);
}
// Install single available missing dependency.
if ($installdep) {
// No sesskey support guaranteed here, because sessions might not work yet.
$installable = $pluginman->filter_installable($pluginman->missing_dependencies(true));
if (!empty($installable[$installdep])) {
$installable = array($installable[$installdep]);
upgrade_install_plugins($installable, $confirminstalldep,
get_string('dependencyinstallhead', 'core_plugin'),
new moodle_url($PAGE->url, array('installdep' => $installdep, 'confirminstalldep' => 1))
);
}
}
// Install all available updates.
if ($installupdatex) {
// No sesskey support guaranteed here, because sessions might not work yet.
$installable = $pluginman->filter_installable($pluginman->available_updates());
upgrade_install_plugins($installable, $confirminstallupdate,
get_string('updateavailableinstallallhead', 'core_admin'),
new moodle_url($PAGE->url, array('installupdatex' => 1, 'confirminstallupdate' => 1))
);
}
// Install single available update.
if ($installupdate and $installupdateversion) {
// No sesskey support guaranteed here, because sessions might not work yet.
if ($pluginman->is_remote_plugin_installable($installupdate, $installupdateversion)) {
$installable = array($pluginman->get_remote_plugin_info($installupdate, $installupdateversion, true));
upgrade_install_plugins($installable, $confirminstallupdate,
get_string('updateavailableinstallallhead', 'core_admin'),
new moodle_url($PAGE->url, array('installupdate' => $installupdate,
'installupdateversion' => $installupdateversion, 'confirminstallupdate' => 1)
)
);
}
}
echo $output->upgrade_plugin_check_page(core_plugin_manager::instance(), \core\update\checker::instance(),
$version, $showallplugins, $PAGE->url, new moodle_url($PAGE->url, array('confirmplugincheck' => 1)));
die();
} else {
// Always verify plugin dependencies!
// check plugin dependencies first
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
$output = $PAGE->get_renderer('core', 'admin');
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
die();
}
unset($failed);
// Launch main upgrade.
if ($fetchupdates) {
// no sesskey support guaranteed here
if (empty($CFG->disableupdatenotifications)) {
available_update_checker::instance()->fetch();
}
redirect($reloadurl);
}
$output = $PAGE->get_renderer('core', 'admin');
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
$version, $showallplugins, $reloadurl,
new moodle_url('/admin/index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1)));
die();
} else {
// Launch main upgrade
upgrade_core($version, true);
}
} else if ($version < $CFG->version) {
@@ -512,173 +280,51 @@ if (!$cache and $version > $CFG->version) { // upgrade
}
// Updated human-readable release version if necessary
if (!$cache and $release <> $CFG->release) { // Update the release version
if ($release <> $CFG->release) { // Update the release version
set_config('release', $release);
}
if (!$cache and $branch <> $CFG->branch) { // Update the branch
if ($branch <> $CFG->branch) { // Update the branch
set_config('branch', $branch);
}
if (!$cache and moodle_needs_upgrading()) {
$PAGE->set_url(new moodle_url($PAGE->url, array('confirmplugincheck' => $confirmplugins)));
check_upgrade_key($upgradekeyhash);
if (moodle_needs_upgrading()) {
if (!$PAGE->headerprinted) {
// means core upgrade or installation was not already done
$pluginman = core_plugin_manager::instance();
$output = $PAGE->get_renderer('core', 'admin');
if (!$confirmplugins) {
$strplugincheck = get_string('plugincheck');
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
$PAGE->navbar->add($strplugincheck);
$PAGE->set_title($strplugincheck);
$PAGE->set_heading($strplugincheck);
$PAGE->set_cacheable(false);
// Check for available updates.
if ($fetchupdates) {
require_sesskey();
$updateschecker = \core\update\checker::instance();
if ($updateschecker->enabled()) {
$updateschecker->fetch();
}
// no sesskey support guaranteed here
available_update_checker::instance()->fetch();
redirect($PAGE->url);
}
// Cancel all plugin installations.
if ($abortinstallx) {
require_sesskey();
$abortables = $pluginman->list_cancellable_installations();
if ($abortables) {
if ($confirmabortinstall) {
foreach ($abortables as $plugin) {
$pluginman->cancel_plugin_installation($plugin->component);
}
redirect($PAGE->url);
} else {
$continue = new moodle_url($PAGE->url, array('abortinstallx' => $abortinstallx,
'confirmabortinstall' => 1));
echo $output->upgrade_confirm_abort_install_page($abortables, $continue);
die();
}
}
redirect($PAGE->url);
}
$output = $PAGE->get_renderer('core', 'admin');
// Cancel single plugin installation.
if ($abortinstall) {
require_sesskey();
if ($confirmabortinstall) {
$pluginman->cancel_plugin_installation($abortinstall);
redirect($PAGE->url);
} else {
$continue = new moodle_url($PAGE->url, array('abortinstall' => $abortinstall, 'confirmabortinstall' => 1));
$abortable = $pluginman->get_plugin_info($abortinstall);
if ($pluginman->can_cancel_plugin_installation($abortable)) {
echo $output->upgrade_confirm_abort_install_page(array($abortable), $continue);
die();
}
redirect($PAGE->url);
}
// check plugin dependencies first
$failed = array();
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
die();
}
unset($failed);
// Cancel all plugins upgrades (that is, restore archived versions).
if ($abortupgradex) {
require_sesskey();
$restorable = $pluginman->list_restorable_archives();
if ($restorable) {
upgrade_install_plugins($restorable, $confirmabortupgrade,
get_string('cancelupgradehead', 'core_plugin'),
new moodle_url($PAGE->url, array('abortupgradex' => 1, 'confirmabortupgrade' => 1))
);
}
redirect($PAGE->url);
}
// Cancel single plugin upgrade (that is, install the archived version).
if ($abortupgrade) {
require_sesskey();
$restorable = $pluginman->list_restorable_archives();
if (isset($restorable[$abortupgrade])) {
$restorable = array($restorable[$abortupgrade]);
upgrade_install_plugins($restorable, $confirmabortupgrade,
get_string('cancelupgradehead', 'core_plugin'),
new moodle_url($PAGE->url, array('abortupgrade' => $abortupgrade, 'confirmabortupgrade' => 1))
);
}
redirect($PAGE->url);
}
// Install all available missing dependencies.
if ($installdepx) {
require_sesskey();
$installable = $pluginman->filter_installable($pluginman->missing_dependencies(true));
upgrade_install_plugins($installable, $confirminstalldep,
get_string('dependencyinstallhead', 'core_plugin'),
new moodle_url($PAGE->url, array('installdepx' => 1, 'confirminstalldep' => 1))
);
}
// Install single available missing dependency.
if ($installdep) {
require_sesskey();
$installable = $pluginman->filter_installable($pluginman->missing_dependencies(true));
if (!empty($installable[$installdep])) {
$installable = array($installable[$installdep]);
upgrade_install_plugins($installable, $confirminstalldep,
get_string('dependencyinstallhead', 'core_plugin'),
new moodle_url($PAGE->url, array('installdep' => $installdep, 'confirminstalldep' => 1))
);
}
}
// Install all available updates.
if ($installupdatex) {
require_sesskey();
$installable = $pluginman->filter_installable($pluginman->available_updates());
upgrade_install_plugins($installable, $confirminstallupdate,
get_string('updateavailableinstallallhead', 'core_admin'),
new moodle_url($PAGE->url, array('installupdatex' => 1, 'confirminstallupdate' => 1))
);
}
// Install single available update.
if ($installupdate and $installupdateversion) {
require_sesskey();
if ($pluginman->is_remote_plugin_installable($installupdate, $installupdateversion)) {
$installable = array($pluginman->get_remote_plugin_info($installupdate, $installupdateversion, true));
upgrade_install_plugins($installable, $confirminstallupdate,
get_string('updateavailableinstallallhead', 'core_admin'),
new moodle_url($PAGE->url, array('installupdate' => $installupdate,
'installupdateversion' => $installupdateversion, 'confirminstallupdate' => 1)
)
);
}
}
// Show plugins info.
echo $output->upgrade_plugin_check_page($pluginman, \core\update\checker::instance(),
// dependencies check passed, let's rock!
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
$version, $showallplugins,
new moodle_url($PAGE->url),
new moodle_url($PAGE->url, array('confirmplugincheck' => 1, 'cache' => 0)));
new moodle_url('/admin/index.php', array('confirmplugincheck'=>1)));
die();
}
// Make sure plugin dependencies are always checked.
$failed = array();
if (!$pluginman->all_plugins_ok($version, $failed)) {
$output = $PAGE->get_renderer('core', 'admin');
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
die();
}
unset($failed);
}
// install/upgrade all plugins and other parts
upgrade_noncore(true);
}
@@ -711,10 +357,6 @@ if (during_initial_install()) {
}
}
// Cleanup SESSION to make sure other code does not complain in the future.
unset($SESSION->has_timed_out);
unset($SESSION->wantsurl);
// at this stage there can be only one admin unless more were added by install - users may change username, so do not rely on that
$adminids = explode(',', $CFG->siteadmins);
$adminuser = get_complete_user_data('id', reset($adminids));
@@ -738,40 +380,14 @@ if (during_initial_install()) {
upgrade_finished('upgradesettings.php');
}
if (has_capability('moodle/site:config', context_system::instance())) {
if ($fetchupdates) {
require_sesskey();
$updateschecker = \core\update\checker::instance();
if ($updateschecker->enabled()) {
$updateschecker->fetch();
}
redirect(new moodle_url('/admin/index.php', array('cache' => 0)));
}
}
// Now we can be sure everything was upgraded and caches work fine,
// redirect if necessary to make sure caching is enabled.
if (!$cache) {
redirect(new moodle_url('/admin/index.php', array('cache' => 1)));
}
// Turn xmlstrictheaders back on now.
$CFG->xmlstrictheaders = $origxmlstrictheaders;
unset($origxmlstrictheaders);
// Check for valid admin user - no guest autologin
require_login(0, false);
if (isguestuser()) {
// Login as real user!
$SESSION->wantsurl = (string)new moodle_url('/admin/index.php');
redirect(get_login_url());
}
$context = context_system::instance();
if (!has_capability('moodle/site:config', $context)) {
// Do not throw exception display an empty page with administration menu if visible for current user.
$PAGE->set_title($SITE->fullname);
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->footer();
exit;
}
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context);
// check that site is properly customized
$site = get_site();
@@ -779,10 +395,14 @@ if (empty($site->shortname)) {
// probably new installation - lets return to frontpage after this step
// remove settings that we want uninitialised
unset_config('registerauth');
unset_config('timezone'); // Force admin to select timezone!
redirect('upgradesettings.php?return=site');
}
// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders
if (!empty($id) and $id == $CFG->siteidentifier) {
set_config('registered', time());
}
// setup critical warnings before printing admin tree block
$insecuredataroot = is_dataroot_insecure(true);
$SESSION->admin_critical_warning = ($insecuredataroot==INSECURE_DATAROOT_ERROR);
@@ -794,68 +414,34 @@ if (any_new_admin_settings($adminroot)){
redirect('upgradesettings.php');
}
// Return to original page that started the plugin uninstallation if necessary.
if (isset($SESSION->pluginuninstallreturn)) {
$return = $SESSION->pluginuninstallreturn;
unset($SESSION->pluginuninstallreturn);
if ($return) {
redirect($return);
}
}
// Everything should now be set up, and the user is an admin
// Print default admin page with notifications.
$errorsdisplayed = defined('WARN_DISPLAY_ERRORS_ENABLED');
// 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}');
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
$cronoverdue = ($lastcron < time() - 3600 * 24);
$dbproblems = $DB->diagnose();
$maintenancemode = !empty($CFG->maintenance_enabled);
// Available updates for Moodle core.
$updateschecker = \core\update\checker::instance();
$availableupdates = array();
$availableupdatesfetch = null;
if ($updateschecker->enabled()) {
// Only compute the update information when it is going to be displayed to the user.
$availableupdates['core'] = $updateschecker->get_update_info('core',
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
// Available updates for contributed plugins
$pluginman = core_plugin_manager::instance();
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
$pluginavailableupdates = $plugininfo->available_updates();
if (!empty($pluginavailableupdates)) {
foreach ($pluginavailableupdates as $pluginavailableupdate) {
if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
$availableupdates[$plugintype.'_'.$pluginname] = array();
}
$availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
}
}
}
}
// The timestamp of the most recent check for available updates
$availableupdatesfetch = $updateschecker->get_last_timefetched();
}
$updateschecker = available_update_checker::instance();
$availableupdates = $updateschecker->get_update_info('core',
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
$availableupdatesfetch = $updateschecker->get_last_timefetched();
$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 = $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}');
admin_externalpage_setup('adminnotifications');
$output = $PAGE->get_renderer('core', 'admin');
if ($fetchupdates) {
require_sesskey();
$updateschecker->fetch();
redirect($PAGE->url);
}
echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed, $cronoverdue, $dbproblems,
$maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb,
$registered, $cachewarnings, $eventshandlers);
$output = $PAGE->get_renderer('core', 'admin');
echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
$cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb,
$registered);
+12 -1
View File
@@ -18,7 +18,7 @@
/**
* This file contains functions used by the admin pages
*
* @since Moodle 2.1
* @since 2.1
* @package admin
* @copyright 2011 Andrew Davis
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -35,5 +35,16 @@ function admin_page_type_list($pagetype, $parentcontext, $currentcontext) {
'admin-*' => get_string('page-admin-x', 'pagetype'),
$pagetype => get_string('page-admin-current', 'pagetype')
);
// Add the missing * (any page) option for them. MDL-30340
// TODO: These pages are really 'pagetype-varying' - MDL-30564 -
// and some day we should stop behaving that way, so proper pagetypes
// can be specified for it (like course-category-* or so).
// Luckly... the option we are introducing '*' is independent
// of that varying behavior, so will work.
if ($pagetype == 'admin-course-category') {
$array += array(
'*' => get_string('page-x', 'pagetype')
);
}
return $array;
}
+2 -2
View File
@@ -24,11 +24,11 @@ require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/licenselib.php');
require_login();
require_capability('moodle/site:config', context_system::instance());
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=managelicenses";
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$action = optional_param('action', '', PARAM_ACTION);
$license = optional_param('license', '', PARAM_SAFEDIR);
////////////////////////////////////////////////////////////////////////////////
+42 -10
View File
@@ -33,21 +33,55 @@ require_once($CFG->libdir.'/tablelib.php');
admin_externalpage_setup('managelocalplugins');
$delete = optional_param('delete', '', PARAM_PLUGIN);
$confirm = optional_param('confirm', '', PARAM_BOOL);
/// If data submitted, then process and store.
if (!empty($delete) and confirm_sesskey()) {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('localplugins'));
if (!$confirm) {
if (get_string_manager()->string_exists('pluginname', 'local_' . $delete)) {
$strpluginname = get_string('pluginname', 'local_' . $delete);
} else {
$strpluginname = $delete;
}
echo $OUTPUT->confirm(get_string('localplugindeleteconfirm', '', $strpluginname),
new moodle_url($PAGE->url, array('delete' => $delete, 'confirm' => 1)),
$PAGE->url);
echo $OUTPUT->footer();
die();
} else {
uninstall_plugin('local', $delete);
$a = new stdclass();
$a->name = $delete;
$pluginlocation = get_plugin_types();
$a->directory = $pluginlocation['local'] . '/' . $delete;
echo $OUTPUT->notification(get_string('plugindeletefiles', '', $a), 'notifysuccess');
echo $OUTPUT->continue_button($PAGE->url);
echo $OUTPUT->footer();
die();
}
}
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('localplugins'));
/// Print the table of all installed local plugins
$table = new flexible_table('localplugins_administration_table');
$table->define_columns(array('name', 'version', 'uninstall'));
$table->define_headers(array(get_string('plugin'), get_string('version'), get_string('uninstallplugin', 'core_admin')));
$table->define_columns(array('name', 'version', 'delete'));
$table->define_headers(array(get_string('plugin'), get_string('version'), get_string('delete')));
$table->define_baseurl($PAGE->url);
$table->set_attribute('id', 'localplugins');
$table->set_attribute('class', 'admintable generaltable');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->setup();
$plugins = array();
foreach (core_component::get_plugin_list('local') as $plugin => $plugindir) {
foreach (get_plugin_list('local') as $plugin => $plugindir) {
if (get_string_manager()->string_exists('pluginname', 'local_' . $plugin)) {
$strpluginname = get_string('pluginname', 'local_' . $plugin);
} else {
@@ -55,13 +89,11 @@ foreach (core_component::get_plugin_list('local') as $plugin => $plugindir) {
}
$plugins[$plugin] = $strpluginname;
}
core_collator::asort($plugins);
collatorlib::asort($plugins);
foreach ($plugins as $plugin => $name) {
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('local_'.$plugin, 'manage')) {
$uninstall = html_writer::link($uninstallurl, get_string('uninstallplugin', 'core_admin'));
}
$delete = new moodle_url($PAGE->url, array('delete' => $plugin, 'sesskey' => sesskey()));
$delete = html_writer::link($delete, get_string('delete'));
$version = get_config('local_' . $plugin);
if (!empty($version->version)) {
@@ -70,7 +102,7 @@ foreach ($plugins as $plugin => $name) {
$version = '?';
}
$table->add_data(array($name, $version, $uninstall));
$table->add_data(array($name, $version, $delete));
}
$table->print_html();
+30 -6
View File
@@ -29,11 +29,13 @@ require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('managemessageoutputs');
// Require site configuration capability
require_capability('moodle/site:config', context_system::instance());
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
// Get the submitted params
$disable = optional_param('disable', 0, PARAM_INT);
$enable = optional_param('enable', 0, PARAM_INT);
$uninstall = optional_param('uninstall', 0, PARAM_INT);
$confirm = optional_param('confirm', false, PARAM_BOOL);
$headingtitle = get_string('managemessageoutputs', 'message');
@@ -42,7 +44,6 @@ if (!empty($disable) && confirm_sesskey()) {
print_error('outputdoesnotexist', 'message');
}
$DB->set_field('message_processors', 'enabled', '0', array('id'=>$processor->id)); // Disable output
core_plugin_manager::reset_caches();
}
if (!empty($enable) && confirm_sesskey()) {
@@ -50,15 +51,38 @@ if (!empty($enable) && confirm_sesskey()) {
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) {
if (!empty($uninstall) && confirm_sesskey()) {
echo $OUTPUT->header();
echo $OUTPUT->heading($headingtitle);
if (!$processor = $DB->get_record('message_processors', array('id'=>$uninstall))) {
print_error('outputdoesnotexist', 'message');
}
$processorname = get_string('pluginname', 'message_'.$processor->name);
if (!$confirm) {
echo $OUTPUT->confirm(get_string('processordeleteconfirm', 'message', $processorname), 'message.php?uninstall='.$processor->id.'&confirm=1', 'message.php');
echo $OUTPUT->footer();
exit;
} else {
message_processor_uninstall($processor->name);
$a = new stdClass();
$a->processor = $processorname;
$a->directory = $CFG->dirroot.'/message/output/'.$processor->name;
notice(get_string('processordeletefiles', 'message', $a), 'message.php');
}
}
if ($disable || $enable || $uninstall) {
$url = new moodle_url('message.php');
redirect($url);
}
// Page settings
$PAGE->set_context(context_system::instance());
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
// Grab the renderer
$renderer = $PAGE->get_renderer('core', 'message');
@@ -71,4 +95,4 @@ $messageoutputs = $renderer->manage_messageoutputs($processors);
echo $OUTPUT->header();
echo $OUTPUT->heading($headingtitle);
echo $messageoutputs;
echo $OUTPUT->footer();
echo $OUTPUT->footer();
+7 -9
View File
@@ -16,11 +16,13 @@ require_login();
admin_externalpage_setup('ssoaccesscontrol');
echo $OUTPUT->header();
if (!extension_loaded('openssl')) {
print_error('requiresopenssl', 'mnet');
}
$sitecontext = context_system::instance();
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$sesskey = sesskey();
$formerror = array();
@@ -63,11 +65,9 @@ if (!empty($action) and confirm_sesskey()) {
if (mnet_update_sso_access_control($idrec->username, $idrec->mnet_host_id, $accessctrl)) {
if ($accessctrl == 'allow') {
redirect('access_control.php', get_string('ssl_acl_allow','mnet', array('user' => $idrec->username,
'host' => $mnethosts[$idrec->mnet_host_id])));
} else if ($accessctrl == 'deny') {
redirect('access_control.php', get_string('ssl_acl_deny','mnet', array('user' => $idrec->username,
'host' => $mnethosts[$idrec->mnet_host_id])));
redirect('access_control.php', get_string('ssl_acl_allow','mnet', array('uset'=>$idrec->username, 'host'=>$mnethosts[$idrec->mnet_host_id])));
} elseif ($accessctrl == 'deny') {
redirect('access_control.php', get_string('ssl_acl_deny','mnet', array('user'=>$idrec->username, 'host'=>$mnethosts[$idrec->mnet_host_id])));
}
}
break;
@@ -103,7 +103,7 @@ if ($form = data_submitted() and confirm_sesskey()) {
$usernames = explode(',', $form->username);
foreach ($usernames as $username) {
$username = trim(core_text::strtolower($username));
$username = trim(textlib::strtolower($username));
if (!empty($username)) {
if (mnet_update_sso_access_control($username, $form->mnet_host_id, $form->accessctrl)) {
if ($form->accessctrl == 'allow') {
@@ -118,8 +118,6 @@ if ($form = data_submitted() and confirm_sesskey()) {
exit;
}
echo $OUTPUT->header();
// Explain
echo $OUTPUT->box(get_string('ssoacldescr','mnet'));
// Are the needed bits enabled?
+1 -1
View File
@@ -36,7 +36,7 @@ $hostid = required_param('hostid', PARAM_INT);
require_login();
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
$mnet = get_mnet_environment();
+4 -4
View File
@@ -1,4 +1,4 @@
<?php
<?PHP
// Allows the admin to configure mnet stuff
@@ -9,7 +9,7 @@
require_login();
admin_externalpage_setup('net');
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
@@ -85,7 +85,7 @@
echo $OUTPUT->header();
?>
<form method="post" action="index.php">
<table align="center" width="635" class="generaltable" border="0" cellpadding="5" cellspacing="0">
<table align="center" width="635" class="generalbox" border="0" cellpadding="5" cellspacing="0">
<tr>
<td class="generalboxcontent">
<table cellpadding="9" cellspacing="0" >
@@ -106,7 +106,7 @@
</table>
</form>
<form method="post" action="index.php">
<table align="center" width="635" class="generaltable" border="0" cellpadding="5" cellspacing="0">
<table align="center" width="635" class="generalbox" border="0" cellpadding="5" cellspacing="0">
<tr>
<td class="generalboxcontent">
<table cellpadding="9" cellspacing="0" >
+1 -15
View File
@@ -78,13 +78,9 @@ class mnet_review_host_form extends moodleform {
$mnet_peer = $this->_customdata['peer'];
$mform->addElement('hidden', 'last_connect_time');
$mform->setType('last_connect_time', PARAM_INT);
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'applicationid');
$mform->setType('applicationid', PARAM_INT);
$mform->addElement('hidden', 'oldpublickey');
$mform->setType('oldpublickey', PARAM_PEM);
$mform->addElement('text', 'name', get_string('site'), array('maxlength' => 80, 'size' => 50));
$mform->setType('name', PARAM_NOTAGS);
@@ -94,17 +90,8 @@ class mnet_review_host_form extends moodleform {
$mform->setType('wwwroot', PARAM_URL);
$mform->addRule('wwwroot', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$options = array(
mnet_peer::SSL_NONE => get_string('none'),
mnet_peer::SSL_HOST => get_string('verifyhostonly', 'core_mnet'),
mnet_peer::SSL_HOST_AND_PEER => get_string('verifyhostandpeer', 'core_mnet')
);
$mform->addElement('select', 'sslverification', get_string('sslverification', 'core_mnet'), $options);
$mform->setDefault('sslverification', mnet_peer::SSL_HOST_AND_PEER);
$mform->addHelpButton('sslverification', 'sslverification', 'core_mnet');
$themes = array('' => get_string('forceno'));
foreach (array_keys(core_component::get_plugin_list('theme')) as $themename) {
foreach (array_keys(get_plugin_list('theme')) as $themename) {
$themes[$themename] = get_string('pluginname', 'theme_'.$themename);
}
$mform->addElement('select', 'theme', get_string('forcetheme'), $themes);
@@ -161,7 +148,6 @@ class mnet_review_host_form extends moodleform {
$mform->addGroup($radioarray, 'radioar', get_string('deleted'), array(' ', ' '), false);
} else {
$mform->addElement('hidden', 'deleted');
$mform->setType('deleted', PARAM_BOOL);
}
// finished with static stuff, print save button
+1 -2
View File
@@ -34,7 +34,7 @@ require_once($CFG->dirroot.'/'.$CFG->admin.'/mnet/peer_forms.php');
require_login();
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');
/// Initialize variables.
@@ -172,7 +172,6 @@ if ($formdata = $reviewform->get_data()) {
$mnet_peer->public_key = $formdata->public_key;
$credentials = $mnet_peer->check_credentials($mnet_peer->public_key);
$mnet_peer->public_key_expires = $credentials['validTo_time_t'];
$mnet_peer->sslverification = $formdata->sslverification;
if ($mnet_peer->commit()) {
redirect(new moodle_url('/admin/mnet/peers.php', array('hostid' => $mnet_peer->id)), get_string('changessaved'));
+1 -1
View File
@@ -34,7 +34,7 @@ $hostid = required_param('hostid', PARAM_INT);
$mnet_peer = new mnet_peer();
$mnet_peer->set_id($hostid);
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');
admin_externalpage_setup('mnetpeers');
-2
View File
@@ -50,8 +50,6 @@ class mnet_profile_form extends moodleform {
}
$mform->addElement('hidden', 'hostid', $this->_customdata['hostid']);
$mform->setType('hostid', PARAM_INT);
$fields = mnet_profile_field_options();
// Fields to import ----------------------------------------------------
+1 -1
View File
@@ -33,7 +33,7 @@ $mnet = get_mnet_environment();
require_login();
admin_externalpage_setup('mnetpeers');
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
$hostid = required_param('hostid', PARAM_INT);
-3
View File
@@ -39,7 +39,6 @@ class mnet_services_form extends moodleform {
$myservices = mnet_get_service_info($mnet_peer);
$mform->addElement('hidden', 'hostid', $mnet_peer->id);
$mform->setType('hostid', PARAM_INT);
$count = 0;
foreach ($myservices as $name => $versions) {
@@ -56,8 +55,6 @@ class mnet_services_form extends moodleform {
$mform->addElement('html', '<h3>' . get_string($name.'_name', $langmodule , $mnet_peer->name) . '</h3>' . get_string($name.'_description', $langmodule, $mnet_peer->name));
$mform->addElement('hidden', 'exists[' . $version['serviceid'] . ']', 1);
// Temporary fix until MDL-38885 gets integrated.
$mform->setType('exists', PARAM_BOOL);
$pubstr = get_string('publish','mnet');
if (!empty($version['hostsubscribes'])) {
+9
View File
@@ -34,12 +34,21 @@ if (!defined('MOODLE_INTERNAL')) {
}
$strmnetservices = get_string('mnetservices', 'mnet');
$strmnetlog = get_string('mnetlog', 'mnet');
$strmnetedithost = get_string('reviewhostdetails', 'mnet');
$logurl = $CFG->wwwroot.
'/report/log/index.php?chooselog=1&amp;showusers=1&amp;showcourses=1&amp;host_course='.$mnet_peer->id.
'%2F1&amp;user='.'0'.
'&amp;date=0'.
'&amp;modid=&amp;modaction=0&amp;logformat=showashtml';
$tabs = array();
if (isset($mnet_peer->id) && $mnet_peer->id > 0) {
$tabs[] = new tabobject('mnetdetails', 'peers.php?step=update&amp;hostid='.$mnet_peer->id, $strmnetedithost, $strmnetedithost, false);
$tabs[] = new tabobject('mnetservices', 'services.php?hostid='.$mnet_peer->id, $strmnetservices, $strmnetservices, false);
if ($mnet_peer->application->name == 'moodle' && $mnet_peer->id != $CFG->mnet_all_hosts_id) {
$tabs[] = new tabobject('mnetlog', $logurl, $strmnetlog, $strmnetlog, false);
}
$tabs[] = new tabobject('mnetprofilefields', 'profilefields.php?hostid=' . $mnet_peer->id, get_string('profilefields', 'mnet'), get_string('profilefields', 'mnet'), false);
} else {
$tabs[] = new tabobject('mnetdetails', '#', $strmnetedithost, $strmnetedithost, false);
+1 -20
View File
@@ -24,7 +24,7 @@ if ($CFG->mnet_dispatcher_mode === 'off') {
require_login();
admin_externalpage_setup('mnettestclient');
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context);
error_reporting(DEBUG_ALL);
@@ -66,19 +66,12 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
$mnet_request->set_method('system/listServices');
$mnet_request->send($mnet_peer);
$services = $mnet_request->response;
$yesno = array('No', 'Yes');
$servicenames = array();
echo $OUTPUT->heading(get_string('servicesavailableonhost', 'mnet', $host->wwwroot));
if (!empty($mnet_request->error)) {
echo $OUTPUT->heading(get_string('error'), 3);
echo html_writer::alist($mnet_request->error);
$services = array();
}
$table = new html_table();
$table->head = array(
get_string('serviceid', 'mnet'),
@@ -134,7 +127,6 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
echo html_writer::table($table);
$mnet_request = new mnet_xmlrpc_client();
$mnet_request->set_method('system/listMethods');
if (isset($servicename) && array_key_exists($servicename, $serviceinfo)) {
echo $OUTPUT->heading(get_string('methodsavailableonhostinservice', 'mnet', (object)array('host' => $host->wwwroot, 'service' => $servicename)));
@@ -147,11 +139,6 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
$mnet_request->send($mnet_peer);
$methods = $mnet_request->response;
if (!empty($mnet_request->error)) {
echo $OUTPUT->heading(get_string('error'), 3);
echo html_writer::alist($mnet_request->error);
$methods = array();
}
$table = new html_table();
$table->head = array(
@@ -184,12 +171,6 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
echo $OUTPUT->heading(get_string('methodsignature', 'mnet', $method));
if (!empty($mnet_request->error)) {
echo $OUTPUT->heading(get_string('error'), 3);
echo html_writer::alist($mnet_request->error);
$signature = array();
}
$table = new html_table();
$table->head = array(
get_string('position', 'mnet'),
+1 -1
View File
@@ -8,7 +8,7 @@
require_login();
admin_externalpage_setup('trustedhosts');
$context = context_system::instance();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
+63 -32
View File
@@ -13,12 +13,14 @@
$show = optional_param('show', '', PARAM_PLUGIN);
$hide = optional_param('hide', '', PARAM_PLUGIN);
$delete = optional_param('delete', '', PARAM_PLUGIN);
$confirm = optional_param('confirm', '', PARAM_BOOL);
/// Print headings
$stractivities = get_string("activities");
$struninstall = get_string('uninstallplugin', 'core_admin');
$strdelete = get_string("delete");
$strversion = get_string("version");
$strhide = get_string("hide");
$strshow = get_string("show");
@@ -40,14 +42,14 @@
SET visibleold=visible, visible=0
WHERE module=?";
$DB->execute($sql, array($module->id));
// Increment course.cacherev for courses where we just made something invisible.
// This will force cache rebuilding on the next request.
increment_revision_number('course', 'cacherev',
"id IN (SELECT DISTINCT course
// clear the course modinfo cache for courses
// where we just deleted something
$sql = "UPDATE {course}
SET modinfo=''
WHERE id IN (SELECT DISTINCT course
FROM {course_modules}
WHERE visibleold=1 AND module=?)",
array($module->id));
core_plugin_manager::reset_caches();
WHERE visibleold=1 AND module=?)";
$DB->execute($sql, array($module->id));
admin_get_root(true, false); // settings not required - only pages
}
@@ -57,17 +59,49 @@
}
$DB->set_field("modules", "visible", "1", array("id"=>$module->id)); // Show main module
$DB->set_field('course_modules', 'visible', '1', array('visibleold'=>1, 'module'=>$module->id)); // Get the previous saved visible state for the course module.
// Increment course.cacherev for courses where we just made something visible.
// This will force cache rebuilding on the next request.
increment_revision_number('course', 'cacherev',
"id IN (SELECT DISTINCT course
// clear the course modinfo cache for courses
// where we just made something visible
$sql = "UPDATE {course}
SET modinfo = ''
WHERE id IN (SELECT DISTINCT course
FROM {course_modules}
WHERE visible=1 AND module=?)",
array($module->id));
core_plugin_manager::reset_caches();
WHERE visible=1 AND module=?)";
$DB->execute($sql, array($module->id));
admin_get_root(true, false); // settings not required - only pages
}
if (!empty($delete) and confirm_sesskey()) {
echo $OUTPUT->header();
echo $OUTPUT->heading($stractivities);
if (get_string_manager()->string_exists('modulename', $delete)) {
$strmodulename = get_string('modulename', $delete);
} else {
$strmodulename = $delete;
}
if (!$confirm) {
echo $OUTPUT->confirm(get_string("moduledeleteconfirm", "", $strmodulename), "modules.php?delete=$delete&confirm=1", "modules.php");
echo $OUTPUT->footer();
exit;
} else { // Delete everything!!
if ($delete == "forum") {
print_error("cannotdeleteforummodule", 'forum');
}
uninstall_plugin('mod', $delete);
$a = new stdClass();
$a->module = $strmodulename;
$a->directory = "$CFG->dirroot/mod/$delete";
echo $OUTPUT->notification(get_string("moduledeletefiles", "", $a), 'notifysuccess');
echo $OUTPUT->continue_button("modules.php");
echo $OUTPUT->footer();
exit;
}
}
echo $OUTPUT->header();
echo $OUTPUT->heading($stractivities);
@@ -80,11 +114,11 @@
/// Print the table of all modules
// construct the flexible table ready to display
$table = new flexible_table(MODULE_TABLE);
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'uninstall', 'settings'));
$table->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strsettings, $struninstall));
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'delete', 'settings'));
$table->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/modules.php');
$table->set_attribute('id', 'modules');
$table->set_attribute('class', 'admintable generaltable');
$table->set_attribute('class', 'generaltable');
$table->setup();
foreach ($modules as $module) {
@@ -99,10 +133,7 @@
$missing = false;
}
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('mod_'.$module->name, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$delete = "<a href=\"modules.php?delete=$module->name&amp;sesskey=".sesskey()."\">$strdelete</a>";
if (file_exists("$CFG->dirroot/mod/$module->name/settings.php") ||
file_exists("$CFG->dirroot/mod/$module->name/settingstree.php")) {
@@ -130,28 +161,28 @@
$class = '';
} else if ($module->visible) {
$visible = "<a href=\"modules.php?hide=$module->name&amp;sesskey=".sesskey()."\" title=\"$strhide\">".
"<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strhide\" /></a>";
"<img src=\"" . $OUTPUT->pix_url('i/hide') . "\" class=\"icon\" alt=\"$strhide\" /></a>";
$class = '';
} else {
$visible = "<a href=\"modules.php?show=$module->name&amp;sesskey=".sesskey()."\" title=\"$strshow\">".
"<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strshow\" /></a>";
$class = 'dimmed_text';
"<img src=\"" . $OUTPUT->pix_url('i/show') . "\" class=\"icon\" alt=\"$strshow\" /></a>";
$class = ' class="dimmed_text"';
}
if ($module->name == "forum") {
$uninstall = "";
$delete = "";
$visible = "";
$class = "";
}
$version = get_config('mod_'.$module->name, 'version');
$table->add_data(array(
$strmodulename,
'<span'.$class.'>'.$strmodulename.'</span>',
$countlink,
$version,
'<span'.$class.'>'.$module->version.'</span>',
$visible,
$settings,
$uninstall,
), $class);
$delete,
$settings
));
}
$table->print_html();
+166
View File
@@ -0,0 +1,166 @@
<?php
if (!isset($CFG)) {
require('../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('oacleanup');
echo $OUTPUT->header();
online_assignment_cleanup(true);
echo $OUTPUT->footer();
}
function online_assignment_cleanup($output=false) {
global $CFG, $DB, $OUTPUT;
if ($output) {
echo $OUTPUT->heading('Online Assignment Cleanup');
echo '<center>';
}
/// We don't want to run this code if we are doing an upgrade from an assignment
/// version earlier than 2005041400
/// because the assignment type field will not exist
$amv = $DB->get_field('modules', 'version', array('name'=>'assignment'));
if ((int)$amv < 2005041400) {
if ($output) {
echo '</center>';
}
return;
}
/// get the module id for assignments from db
$arecord = $DB->get_record('modules', array('name', 'assignment'));
$aid = $arecord->id;
/// get a list of all courses on this site
list($ctxselect, $ctxjoin) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
$sql = "SELECT c.* $ctxselect FROM {course} c $ctxjoin";
$courses = $DB->get_records_sql($sql);
/// cycle through each course
foreach ($courses as $course) {
context_instance_preload($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
if (empty($course->fullname)) {
$fullname = get_string('course').': '.$course->id;
} else {
$fullname = format_string($course->fullname, true, array('context' => $context));
}
if ($output) echo $OUTPUT->heading($fullname);
/// retrieve a list of sections beyond what is currently being shown
$sql = "SELECT *
FROM {course_sections}
WHERE course=? AND section>?
ORDER BY section ASC";
$params = array($course->id, $course->numsections);
if (!($xsections = $DB->get_records_sql($sql, $params))) {
if ($output) echo 'No extra sections<br />';
continue;
}
/// cycle through each of the xtra sections
foreach ($xsections as $xsection) {
if ($output) echo 'Checking Section: '.$xsection->section.'<br />';
/// grab any module instances from the sequence field
if (!empty($xsection->sequence)) {
$instances = explode(',', $xsection->sequence);
/// cycle through the instances
foreach ($instances as $instance) {
/// is this an instance of an online assignment
$sql = "SELECT a.id
FROM {course_modules} cm, {assignment} a
WHERE cm.id = ? AND cm.module = ? AND
cm.instance = a.id AND a.assignmenttype = 'online'";
$params = array($instance, $aid);
/// if record exists then we need to move instance to it's correct section
if ($DB->record_exists_sql($sql, $params)) {
/// check the new section id
/// the journal update erroneously stored it in course_sections->section
$newsection = $xsection->section;
/// double check the new section
if ($newsection > $course->numsections) {
/// get the record for section 0 for this course
if (!($zerosection = $DB->get_record('course_sections', array('course'=>$course->id, 'section'=>'0')))) {
continue;
}
$newsection = $zerosection->id;
}
/// grab the section record
if (!($section = $DB->get_record('course_sections', array('id'=>$newsection)))) {
if ($output) {
echo 'Serious error: Cannot retrieve section: '.$newsection.' for course: '. $fullname .'<br />';
}
continue;
}
/// explode the sequence
if (($sequence = explode(',', $section->sequence)) === false) {
$sequence = array();
}
/// add instance to correct section
array_push($sequence, $instance);
/// implode the sequence
$section->sequence = implode(',', $sequence);
$DB->set_field('course_sections', 'sequence', $section->sequence, array('id'=>$section->id));
/// now we need to remove the instance from the old sequence
/// grab the old section record
if (!($section = $DB->get_record('course_sections', array('id'=>$xsection->id)))) {
if ($output) echo 'Serious error: Cannot retrieve old section: '.$xsection->id.' for course: '.$fullname.'<br />';
continue;
}
/// explode the sequence
if (($sequence = explode(',', $section->sequence)) === false) {
$sequence = array();
}
/// remove the old value from the array
$key = array_search($instance, $sequence);
unset($sequence[$key]);
/// implode the sequence
$section->sequence = implode(',', $sequence);
$DB->set_field('course_sections', 'sequence', $section->sequence, array('id'=>$section->id));
if ($output) echo 'Online Assignment (instance '.$instance.') moved from section '.$section->id.': to section '.$newsection.'<br />';
}
}
}
/// if the summary and sequence are empty then remove this section
if (empty($xsection->summary) and empty($xsection->sequence)) {
$DB->delete_records('course_sections', array('id'=>$xsection->id));
if ($output) echo 'Deleting empty section '.$xsection->section.'<br />';
}
}
}
echo '</center>';
}
+1 -1
View File
@@ -11,7 +11,7 @@
echo '<div class="phpinfo">';
ob_start();
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES + INFO_VARIABLES);
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES);
$html = ob_get_contents();
ob_end_clean();
-86
View File
@@ -1,86 +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/>.
/**
* Provides an overview of installed plagiarism plugins
*
* Displays the list of found plagiarism plugins, their version (if found) and
* a link to uninstall the plagiarism plugin.
*
* @see http://docs.moodle.org/dev/Plagiarism_API
* @package admin
* @copyright 2012 Dan Marsden <dan@danmarsden.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
admin_externalpage_setup('manageplagiarismplugins');
echo $OUTPUT->header();
// Print the table of all installed plagiarism plugins.
$txt = get_strings(array('settings', 'name', 'version'));
$txt->uninstall = get_string('uninstallplugin', 'core_admin');
$plagiarismplugins = core_component::get_plugin_list('plagiarism');
if (empty($plagiarismplugins)) {
echo $OUTPUT->notification(get_string('nopluginsinstalled', 'plagiarism'));
echo $OUTPUT->footer();
exit;
}
echo $OUTPUT->heading(get_string('availableplugins', 'plagiarism'), 3, 'main');
echo $OUTPUT->box_start('generalbox authsui');
$table = new html_table();
$table->head = array($txt->name, $txt->version, $txt->uninstall, $txt->settings);
$table->colclasses = array('mdl-left', 'mdl-align', 'mdl-align', 'mdl-align');
$table->data = array();
$table->attributes['class'] = 'manageplagiarismtable generaltable';
// Iterate through auth plugins and add to the display table.
$authcount = count($plagiarismplugins);
foreach ($plagiarismplugins as $plugin => $dir) {
if (file_exists($dir.'/settings.php')) {
$displayname = "<span>".get_string($plugin, 'plagiarism_'.$plugin)."</span>";
// Settings link.
$url = new moodle_url("/plagiarism/$plugin/settings.php");
$settings = html_writer::link($url, $txt->settings);
// Get version.
$version = get_config('plagiarism_' . $plugin);
if (!empty($version->version)) {
$version = $version->version;
} else {
$version = '?';
}
// uninstall link.
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('plagiarism_'.$plugin, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $txt->uninstall);
}
$table->data[] = array($displayname, $version, $uninstall, $settings);
}
}
echo html_writer::table($table);
echo get_string('configplagiarismplugins', 'plagiarism');
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
+9 -179
View File
@@ -26,191 +26,21 @@
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/filelib.php');
require_once($CFG->libdir . '/pluginlib.php');
$fetchupdates = optional_param('fetchupdates', false, PARAM_BOOL); // Check for available plugins updates.
$updatesonly = optional_param('updatesonly', false, PARAM_BOOL); // Show updateable plugins only.
$contribonly = optional_param('contribonly', false, PARAM_BOOL); // Show additional plugins only.
$uninstall = optional_param('uninstall', '', PARAM_COMPONENT); // Uninstall the plugin.
$delete = optional_param('delete', '', PARAM_COMPONENT); // Delete the plugin folder after it is uninstalled.
$confirmed = optional_param('confirm', false, PARAM_BOOL); // Confirm the uninstall/delete action.
$return = optional_param('return', 'overview', PARAM_ALPHA); // Where to return after uninstall.
$installupdate = optional_param('installupdate', null, PARAM_COMPONENT); // Install given available update.
$installupdateversion = optional_param('installupdateversion', null, PARAM_INT); // Version of the available update to install.
$installupdatex = optional_param('installupdatex', false, PARAM_BOOL); // Install all available plugin updates.
$confirminstallupdate = optional_param('confirminstallupdate', false, PARAM_BOOL); // Available update(s) install confirmed?
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
admin_externalpage_setup('pluginsoverview');
// NOTE: do not use admin_externalpage_setup() here because it loads
// full admin tree which is not possible during uninstallation.
$fetchremote = optional_param('fetchremote', false, PARAM_BOOL);
require_login();
$syscontext = context_system::instance();
require_capability('moodle/site:config', $syscontext);
$pluginman = plugin_manager::instance();
$checker = available_update_checker::instance();
// URL params we want to maintain on redirects.
$pageparams = array('updatesonly' => $updatesonly, 'contribonly' => $contribonly);
$pageurl = new moodle_url('/admin/plugins.php', $pageparams);
$pluginman = core_plugin_manager::instance();
if ($uninstall) {
require_sesskey();
if (!$confirmed) {
admin_externalpage_setup('pluginsoverview', '', $pageparams);
} else {
$PAGE->set_url($pageurl);
$PAGE->set_context($syscontext);
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
}
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
$pluginfo = $pluginman->get_plugin_info($uninstall);
// Make sure we know the plugin.
if (is_null($pluginfo)) {
throw new moodle_exception('err_uninstalling_unknown_plugin', 'core_plugin', '', array('plugin' => $uninstall),
'core_plugin_manager::get_plugin_info() returned null for the plugin to be uninstalled');
}
$pluginname = $pluginman->plugin_name($pluginfo->component);
$PAGE->set_title($pluginname);
$PAGE->navbar->add(get_string('uninstalling', 'core_plugin', array('name' => $pluginname)));
if (!$pluginman->can_uninstall_plugin($pluginfo->component)) {
throw new moodle_exception('err_cannot_uninstall_plugin', 'core_plugin', '',
array('plugin' => $pluginfo->component),
'core_plugin_manager::can_uninstall_plugin() returned false');
}
if (!$confirmed) {
$continueurl = new moodle_url($PAGE->url, array('uninstall' => $pluginfo->component, 'sesskey' => sesskey(), 'confirm' => 1, 'return'=>$return));
$cancelurl = $pluginfo->get_return_url_after_uninstall($return);
echo $output->plugin_uninstall_confirm_page($pluginman, $pluginfo, $continueurl, $cancelurl);
exit();
} else {
$SESSION->pluginuninstallreturn = $pluginfo->get_return_url_after_uninstall($return);
$progress = new progress_trace_buffer(new text_progress_trace(), false);
$pluginman->uninstall_plugin($pluginfo->component, $progress);
$progress->finished();
if ($pluginman->is_plugin_folder_removable($pluginfo->component)) {
$continueurl = new moodle_url($PAGE->url, array('delete' => $pluginfo->component, 'sesskey' => sesskey(), 'confirm' => 1));
echo $output->plugin_uninstall_results_removable_page($pluginman, $pluginfo, $progress, $continueurl);
// Reset op code caches.
if (function_exists('opcache_reset')) {
opcache_reset();
}
exit();
} else {
echo $output->plugin_uninstall_results_page($pluginman, $pluginfo, $progress);
// Reset op code caches.
if (function_exists('opcache_reset')) {
opcache_reset();
}
exit();
}
}
}
if ($delete and $confirmed) {
require_sesskey();
$PAGE->set_url($pageurl);
$PAGE->set_context($syscontext);
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
$pluginfo = $pluginman->get_plugin_info($delete);
// Make sure we know the plugin.
if (is_null($pluginfo)) {
throw new moodle_exception('err_removing_unknown_plugin', 'core_plugin', '', array('plugin' => $delete),
'core_plugin_manager::get_plugin_info() returned null for the plugin to be deleted');
}
$pluginname = $pluginman->plugin_name($pluginfo->component);
$PAGE->set_title($pluginname);
$PAGE->navbar->add(get_string('uninstalling', 'core_plugin', array('name' => $pluginname)));
// Make sure it is not installed.
if (!is_null($pluginfo->versiondb)) {
throw new moodle_exception('err_removing_installed_plugin', 'core_plugin', '',
array('plugin' => $pluginfo->component, 'versiondb' => $pluginfo->versiondb),
'core_plugin_manager::get_plugin_info() returned not-null versiondb for the plugin to be deleted');
}
// Make sure the folder is within Moodle installation tree.
if (strpos($pluginfo->rootdir, $CFG->dirroot) !== 0) {
throw new moodle_exception('err_unexpected_plugin_rootdir', 'core_plugin', '',
array('plugin' => $pluginfo->component, 'rootdir' => $pluginfo->rootdir, 'dirroot' => $CFG->dirroot),
'plugin root folder not in the moodle dirroot');
}
// So long, and thanks for all the bugs.
$pluginman->remove_plugin_folder($pluginfo);
// We need to execute upgrade to make sure everything including caches is up to date.
redirect(new moodle_url('/admin/index.php'));
}
// Install all avilable updates.
if ($installupdatex) {
require_once($CFG->libdir.'/upgradelib.php');
require_sesskey();
$PAGE->set_url($pageurl);
$PAGE->set_context($syscontext);
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
$installable = $pluginman->filter_installable($pluginman->available_updates());
upgrade_install_plugins($installable, $confirminstallupdate,
get_string('updateavailableinstallallhead', 'core_admin'),
new moodle_url($PAGE->url, array('installupdatex' => 1, 'confirminstallupdate' => 1))
);
}
// Install single available update.
if ($installupdate and $installupdateversion) {
require_once($CFG->libdir.'/upgradelib.php');
require_sesskey();
$PAGE->set_url($pageurl);
$PAGE->set_context($syscontext);
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
if ($pluginman->is_remote_plugin_installable($installupdate, $installupdateversion)) {
$installable = array($pluginman->get_remote_plugin_info($installupdate, $installupdateversion, true));
upgrade_install_plugins($installable, $confirminstallupdate,
get_string('updateavailableinstallallhead', 'core_admin'),
new moodle_url($PAGE->url, array('installupdate' => $installupdate,
'installupdateversion' => $installupdateversion, 'confirminstallupdate' => 1)
)
);
}
}
admin_externalpage_setup('pluginsoverview', '', $pageparams);
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
$checker = \core\update\checker::instance();
if ($fetchupdates) {
if ($fetchremote) {
require_sesskey();
$checker->fetch();
redirect($PAGE->url);
}
echo $output->plugin_management_page($pluginman, $checker, $pageparams);
$output = $PAGE->get_renderer('core', 'admin');
echo $output->plugin_management_page($pluginman, $checker);
+3 -5
View File
@@ -5,7 +5,7 @@ require_once($CFG->libdir . '/portfoliolib.php');
require_once($CFG->libdir . '/portfolio/forms.php');
require_once($CFG->libdir . '/adminlib.php');
$portfolio = optional_param('pf', '', PARAM_ALPHANUMEXT);
$portfolio = optional_param('pf', '', PARAM_FORMAT);
$action = optional_param('action', '', PARAM_ALPHA);
$sure = optional_param('sure', '', PARAM_ALPHA);
@@ -35,7 +35,7 @@ if ($action == 'newon') {
admin_externalpage_setup($pagename);
require_capability('moodle/site:config', context_system::instance());
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$baseurl = "$CFG->wwwroot/$CFG->admin/portfolio.php";
$sesskeyurl = "$CFG->wwwroot/$CFG->admin/portfolio.php?sesskey=" . sesskey();
@@ -88,7 +88,6 @@ if (($action == 'edit') || ($action == 'new')) {
} else {
portfolio_static_function($plugin, 'create_instance', $plugin, $fromform->name, $fromform);
}
core_plugin_manager::reset_caches();
$savedstr = get_string('instancesaved', 'portfolio');
redirect($baseurl, $savedstr, 1);
exit;
@@ -117,7 +116,6 @@ if (($action == 'edit') || ($action == 'new')) {
$instance->set('visible', $visible);
$instance->save();
core_plugin_manager::reset_caches();
$return = true;
} else if ($action == 'delete') {
$instance = portfolio_instance($portfolio);
@@ -162,7 +160,7 @@ if (($action == 'edit') || ($action == 'new')) {
$output = $OUTPUT->box_start('generalbox');
$plugins = core_component::get_plugin_list('portfolio');
$plugins = get_plugin_list('portfolio');
$plugins = array_keys($plugins);
$instances = portfolio_instances(false, false);
$usedplugins = array();
+30 -30
View File
@@ -27,37 +27,37 @@ require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
// If we have got here as a confirmed aciton, do it.
if ($confirm && isloggedin() && confirm_sesskey()) {
require_capability('moodle/site:config', context_system::instance());
// Valid request. Purge, and redirect the user back to where they came from.
purge_all_caches();
if ($returnurl) {
$returnurl = $CFG->wwwroot . $returnurl;
} else {
$returnurl = new moodle_url('/admin/purgecaches.php');
}
redirect($returnurl, get_string('purgecachesfinished', 'admin'));
}
// Otherwise, show a button to actually purge the caches.
admin_externalpage_setup('purgecaches');
$actionurl = new moodle_url('/admin/purgecaches.php', array('sesskey'=>sesskey(), 'confirm'=>1));
if ($returnurl) {
$actionurl->param('returnurl', $returnurl);
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
if ($confirm) {
require_sesskey();
// Valid request. Purge, and redisplay the form so it is easy to purge again
// in the near future.
purge_all_caches();
redirect(new moodle_url('/admin/purgecaches.php'), get_string('purgecachesfinished', 'admin'));
} else {
// Show a confirm form.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('purgecaches', 'admin'));
$url = new moodle_url('/admin/purgecaches.php', array('sesskey'=>sesskey(), 'confirm'=>1));
$button = new single_button($url, get_string('purgecaches','admin'), 'post');
// Cancel button takes them back to the page the were on, if possible,
// otherwise to the site home page.
$return = new moodle_url('/');
if (isset($_SERVER['HTTP_REFERER']) and !empty($_SERVER['HTTP_REFERER'])) {
if ($_SERVER['HTTP_REFERER'] !== "$CFG->wwwroot/$CFG->admin/purgecaches.php") {
$return = $_SERVER['HTTP_REFERER'];
}
}
echo $OUTPUT->confirm(get_string('purgecachesconfirm', 'admin'), $button, $return);
echo $OUTPUT->footer();
}
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('purgecaches', 'admin'));
echo $OUTPUT->box_start('generalbox', 'notice');
echo html_writer::tag('p', get_string('purgecachesconfirm', 'admin'));
echo $OUTPUT->single_button($actionurl, get_string('purgecaches', 'admin'), 'post');
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
+78 -17
View File
@@ -28,18 +28,19 @@
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir . '/questionlib.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/pluginlib.php');
require_once($CFG->libdir . '/tablelib.php');
// Check permissions.
require_login();
$systemcontext = context_system::instance();
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/question:config', $systemcontext);
admin_externalpage_setup('manageqbehaviours');
$thispageurl = new moodle_url('/admin/qbehaviours.php');
$behaviours = core_component::get_plugin_list('qbehaviour');
$pluginmanager = core_plugin_manager::instance();
$behaviours = get_plugin_list('qbehaviour');
$pluginmanager = plugin_manager::instance();
// Get some data we will need - question counts and which types are needed.
$counts = $DB->get_records_sql_menu("
@@ -91,7 +92,6 @@ if (($disable = optional_param('disable', '', PARAM_PLUGIN)) && confirm_sesskey(
$disabledbehaviours[] = $disable;
set_config('disabledbehaviours', implode(',', $disabledbehaviours), 'question');
}
core_plugin_manager::reset_caches();
redirect($thispageurl);
}
@@ -109,7 +109,6 @@ if (($enable = optional_param('enable', '', PARAM_PLUGIN)) && confirm_sesskey())
unset($disabledbehaviours[$key]);
set_config('disabledbehaviours', implode(',', $disabledbehaviours), 'question');
}
core_plugin_manager::reset_caches();
redirect($thispageurl);
}
@@ -137,6 +136,70 @@ if (($down = optional_param('down', '', PARAM_PLUGIN)) && confirm_sesskey()) {
redirect($thispageurl);
}
// Delete.
if (($delete = optional_param('delete', '', PARAM_PLUGIN)) && confirm_sesskey()) {
// Check it is OK to delete this question type.
if ($delete == 'missing') {
print_error('cannotdeletemissingbehaviour', 'question', $thispageurl);
}
if (!isset($behaviours[$delete])) {
print_error('unknownbehaviour', 'question', $thispageurl, $delete);
}
$behaviourname = $sortedbehaviours[$delete];
if ($counts[$delete] > 0) {
print_error('cannotdeletebehaviourinuse', 'question', $thispageurl, $behaviourname);
}
if ($needed[$delete] > 0) {
print_error('cannotdeleteneededbehaviour', 'question', $thispageurl, $behaviourname);
}
// If not yet confirmed, display a confirmation message.
if (!optional_param('confirm', '', PARAM_BOOL)) {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('deletebehaviourareyousure', 'question', $behaviourname));
echo $OUTPUT->confirm(
get_string('deletebehaviourareyousuremessage', 'question', $behaviourname),
new moodle_url($thispageurl, array('delete' => $delete, 'confirm' => 1)),
$thispageurl);
echo $OUTPUT->footer();
exit;
}
// Do the deletion.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('deletingbehaviour', 'question', $behaviourname));
// Delete any configuration records.
if (!unset_all_config_for_plugin('qbehaviour_' . $delete)) {
echo $OUTPUT->notification(get_string('errordeletingconfig', 'admin', 'qbehaviour_' . $delete));
}
if (($key = array_search($delete, $disabledbehaviours)) !== false) {
unset($disabledbehaviours[$key]);
set_config('disabledbehaviours', implode(',', $disabledbehaviours), 'question');
}
$behaviourorder = array_keys($sortedbehaviours);
if (($key = array_search($delete, $behaviourorder)) !== false) {
unset($behaviourorder[$key]);
set_config('behavioursortorder', implode(',', $behaviourorder), 'question');
}
// Then the tables themselves
drop_plugin_tables($delete, get_plugin_directory('qbehaviour', $delete) . '/db/install.xml', false);
// Remove event handlers and dequeue pending events
events_uninstall('qbehaviour_' . $delete);
$a = new stdClass();
$a->behaviour = $behaviourname;
$a->directory = get_plugin_directory('qbehaviour', $delete);
echo $OUTPUT->box(get_string('qbehaviourdeletefiles', 'question', $a), 'generalbox', 'notice');
echo $OUTPUT->continue_button($thispageurl);
echo $OUTPUT->footer();
exit;
}
// End of process actions ==================================================
// Print the page heading.
@@ -147,12 +210,12 @@ echo $OUTPUT->heading(get_string('manageqbehaviours', 'admin'));
$table = new flexible_table('qbehaviouradmintable');
$table->define_baseurl($thispageurl);
$table->define_columns(array('behaviour', 'numqas', 'version', 'requires',
'available', 'uninstall'));
'available', 'delete'));
$table->define_headers(array(get_string('behaviour', 'question'), get_string('numqas', 'question'),
get_string('version'), get_string('requires', 'admin'),
get_string('availableq', 'question'), get_string('uninstallplugin', 'core_admin')));
get_string('availableq', 'question'), get_string('delete')));
$table->set_attribute('id', 'qbehaviours');
$table->set_attribute('class', 'generaltable admintable');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->setup();
// Add a row for each question type.
@@ -195,7 +258,7 @@ foreach ($sortedbehaviours as $behaviour => $behaviourname) {
$rowclass = 'dimmed_text';
}
} else {
$icons = $OUTPUT->spacer(array('class' => 'iconsmall'));
$icons = $OUTPUT->spacer() . ' ';
}
// Move icons.
@@ -207,11 +270,9 @@ foreach ($sortedbehaviours as $behaviour => $behaviourname) {
if ($needed[$behaviour]) {
$row[] = '';
} else {
$uninstallurl = core_plugin_manager::instance()->get_uninstall_url('qbehaviour_'.$behaviour, 'manage');
if ($uninstallurl) {
$row[] = html_writer::link($uninstallurl, get_string('uninstallplugin', 'core_admin'),
$row[] = html_writer::link(new moodle_url($thispageurl,
array('delete' => $behaviour, 'sesskey' => sesskey())), get_string('delete'),
array('title' => get_string('uninstallbehaviour', 'question')));
}
}
$table->add_data($row, $rowclass);
@@ -223,10 +284,10 @@ echo $OUTPUT->footer();
function question_behaviour_enable_disable_icons($behaviour, $enabled) {
if ($enabled) {
return question_behaviour_icon_html('disable', $behaviour, 't/hide',
return question_behaviour_icon_html('disable', $behaviour, 'i/hide',
get_string('enabled', 'question'), get_string('disable'));
} else {
return question_behaviour_icon_html('enable', $behaviour, 't/show',
return question_behaviour_icon_html('enable', $behaviour, 'i/show',
get_string('disabled', 'question'), get_string('enable'));
}
}
@@ -235,7 +296,7 @@ function question_behaviour_icon_html($action, $behaviour, $icon, $alt, $tip) {
global $OUTPUT;
return $OUTPUT->action_icon(new moodle_url('/admin/qbehaviours.php',
array($action => $behaviour, 'sesskey' => sesskey())),
new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
null, array('title' => $tip));
new pix_icon($icon, $alt, 'moodle', array('title' => '')),
null, array('title' => $tip)) . ' ';
}
+78 -21
View File
@@ -28,11 +28,12 @@
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir . '/questionlib.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/pluginlib.php');
require_once($CFG->libdir . '/tablelib.php');
// Check permissions.
require_login();
$systemcontext = context_system::instance();
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/question:config', $systemcontext);
$canviewreports = has_capability('report/questioninstances:view', $systemcontext);
@@ -40,7 +41,7 @@ admin_externalpage_setup('manageqtypes');
$thispageurl = new moodle_url('/admin/qtypes.php');
$qtypes = question_bank::get_all_qtypes();
$pluginmanager = core_plugin_manager::instance();
$pluginmanager = plugin_manager::instance();
// Get some data we will need - question counts and which types are needed.
$counts = $DB->get_records_sql("
@@ -121,6 +122,64 @@ if (($down = optional_param('down', '', PARAM_PLUGIN)) && confirm_sesskey()) {
redirect($thispageurl);
}
// Delete.
if (($delete = optional_param('delete', '', PARAM_PLUGIN)) && confirm_sesskey()) {
// Check it is OK to delete this question type.
if ($delete == 'missingtype') {
print_error('cannotdeletemissingqtype', 'question', $thispageurl);
}
if (!isset($qtypes[$delete])) {
print_error('unknownquestiontype', 'question', $thispageurl, $delete);
}
$qtypename = $qtypes[$delete]->local_name();
if ($counts[$delete]->numquestions + $counts[$delete]->numhidden > 0) {
print_error('cannotdeleteqtypeinuse', 'question', $thispageurl, $qtypename);
}
if ($needed[$delete] > 0) {
print_error('cannotdeleteqtypeneeded', 'question', $thispageurl, $qtypename);
}
// If not yet confirmed, display a confirmation message.
if (!optional_param('confirm', '', PARAM_BOOL)) {
$qtypename = $qtypes[$delete]->local_name();
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('deleteqtypeareyousure', 'question', $qtypename));
echo $OUTPUT->confirm(get_string('deleteqtypeareyousuremessage', 'question', $qtypename),
new moodle_url($thispageurl, array('delete' => $delete, 'confirm' => 1)),
$thispageurl);
echo $OUTPUT->footer();
exit;
}
// Do the deletion.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('deletingqtype', 'question', $qtypename));
// Delete any configuration records.
if (!unset_all_config_for_plugin('qtype_' . $delete)) {
echo $OUTPUT->notification(get_string('errordeletingconfig', 'admin', 'qtype_' . $delete));
}
unset_config($delete . '_disabled', 'question');
unset_config($delete . '_sortorder', 'question');
// Then the tables themselves
drop_plugin_tables($delete, $qtypes[$delete]->plugin_dir() . '/db/install.xml', false);
// Remove event handlers and dequeue pending events
events_uninstall('qtype_' . $delete);
$a = new stdClass();
$a->qtype = $qtypename;
$a->directory = $qtypes[$delete]->plugin_dir();
echo $OUTPUT->box(get_string('qtypedeletefiles', 'question', $a), 'generalbox', 'notice');
echo $OUTPUT->continue_button($thispageurl);
echo $OUTPUT->footer();
exit;
}
// End of process actions ==================================================
// Print the page heading.
@@ -131,12 +190,12 @@ echo $OUTPUT->heading(get_string('manageqtypes', 'admin'));
$table = new flexible_table('qtypeadmintable');
$table->define_baseurl($thispageurl);
$table->define_columns(array('questiontype', 'numquestions', 'version', 'requires',
'availableto', 'uninstall', 'settings'));
'availableto', 'delete', 'settings'));
$table->define_headers(array(get_string('questiontype', 'question'), get_string('numquestions', 'question'),
get_string('version'), get_string('requires', 'admin'), get_string('availableq', 'question'),
get_string('settings'), get_string('uninstallplugin', 'core_admin')));
get_string('delete'), get_string('settings')));
$table->set_attribute('id', 'qtypes');
$table->set_attribute('class', 'admintable generaltable');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->setup();
// Add a row for each question type.
@@ -198,7 +257,7 @@ foreach ($sortedqtypes as $qtypename => $localname) {
$rowclass = 'dimmed_text';
}
} else {
$icons = $OUTPUT->spacer();
$icons = $OUTPUT->spacer() . ' ';
}
// Move icons.
@@ -206,6 +265,15 @@ foreach ($sortedqtypes as $qtypename => $localname) {
$icons .= question_type_icon_html('down', $qtypename, 't/down', get_string('down'), '');
$row[] = $icons;
// Delete link, if available.
if ($needed[$qtypename]) {
$row[] = '';
} else {
$row[] = html_writer::link(new moodle_url($thispageurl,
array('delete' => $qtypename, 'sesskey' => sesskey())), get_string('delete'),
array('title' => get_string('uninstallqtype', 'question')));
}
// Settings link, if available.
$settings = admin_get_root()->locate('qtypesetting' . $qtypename);
if ($settings instanceof admin_externalpage) {
@@ -217,17 +285,6 @@ foreach ($sortedqtypes as $qtypename => $localname) {
$row[] = '';
}
// Uninstall link, if available.
if ($needed[$qtypename]) {
$row[] = '';
} else {
$uninstallurl = core_plugin_manager::instance()->get_uninstall_url('qtype_'.$qtypename, 'manage');
if ($uninstallurl) {
$row[] = html_writer::link($uninstallurl, get_string('uninstallplugin', 'core_admin'),
array('title' => get_string('uninstallqtype', 'question')));
}
}
$table->add_data($row, $rowclass);
}
@@ -237,10 +294,10 @@ echo $OUTPUT->footer();
function question_types_enable_disable_icons($qtypename, $createable) {
if ($createable) {
return question_type_icon_html('disable', $qtypename, 't/hide',
return question_type_icon_html('disable', $qtypename, 'i/hide',
get_string('enabled', 'question'), get_string('disable'));
} else {
return question_type_icon_html('enable', $qtypename, 't/show',
return question_type_icon_html('enable', $qtypename, 'i/show',
get_string('disabled', 'question'), get_string('enable'));
}
}
@@ -249,7 +306,7 @@ function question_type_icon_html($action, $qtypename, $icon, $alt, $tip) {
global $OUTPUT;
return $OUTPUT->action_icon(new moodle_url('/admin/qtypes.php',
array($action => $qtypename, 'sesskey' => sesskey())),
new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
null, array('title' => $tip));
new pix_icon($icon, $alt, 'moodle', array('title' => '')),
null, array('title' => $tip)) . ' ';
}
+5 -2
View File
@@ -58,14 +58,17 @@ if (!empty($registeredhub) and $registeredhub->token == $token) {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('registrationconfirmed', 'hub'), 3, 'main');
$hublink = html_writer::tag('a', $hubname, array('href' => $url));
$registeredhub->token = $newtoken;
$registeredhub->confirmed = 1;
$registeredhub->hubname = $hubname;
$registrationmanager->update_registeredhub($registeredhub);
// Display notification message.
echo $OUTPUT->notification(get_string('registrationconfirmedon', 'hub'), 'notifysuccess');
//display notficiation message
$notificationmessage = $OUTPUT->notification(
get_string('registrationconfirmedon', 'hub', $hublink), 'notifysuccess');
echo $notificationmessage;
//display continue button
$registrationpage = new moodle_url('/admin/registration/index.php');
+33 -74
View File
@@ -49,10 +49,8 @@ class site_unregistration_form extends moodleform {
$unregisterlabel = get_string('unregister', 'hub');
$mform->addElement('checkbox', 'unpublishalladvertisedcourses', '',
' ' . get_string('unpublishalladvertisedcourses', 'hub'));
$mform->setType('unpublishalladvertisedcourses', PARAM_INT);
$mform->addElement('checkbox', 'unpublishalluploadedcourses', '',
' ' . get_string('unpublishalluploadedcourses', 'hub'));
$mform->setType('unpublishalluploadedcourses', PARAM_INT);
$mform->addElement('hidden', 'confirm', 1);
$mform->setType('confirm', PARAM_INT);
@@ -84,6 +82,7 @@ class site_clean_registration_data_form extends moodleform {
$unregisterlabel = get_string('forceunregister', 'hub');
$mform->addElement('static', '', get_string('warning', 'hub'), get_string('forceunregisterconfirmation', 'hub', $hubname));
$mform->addElement('hidden', 'confirm', 1);
$mform->setType('confirm', PARAM_INT);
$mform->addElement('hidden', 'unregistration', 1);
@@ -137,8 +136,8 @@ class hub_selector_form extends moodleform {
$options = array();
foreach ($hubs as $hub) {
//to not display a name longer than 100 character (too big)
if (core_text::strlen($hub['name']) > 100) {
$hubname = core_text::substr($hub['name'], 0, 100);
if (textlib::strlen($hub['name']) > 100) {
$hubname = textlib::substr($hub['name'], 0, 100);
$hubname = $hubname . "...";
} else {
$hubname = $hub['name'];
@@ -150,7 +149,6 @@ class hub_selector_form extends moodleform {
if (!empty($hubs)) {
$mform->addElement('select', 'publichub', get_string('publichub', 'hub'),
$options, array("size" => 15));
$mform->setType('publichub', PARAM_URL);
}
$mform->addElement('static', 'or', '', get_string('orenterprivatehub', 'hub'));
@@ -158,10 +156,8 @@ class hub_selector_form extends moodleform {
//Private hub
$mform->addElement('text', 'unlistedurl', get_string('privatehuburl', 'hub'),
array('class' => 'registration_textfield'));
$mform->setType('unlistedurl', PARAM_URL);
$mform->addElement('text', 'password', get_string('password'),
array('class' => 'registration_textfield'));
$mform->setType('password', PARAM_RAW);
$this->add_action_buttons(false, get_string('selecthub', 'hub'));
}
@@ -175,8 +171,11 @@ class hub_selector_form extends moodleform {
$unlistedurl = $this->_form->_submitValues['unlistedurl'];
if (empty($unlistedurl)) {
$errors['unlistedurl'] = get_string('badurlformat', 'hub');
if (!empty($unlistedurl)) {
$unlistedurltotest = clean_param($unlistedurl, PARAM_URL);
if (empty($unlistedurltotest)) {
$errors['unlistedurl'] = get_string('badurlformat', 'hub');
}
}
return $errors;
@@ -204,7 +203,7 @@ class site_registration_form extends moodleform {
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
$sitename = get_config('hub', 'site_name_' . $cleanhuburl);
if ($sitename === false) {
$sitename = format_string($site->fullname, true, array('context' => context_course::instance(SITEID)));
$sitename = format_string($site->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, SITEID)));
}
$sitedescription = get_config('hub', 'site_description_' . $cleanhuburl);
if ($sitedescription === false) {
@@ -244,11 +243,7 @@ class site_registration_form extends moodleform {
$postsnumber = get_config('hub', 'site_postsnumber_' . $cleanhuburl);
$questionsnumber = get_config('hub', 'site_questionsnumber_' . $cleanhuburl);
$resourcesnumber = get_config('hub', 'site_resourcesnumber_' . $cleanhuburl);
$badgesnumber = get_config('hub', 'site_badges_' . $cleanhuburl);
$issuedbadgesnumber = get_config('hub', 'site_issuedbadges_' . $cleanhuburl);
$mediancoursesize = get_config('hub', 'site_mediancoursesize_' . $cleanhuburl);
$participantnumberaveragecfg = get_config('hub', 'site_participantnumberaverage_' . $cleanhuburl);
$modulenumberaveragecfg = get_config('hub', 'site_modulenumberaverage_' . $cleanhuburl);
//hidden parameters
$mform->addElement('hidden', 'huburl', $huburl);
@@ -275,7 +270,6 @@ class site_registration_form extends moodleform {
$options[HUB_SITELINKPUBLISHED] = $registrationmanager->get_site_privacy_string(HUB_SITELINKPUBLISHED);
$mform->addElement('select', 'privacy', get_string('siteprivacy', 'hub'), $options);
$mform->setDefault('privacy', $privacy);
$mform->setType('privacy', PARAM_ALPHA);
$mform->addHelpButton('privacy', 'privacy', 'hub');
unset($options);
@@ -287,7 +281,7 @@ class site_registration_form extends moodleform {
$mform->addHelpButton('description', 'sitedesc', 'hub');
$languages = get_string_manager()->get_list_of_languages();
core_collator::asort($languages);
collatorlib::asort($languages);
$mform->addElement('select', 'language', get_string('sitelang', 'hub'),
$languages);
$mform->setType('language', PARAM_ALPHANUMEXT);
@@ -309,13 +303,11 @@ class site_registration_form extends moodleform {
$countries = get_string_manager()->get_list_of_countries();
$mform->addElement('select', 'countrycode', get_string('sitecountry', 'hub'), $countries);
$mform->setDefault('countrycode', $country);
$mform->setType('countrycode', PARAM_ALPHANUMEXT);
$mform->addHelpButton('countrycode', 'sitecountry', 'hub');
$mform->addElement('text', 'geolocation', get_string('sitegeolocation', 'hub'),
array('class' => 'registration_textfield'));
$mform->setDefault('geolocation', $geolocation);
$mform->setType('geolocation', PARAM_RAW);
$mform->addHelpButton('geolocation', 'sitegeolocation', 'hub');
$mform->addElement('text', 'contactname', get_string('siteadmin', 'hub'),
@@ -333,7 +325,7 @@ class site_registration_form extends moodleform {
$mform->addElement('text', 'contactemail', get_string('siteemail', 'hub'),
array('class' => 'registration_textfield'));
$mform->addRule('contactemail', $strrequired, 'required', null, 'client');
$mform->setType('contactemail', PARAM_EMAIL);
$mform->setType('contactemail', PARAM_TEXT);
$mform->setDefault('contactemail', $contactemail);
$mform->addHelpButton('contactemail', 'siteemail', 'hub');
@@ -342,7 +334,6 @@ class site_registration_form extends moodleform {
$options[1] = get_string("registrationcontactyes");
$mform->addElement('select', 'contactable', get_string('siteregistrationcontact', 'hub'), $options);
$mform->setDefault('contactable', $contactable);
$mform->setType('contactable', PARAM_INT);
$mform->addHelpButton('contactable', 'siteregistrationcontact', 'hub');
unset($options);
@@ -351,7 +342,6 @@ class site_registration_form extends moodleform {
$options[1] = get_string("registrationyes");
$mform->addElement('select', 'emailalert', get_string('siteregistrationemail', 'hub'), $options);
$mform->setDefault('emailalert', $emailalert);
$mform->setType('emailalert', PARAM_INT);
$mform->addHelpButton('emailalert', 'siteregistrationemail', 'hub');
unset($options);
@@ -382,111 +372,80 @@ class site_registration_form extends moodleform {
require_once($CFG->dirroot . "/course/lib.php");
$participantnumberaverage = number_format(average_number_of_participants(), 2);
$modulenumberaverage = number_format(average_number_of_courses_modules(), 2);
require_once($CFG->libdir . '/badgeslib.php');
$badges = $DB->count_records_select('badge', 'status <> ' . BADGE_STATUS_ARCHIVED);
$issuedbadges = $DB->count_records('badge_issued');
if (HUB_MOODLEORGHUBURL != $huburl) {
$mform->addElement('checkbox', 'courses', get_string('sendfollowinginfo', 'hub'),
" " . get_string('coursesnumber', 'hub', $coursecount));
$mform->setDefault('courses', $coursesnumber != -1);
$mform->setType('courses', PARAM_INT);
$mform->setDefault('courses', true);
$mform->addHelpButton('courses', 'sendfollowinginfo', 'hub');
$mform->addElement('checkbox', 'users', '',
" " . get_string('usersnumber', 'hub', $usercount));
$mform->setDefault('users', $usersnumber != -1);
$mform->setType('users', PARAM_INT);
$mform->setDefault('users', true);
$mform->addElement('checkbox', 'roleassignments', '',
" " . get_string('roleassignmentsnumber', 'hub', $roleassigncount));
$mform->setDefault('roleassignments', $roleassignmentsnumber != -1);
$mform->setType('roleassignments', PARAM_INT);
$mform->setDefault('roleassignments', true);
$mform->addElement('checkbox', 'posts', '',
" " . get_string('postsnumber', 'hub', $postcount));
$mform->setDefault('posts', $postsnumber != -1);
$mform->setType('posts', PARAM_INT);
$mform->setDefault('posts', true);
$mform->addElement('checkbox', 'questions', '',
" " . get_string('questionsnumber', 'hub', $questioncount));
$mform->setDefault('questions', $questionsnumber != -1);
$mform->setType('questions', PARAM_INT);
$mform->setDefault('questions', true);
$mform->addElement('checkbox', 'resources', '',
" " . get_string('resourcesnumber', 'hub', $resourcecount));
$mform->setDefault('resources', $resourcesnumber != -1);
$mform->setType('resources', PARAM_INT);
$mform->addElement('checkbox', 'badges', '',
" " . get_string('badgesnumber', 'hub', $badges));
$mform->setDefault('badges', $badgesnumber != -1);
$mform->setType('resources', PARAM_INT);
$mform->addElement('checkbox', 'issuedbadges', '',
" " . get_string('issuedbadgesnumber', 'hub', $issuedbadges));
$mform->setDefault('issuedbadges', $issuedbadgesnumber != -1);
$mform->setType('resources', PARAM_INT);
$mform->setDefault('resources', true);
$mform->addElement('checkbox', 'participantnumberaverage', '',
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
$mform->setDefault('participantnumberaverage', $participantnumberaveragecfg != -1);
$mform->setType('participantnumberaverage', PARAM_FLOAT);
$mform->setDefault('participantnumberaverage', true);
$mform->addElement('checkbox', 'modulenumberaverage', '',
" " . get_string('modulenumberaverage', 'hub', $modulenumberaverage));
$mform->setDefault('modulenumberaverage', $modulenumberaveragecfg != -1);
$mform->setType('modulenumberaverage', PARAM_FLOAT);
$mform->setDefault('modulenumberaverage', true);
} else {
$mform->addElement('static', 'courseslabel', get_string('sendfollowinginfo', 'hub'),
" " . get_string('coursesnumber', 'hub', $coursecount));
$mform->addElement('hidden', 'courses', 1);
$mform->setType('courses', PARAM_INT);
$mform->addElement('hidden', 'courses', true);
$mform->setType('courses', PARAM_FLOAT);
$mform->addHelpButton('courseslabel', 'sendfollowinginfo', 'hub');
$mform->addElement('static', 'userslabel', '',
" " . get_string('usersnumber', 'hub', $usercount));
$mform->addElement('hidden', 'users', 1);
$mform->setType('users', PARAM_INT);
$mform->addElement('hidden', 'users', true);
$mform->setType('users', PARAM_FLOAT);
$mform->addElement('static', 'roleassignmentslabel', '',
" " . get_string('roleassignmentsnumber', 'hub', $roleassigncount));
$mform->addElement('hidden', 'roleassignments', 1);
$mform->setType('roleassignments', PARAM_INT);
$mform->addElement('hidden', 'roleassignments', true);
$mform->setType('roleassignments', PARAM_FLOAT);
$mform->addElement('static', 'postslabel', '',
" " . get_string('postsnumber', 'hub', $postcount));
$mform->addElement('hidden', 'posts', 1);
$mform->setType('posts', PARAM_INT);
$mform->addElement('hidden', 'posts', true);
$mform->setType('posts', PARAM_FLOAT);
$mform->addElement('static', 'questionslabel', '',
" " . get_string('questionsnumber', 'hub', $questioncount));
$mform->addElement('hidden', 'questions', 1);
$mform->setType('questions', PARAM_INT);
$mform->addElement('hidden', 'questions', true);
$mform->setType('questions', PARAM_FLOAT);
$mform->addElement('static', 'resourceslabel', '',
" " . get_string('resourcesnumber', 'hub', $resourcecount));
$mform->addElement('hidden', 'resources', 1);
$mform->setType('resources', PARAM_INT);
$mform->addElement('static', 'badgeslabel', '',
" " . get_string('badgesnumber', 'hub', $badges));
$mform->addElement('hidden', 'badges', 1);
$mform->setType('badges', PARAM_INT);
$mform->addElement('static', 'issuedbadgeslabel', '',
" " . get_string('issuedbadgesnumber', 'hub', $issuedbadges));
$mform->addElement('hidden', 'issuedbadges', true);
$mform->setType('issuedbadges', PARAM_INT);
$mform->addElement('hidden', 'resources', true);
$mform->setType('resources', PARAM_FLOAT);
$mform->addElement('static', 'participantnumberaveragelabel', '',
" " . get_string('participantnumberaverage', 'hub', $participantnumberaverage));
$mform->addElement('hidden', 'participantnumberaverage', 1);
$mform->addElement('hidden', 'participantnumberaverage', true);
$mform->setType('participantnumberaverage', PARAM_FLOAT);
$mform->addElement('static', 'modulenumberaveragelabel', '',
" " . get_string('modulenumberaverage', 'hub', $modulenumberaverage));
$mform->addElement('hidden', 'modulenumberaverage', 1);
$mform->addElement('hidden', 'modulenumberaverage', true);
$mform->setType('modulenumberaverage', PARAM_FLOAT);
}
+3 -3
View File
@@ -22,9 +22,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
*
* On this page the administrator selects which hub he wants to register (except for moodle.net)
* Admins can register with moodle.net via the site admin menu "Registration" link.
* On this page the administrator can also unregister from any hubs including moodle.net.
* On this page the administrator selects which hub he wants to register,
* except for MOOCH. Admins can register with MOOCH with the top admin menu "Registration" link.
* On this page the administrator can also unregister from any hubs, including MOOCH.
*/
require('../../config.php');
+27 -42
View File
@@ -53,30 +53,31 @@ class registration_manager {
public function cron() {
global $CFG;
if (extension_loaded('xmlrpc')) {
$function = 'hub_update_site_info';
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
//check if the last registration cron update was less than a week ago
$lastcron = get_config('registration', 'crontime');
if ($lastcron === false or $lastcron < strtotime("-7 day")) { //set to a week, see MDL-23704
$function = 'hub_update_site_info';
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
// Update all hubs where the site is registered.
$hubs = $this->get_registered_on_hubs();
if (empty($hubs)) {
mtrace(get_string('registrationwarning', 'admin'));
}
foreach ($hubs as $hub) {
// Update the registration.
$siteinfo = $this->get_site_info($hub->huburl);
$params = array('siteinfo' => $siteinfo);
$serverurl = $hub->huburl . "/local/hub/webservice/webservices.php";
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
try {
$result = $xmlrpcclient->call($function, $params);
$this->update_registeredhub($hub); // To update timemodified.
mtrace(get_string('siteupdatedcron', 'hub', $hub->hubname));
} catch (Exception $e) {
$errorparam = new stdClass();
$errorparam->errormessage = $e->getMessage();
$errorparam->hubname = $hub->hubname;
mtrace(get_string('errorcron', 'hub', $errorparam));
//update all hub where the site is registered on
$hubs = $this->get_registered_on_hubs();
foreach ($hubs as $hub) {
//update the registration
$siteinfo = $this->get_site_info($hub->huburl);
$params = array('siteinfo' => $siteinfo);
$serverurl = $hub->huburl . "/local/hub/webservice/webservices.php";
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
try {
$result = $xmlrpcclient->call($function, $params);
mtrace(get_string('siteupdatedcron', 'hub', $hub->hubname));
} catch (Exception $e) {
$errorparam = new stdClass();
$errorparam->errormessage = $e->getMessage();
$errorparam->hubname = $hub->hubname;
mtrace(get_string('errorcron', 'hub', $errorparam));
}
}
set_config('crontime', time(), 'registration');
}
} else {
mtrace(get_string('errorcronnoxmlrpc', 'hub'));
@@ -117,7 +118,6 @@ class registration_manager {
*/
public function add_registeredhub($hub) {
global $DB;
$hub->timemodified = time();
$id = $DB->insert_record('registration_hubs', $hub);
return $id;
}
@@ -171,16 +171,15 @@ class registration_manager {
/**
* Update a registered hub (mostly use to update the confirmation status)
* @param object $hub the hub
* @param object $communication the hub
*/
public function update_registeredhub($hub) {
public function update_registeredhub($communication) {
global $DB;
$hub->timemodified = time();
$DB->update_record('registration_hubs', $hub);
$DB->update_record('registration_hubs', $communication);
}
/**
* Return all hubs where the site is registered
* Return all hubs where the site is registered on
*/
public function get_registered_on_hubs() {
global $DB;
@@ -248,20 +247,6 @@ class registration_manager {
$resourcecount = $DB->count_records('resource');
}
$siteinfo['resources'] = $resourcecount;
// Badge statistics.
require_once($CFG->libdir . '/badgeslib.php');
if (get_config('hub', 'site_badges_' . $cleanhuburl) == -1) {
$badges = -1;
} else {
$badges = $DB->count_records_select('badge', 'status <> ' . BADGE_STATUS_ARCHIVED);
}
$siteinfo['badges'] = $badges;
if (get_config('hub', 'site_issuedbadges_' . $cleanhuburl) == -1) {
$issuedbadges = -1;
} else {
$issuedbadges = $DB->count_records('badge_issued');
}
$siteinfo['issuedbadges'] = $issuedbadges;
//TODO
require_once($CFG->dirroot . "/course/lib.php");
if (get_config('hub', 'site_participantnumberaverage_' . $cleanhuburl) == -1) {
+2 -45
View File
@@ -39,8 +39,6 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
require_once($CFG->dirroot . '/webservice/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
require_sesskey();
$huburl = required_param('huburl', PARAM_URL);
$huburl = rtrim($huburl, "/");
@@ -64,18 +62,7 @@ $siteregistrationform = new site_registration_form('',
$fromform = $siteregistrationform->get_data();
if (!empty($fromform) and confirm_sesskey()) {
// Set to -1 all optional data marked as "don't send" by the admin.
// The function get_site_info() will not calculate the optional data if config is set to -1.
$inputnames = array('courses', 'users', 'roleassignments', 'posts', 'questions', 'resources',
'badges', 'issuedbadges', 'modulenumberaverage', 'participantnumberaverage');
foreach ($inputnames as $inputname) {
if (empty($fromform->{$inputname})) {
$fromform->{$inputname} = -1;
}
}
// Save the settings.
//save the settings
$cleanhuburl = clean_param($huburl, PARAM_ALPHANUMEXT);
set_config('site_name_' . $cleanhuburl, $fromform->name, 'hub');
set_config('site_description_' . $cleanhuburl, $fromform->description, 'hub');
@@ -97,8 +84,6 @@ if (!empty($fromform) and confirm_sesskey()) {
set_config('site_postsnumber_' . $cleanhuburl, $fromform->posts, 'hub');
set_config('site_questionsnumber_' . $cleanhuburl, $fromform->questions, 'hub');
set_config('site_resourcesnumber_' . $cleanhuburl, $fromform->resources, 'hub');
set_config('site_badges_' . $cleanhuburl, $fromform->badges, 'hub');
set_config('site_issuedbadges_' . $cleanhuburl, $fromform->issuedbadges, 'hub');
set_config('site_modulenumberaverage_' . $cleanhuburl, $fromform->modulenumberaverage, 'hub');
set_config('site_participantnumberaverage_' . $cleanhuburl, $fromform->participantnumberaverage, 'hub');
}
@@ -118,7 +103,6 @@ if ($update and confirm_sesskey()) {
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $registeredhub->token);
try {
$result = $xmlrpcclient->call($function, $params);
$registrationmanager->update_registeredhub($registeredhub); // To update timemodified.
} catch (Exception $e) {
$error = $OUTPUT->notification(get_string('errorregistration', 'hub', $e->getMessage()));
}
@@ -129,21 +113,6 @@ if ($update and confirm_sesskey()) {
if (!empty($fromform) and empty($update) and confirm_sesskey()) {
if (!empty($fromform) and confirm_sesskey()) { // if the register button has been clicked
// Retrieve the optional info (specially course number, user number, module number average...).
$siteinfo = $registrationmanager->get_site_info($huburl);
$fromform->courses = $siteinfo['courses'];
$fromform->users = $siteinfo['users'];
$fromform->enrolments = $siteinfo['enrolments'];
$fromform->posts = $siteinfo['posts'];
$fromform->questions = $siteinfo['questions'];
$fromform->resources = $siteinfo['resources'];
$fromform->badges = $siteinfo['badges'];
$fromform->issuedbadges = $siteinfo['issuedbadges'];
$fromform->modulenumberaverage = $siteinfo['modulenumberaverage'];
$fromform->participantnumberaverage = $siteinfo['participantnumberaverage'];
$fromform->street = $siteinfo['street'];
$params = (array) $fromform; //we are using the form input as the redirection parameters (token, url and name)
$unconfirmedhub = $registrationmanager->get_unconfirmedhub($huburl);
@@ -178,20 +147,8 @@ if (!empty($error)) {
echo $error;
}
// Some Moodle.org registration explanation.
//some Moodle.org resitration explanation
if ($huburl == HUB_MOODLEORGHUBURL) {
if (!empty($registeredhub->token)) {
if ($registeredhub->timemodified == 0) {
$registrationmessage = get_string('pleaserefreshregistrationunknown', 'admin');
} else {
$lastupdated = userdate($registeredhub->timemodified, get_string('strftimedate', 'langconfig'));
$registrationmessage = get_string('pleaserefreshregistration', 'admin', $lastupdated);
}
} else {
$registrationmessage = get_string('registrationwarning', 'admin');
}
echo $OUTPUT->notification($registrationmessage);
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
$renderer = $PAGE->get_renderer('core', 'register');
echo $renderer->moodleorg_registration_message();
+8 -8
View File
@@ -31,18 +31,18 @@
class core_register_renderer extends plugin_renderer_base {
/**
* Display message about the benefits of registering on Moodle.org
* Display Moodle.org registration message about benefit to register on Moodle.org
*
* @return string
*/
public function moodleorg_registration_message() {
$moodleorgstatslink = html_writer::link('http://moodle.net/stats',
get_string('statsmoodleorg', 'admin'),
array('target' => '_blank'));
$moodleorgregmsg = get_string('registermoodleorg', 'admin');
$moodleorgurl = html_writer::link('http://moodle.org', 'Moodle.org');
$moodleorgstatsurl = html_writer::link('http://moodle.org/stats', get_string('statsmoodleorg', 'admin'));
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, 'MOOCH');
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
$items = array(get_string('registermoodleorgli1', 'admin'),
get_string('registermoodleorgli2', 'admin', $moodleorgstatslink));
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
get_string('registermoodleorgli3', 'admin', $moochurl));
$moodleorgregmsg .= html_writer::alist($items);
return $moodleorgregmsg;
}
@@ -92,4 +92,4 @@ class core_register_renderer extends plugin_renderer_base {
return html_writer::table($table);
}
}
}
+251 -980
View File
File diff suppressed because it is too large Load Diff
+43 -29
View File
@@ -18,7 +18,7 @@
* Provides an overview of installed reports
*
* Displays the list of found reports, their version (if found) and
* a link to uninstall the report.
* a link to delete the report.
*
* The code is based on admin/localplugins.php by David Mudrak.
*
@@ -33,25 +33,55 @@ require_once($CFG->libdir.'/tablelib.php');
admin_externalpage_setup('managereports');
$delete = optional_param('delete', '', PARAM_PLUGIN);
$confirm = optional_param('confirm', '', PARAM_BOOL);
/// If data submitted, then process and store.
if (!empty($delete) and confirm_sesskey()) {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('reports'));
if (!$confirm) {
if (get_string_manager()->string_exists('pluginname', 'report_' . $delete)) {
$strpluginname = get_string('pluginname', 'report_' . $delete);
} else {
$strpluginname = $delete;
}
echo $OUTPUT->confirm(get_string('reportsdeleteconfirm', 'admin', $strpluginname),
new moodle_url($PAGE->url, array('delete' => $delete, 'confirm' => 1)),
$PAGE->url);
echo $OUTPUT->footer();
die();
} else {
uninstall_plugin('report', $delete);
$a = new stdclass();
$a->name = $delete;
$pluginlocation = get_plugin_types();
$a->directory = $pluginlocation['report'] . '/' . $delete;
echo $OUTPUT->notification(get_string('plugindeletefiles', '', $a), 'notifysuccess');
echo $OUTPUT->continue_button($PAGE->url);
echo $OUTPUT->footer();
die();
}
}
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('reports'));
/// Print the table of all installed report plugins
$struninstall = get_string('uninstallplugin', 'core_admin');
$table = new flexible_table('reportplugins_administration_table');
$table->define_columns(array('name', 'logstoressupported', 'version', 'uninstall'));
$table->define_headers(array(get_string('plugin'), get_string('logstoressupported', 'admin'), get_string('version'),
$struninstall));
$table->define_columns(array('name', 'version', 'delete'));
$table->define_headers(array(get_string('plugin'), get_string('version'), get_string('delete')));
$table->define_baseurl($PAGE->url);
$table->set_attribute('id', 'reportplugins');
$table->set_attribute('class', 'admintable generaltable');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->setup();
$plugins = array();
$availableplugins = core_component::get_plugin_list('report');
foreach ($availableplugins as $plugin => $plugindir) {
foreach (get_plugin_list('report') as $plugin => $plugindir) {
if (get_string_manager()->string_exists('pluginname', 'report_' . $plugin)) {
$strpluginname = get_string('pluginname', 'report_' . $plugin);
} else {
@@ -59,7 +89,7 @@ foreach ($availableplugins as $plugin => $plugindir) {
}
$plugins[$plugin] = $strpluginname;
}
core_collator::asort($plugins);
collatorlib::asort($plugins);
$like = $DB->sql_like('plugin', '?', true, true, false, '|');
$params = array('report|_%');
@@ -73,25 +103,9 @@ foreach ($installed as $config) {
}
}
$logmanager = get_log_manager();
foreach ($plugins as $plugin => $name) {
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('report_'.$plugin, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$stores = array();
if (isset($availableplugins[$plugin])) {
$stores = $logmanager->get_supported_logstores('report_' . $plugin);
}
if ($stores === false) {
$supportedstores = get_string('logstorenotrequired', 'admin');
} else if (!empty($stores)) {
$supportedstores = implode(', ', $stores);
} else {
$supportedstores = get_string('nosupportedlogstore', 'admin');;
}
$delete = new moodle_url($PAGE->url, array('delete' => $plugin, 'sesskey' => sesskey()));
$delete = html_writer::link($delete, get_string('delete'));
if (!isset($versions[$plugin])) {
if (file_exists("$CFG->dirroot/report/$plugin/version.php")) {
@@ -112,7 +126,7 @@ foreach ($plugins as $plugin => $name) {
}
}
$table->add_data(array($name, $supportedstores, $version, $uninstall));
$table->add_data(array($name, $version, $delete));
}
$table->print_html();
+17 -37
View File
@@ -19,7 +19,7 @@ require_once($CFG->dirroot . '/repository/lib.php');
require_once($CFG->libdir . '/adminlib.php');
$repository = optional_param('repos', '', PARAM_ALPHANUMEXT);
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$action = optional_param('action', '', PARAM_ACTION);
$sure = optional_param('sure', '', PARAM_ALPHA);
$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
@@ -47,7 +47,7 @@ if ($action == 'newon') {
$visible = false;
}
require_capability('moodle/site:config', context_system::instance());
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
admin_externalpage_setup($pagename);
$sesskeyurl = $CFG->wwwroot.'/'.$CFG->admin.'/repository.php?sesskey=' . sesskey();
@@ -140,15 +140,12 @@ if (($action == 'edit') || ($action == 'new')) {
$success = $repositorytype->update_options($settings);
} else {
$type = new repository_type($plugin, (array)$fromform, $visible);
$type->create();
$success = true;
if (!$repoid = $type->create()) {
$success = false;
}
$data = data_submitted();
}
if ($success) {
// configs saved
core_plugin_manager::reset_caches();
redirect($baseurl);
} else {
print_error('instancenotsaved', 'repository', $baseurl);
@@ -189,7 +186,6 @@ if (($action == 'edit') || ($action == 'new')) {
print_error('invalidplugin', 'repository', '', $repository);
}
$repositorytype->update_visibility(true);
core_plugin_manager::reset_caches();
$return = true;
} else if ($action == 'hide') {
if (!confirm_sesskey()) {
@@ -200,7 +196,6 @@ if (($action == 'edit') || ($action == 'new')) {
print_error('invalidplugin', 'repository', '', $repository);
}
$repositorytype->update_visibility(false);
core_plugin_manager::reset_caches();
$return = true;
} else if ($action == 'delete') {
$repositorytype = repository::get_type_by_typename($repository);
@@ -211,7 +206,6 @@ if (($action == 'edit') || ($action == 'new')) {
}
if ($repositorytype->delete($downloadcontents)) {
core_plugin_manager::reset_caches();
redirect($baseurl);
} else {
print_error('instancenotdeleted', 'repository', $baseurl);
@@ -264,7 +258,6 @@ if (($action == 'edit') || ($action == 'new')) {
$strshow = get_string('on', 'repository');
$strhide = get_string('off', 'repository');
$strdelete = get_string('disabled', 'repository');
$struninstall = get_string('uninstallplugin', 'core_admin');
$actionchoicesforexisting = array(
'show' => $strshow,
@@ -287,21 +280,18 @@ if (($action == 'edit') || ($action == 'new')) {
// Table to list plug-ins
$table = new html_table();
$table->head = array(get_string('name'), get_string('isactive', 'repository'), get_string('order'), $settingsstr, $struninstall);
$table->colclasses = array('leftalign', 'centeralign', 'centeralign', 'centeralign', 'centeralign', 'centeralign');
$table->id = 'repositoriessetting';
$table->head = array(get_string('name'), get_string('isactive', 'repository'), get_string('order'), $settingsstr);
$table->align = array('left', 'center', 'center', 'center', 'center');
$table->data = array();
$table->attributes['class'] = 'admintable generaltable';
// Get list of used plug-ins
$repositorytypes = repository::get_types();
// Array to store plugins being used
$alreadyplugins = array();
if (!empty($repositorytypes)) {
$totalrepositorytypes = count($repositorytypes);
$instances = repository::get_types();
if (!empty($instances)) {
// Array to store plugins being used
$alreadyplugins = array();
$totalinstances = count($instances);
$updowncount = 1;
foreach ($repositorytypes as $i) {
foreach ($instances as $i) {
$settings = '';
$typename = $i->get_typename();
// Display edit link only if you can config the type or if it has multiple instances (e.g. has instance config)
@@ -324,10 +314,9 @@ if (($action == 'edit') || ($action == 'new')) {
$userinstances = array();
foreach ($instances as $instance) {
$repocontext = context::instance_by_id($instance->instance->contextid);
if ($repocontext->contextlevel == CONTEXT_COURSE) {
if ($instance->context->contextlevel == CONTEXT_COURSE) {
$courseinstances[] = $instance;
} else if ($repocontext->contextlevel == CONTEXT_USER) {
} else if ($instance->context->contextlevel == CONTEXT_USER) {
$userinstances[] = $instance;
}
}
@@ -375,7 +364,7 @@ if (($action == 'edit') || ($action == 'new')) {
else {
$updown .= $spacer;
}
if ($updowncount < $totalrepositorytypes) {
if ($updowncount < $totalinstances) {
$updown .= "<a href=\"$sesskeyurl&amp;action=movedown&amp;repos=".$typename."\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/down') . "\" alt=\"down\" /></a>";
}
@@ -385,12 +374,7 @@ if (($action == 'edit') || ($action == 'new')) {
$updowncount++;
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('repository_' . $typename, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$table->data[] = array($i->get_readablename(), $OUTPUT->render($select), $updown, $settings, $uninstall);
$table->data[] = array($i->get_readablename(), $OUTPUT->render($select), $updown, $settings);
if (!in_array($typename, $alreadyplugins)) {
$alreadyplugins[] = $typename;
@@ -399,18 +383,14 @@ if (($action == 'edit') || ($action == 'new')) {
}
// Get all the plugins that exist on disk
$plugins = core_component::get_plugin_list('repository');
$plugins = get_plugin_list('repository');
if (!empty($plugins)) {
foreach ($plugins as $plugin => $dir) {
// Check that it has not already been listed
if (!in_array($plugin, $alreadyplugins)) {
$select = new single_select(repository_action_url($plugin, 'repos'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . basename($plugin));
$select->set_label(get_string('action'), array('class' => 'accesshide'));
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('repository_' . $plugin, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '', $uninstall);
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '');
}
}
}
+3 -11
View File
@@ -62,9 +62,6 @@ $return = true;
if (!empty($edit) || !empty($new)) {
if (!empty($edit)) {
$instance = repository::get_instance($edit);
if (!$instance->can_be_edited_by_user()) {
throw new repository_exception('nopermissiontoaccess', 'repository');
}
$instancetype = repository::get_type_by_id($instance->options['typeid']);
$classname = 'repository_' . $instancetype->get_typename();
$configs = $instance->get_instance_option_names();
@@ -102,7 +99,6 @@ if (!empty($edit) || !empty($new)) {
$data = data_submitted();
}
if ($success) {
core_plugin_manager::reset_caches();
redirect($parenturl);
} else {
print_error('instancenotsaved', 'repository', $parenturl);
@@ -119,20 +115,16 @@ if (!empty($edit) || !empty($new)) {
} else if (!empty($hide)) {
$instance = repository::get_type_by_typename($hide);
$instance->hide();
core_plugin_manager::reset_caches();
$return = true;
} else if (!empty($delete)) {
$instance = repository::get_instance($delete);
//if you try to delete an instance set as readonly, display an error message
if ($instance->readonly) {
// If you try to delete an instance set as readonly, display an error message.
throw new repository_exception('readonlyinstance', 'repository');
} else if (!$instance->can_be_edited_by_user()) {
throw new repository_exception('nopermissiontoaccess', 'repository');
}
throw new repository_exception('readonlyinstance', 'repository');
}
if ($sure) {
if ($instance->delete($downloadcontents)) {
$deletedstr = get_string('instancedeleted', 'repository');
core_plugin_manager::reset_caches();
redirect($parenturl, $deletedstr, 3);
} else {
print_error('instancenotdeleted', 'repository', $parenturl);
+24 -21
View File
@@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -15,15 +16,16 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Select site administrators.
* Lets you site administrators
*
* @package core_role
* @copyright 2010 Petr Skoda {@link http://skodak.org}
* @package core
* @subpackage role
* @copyright 2010 Petr Skoda (skodak) http://skodak.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php');
$confirmadd = optional_param('confirmadd', 0, PARAM_INT);
$confirmdel = optional_param('confirmdel', 0, PARAM_INT);
@@ -35,10 +37,10 @@ if (!is_siteadmin()) {
die;
}
$admisselector = new core_role_admins_existing_selector();
$admisselector = new admins_existing_selector();
$admisselector->set_extra_fields(array('username', 'email'));
$potentialadmisselector = new core_role_admins_potential_selector();
$potentialadmisselector = new admins_potential_selector();
$potentialadmisselector->set_extra_fields(array('username', 'email'));
if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
@@ -46,8 +48,7 @@ if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
$user = reset($userstoadd);
$username = fullname($user) . " ($user->username, $user->email)";
echo $OUTPUT->header();
$yesurl = new moodle_url('/admin/roles/admins.php', array('confirmadd'=>$user->id, 'sesskey'=>sesskey()));
echo $OUTPUT->confirm(get_string('confirmaddadmin', 'core_role', $username), $yesurl, $PAGE->url);
echo $OUTPUT->confirm(get_string('confirmaddadmin', 'role', $username), new moodle_url('/admin/roles/admins.php', array('confirmadd'=>$user->id, 'sesskey'=>sesskey())), $PAGE->url);
echo $OUTPUT->footer();
die;
}
@@ -56,12 +57,11 @@ if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
if ($userstoremove = $admisselector->get_selected_users()) {
$user = reset($userstoremove);
if ($USER->id == $user->id) {
// Can not remove self.
//can not remove self
} else {
$username = fullname($user) . " ($user->username, $user->email)";
echo $OUTPUT->header();
$yesurl = new moodle_url('/admin/roles/admins.php', array('confirmdel'=>$user->id, 'sesskey'=>sesskey()));
echo $OUTPUT->confirm(get_string('confirmdeladmin', 'core_role', $username), $yesurl, $PAGE->url);
echo $OUTPUT->confirm(get_string('confirmdeladmin', 'role', $username), new moodle_url('/admin/roles/admins.php', array('confirmdel'=>$user->id, 'sesskey'=>sesskey())), $PAGE->url);
echo $OUTPUT->footer();
die;
}
@@ -72,7 +72,7 @@ if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
$newmain = reset($newmain);
$newmain = $newmain->id;
$admins = array();
foreach (explode(',', $CFG->siteadmins) as $admin) {
foreach(explode(',', $CFG->siteadmins) as $admin) {
$admin = (int)$admin;
if ($admin) {
$admins[$admin] = $admin;
@@ -89,7 +89,7 @@ if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
} else if ($confirmadd and confirm_sesskey()) {
$admins = array();
foreach (explode(',', $CFG->siteadmins) as $admin) {
foreach(explode(',', $CFG->siteadmins) as $admin) {
$admin = (int)$admin;
if ($admin) {
$admins[$admin] = $admin;
@@ -101,7 +101,7 @@ if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
} else if ($confirmdel and confirm_sesskey() and $confirmdel != $USER->id) {
$admins = array();
foreach (explode(',', $CFG->siteadmins) as $admin) {
foreach(explode(',', $CFG->siteadmins) as $admin) {
$admin = (int)$admin;
if ($admin) {
$admins[$admin] = $admin;
@@ -112,12 +112,12 @@ if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
redirect($PAGE->url);
}
// Print header.
/// Print header
echo $OUTPUT->header();
?>
<div id="addadmisform">
<h3 class="main"><?php print_string('manageadmins', 'core_role'); ?></h3>
<h3 class="main"><?php print_string('manageadmins', 'role'); ?></h3>
<form id="assignform" method="post" action="<?php echo $PAGE->url ?>">
<div>
@@ -127,18 +127,18 @@ echo $OUTPUT->header();
<tr>
<td id='existingcell'>
<p>
<label for="removeselect"><?php print_string('existingadmins', 'core_role'); ?></label>
<label for="removeselect"><?php print_string('existingadmins', 'role'); ?></label>
</p>
<?php $admisselector->display(); ?>
</td>
<td id="buttonscell">
<td id='buttonscell'>
<p class="arrow_button">
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$OUTPUT->rarrow(); ?>" title="<?php print_string('remove'); ?>" />
<input name="main" id="main" type="submit" value="<?php echo get_string('mainadminset', 'core_role'); ?>" title="<?php print_string('mainadminset', 'core_role'); ?>" />
<input name="main" id="main" type="submit" value="<?php echo get_string('mainadminset', 'role'); ?>" title="<?php print_string('mainadminset', 'role'); ?>" />
</p>
</td>
<td id="potentialcell">
<td id='potentialcell'>
<p>
<label for="addselect"><?php print_string('users'); ?></label>
</p>
@@ -152,4 +152,7 @@ echo $OUTPUT->header();
<?php
//this must be after calling display() on the selectors so their setup JS executes first
//////$PAGE->requires->js_function_call('init_add_remove_admis_page');
echo $OUTPUT->footer();
-83
View File
@@ -1,83 +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 processes AJAX requests and returns JSON
*
* This is a server part of yui permissions manager module
*
* @package core_role
* @copyright 2015 Martin Mastny
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('AJAX_SCRIPT', true);
require(__DIR__ . '/../../config.php');
$contextid = required_param('contextid', PARAM_INT);
$getroles = optional_param('getroles', 0, PARAM_BOOL);
list($context, $course, $cm) = get_context_info_array($contextid);
require_login($course, false, $cm);
require_capability('moodle/role:review', $context);
require_sesskey();
$OUTPUT->header();
list($overridableroles, $overridecounts, $nameswithcounts) = get_overridable_roles($context,
ROLENAME_BOTH, true);
if ($getroles) {
echo json_encode($overridableroles);
die();
}
$capability = required_param('capability', PARAM_CAPABILITY);
$roleid = required_param('roleid', PARAM_INT);
$action = required_param('action', PARAM_ALPHA);
$capability = $DB->get_record('capabilities', array('name' => $capability), '*', MUST_EXIST);
if (!isset($overridableroles[$roleid])) {
throw new moodle_exception('invalidarguments');
}
if (!has_capability('moodle/role:override', $context)) {
if (!has_capability('moodle/role:safeoverride', $context) || !is_safe_capability($capability)) {
require_capability('moodle/role:override', $context);
}
}
switch ($action) {
case 'allow':
role_change_permission($roleid, $context, $capability->name, CAP_ALLOW);
break;
case 'prevent':
role_change_permission($roleid, $context, $capability->name, CAP_PREVENT);
break;
case 'prohibit':
role_change_permission($roleid, $context, $capability->name, CAP_PROHIBIT);
break;
case 'unprohibit':
role_change_permission($roleid, $context, $capability->name, CAP_INHERIT);
break;
default:
throw new moodle_exception('invalidarguments');
}
echo json_encode($action);
die();
+12 -24
View File
@@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -15,21 +16,23 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Allow overriding of roles by other roles.
* Allow overriding of roles by other roles
*
* @package core_role
* @package core
* @subpackage role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php');
$mode = required_param('mode', PARAM_ALPHANUMEXT);
$mode = required_param('mode', PARAM_ACTION);
$classformode = array(
'assign' => 'core_role_allow_assign_page',
'override' => 'core_role_allow_override_page',
'switch' => 'core_role_allow_switch_page'
'assign' => 'role_allow_assign_page',
'override' => 'role_allow_override_page',
'switch' => 'role_allow_switch_page'
);
if (!isset($classformode[$mode])) {
print_error('invalidmode', '', '', $mode);
@@ -38,30 +41,15 @@ if (!isset($classformode[$mode])) {
$baseurl = new moodle_url('/admin/roles/allow.php', array('mode'=>$mode));
admin_externalpage_setup('defineroles', '', array(), $baseurl);
$syscontext = context_system::instance();
$syscontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/role:manage', $syscontext);
$controller = new $classformode[$mode]();
if (optional_param('submit', false, PARAM_BOOL) && data_submitted() && confirm_sesskey()) {
$controller->process_submission();
$syscontext->mark_dirty();
$event = null;
// Create event depending on mode.
switch ($mode) {
case 'assign':
$event = \core\event\role_allow_assign_updated::create(array('context' => $syscontext));
break;
case 'override':
$event = \core\event\role_allow_override_updated::create(array('context' => $syscontext));
break;
case 'switch':
$event = \core\event\role_allow_switch_updated::create(array('context' => $syscontext));
break;
}
if ($event) {
$event->trigger();
}
mark_context_dirty($syscontext->path);
add_to_log(SITEID, 'role', 'edit allow ' . $mode, str_replace($CFG->wwwroot . '/', '', $baseurl), '', '', $USER->id);
redirect($baseurl);
}
+50 -73
View File
@@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -15,21 +16,21 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Assign roles to users.
* Lets you assign roles to users in a particular context.
*
* @package core_role
* @package core
* @subpackage role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @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 . '/' . $CFG->admin . '/roles/lib.php');
define("MAX_USERS_TO_LIST_PER_ROLE", 10);
$contextid = required_param('contextid', PARAM_INT);
$roleid = optional_param('roleid', 0, PARAM_INT);
$returnto = optional_param('return', null, PARAM_ALPHANUMEXT);
$contextid = required_param('contextid',PARAM_INT);
$roleid = optional_param('roleid', 0, PARAM_INT);
list($context, $course, $cm) = get_context_info_array($contextid);
@@ -50,25 +51,25 @@ if ($course) {
}
// Security.
// security
require_login($course, false, $cm);
require_capability('moodle/role:assign', $context);
$PAGE->set_url($url);
$PAGE->set_context($context);
$contextname = $context->get_context_name();
$contextname = print_context_name($context);
$courseid = $course->id;
// These are needed early because of tabs.php.
// These are needed early because of tabs.php
list($assignableroles, $assigncounts, $nameswithcounts) = get_assignable_roles($context, ROLENAME_BOTH, true);
$overridableroles = get_overridable_roles($context, ROLENAME_BOTH);
// Make sure this user can assign this role.
// Make sure this user can assign this role
if ($roleid && !isset($assignableroles[$roleid])) {
$a = new stdClass;
$a->roleid = $roleid;
$a->context = $contextname;
print_error('cannotassignrolehere', '', $context->get_url(), $a);
print_error('cannotassignrolehere', '', get_context_url($context), $a);
}
// Work out an appropriate page title.
@@ -76,12 +77,12 @@ if ($roleid) {
$a = new stdClass;
$a->role = $assignableroles[$roleid];
$a->context = $contextname;
$title = get_string('assignrolenameincontext', 'core_role', $a);
$title = get_string('assignrolenameincontext', 'role', $a);
} else {
if ($isfrontpage) {
$title = get_string('frontpageroles', 'admin');
} else {
$title = get_string('assignrolesin', 'core_role', $contextname);
$title = get_string('assignrolesin', 'role', $contextname);
}
}
@@ -91,10 +92,10 @@ if ($roleid) {
// Create the user selector objects.
$options = array('context' => $context, 'roleid' => $roleid);
$potentialuserselector = core_role_get_potential_user_selector($context, 'addselect', $options);
$currentuserselector = new core_role_existing_role_holders('removeselect', $options);
$potentialuserselector = roles_get_potential_user_selector($context, 'addselect', $options);
$currentuserselector = new existing_role_holders('removeselect', $options);
// Process incoming role assignments.
// Process incoming role assignments
$errors = array();
if (optional_param('add', false, PARAM_BOOL) && confirm_sesskey()) {
$userstoassign = $potentialuserselector->get_selected_users();
@@ -111,41 +112,39 @@ if ($roleid) {
$potentialuserselector->invalidate_selected_users();
$currentuserselector->invalidate_selected_users();
$rolename = $assignableroles[$roleid];
add_to_log($course->id, 'role', 'assign', 'admin/roles/assign.php?contextid='.$context->id.'&roleid='.$roleid, $rolename, '', $USER->id);
// Counts have changed, so reload.
list($assignableroles, $assigncounts, $nameswithcounts) = get_assignable_roles($context, ROLENAME_BOTH, true);
}
}
// Process incoming role unassignments.
// Process incoming role unassignments
if (optional_param('remove', false, PARAM_BOOL) && confirm_sesskey()) {
$userstounassign = $currentuserselector->get_selected_users();
if (!empty($userstounassign)) {
foreach ($userstounassign as $removeuser) {
// Unassign only roles that are added manually, no messing with other components!!!
//unassign only roles that are added manually, no messing with other components!!!
role_unassign($roleid, $removeuser->id, $context->id, '');
}
$potentialuserselector->invalidate_selected_users();
$currentuserselector->invalidate_selected_users();
$rolename = $assignableroles[$roleid];
add_to_log($course->id, 'role', 'unassign', 'admin/roles/assign.php?contextid='.$context->id.'&roleid='.$roleid, $rolename, '', $USER->id);
// Counts have changed, so reload.
list($assignableroles, $assigncounts, $nameswithcounts) = get_assignable_roles($context, ROLENAME_BOTH, true);
}
}
}
if (!empty($user) && ($user->id != $USER->id)) {
$PAGE->navigation->extend_for_user($user);
$PAGE->navbar->includesettingsbase = true;
}
$PAGE->set_pagelayout('admin');
$PAGE->set_title($title);
switch ($context->contextlevel) {
case CONTEXT_SYSTEM:
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('assignroles', '', array('contextid' => $contextid, 'roleid' => $roleid));
break;
case CONTEXT_USER:
@@ -154,17 +153,17 @@ switch ($context->contextlevel) {
$showroles = 1;
break;
case CONTEXT_COURSECAT:
$PAGE->set_heading($SITE->fullname);
$PAGE->set_heading("$SITE->fullname: ".get_string("categories"));
break;
case CONTEXT_COURSE:
if ($isfrontpage) {
$PAGE->set_heading(get_string('frontpage', 'admin'));
admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid, 'roleid' => $roleid));
} else {
$PAGE->set_heading($course->fullname);
}
break;
case CONTEXT_MODULE:
$PAGE->set_heading($context->get_context_name(false));
$PAGE->set_heading(print_context_name($context, false));
$PAGE->set_cacheable(false);
break;
case CONTEXT_BLOCK:
@@ -175,28 +174,25 @@ switch ($context->contextlevel) {
echo $OUTPUT->header();
// Print heading.
echo $OUTPUT->heading_with_help($title, 'assignroles', 'core_role');
echo $OUTPUT->heading_with_help($title, 'assignroles', 'role');
if ($roleid) {
// Show UI for assigning a particular role to users.
// Print a warning if we are assigning system roles.
if ($context->contextlevel == CONTEXT_SYSTEM) {
echo $OUTPUT->notification(get_string('globalroleswarning', 'core_role'));
echo $OUTPUT->box(get_string('globalroleswarning', 'role'));
}
// Print the form.
$assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
if ($returnto !== null) {
$assignurl->param('return', $returnto);
}
$assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
?>
<form id="assignform" method="post" action="<?php echo $assignurl ?>"><div>
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
<table id="assigningrole" summary="" class="admintable roleassigntable generaltable" cellspacing="0">
<table summary="" class="roleassigntable generaltable generalbox boxaligncenter" cellspacing="0">
<tr>
<td id="existingcell">
<p><label for="removeselect"><?php print_string('extusers', 'core_role'); ?></label></p>
<p><label for="removeselect"><?php print_string('extusers', 'role'); ?></label></p>
<?php $currentuserselector->display() ?>
</td>
<td id="buttonscell">
@@ -209,7 +205,7 @@ if ($roleid) {
</div>
</td>
<td id="potentialcell">
<p><label for="addselect"><?php print_string('potusers', 'core_role'); ?></label></p>
<p><label for="addselect"><?php print_string('potusers', 'role'); ?></label></p>
<?php $potentialuserselector->display() ?>
</td>
</tr>
@@ -233,45 +229,37 @@ if ($roleid) {
// Print a form to swap roles, and a link back to the all roles list.
echo '<div class="backlink">';
$newroleurl = new moodle_url($PAGE->url);
if ($returnto !== null) {
$newroleurl->param('return', $returnto);
}
$select = new single_select($newroleurl, 'roleid', $nameswithcounts, $roleid, null);
$select->label = get_string('assignanotherrole', 'core_role');
$select = new single_select($PAGE->url, 'roleid', $nameswithcounts, $roleid, null);
$select->label = get_string('assignanotherrole', 'role');
echo $OUTPUT->render($select);
$backurl = new moodle_url('/admin/roles/assign.php', array('contextid' => $contextid));
if ($returnto !== null) {
$backurl->param('return', $returnto);
}
echo '<p><a href="' . $backurl->out() . '">' . get_string('backtoallroles', 'core_role') . '</a></p>';
echo '<p><a href="' . $backurl->out() . '">' . get_string('backtoallroles', 'role') . '</a></p>';
echo '</div>';
} else if (empty($assignableroles)) {
// Print a message that there are no roles that can me assigned here.
echo $OUTPUT->heading(get_string('notabletoassignroleshere', 'core_role'), 3);
echo $OUTPUT->heading(get_string('notabletoassignroleshere', 'role'), 3);
} else {
// Show UI for choosing a role to assign.
// Print a warning if we are assigning system roles.
if ($context->contextlevel == CONTEXT_SYSTEM) {
echo $OUTPUT->notification(get_string('globalroleswarning', 'core_role'));
echo $OUTPUT->box(get_string('globalroleswarning', 'role'));
}
// Print instruction.
echo $OUTPUT->heading(get_string('chooseroletoassign', 'core_role'), 3);
// Print instruction
echo $OUTPUT->heading(get_string('chooseroletoassign', 'role'), 3);
// Get the names of role holders for roles with between 1 and MAX_USERS_TO_LIST_PER_ROLE users,
// and so determine whether to show the extra column.
$roleholdernames = array();
$strmorethanmax = get_string('morethan', 'core_role', MAX_USERS_TO_LIST_PER_ROLE);
$strmorethanmax = get_string('morethan', 'role', MAX_USERS_TO_LIST_PER_ROLE);
$showroleholders = false;
foreach ($assignableroles as $roleid => $notused) {
$roleusers = '';
if (0 < $assigncounts[$roleid] && $assigncounts[$roleid] <= MAX_USERS_TO_LIST_PER_ROLE) {
$userfields = 'u.id, u.username, ' . get_all_user_name_fields(true, 'u');
$roleusers = get_role_users($roleid, $context, false, $userfields);
$roleusers = get_role_users($roleid, $context, false, 'u.id, u.lastname, u.firstname');
if (!empty($roleusers)) {
$strroleusers = array();
foreach ($roleusers as $user) {
@@ -282,32 +270,28 @@ if ($roleid) {
}
} else if ($assigncounts[$roleid] > MAX_USERS_TO_LIST_PER_ROLE) {
$assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
if ($returnto !== null) {
$assignurl->param('return', $returnto);
}
$roleholdernames[$roleid] = '<a href="'.$assignurl.'">'.$strmorethanmax.'</a>';
} else {
$roleholdernames[$roleid] = '';
}
}
// Print overview table.
// Print overview table
$table = new html_table();
$table->id = 'assignrole';
$table->head = array(get_string('role'), get_string('description'), get_string('userswiththisrole', 'core_role'));
$table->colclasses = array('leftalign role', 'leftalign', 'centeralign userrole');
$table->attributes['class'] = 'admintable generaltable';
$table->tablealign = 'center';
$table->width = '60%';
$table->head = array(get_string('role'), get_string('description'), get_string('userswiththisrole', 'role'));
$table->wrap = array('nowrap', '', 'nowrap');
$table->align = array('left', 'left', 'center');
if ($showroleholders) {
$table->headspan = array(1, 1, 2);
$table->colclasses[] = 'leftalign roleholder';
$table->wrap[] = 'nowrap';
$table->align[] = 'left';
}
foreach ($assignableroles as $roleid => $rolename) {
$description = format_string($DB->get_field('role', 'description', array('id'=>$roleid)));
$assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
if ($returnto !== null) {
$assignurl->param('return', $returnto);
}
$row = array('<a href="'.$assignurl.'">'.$rolename.'</a>',
$description, $assigncounts[$roleid]);
if ($showroleholders) {
@@ -319,15 +303,8 @@ if ($roleid) {
echo html_writer::table($table);
if ($context->contextlevel > CONTEXT_USER) {
if ($context->contextlevel === CONTEXT_COURSECAT && $returnto === 'management') {
$url = new moodle_url('/course/management.php', array('categoryid' => $context->instanceid));
} else {
$url = $context->get_url();
}
echo html_writer::start_tag('div', array('class'=>'backlink'));
echo html_writer::tag('a', get_string('backto', '', $contextname), array('href' => $url));
echo html_writer::tag('a', get_string('backto', '', $contextname), array('href'=>get_context_url($context)));
echo html_writer::end_tag('div');
}
}
+21 -28
View File
@@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -17,14 +18,16 @@
/**
* Shows the result of has_capability for every capability for a user in a context.
*
* @package core_role
* @package core
* @subpackage role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php');
$contextid = required_param('contextid', PARAM_INT);
$contextid = required_param('contextid',PARAM_INT);
list($context, $course, $cm) = get_context_info_array($contextid);
@@ -44,42 +47,32 @@ if ($course) {
}
}
// Security first.
// security first
require_login($course, false, $cm);
if (!has_any_capability(array('moodle/role:assign', 'moodle/role:safeoverride', 'moodle/role:override', 'moodle/role:manage'), $context)) {
print_error('nopermissions', 'error', '', get_string('checkpermissions', 'core_role'));
print_error('nopermissions', 'error', '', get_string('checkpermissions', 'role'));
}
$PAGE->set_url($url);
if ($context->contextlevel == CONTEXT_USER and $USER->id != $context->instanceid) {
$PAGE->navbar->includesettingsbase = true;
$PAGE->navigation->extend_for_user($user);
$PAGE->set_context(context_course::instance($course->id));
} else {
$PAGE->set_context($context);
}
$PAGE->set_context($context);
$courseid = $course->id;
$contextname = $context->get_context_name();
$contextname = print_context_name($context);
// Get the user_selector we will need.
// Teachers within a course just get to see the same list of enrolled users.
// Admins (people with moodle/role:manage) can run this report for any user.
$options = array('accesscontext' => $context);
$userselector = new core_role_check_users_selector('reportuser', $options);
$userselector = new role_check_users_selector('reportuser', $options);
$userselector->set_rows(20);
// Work out an appropriate page title.
$title = get_string('checkpermissionsin', 'core_role', $contextname);
$title = get_string('checkpermissionsin', 'role', $contextname);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($title);
switch ($context->contextlevel) {
case CONTEXT_SYSTEM:
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('checkpermissions', '', array('contextid' => $contextid));
break;
case CONTEXT_USER:
@@ -88,17 +81,17 @@ switch ($context->contextlevel) {
$showroles = 1;
break;
case CONTEXT_COURSECAT:
$PAGE->set_heading($SITE->fullname);
$PAGE->set_heading("$SITE->fullname: ".get_string("categories"));
break;
case CONTEXT_COURSE:
if ($isfrontpage) {
$PAGE->set_heading(get_string('frontpage', 'admin'));
admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid), $CFG->wwwroot . '/' . $CFG->admin . '/roles/check.php');
} else {
$PAGE->set_heading($course->fullname);
}
break;
case CONTEXT_MODULE:
$PAGE->set_heading($context->get_context_name(false));
$PAGE->set_heading(print_context_name($context, false));
$PAGE->set_cacheable(false);
break;
case CONTEXT_BLOCK:
@@ -124,7 +117,7 @@ if (!is_null($reportuser)) {
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
if (!empty($roleassignments)) {
echo $OUTPUT->heading(get_string('rolesforuser', 'core_role', fullname($reportuser)), 3);
echo $OUTPUT->heading(get_string('rolesforuser', 'role', fullname($reportuser)), 3);
echo html_writer::start_tag('ul');
$systemcontext = context_system::instance();
@@ -138,20 +131,20 @@ if (!is_null($reportuser)) {
array('action' => 'view', 'roleid' => $ra->roleid)), $rolename);
}
echo html_writer::tag('li', get_string('roleincontext', 'core_role',
echo html_writer::tag('li', get_string('roleincontext', 'role',
array('role' => $rolename, 'context' => $link)));
}
echo html_writer::end_tag('ul');
}
echo $OUTPUT->heading(get_string('permissionsforuser', 'core_role', fullname($reportuser)), 3);
$table = new core_role_check_capability_table($context, $reportuser, $contextname);
echo $OUTPUT->heading(get_string('permissionsforuser', 'role', fullname($reportuser)), 3);
$table = new check_capability_table($context, $reportuser, $contextname);
$table->display();
echo $OUTPUT->box_end();
$selectheading = get_string('selectanotheruser', 'core_role');
$selectheading = get_string('selectanotheruser', 'role');
} else {
$selectheading = get_string('selectauser', 'core_role');
$selectheading = get_string('selectauser', 'role');
}
// Show UI for choosing a user to report on.
@@ -172,14 +165,14 @@ echo $OUTPUT->heading('<label for="reportuser">' . $selectheading . '</label>',
$userselector->display();
// Submit button and the end of the form.
echo '<p id="chooseusersubmit"><input type="submit" value="' . get_string('showthisuserspermissions', 'core_role') . '" /></p>';
echo '<p id="chooseusersubmit"><input type="submit" value="' . get_string('showthisuserspermissions', 'role') . '" /></p>';
echo '</form>';
echo $OUTPUT->box_end();
// Appropriate back link.
if ($context->contextlevel > CONTEXT_USER) {
echo html_writer::start_tag('div', array('class'=>'backlink'));
echo html_writer::tag('a', get_string('backto', '', $contextname), array('href'=>$context->get_url()));
echo html_writer::tag('a', get_string('backto', '', $contextname), array('href'=>get_context_url($context)));
echo html_writer::end_tag('div');
}
@@ -1,98 +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/>.
/**
* Existing admin user selector.
*
* @package core_role
* @copyright 2010 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot.'/user/selector/lib.php');
class core_role_admins_existing_selector extends user_selector_base {
/**
* Create instance.
*
* @param string $name control name
* @param array $options should have two elements with keys groupid and courseid.
*/
public function __construct($name = null, $options = array()) {
if (is_null($name)) {
$name = 'removeselect';
}
$options['multiselect'] = false;
parent::__construct($name, $options);
}
public function find_users($search) {
global $DB, $CFG;
list($wherecondition, $params) = $this->search_sql($search, '');
$fields = 'SELECT ' . $this->required_fields_sql('');
if ($wherecondition) {
$wherecondition = "$wherecondition AND id IN ($CFG->siteadmins)";
} else {
$wherecondition = "id IN ($CFG->siteadmins)";
}
$sql = " FROM {user}
WHERE $wherecondition";
list($sort, $sortparams) = users_order_by_sql('', $search, $this->accesscontext);
$params = array_merge($params, $sortparams);
$order = ' ORDER BY ' . $sort;
$availableusers = $DB->get_records_sql($fields . $sql . $order, $params);
if (empty($availableusers)) {
return array();
}
$mainadmin = array();
$mainadminuser = get_admin();
if ($mainadminuser && isset($availableusers[$mainadminuser->id])) {
$mainadmin = array($mainadminuser->id => $availableusers[$mainadminuser->id]);
unset($availableusers[$mainadminuser->id]);
}
$result = array();
if ($mainadmin) {
$result[get_string('mainadmin', 'core_role')] = $mainadmin;
}
if ($availableusers) {
if ($search) {
$groupname = get_string('extusersmatching', 'core_role', $search);
} else {
$groupname = get_string('extusers', 'core_role');
}
$result[$groupname] = $availableusers;
}
return $result;
}
protected function get_options() {
global $CFG;
$options = parent::get_options();
$options['file'] = $CFG->admin . '/roles/lib.php';
return $options;
}
}
@@ -1,91 +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/>.
/**
* Potential admin user selector.
*
* @package core_role
* @copyright 2010 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot.'/user/selector/lib.php');
class core_role_admins_potential_selector extends user_selector_base {
/**
* Create instance.
*
* @param string $name control name
* @param array $options should have two elements with keys groupid and courseid.
*/
public function __construct($name = null, $options = array()) {
global $CFG;
if (is_null($name)) {
$name = 'addselect';
}
$options['multiselect'] = false;
$options['exclude'] = explode(',', $CFG->siteadmins);
parent::__construct($name, $options);
}
public function find_users($search) {
global $CFG, $DB;
list($wherecondition, $params) = $this->search_sql($search, '');
$fields = 'SELECT ' . $this->required_fields_sql('');
$countfields = 'SELECT COUNT(1)';
$sql = " FROM {user}
WHERE $wherecondition AND mnethostid = :localmnet";
// It could be dangerous to make remote users admins and also this could lead to other problems.
$params['localmnet'] = $CFG->mnet_localhost_id;
list($sort, $sortparams) = users_order_by_sql('', $search, $this->accesscontext);
$order = ' ORDER BY ' . $sort;
// Check to see if there are too many to show sensibly.
if (!$this->is_validating()) {
$potentialcount = $DB->count_records_sql($countfields . $sql, $params);
if ($potentialcount > $this->maxusersperpage) {
return $this->too_many_results($search, $potentialcount);
}
}
$availableusers = $DB->get_records_sql($fields . $sql . $order, array_merge($params, $sortparams));
if (empty($availableusers)) {
return array();
}
if ($search) {
$groupname = get_string('potusersmatching', 'core_role', $search);
} else {
$groupname = get_string('potusers', 'core_role');
}
return array($groupname => $availableusers);
}
protected function get_options() {
global $CFG;
$options = parent::get_options();
$options['file'] = $CFG->admin . '/roles/lib.php';
return $options;
}
}
-49
View File
@@ -1,49 +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/>.
/**
* Role assign matrix.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Subclass of role_allow_role_page for the Allow assigns tab.
*/
class core_role_allow_assign_page extends core_role_allow_role_page {
public function __construct() {
parent::__construct('role_allow_assign', 'allowassign');
}
protected function set_allow($fromroleid, $targetroleid) {
allow_assign($fromroleid, $targetroleid);
}
protected function get_cell_tooltip($fromrole, $targetrole) {
$a = new stdClass;
$a->fromrole = $fromrole->localname;
$a->targetrole = $targetrole->localname;
return get_string('allowroletoassign', 'core_role', $a);
}
public function get_intro_text() {
return get_string('configallowassign', 'core_admin');
}
}
@@ -1,49 +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/>.
/**
* Role override matrix.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Subclass of role_allow_role_page for the Allow overrides tab.
*/
class core_role_allow_override_page extends core_role_allow_role_page {
public function __construct() {
parent::__construct('role_allow_override', 'allowoverride');
}
protected function set_allow($fromroleid, $targetroleid) {
allow_override($fromroleid, $targetroleid);
}
protected function get_cell_tooltip($fromrole, $targetrole) {
$a = new stdClass;
$a->fromrole = $fromrole->localname;
$a->targetrole = $targetrole->localname;
return get_string('allowroletooverride', 'core_role', $a);
}
public function get_intro_text() {
return get_string('configallowoverride2', 'core_admin');
}
}
-164
View File
@@ -1,164 +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/>.
/**
* Base class for allow matrices.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Base class for managing the data in the grid of checkboxes on the role allow
* allow/overrides/switch editing pages (allow.php).
*/
abstract class core_role_allow_role_page {
protected $tablename;
protected $targetcolname;
protected $roles;
protected $allowed = null;
/**
* Constructor.
*
* @param string $tablename the table where our data is stored.
* @param string $targetcolname the name of the target role id column.
*/
public function __construct($tablename, $targetcolname) {
$this->tablename = $tablename;
$this->targetcolname = $targetcolname;
$this->load_required_roles();
}
/**
* Load information about all the roles we will need information about.
*/
protected function load_required_roles() {
// Get all roles.
$this->roles = role_fix_names(get_all_roles(), context_system::instance(), ROLENAME_ORIGINAL);
}
/**
* Update the data with the new settings submitted by the user.
*/
public function process_submission() {
global $DB;
// Delete all records, then add back the ones that should be allowed.
$DB->delete_records($this->tablename);
foreach ($this->roles as $fromroleid => $notused) {
foreach ($this->roles as $targetroleid => $alsonotused) {
if (optional_param('s_' . $fromroleid . '_' . $targetroleid, false, PARAM_BOOL)) {
$this->set_allow($fromroleid, $targetroleid);
}
}
}
}
/**
* Set one allow in the database.
* @param int $fromroleid
* @param int $targetroleid
*/
protected abstract function set_allow($fromroleid, $targetroleid);
/**
* Load the current allows from the database.
*/
public function load_current_settings() {
global $DB;
// Load the current settings.
$this->allowed = array();
foreach ($this->roles as $role) {
// Make an array $role->id => false. This is probably too clever for its own good.
$this->allowed[$role->id] = array_combine(array_keys($this->roles), array_fill(0, count($this->roles), false));
}
$rs = $DB->get_recordset($this->tablename);
foreach ($rs as $allow) {
$this->allowed[$allow->roleid][$allow->{$this->targetcolname}] = true;
}
$rs->close();
}
/**
* Is target allowed?
*
* @param integer $targetroleid a role id.
* @return boolean whether the user should be allowed to select this role as a target role.
*/
protected function is_allowed_target($targetroleid) {
return true;
}
/**
* Returns structure that can be passed to print_table,
* containing one cell for each checkbox.
* @return html_table a table
*/
public function get_table() {
$table = new html_table();
$table->tablealign = 'center';
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '90%';
$table->align = array('left');
$table->rotateheaders = true;
$table->head = array('&#xa0;');
$table->colclasses = array('');
// Add role name headers.
foreach ($this->roles as $targetrole) {
$table->head[] = $targetrole->localname;
$table->align[] = 'left';
if ($this->is_allowed_target($targetrole->id)) {
$table->colclasses[] = '';
} else {
$table->colclasses[] = 'dimmed_text';
}
}
// Now the rest of the table.
foreach ($this->roles as $fromrole) {
$row = array($fromrole->localname);
foreach ($this->roles as $targetrole) {
$checked = '';
$disabled = '';
if ($this->allowed[$fromrole->id][$targetrole->id]) {
$checked = 'checked="checked" ';
}
if (!$this->is_allowed_target($targetrole->id)) {
$disabled = 'disabled="disabled" ';
}
$name = 's_' . $fromrole->id . '_' . $targetrole->id;
$tooltip = $this->get_cell_tooltip($fromrole, $targetrole);
$row[] = '<input type="checkbox" name="' . $name . '" id="' . $name .
'" title="' . $tooltip . '" value="1" ' . $checked . $disabled . '/>' .
'<label for="' . $name . '" class="accesshide">' . $tooltip . '</label>';
}
$table->data[] = $row;
}
return $table;
}
/**
* Snippet of text displayed above the table, telling the admin what to do.
* @return string
*/
public abstract function get_intro_text();
}
-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/>.
/**
* Role witch matrix.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Subclass of role_allow_role_page for the Allow switches tab.
*/
class core_role_allow_switch_page extends core_role_allow_role_page {
protected $allowedtargetroles;
public function __construct() {
parent::__construct('role_allow_switch', 'allowswitch');
}
protected function load_required_roles() {
global $DB;
parent::load_required_roles();
$this->allowedtargetroles = $DB->get_records_menu('role', null, 'id');
}
protected function set_allow($fromroleid, $targetroleid) {
allow_switch($fromroleid, $targetroleid);
}
protected function is_allowed_target($targetroleid) {
return isset($this->allowedtargetroles[$targetroleid]);
}
protected function get_cell_tooltip($fromrole, $targetrole) {
$a = new stdClass;
$a->fromrole = $fromrole->localname;
$a->targetrole = $targetrole->localname;
return get_string('allowroletoswitch', 'core_role', $a);
}
public function get_intro_text() {
return get_string('configallowswitch', 'core_admin');
}
}
@@ -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/>.
/**
* Library code used by the roles administration interfaces.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot.'/user/selector/lib.php');
/**
* Base class to avoid duplicating code.
*/
abstract class core_role_assign_user_selector_base extends user_selector_base {
protected $roleid;
protected $context;
/**
* @param string $name control name
* @param array $options should have two elements with keys groupid and courseid.
*/
public function __construct($name, $options) {
global $CFG;
if (isset($options['context'])) {
$this->context = $options['context'];
} else {
$this->context = context::instance_by_id($options['contextid']);
}
$options['accesscontext'] = $this->context;
parent::__construct($name, $options);
$this->roleid = $options['roleid'];
require_once($CFG->dirroot . '/group/lib.php');
}
protected function get_options() {
global $CFG;
$options = parent::get_options();
$options['file'] = $CFG->admin . '/roles/lib.php';
$options['roleid'] = $this->roleid;
$options['contextid'] = $this->context->id;
return $options;
}
}
@@ -1,195 +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/>.
/**
* Base capability table.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* This class represents a table with one row for each of a list of capabilities
* where the first cell in the row contains the capability name, and there is
* arbitrary stuff in the rest of the row. This class is used by
* admin/roles/manage.php, override.php and check.php.
*
* An ajaxy search UI shown at the top, if JavaScript is on.
*/
abstract class core_role_capability_table_base {
/** The context this table relates to. */
protected $context;
/** The capabilities to display. Initialised as $context->get_capabilities(). */
protected $capabilities = array();
/** Added as an id="" attribute to the table on output. */
protected $id;
/** Added to the class="" attribute on output. */
protected $classes = array('rolecap');
/** Default number of capabilities in the table for the search UI to be shown. */
const NUM_CAPS_FOR_SEARCH = 12;
/**
* Constructor.
* @param context $context the context this table relates to.
* @param string $id what to put in the id="" attribute.
*/
public function __construct(context $context, $id) {
$this->context = $context;
$this->capabilities = $context->get_capabilities();
$this->id = $id;
}
/**
* Use this to add class="" attributes to the table. You get the rolecap by
* default.
* @param array $classnames of class names.
*/
public function add_classes($classnames) {
$this->classes = array_unique(array_merge($this->classes, $classnames));
}
/**
* Display the table.
*/
public function display() {
if (count($this->capabilities) > self::NUM_CAPS_FOR_SEARCH) {
global $PAGE;
$jsmodule = array(
'name' => 'rolescapfilter',
'fullpath' => '/admin/roles/module.js',
'strings' => array(
array('filter', 'moodle'),
array('clear', 'moodle'), ),
'requires' => array('node', 'cookie', 'escape')
);
$PAGE->requires->js_init_call('M.core_role.init_cap_table_filter', array($this->id, $this->context->id), false,
$jsmodule);
}
echo '<table class="' . implode(' ', $this->classes) . '" id="' . $this->id . '">' . "\n<thead>\n";
echo '<tr><th class="name" align="left" scope="col">' . get_string('capability', 'core_role') . '</th>';
$this->add_header_cells();
echo "</tr>\n</thead>\n<tbody>\n";
// Loop over capabilities.
$contextlevel = 0;
$component = '';
foreach ($this->capabilities as $capability) {
if ($this->skip_row($capability)) {
continue;
}
// Prints a breaker if component or name or context level has changed.
if (component_level_changed($capability, $component, $contextlevel)) {
$this->print_heading_row($capability);
}
$contextlevel = $capability->contextlevel;
$component = $capability->component;
// Start the row.
$rowattributes = $this->get_row_attributes($capability);
// Handle class attributes same as other.
$rowclasses = array_unique(array_merge(array('rolecap'), $this->get_row_classes($capability)));
if (array_key_exists('class', $rowattributes)) {
$rowclasses = array_unique(array_merge($rowclasses, array($rowattributes['class'])));
}
$rowattributes['class'] = implode(' ', $rowclasses);
// Table cell for the capability name.
$contents = '<th scope="row" class="name"><span class="cap-desc">' . get_capability_docs_link($capability) .
'<span class="cap-name">' . $capability->name . '</span></span></th>';
// Add the cells specific to this table.
$contents .= $this->add_row_cells($capability);
echo html_writer::tag('tr', $contents, $rowattributes);
}
// End of the table.
echo "</tbody>\n</table>\n";
}
/**
* Used to output a heading rows when the context level or component changes.
* @param stdClass $capability gives the new component and contextlevel.
*/
protected function print_heading_row($capability) {
echo '<tr class="rolecapheading header"><td colspan="' . (1 + $this->num_extra_columns()) . '" class="header"><strong>' .
get_component_string($capability->component, $capability->contextlevel) .
'</strong></td></tr>';
}
/**
* For subclasses to override, output header cells, after the initial capability one.
*/
protected abstract function add_header_cells();
/**
* For subclasses to override, return the number of cells that add_header_cells/add_row_cells output.
*/
protected abstract function num_extra_columns();
/**
* For subclasses to override. Allows certain capabilties
* to be left out of the table.
*
* @param object $capability the capability this row relates to.
* @return boolean. If true, this row is omitted from the table.
*/
protected function skip_row($capability) {
return false;
}
/**
* For subclasses to override. A change to reaturn class names that are added
* to the class="" attribute on the &lt;tr> for this capability.
*
* @param stdClass $capability the capability this row relates to.
* @return array of class name strings.
*/
protected function get_row_classes($capability) {
return array();
}
/**
* For subclasses to override. Additional attributes to be added to
* each table row for the capability
*
* @param stdClass $capability the capability this row relates to.
* @return array attribute names and their values.
*/
protected function get_row_attributes($capability) {
return array();
}
/**
* For subclasses to override. Output the data cells for this capability. The
* capability name cell will already have been output.
*
* You can rely on get_row_classes always being called before add_row_cells.
*
* @param stdClass $capability the capability this row relates to.
* @return string html of row cells
*/
protected abstract function add_row_cells($capability);
}
@@ -1,193 +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/>.
/**
* Capabilities table with risks.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* This subclass is the bases for both the define roles and override roles
* pages. As well as adding the risks columns, this also provides generic
* facilities for showing a certain number of permissions columns, and
* recording the current and submitted permissions for each capability.
*/
abstract class core_role_capability_table_with_risks extends core_role_capability_table_base {
protected $allrisks;
protected $allpermissions; // We don't need perms ourselves, but all our subclasses do.
protected $strperms; // Language string cache.
protected $risksurl; // URL in moodledocs about risks.
/** @var array The capabilities to highlight as default/inherited. */
protected $parentpermissions;
protected $displaypermissions;
protected $permissions;
protected $changed;
protected $roleid;
public function __construct($context, $id, $roleid) {
parent::__construct($context, $id);
$this->allrisks = get_all_risks();
$this->risksurl = get_docs_url(s(get_string('risks', 'core_role')));
$this->allpermissions = array(
CAP_INHERIT => 'inherit',
CAP_ALLOW => 'allow',
CAP_PREVENT => 'prevent' ,
CAP_PROHIBIT => 'prohibit',
);
$this->strperms = array();
foreach ($this->allpermissions as $permname) {
$this->strperms[$permname] = get_string($permname, 'core_role');
}
$this->roleid = $roleid;
$this->load_current_permissions();
// Fill in any blank permissions with an explicit CAP_INHERIT, and init a locked field.
foreach ($this->capabilities as $capid => $cap) {
if (!isset($this->permissions[$cap->name])) {
$this->permissions[$cap->name] = CAP_INHERIT;
}
$this->capabilities[$capid]->locked = false;
}
}
protected function load_current_permissions() {
global $DB;
// Load the overrides/definition in this context.
if ($this->roleid) {
$this->permissions = $DB->get_records_menu('role_capabilities', array('roleid' => $this->roleid,
'contextid' => $this->context->id), '', 'capability,permission');
} else {
$this->permissions = array();
}
}
protected abstract function load_parent_permissions();
/**
* Update $this->permissions based on submitted data, while making a list of
* changed capabilities in $this->changed.
*/
public function read_submitted_permissions() {
$this->changed = array();
foreach ($this->capabilities as $cap) {
if ($cap->locked || $this->skip_row($cap)) {
// The user is not allowed to change the permission for this capability.
continue;
}
$permission = optional_param($cap->name, null, PARAM_PERMISSION);
if (is_null($permission)) {
// A permission was not specified in submitted data.
continue;
}
// If the permission has changed, update $this->permissions and
// Record the fact there is data to save.
if ($this->permissions[$cap->name] != $permission) {
$this->permissions[$cap->name] = $permission;
$this->changed[] = $cap->name;
}
}
}
/**
* Save the new values of any permissions that have been changed.
*/
public function save_changes() {
// Set the permissions.
foreach ($this->changed as $changedcap) {
assign_capability($changedcap, $this->permissions[$changedcap],
$this->roleid, $this->context->id, true);
}
// Force accessinfo refresh for users visiting this context.
$this->context->mark_dirty();
}
public function display() {
$this->load_parent_permissions();
foreach ($this->capabilities as $cap) {
if (!isset($this->parentpermissions[$cap->name])) {
$this->parentpermissions[$cap->name] = CAP_INHERIT;
}
}
parent::display();
}
protected function add_header_cells() {
global $OUTPUT;
echo '<th colspan="' . count($this->displaypermissions) . '" scope="col">' .
get_string('permission', 'core_role') . ' ' . $OUTPUT->help_icon('permission', 'core_role') . '</th>';
echo '<th class="risk" colspan="' . count($this->allrisks) . '" scope="col">' . get_string('risks', 'core_role') . '</th>';
}
protected function num_extra_columns() {
return count($this->displaypermissions) + count($this->allrisks);
}
protected function get_row_classes($capability) {
$rowclasses = array();
foreach ($this->allrisks as $riskname => $risk) {
if ($risk & (int)$capability->riskbitmask) {
$rowclasses[] = $riskname;
}
}
return $rowclasses;
}
protected abstract function add_permission_cells($capability);
protected function add_row_cells($capability) {
$cells = $this->add_permission_cells($capability);
// One cell for each possible risk.
foreach ($this->allrisks as $riskname => $risk) {
$cells .= '<td class="risk ' . str_replace('risk', '', $riskname) . '">';
if ($risk & (int)$capability->riskbitmask) {
$cells .= $this->get_risk_icon($riskname);
}
$cells .= '</td>';
}
return $cells;
}
/**
* Print a risk icon, as a link to the Risks page on Moodle Docs.
*
* @param string $type the type of risk, will be one of the keys from the
* get_all_risks array. Must start with 'risk'.
*/
public function get_risk_icon($type) {
global $OUTPUT;
$iconurl = $OUTPUT->pix_url('i/' . str_replace('risk', 'risk_', $type));
$text = '<img src="' . $iconurl . '" alt="' . get_string($type . 'short', 'admin') . '" />';
$action = new popup_action('click', $this->risksurl, 'docspopup');
$riskicon = $OUTPUT->action_link($this->risksurl, $text, $action, array('title'=>get_string($type, 'admin')));
return $riskicon;
}
}
@@ -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/>.
/**
* Library code used by the roles administration interfaces.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Subclass of core_role_capability_table_base for use on the Check permissions page.
*
* We have one additional column, Allowed, which contains yes/no.
*/
class core_role_check_capability_table extends core_role_capability_table_base {
protected $user;
protected $fullname;
protected $contextname;
protected $stryes;
protected $strno;
private $hascap;
/**
* Constructor
* @param object $context the context this table relates to.
* @param object $user the user we are generating the results for.
* @param string $contextname $context->get_context_name() - to save recomputing.
*/
public function __construct($context, $user, $contextname) {
parent::__construct($context, 'explaincaps');
$this->user = $user;
$this->fullname = fullname($user);
$this->contextname = $contextname;
$this->stryes = get_string('yes');
$this->strno = get_string('no');
}
protected function add_header_cells() {
echo '<th>' . get_string('allowed', 'core_role') . '</th>';
}
protected function num_extra_columns() {
return 1;
}
protected function get_row_classes($capability) {
$this->hascap = has_capability($capability->name, $this->context, $this->user->id);
if ($this->hascap) {
return array('yes');
} else {
return array('no');
}
}
protected function add_row_cells($capability) {
if ($this->hascap) {
$result = $this->stryes;
} else {
$result = $this->strno;
}
$a = new stdClass;
$a->fullname = $this->fullname;
$a->capability = $capability->name;
$a->context = $this->contextname;
return '<td>' . $result . '</td>';
}
}
@@ -1,153 +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/>.
/**
* User selector.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot.'/user/selector/lib.php');
/**
* User selector subclass for the selection of users in the check permissions page.
*
* @copyright 2012 Petr Skoda {@link http://skodak.org}
*/
class core_role_check_users_selector extends user_selector_base {
/** @var bool limit listing of users to enrolled only */
protected $onlyenrolled;
/**
* Constructor.
*
* @param string $name the control name/id for use in the HTML.
* @param array $options other options needed to construct this selector.
* You must be able to clone a userselector by doing new get_class($us)($us->get_name(), $us->get_options());
*/
public function __construct($name, $options) {
if (!isset($options['multiselect'])) {
$options['multiselect'] = false;
}
parent::__construct($name, $options);
$coursecontext = $this->accesscontext->get_course_context(false);
if ($coursecontext and $coursecontext->id != SITEID and !has_capability('moodle/role:manage', $coursecontext)) {
// Prevent normal teachers from looking up all users.
$this->onlyenrolled = true;
} else {
$this->onlyenrolled = false;
}
}
public function find_users($search) {
global $DB;
list($wherecondition, $params) = $this->search_sql($search, 'u');
$fields = 'SELECT ' . $this->required_fields_sql('u');
$countfields = 'SELECT COUNT(1)';
$coursecontext = $this->accesscontext->get_course_context(false);
if ($coursecontext and $coursecontext != SITEID) {
$sql1 = " FROM {user} u
JOIN {user_enrolments} ue ON (ue.userid = u.id)
JOIN {enrol} e ON (e.id = ue.enrolid AND e.courseid = :courseid1)
WHERE $wherecondition";
$params['courseid1'] = $coursecontext->instanceid;
if ($this->onlyenrolled) {
$sql2 = null;
} else {
$sql2 = " FROM {user} u
LEFT JOIN ({user_enrolments} ue
JOIN {enrol} e ON (e.id = ue.enrolid AND e.courseid = :courseid2)) ON (ue.userid = u.id)
WHERE $wherecondition
AND ue.id IS NULL";
$params['courseid2'] = $coursecontext->instanceid;
}
} else {
if ($this->onlyenrolled) {
// Bad luck, current user may not view only enrolled users.
return array();
}
$sql1 = null;
$sql2 = " FROM {user} u
WHERE $wherecondition";
}
$params['contextid'] = $this->accesscontext->id;
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
$order = ' ORDER BY ' . $sort;
$result = array();
if ($search) {
$groupname1 = get_string('enrolledusersmatching', 'enrol', $search);
$groupname2 = get_string('potusersmatching', 'core_role', $search);
} else {
$groupname1 = get_string('enrolledusers', 'enrol');
$groupname2 = get_string('potusers', 'core_role');
}
if ($sql1) {
$enrolleduserscount = $DB->count_records_sql($countfields . $sql1, $params);
if (!$this->is_validating() and $enrolleduserscount > $this->maxusersperpage) {
$result[$groupname1] = array();
$toomany = $this->too_many_results($search, $enrolleduserscount);
$result[implode(' - ', array_keys($toomany))] = array();
} else {
$enrolledusers = $DB->get_records_sql($fields . $sql1 . $order, array_merge($params, $sortparams));
if ($enrolledusers) {
$result[$groupname1] = $enrolledusers;
}
}
if ($sql2) {
$result[''] = array();
}
}
if ($sql2) {
$otheruserscount = $DB->count_records_sql($countfields . $sql2, $params);
if (!$this->is_validating() and $otheruserscount > $this->maxusersperpage) {
$result[$groupname2] = array();
$toomany = $this->too_many_results($search, $otheruserscount);
$result[implode(' - ', array_keys($toomany))] = array();
} else {
$otherusers = $DB->get_records_sql($fields . $sql2 . $order, array_merge($params, $sortparams));
if ($otherusers) {
$result[$groupname2] = $otherusers;
}
}
}
return $result;
}
protected function get_options() {
global $CFG;
$options = parent::get_options();
$options['file'] = $CFG->admin . '/roles/lib.php';
return $options;
}
}
@@ -1,657 +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/>.
/**
* Advanced role definition form.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* As well as tracking the permissions information about the role we are creating
* or editing, we also track the other information about the role. (This class is
* starting to be more and more like a formslib form in some respects.)
*/
class core_role_define_role_table_advanced extends core_role_capability_table_with_risks {
/** @var stdClass Used to store other information (besides permissions) about the role we are creating/editing. */
protected $role;
/** @var array Used to store errors found when validating the data. */
protected $errors;
protected $contextlevels;
protected $allcontextlevels;
protected $disabled = '';
protected $allowassign;
protected $allowoverride;
protected $allowswitch;
public function __construct($context, $roleid) {
$this->roleid = $roleid;
parent::__construct($context, 'defineroletable', $roleid);
$this->displaypermissions = $this->allpermissions;
$this->strperms[$this->allpermissions[CAP_INHERIT]] = get_string('notset', 'core_role');
$this->allcontextlevels = array();
$levels = context_helper::get_all_levels();
foreach ($levels as $level => $classname) {
$this->allcontextlevels[$level] = context_helper::get_level_name($level);
}
}
protected function load_current_permissions() {
global $DB;
if ($this->roleid) {
if (!$this->role = $DB->get_record('role', array('id' => $this->roleid))) {
throw new moodle_exception('invalidroleid');
}
$contextlevels = get_role_contextlevels($this->roleid);
// Put the contextlevels in the array keys, as well as the values.
if (!empty($contextlevels)) {
$this->contextlevels = array_combine($contextlevels, $contextlevels);
} else {
$this->contextlevels = array();
}
$this->allowassign = array_keys($this->get_allow_roles_list('assign'));
$this->allowoverride = array_keys($this->get_allow_roles_list('override'));
$this->allowswitch = array_keys($this->get_allow_roles_list('switch'));
} else {
$this->role = new stdClass;
$this->role->name = '';
$this->role->shortname = '';
$this->role->description = '';
$this->role->archetype = '';
$this->contextlevels = array();
$this->allowassign = array();
$this->allowoverride = array();
$this->allowswitch = array();
}
parent::load_current_permissions();
}
public function read_submitted_permissions() {
global $DB;
$this->errors = array();
// Role short name. We clean this in a special way. We want to end up
// with only lowercase safe ASCII characters.
$shortname = optional_param('shortname', null, PARAM_RAW);
if (!is_null($shortname)) {
$this->role->shortname = $shortname;
$this->role->shortname = core_text::specialtoascii($this->role->shortname);
$this->role->shortname = core_text::strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
if (empty($this->role->shortname)) {
$this->errors['shortname'] = get_string('errorbadroleshortname', 'core_role');
}
}
if ($DB->record_exists_select('role', 'shortname = ? and id <> ?', array($this->role->shortname, $this->roleid))) {
$this->errors['shortname'] = get_string('errorexistsroleshortname', 'core_role');
}
// Role name.
$name = optional_param('name', null, PARAM_TEXT);
if (!is_null($name)) {
$this->role->name = $name;
// Hack: short names of standard roles are equal to archetypes, empty name means localised via lang packs.
$archetypes = get_role_archetypes();
if (!isset($archetypes[$shortname]) and html_is_blank($this->role->name)) {
$this->errors['name'] = get_string('errorbadrolename', 'core_role');
}
}
if ($this->role->name !== '' and $DB->record_exists_select('role', 'name = ? and id <> ?', array($this->role->name, $this->roleid))) {
$this->errors['name'] = get_string('errorexistsrolename', 'core_role');
}
// Description.
$description = optional_param('description', null, PARAM_RAW);
if (!is_null($description)) {
$this->role->description = $description;
}
// Legacy type.
$archetype = optional_param('archetype', null, PARAM_RAW);
if (isset($archetype)) {
$archetypes = get_role_archetypes();
if (isset($archetypes[$archetype])) {
$this->role->archetype = $archetype;
} else {
$this->role->archetype = '';
}
}
// Assignable context levels.
foreach ($this->allcontextlevels as $cl => $notused) {
$assignable = optional_param('contextlevel' . $cl, null, PARAM_BOOL);
if (!is_null($assignable)) {
if ($assignable) {
$this->contextlevels[$cl] = $cl;
} else {
unset($this->contextlevels[$cl]);
}
}
}
// Allowed roles.
$allow = optional_param_array('allowassign', null, PARAM_INT);
if (!is_null($allow)) {
$this->allowassign = $allow;
}
$allow = optional_param_array('allowoverride', null, PARAM_INT);
if (!is_null($allow)) {
$this->allowoverride = $allow;
}
$allow = optional_param_array('allowswitch', null, PARAM_INT);
if (!is_null($allow)) {
$this->allowswitch = $allow;
}
// Now read the permissions for each capability.
parent::read_submitted_permissions();
}
public function is_submission_valid() {
return empty($this->errors);
}
/**
* Call this after the table has been initialised,
* this resets everything to that role.
*
* @param int $roleid role id or 0 for no role
* @param array $options array with following keys:
* 'name', 'shortname', 'description', 'permissions', 'archetype',
* 'contextlevels', 'allowassign', 'allowoverride', 'allowswitch'
*/
public function force_duplicate($roleid, array $options) {
global $DB;
if ($roleid == 0) {
// This means reset to nothing == remove everything.
if ($options['shortname']) {
$this->role->shortname = '';
}
if ($options['name']) {
$this->role->name = '';
}
if ($options['description']) {
$this->role->description = '';
}
if ($options['archetype']) {
$this->role->archetype = '';
}
if ($options['contextlevels']) {
$this->contextlevels = array();
}
if ($options['allowassign']) {
$this->allowassign = array();
}
if ($options['allowoverride']) {
$this->allowoverride = array();
}
if ($options['allowswitch']) {
$this->allowswitch = array();
}
if ($options['permissions']) {
foreach ($this->capabilities as $capid => $cap) {
$this->permissions[$cap->name] = CAP_INHERIT;
}
}
return;
}
$role = $DB->get_record('role', array('id'=>$roleid), '*', MUST_EXIST);
if ($options['shortname']) {
$this->role->shortname = $role->shortname;
}
if ($options['name']) {
$this->role->name = $role->name;
}
if ($options['description']) {
$this->role->description = $role->description;
}
if ($options['archetype']) {
$this->role->archetype = $role->archetype;
}
if ($options['contextlevels']) {
$this->contextlevels = array();
$levels = get_role_contextlevels($roleid);
foreach ($levels as $cl) {
$this->contextlevels[$cl] = $cl;
}
}
if ($options['allowassign']) {
$this->allowassign = array_keys($this->get_allow_roles_list('assign', $roleid));
}
if ($options['allowoverride']) {
$this->allowoverride = array_keys($this->get_allow_roles_list('override', $roleid));
}
if ($options['allowswitch']) {
$this->allowswitch = array_keys($this->get_allow_roles_list('switch', $roleid));
}
if ($options['permissions']) {
$this->permissions = $DB->get_records_menu('role_capabilities',
array('roleid' => $roleid, 'contextid' => context_system::instance()->id),
'', 'capability,permission');
foreach ($this->capabilities as $capid => $cap) {
if (!isset($this->permissions[$cap->name])) {
$this->permissions[$cap->name] = CAP_INHERIT;
}
}
}
}
/**
* Change the role definition to match given archetype.
*
* @param string $archetype
* @param array $options array with following keys:
* 'name', 'shortname', 'description', 'permissions', 'archetype',
* 'contextlevels', 'allowassign', 'allowoverride', 'allowswitch'
*/
public function force_archetype($archetype, array $options) {
$archetypes = get_role_archetypes();
if (!isset($archetypes[$archetype])) {
throw new coding_exception('Unknown archetype: '.$archetype);
}
if ($options['shortname']) {
$this->role->shortname = '';
}
if ($options['name']) {
$this->role->name = '';
}
if ($options['description']) {
$this->role->description = '';
}
if ($options['archetype']) {
$this->role->archetype = $archetype;
}
if ($options['contextlevels']) {
$this->contextlevels = array();
$defaults = get_default_contextlevels($archetype);
foreach ($defaults as $cl) {
$this->contextlevels[$cl] = $cl;
}
}
if ($options['allowassign']) {
$this->allowassign = get_default_role_archetype_allows('assign', $archetype);
}
if ($options['allowoverride']) {
$this->allowoverride = get_default_role_archetype_allows('override', $archetype);
}
if ($options['allowswitch']) {
$this->allowswitch = get_default_role_archetype_allows('switch', $archetype);
}
if ($options['permissions']) {
$defaultpermissions = get_default_capabilities($archetype);
foreach ($this->permissions as $k => $v) {
if (isset($defaultpermissions[$k])) {
$this->permissions[$k] = $defaultpermissions[$k];
continue;
}
$this->permissions[$k] = CAP_INHERIT;
}
}
}
/**
* Change the role definition to match given preset.
*
* @param string $xml
* @param array $options array with following keys:
* 'name', 'shortname', 'description', 'permissions', 'archetype',
* 'contextlevels', 'allowassign', 'allowoverride', 'allowswitch'
*/
public function force_preset($xml, array $options) {
if (!$info = core_role_preset::parse_preset($xml)) {
throw new coding_exception('Invalid role preset');
}
if ($options['shortname']) {
if (isset($info['shortname'])) {
$this->role->shortname = $info['shortname'];
}
}
if ($options['name']) {
if (isset($info['name'])) {
$this->role->name = $info['name'];
}
}
if ($options['description']) {
if (isset($info['description'])) {
$this->role->description = $info['description'];
}
}
if ($options['archetype']) {
if (isset($info['archetype'])) {
$this->role->archetype = $info['archetype'];
}
}
if ($options['contextlevels']) {
if (isset($info['contextlevels'])) {
$this->contextlevels = $info['contextlevels'];
}
}
foreach (array('assign', 'override', 'switch') as $type) {
if ($options['allow'.$type]) {
if (isset($info['allow'.$type])) {
$this->{'allow'.$type} = $info['allow'.$type];
}
}
}
if ($options['permissions']) {
foreach ($this->permissions as $k => $v) {
// Note: do not set everything else to CAP_INHERIT here
// because the xml file might not contain all capabilities.
if (isset($info['permissions'][$k])) {
$this->permissions[$k] = $info['permissions'][$k];
}
}
}
}
public function get_role_name() {
return $this->role->name;
}
public function get_role_id() {
return $this->role->id;
}
public function get_archetype() {
return $this->role->archetype;
}
protected function load_parent_permissions() {
$this->parentpermissions = get_default_capabilities($this->role->archetype);
}
public function save_changes() {
global $DB, $CFG;
if (!$this->roleid) {
// Creating role.
$this->role->id = create_role($this->role->name, $this->role->shortname, $this->role->description, $this->role->archetype);
$this->roleid = $this->role->id; // Needed to make the parent::save_changes(); call work.
} else {
// Updating role.
$DB->update_record('role', $this->role);
// This will ensure the course contacts cache is purged so name changes get updated in
// the UI. It would be better to do this only when we know that fields affected are
// updated. But thats getting into the weeds of the coursecat cache and role edits
// should not be that frequent, so here is the ugly brutal approach.
require_once($CFG->libdir . '/coursecatlib.php');
coursecat::role_assignment_changed($this->role->id, context_system::instance());
}
// Assignable contexts.
set_role_contextlevels($this->role->id, $this->contextlevels);
// Set allowed roles.
$this->save_allow('assign');
$this->save_allow('override');
$this->save_allow('switch');
// Permissions.
parent::save_changes();
}
protected function save_allow($type) {
global $DB;
$current = array_keys($this->get_allow_roles_list($type));
$wanted = $this->{'allow'.$type};
$addfunction = 'allow_'.$type;
$deltable = 'role_allow_'.$type;
$field = 'allow'.$type;
foreach ($current as $roleid) {
if (!in_array($roleid, $wanted)) {
$DB->delete_records($deltable, array('roleid'=>$this->roleid, $field=>$roleid));
continue;
}
$key = array_search($roleid, $wanted);
unset($wanted[$key]);
}
foreach ($wanted as $roleid) {
if ($roleid == -1) {
$roleid = $this->roleid;
}
$addfunction($this->roleid, $roleid);
}
}
protected function get_name_field($id) {
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->name) . '" />';
}
protected function get_shortname_field($id) {
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->shortname) . '" />';
}
protected function get_description_field($id) {
return '<textarea class="form-textarea" id="'. s($id) .'" name="description" rows="10" cols="50">' .
htmlspecialchars($this->role->description) .
'</textarea>';
}
protected function get_archetype_field($id) {
$options = array();
$options[''] = get_string('none');
foreach (get_role_archetypes() as $type) {
$options[$type] = get_string('archetype'.$type, 'role');
}
return html_writer::select($options, 'archetype', $this->role->archetype, false);
}
protected function get_assignable_levels_control() {
$output = '';
foreach ($this->allcontextlevels as $cl => $clname) {
$extraarguments = $this->disabled;
if (in_array($cl, $this->contextlevels)) {
$extraarguments .= 'checked="checked" ';
}
if (!$this->disabled) {
$output .= '<input type="hidden" name="contextlevel' . $cl . '" value="0" />';
}
$output .= '<input type="checkbox" id="cl' . $cl . '" name="contextlevel' . $cl .
'" value="1" ' . $extraarguments . '/> ';
$output .= '<label for="cl' . $cl . '">' . $clname . "</label><br />\n";
}
return $output;
}
/**
* Returns an array of roles of the allowed type.
*
* @param string $type Must be one of: assign, switch, or override.
* @param int $roleid (null means current role)
* @return array
*/
protected function get_allow_roles_list($type, $roleid = null) {
global $DB;
if ($type !== 'assign' and $type !== 'switch' and $type !== 'override') {
debugging('Invalid role allowed type specified', DEBUG_DEVELOPER);
return array();
}
if ($roleid === null) {
$roleid = $this->roleid;
}
if (empty($roleid)) {
return array();
}
$sql = "SELECT r.*
FROM {role} r
JOIN {role_allow_{$type}} a ON a.allow{$type} = r.id
WHERE a.roleid = :roleid
ORDER BY r.sortorder ASC";
return $DB->get_records_sql($sql, array('roleid'=>$roleid));
}
/**
* Returns an array of roles with the allowed type.
*
* @param string $type Must be one of: assign, switch, or override.
* @return array Am array of role names with the allowed type
*/
protected function get_allow_role_control($type) {
if ($type !== 'assign' and $type !== 'switch' and $type !== 'override') {
debugging('Invalid role allowed type specified', DEBUG_DEVELOPER);
return '';
}
$property = 'allow'.$type;
$selected = $this->$property;
$options = array();
foreach (role_get_names(null, ROLENAME_ALIAS) as $role) {
$options[$role->id] = $role->localname;
}
if ($this->roleid == 0) {
$options[-1] = get_string('thisnewrole', 'core_role');
}
return html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple'=>'multiple', 'size'=>10));
}
/**
* Returns information about the risks associated with a role.
*
* @return string
*/
protected function get_role_risks_info() {
return '';
}
protected function print_field($name, $caption, $field) {
global $OUTPUT;
// Attempt to generate HTML like formslib.
echo '<div class="fitem">';
echo '<div class="fitemtitle">';
if ($name) {
echo '<label for="' . $name . '">';
}
echo $caption;
if ($name) {
echo "</label>\n";
}
echo '</div>';
if (isset($this->errors[$name])) {
$extraclass = ' error';
} else {
$extraclass = '';
}
echo '<div class="felement' . $extraclass . '">';
echo $field;
if (isset($this->errors[$name])) {
echo $OUTPUT->error_text($this->errors[$name]);
}
echo '</div>';
echo '</div>';
}
protected function print_show_hide_advanced_button() {
echo '<p class="definenotice">' . get_string('highlightedcellsshowdefault', 'core_role') . ' </p>';
echo '<div class="advancedbutton">';
echo '<input type="submit" name="toggleadvanced" value="' . get_string('hideadvanced', 'form') . '" />';
echo '</div>';
}
public function display() {
global $OUTPUT;
// Extra fields at the top of the page.
echo '<div class="topfields clearfix">';
$this->print_field('shortname', get_string('roleshortname', 'core_role').'&nbsp;'.$OUTPUT->help_icon('roleshortname', 'core_role'), $this->get_shortname_field('shortname'));
$this->print_field('name', get_string('customrolename', 'core_role').'&nbsp;'.$OUTPUT->help_icon('customrolename', 'core_role'), $this->get_name_field('name'));
$this->print_field('edit-description', get_string('customroledescription', 'core_role').'&nbsp;'.$OUTPUT->help_icon('customroledescription', 'core_role'),
$this->get_description_field('description'));
$this->print_field('menuarchetype', get_string('archetype', 'core_role').'&nbsp;'.$OUTPUT->help_icon('archetype', 'core_role'), $this->get_archetype_field('archetype'));
$this->print_field('', get_string('maybeassignedin', 'core_role'), $this->get_assignable_levels_control());
$this->print_field('menuallowassign', get_string('allowassign', 'core_role'), $this->get_allow_role_control('assign'));
$this->print_field('menuallowoverride', get_string('allowoverride', 'core_role'), $this->get_allow_role_control('override'));
$this->print_field('menuallowswitch', get_string('allowswitch', 'core_role'), $this->get_allow_role_control('switch'));
if ($risks = $this->get_role_risks_info()) {
$this->print_field('', get_string('rolerisks', 'core_role'), $risks);
}
echo "</div>";
$this->print_show_hide_advanced_button();
// Now the permissions table.
parent::display();
}
protected function add_permission_cells($capability) {
// One cell for each possible permission.
$content = '';
foreach ($this->displaypermissions as $perm => $permname) {
$strperm = $this->strperms[$permname];
$extraclass = '';
if ($perm == $this->parentpermissions[$capability->name]) {
$extraclass = ' capdefault';
}
$checked = '';
if ($this->permissions[$capability->name] == $perm) {
$checked = 'checked="checked" ';
}
$content .= '<td class="' . $permname . $extraclass . '">';
$content .= '<label><input type="radio" name="' . $capability->name .
'" value="' . $perm . '" ' . $checked . '/> ';
$content .= '<span class="note">' . $strperm . '</span>';
$content .= '</label></td>';
}
return $content;
}
}
@@ -1,64 +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/>.
/**
* Library code used by the roles administration interfaces.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
class core_role_define_role_table_basic extends core_role_define_role_table_advanced {
protected $stradvmessage;
protected $strallow;
public function __construct($context, $roleid) {
parent::__construct($context, $roleid);
$this->displaypermissions = array(CAP_ALLOW => $this->allpermissions[CAP_ALLOW]);
$this->stradvmessage = get_string('useshowadvancedtochange', 'core_role');
$this->strallow = $this->strperms[$this->allpermissions[CAP_ALLOW]];
}
protected function print_show_hide_advanced_button() {
echo '<div class="advancedbutton">';
echo '<input type="submit" name="toggleadvanced" value="' . get_string('showadvanced', 'form') . '" />';
echo '</div>';
}
protected function add_permission_cells($capability) {
$perm = $this->permissions[$capability->name];
$permname = $this->allpermissions[$perm];
$defaultperm = $this->allpermissions[$this->parentpermissions[$capability->name]];
$content = '<td class="' . $permname . '">';
if ($perm == CAP_ALLOW || $perm == CAP_INHERIT) {
$checked = '';
if ($perm == CAP_ALLOW) {
$checked = 'checked="checked" ';
}
$content .= '<input type="hidden" name="' . $capability->name . '" value="' . CAP_INHERIT . '" />';
$content .= '<label><input type="checkbox" name="' . $capability->name .
'" value="' . CAP_ALLOW . '" ' . $checked . '/> ' . $this->strallow . '</label>';
} else {
$content .= '<input type="hidden" name="' . $capability->name . '" value="' . $perm . '" />';
$content .= $this->strperms[$permname] . '<span class="note">' . $this->stradvmessage . '</span>';
}
$content .= '</td>';
return $content;
}
}
@@ -1,153 +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/>.
/**
* Existing user selector.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* User selector subclass for the list of users who already have the role in
* question on the assign roles page.
*/
class core_role_existing_role_holders extends core_role_assign_user_selector_base {
public function find_users($search) {
global $DB;
list($wherecondition, $params) = $this->search_sql($search, 'u');
list($ctxcondition, $ctxparams) = $DB->get_in_or_equal($this->context->get_parent_context_ids(true), SQL_PARAMS_NAMED, 'ctx');
$params = array_merge($params, $ctxparams);
$params['roleid'] = $this->roleid;
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
$params = array_merge($params, $sortparams);
$fields = "SELECT ra.id AS raid," . $this->required_fields_sql('u') . ",ra.contextid,ra.component ";
$countfields = "SELECT COUNT(1) ";
$sql = "FROM {role_assignments} ra
JOIN {user} u ON u.id = ra.userid
JOIN {context} ctx ON ra.contextid = ctx.id
WHERE $wherecondition
AND ctx.id $ctxcondition
AND ra.roleid = :roleid";
$order = " ORDER BY ctx.depth DESC, ra.component, $sort";
if (!$this->is_validating()) {
$existinguserscount = $DB->count_records_sql($countfields . $sql, $params);
if ($existinguserscount > $this->maxusersperpage) {
return $this->too_many_results($search, $existinguserscount);
}
}
$contextusers = $DB->get_records_sql($fields . $sql . $order, $params);
// No users at all.
if (empty($contextusers)) {
return array();
}
// We have users. Out put them in groups by context depth.
// To help the loop below, tack a dummy user on the end of the results
// array, to trigger output of the last group.
$dummyuser = new stdClass;
$dummyuser->contextid = 0;
$dummyuser->id = 0;
$dummyuser->component = '';
$contextusers[] = $dummyuser;
$results = array(); // The results array we are building up.
$doneusers = array(); // Ensures we only list each user at most once.
$currentcontextid = $this->context->id;
$currentgroup = array();
foreach ($contextusers as $user) {
if (isset($doneusers[$user->id])) {
continue;
}
$doneusers[$user->id] = 1;
if ($user->contextid != $currentcontextid) {
// We have got to the end of the previous group. Add it to the results array.
if ($currentcontextid == $this->context->id) {
$groupname = $this->this_con_group_name($search, count($currentgroup));
} else {
$groupname = $this->parent_con_group_name($search, $currentcontextid);
}
$results[$groupname] = $currentgroup;
// Get ready for the next group.
$currentcontextid = $user->contextid;
$currentgroup = array();
}
// Add this user to the group we are building up.
unset($user->contextid);
if ($currentcontextid != $this->context->id) {
$user->disabled = true;
}
if ($user->component !== '') {
// Bad luck, you can tweak only manual role assignments.
$user->disabled = true;
}
unset($user->component);
$currentgroup[$user->id] = $user;
}
return $results;
}
protected function this_con_group_name($search, $numusers) {
if ($this->context->contextlevel == CONTEXT_SYSTEM) {
// Special case in the System context.
if ($search) {
return get_string('extusersmatching', 'core_role', $search);
} else {
return get_string('extusers', 'core_role');
}
}
$contexttype = context_helper::get_level_name($this->context->contextlevel);
if ($search) {
$a = new stdClass;
$a->search = $search;
$a->contexttype = $contexttype;
if ($numusers) {
return get_string('usersinthisxmatching', 'core_role', $a);
} else {
return get_string('noneinthisxmatching', 'core_role', $a);
}
} else {
if ($numusers) {
return get_string('usersinthisx', 'core_role', $contexttype);
} else {
return get_string('noneinthisx', 'core_role', $contexttype);
}
}
}
protected function parent_con_group_name($search, $contextid) {
$context = context::instance_by_id($contextid);
$contextname = $context->get_context_name(true, true);
if ($search) {
$a = new stdClass;
$a->contextname = $contextname;
$a->search = $search;
return get_string('usersfrommatching', 'core_role', $a);
} else {
return get_string('usersfrom', 'core_role', $contextname);
}
}
}
@@ -1,104 +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/>.
/**
* override permissions table.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
class core_role_override_permissions_table_advanced extends core_role_capability_table_with_risks {
protected $strnotset;
protected $haslockedcapabilities = false;
/**
* Constructor.
*
* This method loads loads all the information about the current state of
* the overrides, then updates that based on any submitted data. It also
* works out which capabilities should be locked for this user.
*
* @param object $context the context this table relates to.
* @param integer $roleid the role being overridden.
* @param boolean $safeoverridesonly If true, the user is only allowed to override
* capabilities with no risks.
*/
public function __construct($context, $roleid, $safeoverridesonly) {
parent::__construct($context, 'overriderolestable', $roleid);
$this->displaypermissions = $this->allpermissions;
$this->strnotset = get_string('notset', 'core_role');
// Determine which capabilities should be locked.
if ($safeoverridesonly) {
foreach ($this->capabilities as $capid => $cap) {
if (!is_safe_capability($cap)) {
$this->capabilities[$capid]->locked = true;
$this->haslockedcapabilities = true;
}
}
}
}
protected function load_parent_permissions() {
// Get the capabilities from the parent context, so that can be shown in the interface.
$parentcontext = $this->context->get_parent_context();
$this->parentpermissions = role_context_capabilities($this->roleid, $parentcontext);
}
public function has_locked_capabilities() {
return $this->haslockedcapabilities;
}
protected function add_permission_cells($capability) {
$disabled = '';
if ($capability->locked || $this->parentpermissions[$capability->name] == CAP_PROHIBIT) {
$disabled = ' disabled="disabled"';
}
// One cell for each possible permission.
$content = '';
foreach ($this->displaypermissions as $perm => $permname) {
$strperm = $this->strperms[$permname];
$extraclass = '';
if ($perm != CAP_INHERIT && $perm == $this->parentpermissions[$capability->name]) {
$extraclass = ' capcurrent';
}
$checked = '';
if ($this->permissions[$capability->name] == $perm) {
$checked = 'checked="checked" ';
}
$content .= '<td class="' . $permname . $extraclass . '">';
$content .= '<label><input type="radio" name="' . $capability->name .
'" value="' . $perm . '" ' . $checked . $disabled . '/> ';
if ($perm == CAP_INHERIT) {
$inherited = $this->parentpermissions[$capability->name];
if ($inherited == CAP_INHERIT) {
$inherited = $this->strnotset;
} else {
$inherited = $this->strperms[$this->allpermissions[$inherited]];
}
$strperm .= ' (' . $inherited . ')';
}
$content .= '<span class="note">' . $strperm . '</span>';
$content .= '</label></td>';
}
return $content;
}
}
@@ -1,66 +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/>.
/**
* Allow something form.
*
* @package core_role
* @copyright 2009 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/formslib.php");
class core_role_permission_allow_form extends moodleform {
/**
* Define the form.
*/
protected function definition() {
global $CFG;
$mform = $this->_form;
list($context, $capability, $overridableroles) = $this->_customdata;
list($needed, $forbidden) = get_roles_with_cap_in_context($context, $capability->name);
foreach ($needed as $id => $unused) {
unset($overridableroles[$id]);
}
foreach ($forbidden as $id => $unused) {
unset($overridableroles[$id]);
}
$mform->addElement('header', 'allowheader', get_string('roleallowheader', 'core_role'));
$mform->addElement('select', 'roleid', get_string('roleselect', 'core_role'), $overridableroles);
$mform->addElement('hidden', 'capability');
$mform->setType('capability', PARAM_CAPABILITY);
$mform->setDefault('capability', $capability->name);
$mform->addElement('hidden', 'contextid');
$mform->setType('contextid', PARAM_INT);
$mform->setDefault('contextid', $context->id);
$mform->addElement('hidden', 'allow');
$mform->setType('allow', PARAM_INT);
$mform->setDefault('allow', 1);
$this->add_action_buttons(true, get_string('allow', 'core_role'));
}
}
@@ -1,64 +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/>.
/**
* Prohibit something form.
*
* @package core_role
* @copyright 2009 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/formslib.php");
class core_role_permission_prohibit_form extends moodleform {
/**
* Define the form.
*/
protected function definition() {
global $CFG;
$mform = $this->_form;
list($context, $capability, $overridableroles) = $this->_customdata;
list($needed, $forbidden) = get_roles_with_cap_in_context($context, $capability->name);
foreach ($forbidden as $id => $unused) {
unset($overridableroles[$id]);
}
$mform->addElement('header', 'ptohibitheader', get_string('roleprohibitheader', 'core_role'));
$mform->addElement('select', 'roleid', get_string('roleselect', 'core_role'), $overridableroles);
$mform->addElement('hidden', 'capability');
$mform->setType('capability', PARAM_CAPABILITY);
$mform->setDefault('capability', $capability->name);
$mform->addElement('hidden', 'contextid');
$mform->setType('contextid', PARAM_INT);
$mform->setDefault('contextid', $context->id);
$mform->addElement('hidden', 'prohibit');
$mform->setType('prohibit', PARAM_INT);
$mform->setDefault('prohibit', 1);
$this->add_action_buttons(true, get_string('prohibit', 'core_role'));
}
}
-175
View File
@@ -1,175 +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/>.
/**
* Library code used by the roles administration interfaces.
*
* @package core_role
* @copyright 2009 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Subclass of core_role_capability_table_base for use on the Permissions page.
*/
class core_role_permissions_table extends core_role_capability_table_base {
protected $contextname;
protected $allowoverrides;
protected $allowsafeoverrides;
protected $overridableroles;
protected $roles;
protected $icons = array();
/**
* Constructor.
* @param context $context the context this table relates to.
* @param string $contextname $context->get_context_name() - to save recomputing.
* @param array $allowoverrides
* @param array $allowsafeoverrides
* @param array $overridableroles
*/
public function __construct($context, $contextname, $allowoverrides, $allowsafeoverrides, $overridableroles) {
parent::__construct($context, 'permissions');
$this->contextname = $contextname;
$this->allowoverrides = $allowoverrides;
$this->allowsafeoverrides = $allowsafeoverrides;
$this->overridableroles = $overridableroles;
$roles = get_all_roles($context);
$this->roles = role_fix_names(array_reverse($roles, true), $context, ROLENAME_ALIAS, true);
}
protected function add_header_cells() {
echo '<th>' . get_string('risks', 'core_role') . '</th>';
echo '<th>' . get_string('neededroles', 'core_role') . '</th>';
echo '<th>' . get_string('prohibitedroles', 'core_role') . '</th>';
}
protected function num_extra_columns() {
return 3;
}
protected function add_row_cells($capability) {
global $OUTPUT, $PAGE;
$renderer = $PAGE->get_renderer('core');
$adminurl = new moodle_url("/admin/");
$context = $this->context;
$contextid = $this->context->id;
$allowoverrides = $this->allowoverrides;
$allowsafeoverrides = $this->allowsafeoverrides;
$overridableroles = $this->overridableroles;
$roles = $this->roles;
list($needed, $forbidden) = get_roles_with_cap_in_context($context, $capability->name);
$neededroles = array();
$forbiddenroles = array();
$allowable = $overridableroles;
$forbitable = $overridableroles;
foreach ($neededroles as $id => $unused) {
unset($allowable[$id]);
}
foreach ($forbidden as $id => $unused) {
unset($allowable[$id]);
unset($forbitable[$id]);
}
foreach ($roles as $id => $name) {
if (isset($needed[$id])) {
$templatecontext = array("rolename" => $name, "roleid" => $id, "action" => "prevent", "spanclass" => "allowed",
"linkclass" => "preventlink", "adminurl" => $adminurl->out(), "imageurl" => "");
if (isset($overridableroles[$id]) and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
$templatecontext['imageurl'] = $renderer->pix_url('t/delete');
}
$neededroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext);
}
}
$neededroles = implode(' ', $neededroles);
foreach ($roles as $id => $name) {
if (isset($forbidden[$id]) and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
$templatecontext = array("rolename" => $name, "roleid" => $id, "action" => "unprohibit",
"spanclass" => "forbidden", "linkclass" => "unprohibitlink", "adminurl" => $adminurl->out(),
"imageurl" => "");
if (isset($overridableroles[$id]) and prohibit_is_removable($id, $context, $capability->name)) {
$templatecontext['imageurl'] = $renderer->pix_url('t/delete');
}
$forbiddenroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext);
}
}
$forbiddenroles = implode(' ', $forbiddenroles);
if ($allowable and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
$allowurl = new moodle_url($PAGE->url, array('contextid' => $contextid,
'capability' => $capability->name, 'allow' => 1));
$allowicon = $OUTPUT->action_icon($allowurl, new pix_icon('t/add', get_string('allow', 'core_role')), null,
array('class' => 'allowlink', 'data-action' => 'allow'));
$neededroles .= html_writer::div($allowicon, 'allowmore');
}
if ($forbitable and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
$prohibiturl = new moodle_url($PAGE->url, array('contextid' => $contextid,
'capability' => $capability->name, 'prohibit' => 1));
$prohibiticon = $OUTPUT->action_icon($prohibiturl, new pix_icon('t/add', get_string('prohibit', 'core_role')), null,
array('class' => 'prohibitlink', 'data-action' => 'prohibit'));
$forbiddenroles .= html_writer::div($prohibiticon, 'prohibitmore');
}
$risks = $this->get_risks($capability);
$contents = html_writer::tag('td', $risks, array('class' => 'risks'));
$contents .= html_writer::tag('td', $neededroles, array('class' => 'allowedroles'));
$contents .= html_writer::tag('td', $forbiddenroles, array('class' => 'forbiddenroles'));
return $contents;
}
protected function get_risks($capability) {
global $OUTPUT;
$allrisks = get_all_risks();
$risksurl = new moodle_url(get_docs_url(s(get_string('risks', 'core_role'))));
$return = '';
foreach ($allrisks as $type => $risk) {
if ($risk & (int)$capability->riskbitmask) {
if (!isset($this->icons[$type])) {
$pixicon = new pix_icon('/i/' . str_replace('risk', 'risk_', $type), get_string($type . 'short', 'admin'));
$this->icons[$type] = $OUTPUT->action_icon($risksurl, $pixicon, new popup_action('click', $risksurl));
}
$return .= $this->icons[$type];
}
}
return $return;
}
/**
* Add additional attributes to row
*
* @param stdClass $capability capability that this table row relates to.
* @return array key value pairs of attribute names and values.
*/
protected function get_row_attributes($capability) {
return array(
'data-id' => $capability->id,
'data-name' => $capability->name,
'data-humanname' => get_capability_string($capability->name),
);
}
}
@@ -1,86 +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/>.
/**
* Library code used by the roles administration interfaces.
*
* @package core_role
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* User selector subclass for the list of potential users on the assign roles page,
* when we are assigning in a context below the course level. (CONTEXT_MODULE and
* some CONTEXT_BLOCK).
*
* This returns only enrolled users in this context.
*/
class core_role_potential_assignees_below_course extends core_role_assign_user_selector_base {
public function find_users($search) {
global $DB;
list($enrolsql, $eparams) = get_enrolled_sql($this->context);
// Now we have to go to the database.
list($wherecondition, $params) = $this->search_sql($search, 'u');
$params = array_merge($params, $eparams);
if ($wherecondition) {
$wherecondition = ' AND ' . $wherecondition;
}
$fields = 'SELECT ' . $this->required_fields_sql('u');
$countfields = 'SELECT COUNT(u.id)';
$sql = " FROM ($enrolsql) enrolled_users_view
JOIN {user} u ON u.id = enrolled_users_view.id
LEFT JOIN {role_assignments} ra ON (ra.userid = enrolled_users_view.id AND
ra.roleid = :roleid AND ra.contextid = :contextid)
WHERE ra.id IS NULL
$wherecondition";
$params['contextid'] = $this->context->id;
$params['roleid'] = $this->roleid;
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
$order = ' ORDER BY ' . $sort;
// Check to see if there are too many to show sensibly.
if (!$this->is_validating()) {
$potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params);
if ($potentialmemberscount > $this->maxusersperpage) {
return $this->too_many_results($search, $potentialmemberscount);
}
}
// If not, show them.
$availableusers = $DB->get_records_sql($fields . $sql . $order, array_merge($params, $sortparams));
if (empty($availableusers)) {
return array();
}
if ($search) {
$groupname = get_string('potusersmatching', 'core_role', $search);
} else {
$groupname = get_string('potusers', 'core_role');
}
return array($groupname => $availableusers);
}
}

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