Compare commits

...

223 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 86e74d3eaf Moodle release 1.9.17 2012-03-11 15:55:59 +01:00
Eloy Lafuente (stronk7) 076b2ce86c weekly release 1.9.16+ 2012-03-09 11:16:53 +01:00
Eloy Lafuente (stronk7) b3391165f1 Merge branch 'wip-MDL-31248-MOODLE_19_STABLE-v3' of git://github.com/abgreeve/moodle into MOODLE_19_STABLE 2012-03-09 09:49:52 +01:00
Eloy Lafuente (stronk7) cf9b51f4f1 Revert "MDL-31248 - lib - Alteration to the rc4encrypt function to allow for old password use."
This reverts commit f8adbd6a02.
2012-03-09 09:40:40 +01:00
Eloy Lafuente (stronk7) f4f2b26ec5 Revert "MDL-31248 - lib - prevent moodle_strtolower() silent discard to lead to false-correct usernames"
This reverts commit c67bc65cbe.
2012-03-09 09:40:38 +01:00
Eloy Lafuente (stronk7) 281afcd067 Revert "MDL-31248 - lib - Gah, erroneus condition fixed."
This reverts commit e85a54d931.
2012-03-09 09:40:32 +01:00
Adrian Greeve b48d546c97 MDL-31248 - lib - Retaining the old password key and creating a new cookie prefix. 2012-03-09 13:35:22 +08:00
Eloy Lafuente (stronk7) e85a54d931 MDL-31248 - lib - Gah, erroneus condition fixed.
For sure that leaded to accept anything as valid username
for cookies in 19_STABLE. That explains why garbled username were
being transformed into "invented" usernames, instead of blank.
2012-03-08 12:27:44 +01:00
Eloy Lafuente (stronk7) c67bc65cbe MDL-31248 - lib - prevent moodle_strtolower() silent discard to lead to false-correct usernames 2012-03-08 11:42:13 +01:00
Adrian Greeve f8adbd6a02 MDL-31248 - lib - Alteration to the rc4encrypt function to allow for old password use. 2012-03-08 08:15:45 +08:00
Eloy Lafuente (stronk7) 2c39e251b4 weekly release 1.9.16+ 2012-03-01 11:34:39 +01:00
Eloy Lafuente (stronk7) cd20b15196 weekly release 1.9.16+ 2012-02-23 11:41:24 +01:00
Eloy Lafuente (stronk7) a364ab036c weekly release 1.9.16+ 2012-02-17 01:53:52 +01:00
Eloy Lafuente (stronk7) 46d0e6fb17 MDL-25185 - data - whitespace fixes 2012-02-13 16:20:20 +01:00
Sam Hemelryk 7eb1327487 Merge branch 'wip-MDL-25185-MOODLE_19_STABLE' of git://github.com/abgreeve/moodle into MOODLE_19_STABLE 2012-02-13 17:34:09 +13:00
Eloy Lafuente (stronk7) f5dc0e4110 weekly release 1.9.16+ 2012-02-13 01:21:39 +01:00
Adrian Greeve 312ada2856 MDL-25185 - data - Allowing data from the database to be exported according to group roles. 2012-02-03 07:49:27 +08:00
Eloy Lafuente (stronk7) 4f87a0dccc weekly release 1.9.16+ 2012-02-02 12:16:03 +01:00
Eloy Lafuente (stronk7) 2726791626 weekly release 1.9.16+ 2012-01-27 02:24:07 +01:00
Eloy Lafuente (stronk7) 8db39dc10a weekly release 1.9.16+ 2012-01-19 13:31:02 +01:00
Eloy Lafuente (stronk7) ebd57374cb Merge branch 'w03_MDL-31213_m19_attributesmess' of git://github.com/skodak/moodle into MOODLE_19_STABLE 2012-01-17 12:38:56 +01:00
Petr Skoda c444939ec7 MDL-31213 fix incorrect modifications of quickforms attributes 2012-01-17 11:17:35 +01:00
Tim Gus bc6e8366a9 MDL-31055 backport disabledIf fix from 2.0. (MDL-27045) 2012-01-16 15:22:21 +08:00
Eloy Lafuente (stronk7) 09249fe5c9 weekly release 1.9.16+ 2012-01-12 11:29:47 +01:00
Eloy Lafuente (stronk7) 863b49bd9c Merge branch 'MDL-29294_19' of git://github.com/timhunt/moodle into MOODLE_19_STABLE 2012-01-08 22:59:52 +01:00
Eloy Lafuente (stronk7) 593a3e84c0 Moodle release 1.9.16 2012-01-07 17:09:21 +01:00
Eloy Lafuente (stronk7) fa6008c687 weekly release 1.9.15+ 2012-01-05 15:09:59 +01:00
Aparup Banerjee 15624257cb Merge branch 'wip-mdl-29844-m19' of git://github.com/rajeshtaneja/moodle into MOODLE_19_STABLE 2012-01-04 10:11:20 +08:00
Sam Hemelryk 5753b2da0b Merge branch 'w52_MDL-29917_m19_autocomplete' of git://github.com/skodak/moodle into MOODLE_19_STABLE 2012-01-04 10:57:58 +13:00
Rajesh Taneja 4ed1199524 MDL-29844 Administration: Added new config for users to login for viewing profile image 2012-01-03 13:48:24 +08:00
Petr Skoda f88a9ef3fb MDL-13572 do not send messages to invalid addresses 2012-01-02 23:25:38 +01:00
Petr Skoda 43625959f7 MDL-29917 prevent form autocompletion in most Moodle forms
The password autocompletion in case of Moodle makes sense only on the login page, the form autocompletion in general is most probably useful only on the user signup page.

This patch is compatible with html 5, unfortunately we have to ignore strict warnings in legacy xhtml 1.0 standard.
2011-12-30 14:57:36 +01:00
Tim Hunt 4d06e61a53 MDL-29294 qtype match restore problem on Oracle. 2011-12-28 11:44:51 +00:00
Eloy Lafuente (stronk7) ea5534f864 weekly release 1.9.15+ 2011-12-23 03:06:52 +01:00
Eloy Lafuente (stronk7) faecf14df6 Merge branch 'MDL-20198c_m19' of git://github.com/rwijaya/moodle into MOODLE_19_STABLE 2011-12-20 01:26:21 +01:00
Sam Hemelryk 8afed3b9fc Merge branch 'wip-MDL-28948-MOODLE_19_STABLE' of git://github.com/abgreeve/moodle into MOODLE_19_STABLE 2011-12-20 10:40:51 +13:00
adrian@moodle.com 75366c60ff MDL-28948 - lib - removed the hard coded key for the rc4encryt function. 2011-12-16 09:27:10 +08:00
Petr Skoda 65e18e9ea8 MDL-30610 new environment requirements for 2.3 2011-12-14 02:44:20 +01:00
Rossiani Wijaya 5d72721e5c MDL-20198: wiki module: extend Dong's patch to fixed grouping access to view/edit wiki.. 2011-12-13 13:37:40 +08:00
Rossiani Wijaya 4866f01b4a MDL-20198: wiki module: fixed grouping access in wiki. Credit goes to Dong Kim(kimx0794@umn.edu). 2011-12-13 13:34:47 +08:00
Petr Skoda 1501cc8cea MDL-30575 yet more mail header cleanup 2011-12-11 23:42:32 +01:00
Petr Skoda a9e3abe0b4 MDL-30575 more mail header cleanup 2011-12-10 18:21:35 +01:00
Eloy Lafuente (stronk7) 485cb391de weekly release 1.9.15+ 2011-12-09 16:30:03 +01:00
Petr Skoda c3056feed8 MDL-27364 use https for recaptcha when site runs via https
Based on solution by Rajesh Taneja.
2011-12-09 11:11:55 +08:00
Aparup Banerjee f844dbcace Merge branch 'wip-MDL-30336-MOODLE_19_STABLE' of git://github.com/abgreeve/moodle into MOODLE_19_STABLE 2011-12-08 16:24:00 +08:00
Aparup Banerjee cc4d45b916 Merge branch 'wip-MDL-30012-m19' of git://github.com/samhemelryk/moodle into MOODLE_19_STABLE 2011-12-08 14:46:40 +08:00
adrian@moodle.com 630fc6ee7e MDL-30336 - login - Added a setting in security that allows auto complete to be set to off in password fields. 2011-12-08 09:21:15 +08:00
Eloy Lafuente (stronk7) 54947d0dad MDL-19147 - forum - whitespace cleanup 2011-12-07 15:56:46 +01:00
Sam Hemelryk e114543f69 Merge branch 'wip-MDL-19147-MOODLE_19_STABLE' of git://github.com/abgreeve/moodle into MOODLE_19_STABLE 2011-12-07 14:19:45 +13:00
Sam Hemelryk 36b0ddeed4 MDL-30012 mod_forum: Fixed bug in forum user script 2011-12-06 16:05:49 +13:00
Eloy Lafuente (stronk7) 7fe52ca7d9 weekly release 1.9.15+ 2011-12-05 12:35:36 +01:00
adrian@moodle.com 24b048c2cf MDL-19147 - forum - Removed single discussions from the pull down menu for moving posts to single discussions. 2011-12-02 08:11:16 +08:00
Eloy Lafuente (stronk7) 6dc36a0101 weekly release 1.9.15+ 2011-12-01 19:21:21 +01:00
Eloy Lafuente (stronk7) dadac0b3b3 emergency release 1.9.15 2011-12-01 18:17:12 +01:00
Eloy Lafuente (stronk7) fdcc0f46cc Merge branch 'wip-MDL-20627-MOODLE_19_STABLE' of git://github.com/abgreeve/moodle into MOODLE_19_STABLE 2011-12-01 18:02:51 +01:00
Eloy Lafuente (stronk7) 51c6d453e1 Merge branch 'w48_MDL-30480_m19_dmlobjects' of git://github.com/skodak/moodle into MOODLE_19_STABLE 2011-11-29 15:33:18 +01:00
Petr Skoda 33314c72f3 MDL-30480 fix BC regression from MDL-29033
Improve insert_record() and update_record() handling of $dataobject parameter. Some developers expect they can use any class instance there. This is not officially supported, but in any case we should not break backwards compatibility so late in STABLE branch.

Credit for discovery goes to Pascal Maury, thanks!
2011-11-29 15:20:23 +01:00
Sam Hemelryk 79cf3f0884 MDL-30273 whitespace cleanup 2011-11-29 16:48:10 +13:00
Sam Hemelryk 921383f789 Merge branch 'wip-MDL-30273-MOODLE_19_STABLE' of git://github.com/abgreeve/moodle into MOODLE_19_STABLE 2011-11-29 16:41:38 +13:00
Eloy Lafuente (stronk7) b4cdee0a73 Moodle release 1.9.15 2011-11-27 23:44:23 +01:00
Eloy Lafuente (stronk7) 8bcfa47d9b weekly release 1.9.14+ 2011-11-25 11:08:15 +01:00
Eloy Lafuente (stronk7) e0d470b5a6 MDL-15610 add missing condition to allow some tests to pass 2011-11-24 20:10:15 +01:00
Dan Marsden 1958705818 SCORM MDL-25757 fix for saving of duplicate CMI values - thanks to Evan Irving-Pease for the patch 2011-11-23 11:10:30 +01:00
adrian@moodle.com 8f83cfbe91 MDL-20627 user - Fixed viewing permission of email when sending group messages. 2011-11-21 08:30:57 +08:00
Charles Fulton 0f035ff23b MDL-30273 forum - prevent the creation of discussions in simple single forums 2011-11-18 15:48:59 +08:00
Eloy Lafuente (stronk7) 5a0fba7e7e weekly release 1.9.14+ 2011-11-18 01:33:06 +01:00
Eloy Lafuente (stronk7) 6ae95cc856 Merge branch 'MDL-29551' of git://github.com/ankitagarwal/moodle into MOODLE_19_STABLE 2011-11-17 17:11:53 +01:00
Ankit Kumar Agarwal c42cd0d1b3 MDL-29893 Fixing issues with password generation function 2011-11-16 11:39:36 +05:30
Patrick Mcneill 3ab2851d2a MDL-29551 Fixing ip_in_range function 2011-11-16 11:09:01 +05:30
Eloy Lafuente (stronk7) 012a51e958 weekly release 1.9.14+ 2011-11-15 11:09:43 +01:00
Eloy Lafuente (stronk7) 5fe44ec90d Merge branch 'MDL-29092_m19' of git://github.com/rwijaya/moodle into MOODLE_19_STABLE 2011-11-11 18:31:34 +01:00
Stephen Bourget ee1692e740 MDL-29529 Assignment: Fix regression (order by status) caused by MDL-27638 2011-11-11 01:21:46 +01:00
Aparup Banerjee 9d7e30f9b8 Merge branch 'MDL-29977-mnet-masquerade_19_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_19_STABLE 2011-11-09 13:37:41 +08:00
David Mudrak 408d3ca000 MDL-29977 MNet does not allow to start a remote session when masquerading as another user 2011-11-04 10:57:58 +01:00
Tim Hunt 9d656f584a MDL-30038 mod_lesson was not working on PHP4. 2011-11-03 10:24:38 +00:00
Rossiani Wijaya 01dd64a8c8 MDL-29092 login/change password: backporting to 1.9 for MDL-26381 and set form action to user https when loginhttps is enable 2011-11-03 13:02:24 +08:00
Eloy Lafuente (stronk7) f28a448513 weekly release 1.9.14+ 2011-11-02 19:55:31 +01:00
Sam Hemelryk 01c33e8a01 Merge branch 'w43_MDL-29925_m19_calendar' of git://github.com/skodak/moodle into MOODLE_19_STABLE 2011-11-01 09:37:18 +13:00
David Mudrak 67205358fc MDL-29991 MDL-27107 auth_mnet - consider all incoming roaming users confirmed
Moodle 2.x sites do not send the 'confirmed' field any more (see MDL-27107). We
consider all roaming users confirmed automatically.
2011-10-29 17:04:29 +02:00
Petr Skoda e311b14364 MDL-29925 fix calendar parameter handling 2011-10-28 19:07:48 +02:00
Eloy Lafuente (stronk7) ea8bda2526 weekly release 1.9.14+ 2011-10-27 18:55:42 +02:00
Eloy Lafuente (stronk7) b3b6da8b72 weekly release 1.9.14+ 2011-10-19 18:47:10 +02:00
Sam Hemelryk 37e289a131 Merge branch 'MDL-29697-Fix_incorrect_error_msg' of https://github.com/ncsu-delta/moodle into MOODLE_19_STABLE 2011-10-18 11:11:57 +13:00
Sam Hemelryk 0aff48f3a4 Merge branch 'MDL-28170_19' of git://github.com/stronk7/moodle into MOODLE_19_STABLE 2011-10-17 18:51:08 +13:00
Eloy Lafuente (stronk7) e660329ab1 MDL-28170 environment - add new 2.2 section
nothing changes from 2.1 as far as it was agreed that this will be
the last version supporting 1.9 upgrade. See issue for details.
2011-10-17 02:15:13 +02:00
Eloy Lafuente (stronk7) 53f32cbd8a MDL-29626 backup - fix restore of links to course page to behave like other links 2011-10-17 01:47:16 +02:00
Eloy Lafuente (stronk7) ba6446ecaf weekly release 1.9.14+ 2011-10-12 23:50:28 +02:00
Eloy Lafuente (stronk7) a89aa3131b MDL-16553 Assignment, student view: whitespace fix 2011-10-10 13:12:18 +02:00
Sam Hemelryk e1b4fa3029 Merge branch 'MDL-16553-19' of git://github.com/bostelm/moodle into MOODLE_19_STABLE 2011-10-10 17:57:41 +13:00
Sam Hemelryk d2a5725cd5 Merge branch 'MDL-23047-Add_missing_log' of https://github.com/ncsu-delta/moodle into MOODLE_19_STABLE 2011-10-10 12:18:08 +13:00
Eloy Lafuente (stronk7) 07728bfaee Moodle release 1.9.14 2011-10-09 00:56:48 +02:00
Henning Bostelmann b9625c16b6 MDL-16553 Assignment, student view: show response files when no grade available 2011-10-07 23:23:41 +01:00
Glenn Ansley 6e698a4563 MDL-29697 Don't return the error if it wasn't updated because original question type had no answers 2011-10-07 12:04:13 -04:00
Glenn Ansley cefe46ad16 MDL-23047 Add resorce view to log table when viewing file set to 'Yes, without frame' 2011-10-07 09:16:30 -04:00
Eloy Lafuente (stronk7) e9e2def9b0 weekly release 1.9.13+ 2011-10-07 00:13:18 +02:00
Sam Hemelryk ed999df32a Merge branch 'wip-MDL-25454-MOODLE_19_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_19_STABLE 2011-10-03 14:23:16 +13:00
Glenn Ansley 970cc1c968 MDL-28428 quiz: Prefer getElementById for IE9 fix 2011-10-03 13:51:17 +13:00
Marina Glancy 2f81316ad1 MDL-25454: using the faster way to check if record exists in db 2011-09-29 17:12:24 +08:00
Marina Glancy b7df65036f MDL-25454 before skipping course backup make sure that there are no change entries in it's log during the last month 2011-09-29 10:01:20 +08:00
Eloy Lafuente (stronk7) 050504c371 weekly release 1.9.13+ 2011-09-28 11:09:43 +02:00
Tim Hunt 71712c9424 MDL-29462 html_to_text('0') gives '', not '0'.
Conflicts:

	lib/simpletest/testweblib.php
2011-09-21 16:38:35 +01:00
Eloy Lafuente (stronk7) d04b36808d weekly release 1.9.13+ 2011-09-21 17:13:18 +02:00
Andrew Davis (andyjdavis) 97f258fabb MDL-29311 messaging: added a safety check to prevent message refreshing causing inadvertant DOS 2011-09-19 13:45:10 +08:00
Sam Hemelryk 5f4d14ebbe Merge branch 'MDL-29212_19' of git://github.com/timhunt/moodle into MOODLE_19_STABLE 2011-09-19 13:22:07 +12:00
Charles Fulton 77848edc26 MDL-18952: move uploaded file into dataroot before attempting to read it 2011-09-16 09:49:44 -07:00
Eloy Lafuente (stronk7) 400d887474 weekly release 1.9.13+ 2011-09-16 01:41:43 +02:00
Glenn Ansley 4021470fd3 MDL-29212 RCount incorrect in Quiz Analysis Report when correct answer is 0 2011-09-14 20:57:48 +01:00
Eloy Lafuente (stronk7) b4d495892d Merge branch 'w36_MDL-29033_m19_magicquotes' of git://github.com/skodak/moodle into MOODLE_19_STABLE 2011-09-13 21:57:20 +02:00
Aparup Banerjee b503008c6a MDL-26257 Authentication : whitespace/style fixes 2011-09-13 19:30:34 +08:00
Petr Skoda 040bd939b2 MDL-29033 add tests for the sql injection hack 2011-09-09 16:29:09 +02:00
Petr Skoda bf0ddcb332 MDL-29033 dirty magic quotes hack 2011-09-09 16:18:08 +02:00
Henning Bostelmann 1b2a3392d9 MDL-26257 Shibboleth auth: run logout handler only if logged in via Shibboleth 2011-09-08 11:59:50 +01:00
Eloy Lafuente (stronk7) 9c105fc680 weekly release 1.9.13+ 2011-09-07 17:52:33 +02:00
Eloy Lafuente (stronk7) 09ece44093 weekly release 1.9.13+ 2011-08-31 01:35:14 +02:00
Eloy Lafuente (stronk7) 05dbe4dcb0 MDL-28537 DB whitespace clean, just for testing some CI stuff is working ok 2011-08-29 13:43:56 +02:00
Eloy Lafuente (stronk7) 78e1682d36 Merge branch 'wip-MDL-28537-m19' of git://github.com/samhemelryk/moodle into MOODLE_19_STABLE 2011-08-29 13:36:12 +02:00
Eloy Lafuente (stronk7) 7c460e50c5 Merge branch 'wip-MDL-28722-m19' of git://github.com/samhemelryk/moodle into MOODLE_19_STABLE 2011-08-29 12:49:27 +02:00
Sam Hemelryk 7a8115a92c MDL-28537 DB Fixed up use of the TYPE option when creating MySQL tables, now uses ENGINE for bc and future support 2011-08-29 19:19:28 +12:00
Eloy Lafuente (stronk7) 151543d0b6 Merge branch 'MDL-28079_cron_rs' of git://github.com/andyjdavis/moodle into MOODLE_19_STABLE 2011-08-29 02:12:37 +02:00
David Mudrak 0dd51bbdbd MDL-29148 MNet - improved handling of a verification function return code 2011-08-29 01:47:45 +02:00
Sam Hemelryk b094ce466b Merge branch 'MDL-13331_m19' of git://github.com/nebgor/moodle into MOODLE_19_STABLE 2011-08-29 11:24:26 +12:00
Eloy Lafuente (stronk7) 4ae7426d09 weekly release 1.9.13+ 2011-08-26 15:08:04 +02:00
Sam Hemelryk 4a2acd8c7e MDL-28722 course Fixed typo and variable use when editing a section 2011-08-26 12:48:18 +12:00
Aparup Banerjee 0693cb2220 MDL-16950 Search : added mysqli_real_escape_string call when using mysqli 2011-08-25 17:53:12 +08:00
Eloy Lafuente (stronk7) 724d76c765 Merge branch 'm19_MDL-4561' of git://github.com/danmarsden/moodle into MOODLE_19_STABLE 2011-08-24 03:33:26 +02:00
Eloy Lafuente (stronk7) 4c8c9ef9a0 Merge branch 'w33_MDL-28932_m19_php5' of git://github.com/skodak/moodle into MOODLE_19_STABLE 2011-08-24 01:35:36 +02:00
Aparup Banerjee d87ea7704d Merge branch 'MDL-28723-plugin-tables_19_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_19_STABLE 2011-08-24 01:16:23 +08:00
Eloy Lafuente (stronk7) e832010c51 MDL-28690 metacourses - add some more alias prefixes to be 100% in the safe side 2011-08-23 17:56:49 +02:00
Eloy Lafuente (stronk7) 615702a5c1 Merge branch 'MDL-28690_metacourse_automatic_unenrolment' of git://github.com/davosmith/moodle into MOODLE_19_STABLE 2011-08-23 17:55:01 +02:00
Eloy Lafuente (stronk7) eee432c616 Merge branch 'wip-mdl-29001-m19' of git://github.com/rajeshtaneja/moodle into MOODLE_19_STABLE 2011-08-23 02:31:08 +02:00
Andrew Davis (andyjdavis) 14fabc127a MDL-28079 cron: added a safety check around a record set in cron 2011-08-22 11:52:54 +08:00
Petr Skoda 93b06d08b4 MDL-28932 remove type hinting which is not compatible with PHP 4 2011-08-21 18:59:50 +02:00
Petr Skoda 188280a76f MDL-27248 remove forgotten unique sortorder index from the course table 2011-08-21 17:35:46 +02:00
Rajesh Taneja 903441b159 MDL-29001 unit tests: removed timezone test fixtures dependent on 'Australia/Perth' 2011-08-19 14:38:39 +08:00
Dan Marsden 38eaf9f365 MDL-4561 allow guests to access metacourses with an enrolment key. 2011-08-19 11:54:01 +12:00
Eloy Lafuente (stronk7) 07950882c6 weekly release 1.9.13+ 2011-08-18 02:44:04 +02:00
Eloy Lafuente (stronk7) c02352a5c4 Revert "MDL-25757 SCORM fix issue with duplicate cmi values being saved"
This reverts commit ba41c237a4.
2011-08-17 02:30:03 +02:00
Eloy Lafuente (stronk7) 34b082a296 Merge branch 'MDL-18012' of git://git.luns.net.uk/moodle into MOODLE_19_STABLE 2011-08-16 16:22:38 +02:00
Eloy Lafuente (stronk7) 443b5044a5 Merge branch 'MDL-24887' of git://git.luns.net.uk/moodle into MOODLE_19_STABLE 2011-08-16 14:36:06 +02:00
David Mudrak 1824a69d7a MDL-28723 Make sure that the arrays used by print_plugin_tables() are correctly initialized
This covers a very rare and unexpected case when no mods or no blocks
are installed. Credit goes to Aparup Banerjee for spotting this.
2011-08-16 14:11:02 +02:00
Eloy Lafuente (stronk7) 2a44c5192c Merge branch 'MDL-23872_m19' of git://github.com/nebgor/moodle into MOODLE_19_STABLE 2011-08-16 11:52:32 +02:00
Eloy Lafuente (stronk7) bfe5eed065 Merge branch 'MDL-28931_m19' of git://github.com/stronk7/moodle into MOODLE_19_STABLE 2011-08-16 03:06:47 +02:00
Eloy Lafuente (stronk7) 2c33a00afb Merge branch 'm19_MDL-25757' of git://github.com/danmarsden/moodle into MOODLE_19_STABLE 2011-08-16 00:39:59 +02:00
Tim Hunt 3367853670 MDL-28639 question import should set timemodified and modified by.
Thanks to Jean-Michel Vedrine for the fix.
2011-08-15 14:58:47 +01:00
Eloy Lafuente (stronk7) 9ea4a1c8f5 MDL-28931 timezone - update to 2011h (2200 rules) 2011-08-14 18:06:55 +02:00
Dan Marsden ba41c237a4 MDL-25757 SCORM fix issue with duplicate cmi values being saved 2011-08-13 13:26:54 +12:00
Davo Smith f802bf65a1 MDL-28690 Do not automatically unenrol users from meta courses after ->longtimenosee days as this can lead to multiple 'welcome' messages 2011-08-12 11:28:58 +01:00
Eloy Lafuente (stronk7) 1287d5ed97 weekly release 1.9.13+ 2011-08-12 00:21:16 +02:00
Daren Chandisingh 1ee988357f MDL-23872 Forms Library : Updated MoodleQuickForm to honour setConstant(), prevents injection.
- resolved conflict
2011-08-10 15:33:56 +08:00
Sam Hemelryk 4a7fee7be0 Merge branch 'MDL-20501_m19' of git://github.com/rwijaya/moodle into MOODLE_19_STABLE 2011-08-10 14:10:58 +08:00
Sam Hemelryk bf6c05f449 Merge branch 'MDL-27174_MOODLE_19_STABLE' of git://github.com/nebgor/moodle into MOODLE_19_STABLE 2011-08-10 13:27:48 +08:00
Eloy Lafuente (stronk7) 9038daab26 Merge branch 'w31_MDL-27597_m19_catlike' of git://github.com/skodak/moodle into MOODLE_19_STABLE 2011-08-10 02:38:04 +02:00
Aparup Banerjee cccaf2648a MDL-28565 General - updated lang files License link to docs.moodle.org/dev/License 2011-08-09 18:22:53 +08:00
Aparup Banerjee 5e64c36b8a MDL-28565 General - updated License and Credits links
to docs.moodle.org/dev/License and docs.moodle.org/dev/Credits
2011-08-09 18:18:36 +08:00
Petr Skoda 3adf4006a7 MDL-27597 fix invalid results of get_categories when shallow is false 2011-08-05 20:20:21 +02:00
Dan Poltawski 1d2d89aa60 MDL-18012 - roles/assign - Use more precise language string 2011-08-03 23:40:33 +01:00
Petr Skoda 51793f4a89 weekly release 1.9.13+ 2011-08-03 17:57:05 +02:00
Dan Poltawski 9955ec862e MDL-24887 - rss block - feed validator link fails with ampersands 2011-08-03 14:53:11 +01:00
Sam Hemelryk 6ea9d495b8 Merge branch 'MDL-28508_19' of git://github.com/timhunt/moodle into MOODLE_19_STABLE 2011-08-02 17:39:44 +08:00
Aparup Banerjee 5cece750f5 MDL-27174 Backup Assignment - fixed fatal missing assignmenttype error during backup. Credit: Chris Follin 2011-08-02 14:27:43 +08:00
Sam Hemelryk 2d58b91a9c Merge branch 'MDL-28209_MOODLE_19_STABLE' of github.com:nebgor/moodle into MOODLE_19_STABLE 2011-08-02 11:06:57 +08:00
Petr Skoda b3b781f9fc Merge branch 'MDL-28199_m19' of git://github.com/rwijaya/moodle into MOODLE_19_STABLE 2011-08-01 13:16:00 +02:00
Rossiani Wijaya 5c53773caf MDL-20501 Survey module: fix text alignment for right to left language 2011-08-01 16:58:34 +08:00
Sam Hemelryk 1f6c3ff2f4 Moodle 1.9.13 release 2011-08-01 16:53:14 +08:00
Rossiani Wijaya 133d528c67 MDL-28199 Lesson mod: fixed lesson answer alignment 2011-08-01 11:45:27 +08:00
Tim Hunt 4d0a6fec12 MDL-28508 bad string trunction in Aiken format. 2011-07-28 12:23:44 +01:00
Petr Skoda 4d3c6ac7d3 weekly release 1.9.12+ 2011-07-26 11:04:59 +02:00
Sam Hemelryk 05f38de60e MDL-28411 Post-integration improvement of string changes 2011-07-26 16:09:12 +08:00
Petr Skoda fdee5d95b7 Merge branch 'MDL-27717_MOODLE_19_STABLE' into MOODLE_19_STABLE 2011-07-25 16:40:56 +02:00
Aparup Banerjee c50253c834 MDL-28209 updated Copyright notice to point to docs.moodle.org/dev/Releases for release notes. 2011-07-25 14:44:55 +08:00
Aparup Banerjee 1384c7e685 MDL-28209 General - following up on MDL-28135, modified links to point to 1.9 version of docs
- development links pointed under /dev.
2011-07-25 14:42:27 +08:00
Aparup Banerjee 10fbf4d8ca MDL-27717 Enrolments - separated display of localized cost being displayed from cost being charged at authorize.net 2011-07-25 12:59:49 +08:00
Dan Poltawski ba4dfc998d MDL-28232 - Course log text export is missing a new line 2011-07-25 12:59:18 +08:00
Sam Hemelryk e41831dde4 Merge branch 'w29_MDL-27464_m19_continue' of git://github.com/skodak/moodle into MOODLE_19_STABLE 2011-07-25 11:04:13 +08:00
Sam Hemelryk fb50bf6c32 Merge branch 'w29_MDL-28360_m19_flatfile' of git://github.com/skodak/moodle into MOODLE_19_STABLE 2011-07-25 10:25:08 +08:00
Matt Meisberger 8f9f666c90 MDL-27464 continuation link sometimes links off-site
Integrating #CSTAGE-656, continuation link sometimes links off-site, into trunk.
2011-07-23 13:21:14 +02:00
Petr Skoda 9dce25dea5 MDL-28411 make sure people understand the difference between groupings and Available for group members only 2011-07-21 11:24:00 +02:00
Matt Meisberger bd4f3fa5c4 MDL-28360 Fix for sql injection vulnerability in flat file enrollment - Matt Meisberger (WebCourseworks) 2011-07-20 15:52:22 +02:00
Petr Skoda 6bbf934a3e weekly release 1.9.12+ 2011-07-19 15:20:19 +02:00
Petr Skoda 5c66e926b6 MDL-27889 use new recaptcha google urls in lang packs 2011-07-19 10:15:46 +02:00
Sam Hemelryk 61b865f72c Merge branch 'MDL-27889_MOODLE_19_STABLE' of git://github.com/nebgor/moodle into MOODLE_19_STABLE 2011-07-18 17:29:08 +08:00
Sam Hemelryk 215e7a00a2 weekly release 1.9.12+ 2011-07-13 20:26:00 +08:00
Eloy Lafuente (stronk7) 715b7649bd MDL-23580 course overview - remove debugging junk
Conflicts:

	admin/report/courseoverview/index.php
2011-07-11 16:55:15 +02:00
Eloy Lafuente (stronk7) 4a817f0753 Merge branch 'MDL-27515_m19' of git://github.com/rwijaya/moodle into MOODLE_19_STABLE 2011-07-11 16:19:16 +02:00
Sam Hemelryk b2d016f3da Merge branch 'wip-MDL-28197-MOODLE_19_STABLE' of git://github.com/marinaglancy/moodle into MOODLE_19_STABLE 2011-07-11 13:38:58 +08:00
Marina Glancy 682e430ce0 MDL-28197 another possible sql vulnerability injection fixed 2011-07-11 09:40:05 +08:00
Marina Glancy ffd3e38977 MDL-28197 adding slashes to group name when creating group in user upload 2011-07-11 09:40:05 +08:00
Eloy Lafuente (stronk7) 731e813ac8 MDL-28062 glossary - rate redirect not working after search 2011-07-11 02:14:00 +02:00
Eloy Lafuente (stronk7) 85c123b5b1 weekly release 1.9.12+ 2011-07-08 11:23:51 +02:00
Rossiani Wijaya b2fd028829 MDL-27515 resource module: change 'require' to 'require_once' 2011-07-08 10:51:39 +08:00
Aparup Banerjee a424b206f6 MDL-27889 lib Updated recaptchlib to point to google urls based on google's api v1.11 2011-07-07 04:59:51 +08:00
Sam Hemelryk c74a93d017 Merge branch 'MDL-27716_19' of git://github.com/timhunt/moodle into MOODLE_19_STABLE 2011-07-06 12:10:17 +08:00
Joseph Rezeau 96aec10056 MDL-27716 qtype_multianswer make the work 'Close' in the overlib popup translatable. 2011-07-04 15:50:17 +01:00
Eloy Lafuente (stronk7) 6c56155188 weekly release 1.9.12+ 2011-07-02 00:02:12 +02:00
Aparup Banerjee 5cea248b8b MDL-28044 general - updated print_error() to point to versioned docs.moodle.org 2011-06-30 11:56:35 +08:00
Eloy Lafuente (stronk7) 1b75cdd4c7 weekly release 1.9.12+ 2011-06-23 11:27:56 +02:00
Eloy Lafuente (stronk7) ed64a00a57 MDL-27966 timezones - updated to 2011g version + fix minor notice 2011-06-21 16:25:43 +02:00
Eloy Lafuente (stronk7) d395fa4024 weekly release 1.9.12+ 2011-06-16 19:11:01 +02:00
Eloy Lafuente (stronk7) 54a70ffb8c Merge branch 'wip-MDL-24355-MOODLE_19_STABLE' of git://github.com/andyjdavis/moodle into MOODLE_19_STABLE 2011-06-16 10:40:46 +02:00
Eloy Lafuente (stronk7) 4474ee420a Merge branch 'wip-mdl-27863-MOODLE_19_STABLE' of git://github.com/rajeshtaneja/moodle into MOODLE_19_STABLE 2011-06-15 11:53:28 +02:00
Rajesh Taneja de5da04c5f MDL-27863 moodlelib - fixed testcase faliure in MDL-27577 2011-06-15 17:38:49 +08:00
Eloy Lafuente (stronk7) 6cc32cbb9e Merge branch 'wip-MDL-27638-MOODLE_19_STABLE' of git://github.com/samhemelryk/moodle into MOODLE_19_STABLE 2011-06-14 12:06:09 +02:00
Sam Hemelryk 3b246aca22 MDL-27638 Removed buggy status line from query as it is being calculated in php anyway 2011-06-14 10:15:21 +08:00
Sam Hemelryk d98e3d6b60 Merge branch 'm19_MDL-27404' of git://github.com/danmarsden/moodle into MOODLE_19_STABLE 2011-06-13 14:55:48 +08:00
Dan Marsden 7ef0866c93 MDL-27404 SCORM fix for IE 6 - thanks to Howard Miller 2011-06-13 11:29:05 +12:00
Dan Marsden c58d4eef1e MDL-27545 fix length of log action field - merged from 2.0 stable MDL-26880 2011-06-13 09:54:06 +12:00
Eloy Lafuente (stronk7) 1de5024830 weekly release 1.9.12+ 2011-06-09 03:43:55 +02:00
Eloy Lafuente (stronk7) c0e462c5d1 Merge branch 'wip-mdl-27577-MOODLE_19_STABLE' of git://github.com/rajeshtaneja/moodle into MOODLE_19_STABLE 2011-06-09 01:10:53 +02:00
Sam Hemelryk d17b16b697 MDL-27695 doc link checks ->release before including version.php now 2011-06-08 16:54:35 +08:00
Aparup Banerjee 7bfc8766bc MDL-27695 Documentation : updated the moodle docs link at the footer of pages to point to new docs url 2011-06-08 13:42:00 +08:00
Andrew Davis (andyjdavis) ab0c861479 MDL-24355 tag: added code to prevent an error if there are no tag correlations found 2011-06-07 17:06:00 +08:00
Rajesh Taneja 7a94695536 MDL-27577 moodlelib - fixed dst offset in userdate, usergetdate and make_timestamp functions 2011-06-03 10:02:30 +08:00
Eloy Lafuente (stronk7) 59d8944377 weekly release 1.9.12+ 2011-06-02 23:38:05 +02:00
Eloy Lafuente (stronk7) 2ecbeaf815 weekly release 1.9.12+ 2011-05-26 00:09:20 +02:00
Sam Hemelryk 226f0f6fdc weekly release 1.9.12+ 2011-05-18 18:14:25 +08:00
Eloy Lafuente (stronk7) 8347921cfa Merge branch 'MDL-26704_user_outline_report_19' of git://github.com/andyjdavis/moodle into MOODLE_19_STABLE 2011-05-17 12:01:40 +02:00
Eloy Lafuente (stronk7) 4f336e2c97 weekly release 1.9.12+ 2011-05-11 15:24:42 +02:00
Andrew Davis (andyjdavis) b66705e52c MDL-26704 gradebook: added some intelligence to the dates displayed on the user outline activity report 2011-05-10 11:28:29 +08:00
Andrew Davis (andyjdavis) d221a3839d Merge branch 'MOODLE_19_STABLE' of git://git.moodle.org/moodle into MOODLE_19_STABLE 2011-05-10 11:17:45 +08:00
Andrew Davis (andyjdavis) a1bc21b045 Revert "MDL-26704 gradebook: switched the user outline activity report to use date submitted instead of date graded"
This reverts commit e9cd73e2f3.
2011-05-06 11:10:01 +08:00
Andrew Davis (andyjdavis) e9cd73e2f3 MDL-26704 gradebook: switched the user outline activity report to use date submitted instead of date graded 2011-05-06 11:08:07 +08:00
Sam Hemelryk ef7383d32a MDL-24355 Fixed up deletion of tag correlations when deleting tags 2011-04-20 12:03:00 +08:00
Sam Hemelryk 3aeb4f03bd MDL-24355 Greatly improved performance of the tag correlation function and fixed up bugs with it 2011-04-20 11:51:16 +08:00
127 changed files with 3641 additions and 2604 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ a few minutes:
For more information, see the INSTALL DOCUMENTATION:
http://docs.moodle.org/en/Installing_Moodle
http://docs.moodle.org/19/en/Installing_Moodle
A local copy can also be found in
+22 -20
View File
@@ -241,10 +241,13 @@
if ($CFG->longtimenosee) { // value in days
$cuttime = $timenow - ($CFG->longtimenosee * 3600 * 24);
$rs = get_recordset_sql ("SELECT id, userid, courseid
FROM {$CFG->prefix}user_lastaccess
WHERE courseid != ".SITEID."
AND timeaccess < $cuttime ");
$rs = get_recordset_sql ("SELECT la.id, la.userid, la.courseid
FROM {$CFG->prefix}user_lastaccess la
JOIN {$CFG->prefix}course c
ON c.id = la.courseid
WHERE la.courseid != ".SITEID."
AND la.timeaccess < $cuttime
AND c.metacourse = 0 ");
while ($assign = rs_fetch_next_record($rs)) {
if ($context = get_context_instance(CONTEXT_COURSE, $assign->courseid)) {
if (role_unassign(0, $assign->userid, 0, $context->id)) {
@@ -348,25 +351,24 @@
mtrace('checking for create_password');
if (count_records('user_preferences', 'name', 'create_password', 'value', '1')) {
mtrace('creating passwords for new users');
$newusers = get_records_sql("SELECT u.id as id, u.email, u.firstname,
u.lastname, u.username,
p.id as prefid
FROM {$CFG->prefix}user u
JOIN {$CFG->prefix}user_preferences p ON u.id=p.userid
WHERE p.name='create_password' AND p.value='1' AND u.email !='' ");
foreach ($newusers as $newuserid => $newuser) {
$newuser->emailstop = 0; // send email regardless
// email user
if (setnew_password_and_mail($newuser)) {
// remove user pref
delete_records('user_preferences', 'id', $newuser->prefid);
} else {
trigger_error("Could not create and mail new user password!");
$newuserssql = "SELECT u.id as id, u.email, u.firstname, u.lastname, u.username, p.id as prefid
FROM {$CFG->prefix}user u
JOIN {$CFG->prefix}user_preferences p ON u.id=p.userid
WHERE p.name='create_password' AND p.value='1' AND u.email !='' ";
if ($newusers = get_records_sql($newuserssql)) {
foreach ($newusers as $newuserid => $newuser) {
$newuser->emailstop = 0; // send email regardless
// email user
if (setnew_password_and_mail($newuser)) {
// remove user pref
delete_records('user_preferences', 'id', $newuser->prefid);
} else {
trigger_error("Could not create and mail new user password!");
}
}
}
}
if (!empty($CFG->usetags)) {
require_once($CFG->dirroot.'/tag/lib.php');
tag_cron();
+228
View File
@@ -442,4 +442,232 @@
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
<MOODLE version="2.2" requires="1.9">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.0.25">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
</VENDOR>
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="10.2" />
<VENDOR name="sqlite" version="2.0" />
</DATABASE>
<PHP version="5.3.2" level="required">
</PHP>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="optional">
<FEEDBACK>
<ON_CHECK message="gdrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="40M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="safe_mode" value="0" level="optional">
<FEEDBACK>
<ON_CHECK message="settingsafemode" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
<MOODLE version="2.3" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.0.25">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
</VENDOR>
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="10.2" />
<VENDOR name="sqlite" version="2.0" />
</DATABASE>
<PHP version="5.3.2" level="required">
</PHP>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="optional">
<FEEDBACK>
<ON_CHECK message="gdrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_CHECK message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="40M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="safe_mode" value="0" level="optional">
<FEEDBACK>
<ON_CHECK message="settingsafemode" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+7 -7
View File
@@ -47,7 +47,7 @@
/// Check some PHP server settings
$documentationlink = '<a href="http://docs.moodle.org/en/Installation">Installation docs</a>';
$documentationlink = '<a href="http://docs.moodle.org/19/en/Installation">Installation docs</a>';
if (ini_get_bool('session.auto_start')) {
error("The PHP server variable 'session.auto_start' should be Off - $documentationlink");
@@ -143,7 +143,7 @@
print_box(text_to_html(get_string('gpl')), 'copyrightnotice');
echo "<br />";
notice_yesno(get_string('doyouagree'), "index.php?agreelicense=1",
"http://docs.moodle.org/en/License");
"http://docs.moodle.org/dev/License");
print_footer('none');
exit;
}
@@ -152,7 +152,7 @@
$navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc')));
print_header($strcurrentrelease, $strcurrentrelease, $navigation, "", "", false, "&nbsp;", "&nbsp;");
print_heading("Moodle $release");
print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'generalbox boxaligncenter boxwidthwide');
print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/19/en/Release_Notes'), 'generalbox boxaligncenter boxwidthwide');
echo '<form action="index.php"><div>';
echo '<input type="hidden" name="agreelicense" value="1" />';
echo '<input type="hidden" name="confirmrelease" value="1" />';
@@ -286,7 +286,7 @@
$navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc')));
print_header($strcurrentrelease, $strcurrentrelease, $navigation, "", "", false, "&nbsp;", "&nbsp;");
print_heading("Moodle $release");
print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'));
print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/19/en/Release_Notes'));
require_once($CFG->libdir.'/environmentlib.php');
print_heading(get_string('environment', 'admin'));
@@ -687,10 +687,10 @@
//////////////////////////////////////////////////////////////////////////////////////////////////
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
$copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
'<a href="http://docs.moodle.org/en/Release" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
'<a href="http://docs.moodle.org/dev/Releases" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
'Copyright &copy; 1999 onwards, Martin Dougiamas<br />'.
'and <a href="http://docs.moodle.org/en/Credits">many other contributors</a>.<br />'.
'<a href="http://docs.moodle.org/en/License">GNU Public License</a>';
'and <a href="http://docs.moodle.org/dev/Credits">many other contributors</a>.<br />'.
'<a href="http://docs.moodle.org/dev/License">GNU Public License</a>';
print_box($copyrighttext, 'copyright');
//////////////////////////////////////////////////////////////////////////////////////////////////
+2 -2
View File
@@ -75,12 +75,12 @@
.$param->extras
." ORDER BY ".$param->orderby;
}
error_log($sql);
$courses = get_records_sql($sql, 0, $numcourses);
if (empty($courses)) {
notify(get_string('statsnodata'));echo '</td></tr></table>';echo '<p>after notify</p>';
notify(get_string('statsnodata'));
echo '</td></tr></table>';
} else {
if (empty($CFG->gdversion)) {
+1 -1
View File
@@ -72,7 +72,7 @@
$straction = get_string('assignroles', 'role');
$strroletoassign = get_string('roletoassign', 'role');
$strsearch = get_string('search');
$strshowall = get_string('showall');
$strshowall = get_string('showallusers');
$strparticipants = get_string('participants');
$strsearchresults = get_string('searchresults');
+2
View File
@@ -8,6 +8,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$temp->add(new admin_setting_configcheckbox('protectusernames', get_string('protectusernames', 'admin'), get_string('configprotectusernames', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('forcelogin', get_string('forcelogin', 'admin'), get_string('configforcelogin', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('forceloginforprofiles', get_string('forceloginforprofiles', 'admin'), get_string('configforceloginforprofiles', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('forceloginforprofileimage', get_string('forceloginforprofileimage', 'admin'), get_string('forceloginforprofileimage_help', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('opentogoogle', get_string('opentogoogle', 'admin'), get_string('configopentogoogle', 'admin'), 0));
$max_upload_choices = get_max_upload_sizes();
@@ -67,6 +68,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$temp->add(new admin_setting_configcheckbox('cookiehttponly', get_string('cookiehttponly', 'admin'), get_string('configcookiehttponly', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('regenloginsession', get_string('regenloginsession', 'admin'), get_string('configregenloginsession', 'admin'), 1));
$temp->add(new admin_setting_configtext('excludeoldflashclients', get_string('excludeoldflashclients', 'admin'), get_string('configexcludeoldflashclients', 'admin'), '10.0.12', PARAM_TEXT));
$temp->add(new admin_setting_configcheckbox('loginpasswordautocomplete', get_string('loginpasswordautocomplete', 'admin'), get_string('loginpasswordautocomplete_help', 'admin'), 0));
$ADMIN->add('security', $temp);
+2 -2
View File
@@ -558,7 +558,7 @@ if ($formdata = $mform->is_cancelled()) {
continue;
}
// save custom profile fields data
profile_save_data($user);
profile_save_data(addslashes_recursive($user));
// make sure user context exists
get_context_instance(CONTEXT_USER, $user->id);
@@ -665,7 +665,7 @@ if ($formdata = $mform->is_cancelled()) {
$newgroupdata = new object();
$newgroupdata->name = $addgroup;
$newgroupdata->courseid = $ccache[$shortname]->id;
if ($ccache[$shortname]->groups[$addgroup]->id = groups_create_group($newgroupdata)){
if ($ccache[$shortname]->groups[$addgroup]->id = groups_create_group(addslashes_recursive($newgroupdata))){
$ccache[$shortname]->groups[$addgroup]->name = $newgroupdata->name;
} else {
$upt->track('enrolments', get_string('unknowngroup', 'error', $addgroup), 'error');
+2 -2
View File
@@ -2,7 +2,7 @@ XMLDB - Base classes and edition interface.
Complete Documentation:
http://docs.moodle.org/en/XMLDB_Defining_one_XML_structure
http://docs.moodle.org/19/en/XMLDB_Defining_one_XML_structure
Ciao, Eloy Lafuente (stronk7)
@@ -70,7 +70,7 @@ Once the XMLDB format was approved, we'll be able to build all the
for each RDBMS flavour.
Once the interface was finished (2-3 days from now) related documentation
will be sent to http://docs.moodle.org/en/XML_database_schema in order
will be sent to http://docs.moodle.org/19/en/XML_database_schema in order
to comment/modify/approve the final XML format.
All the code is, obviously GPL, with its copyrights and so on...
@@ -25,8 +25,8 @@
///////////////////////////////////////////////////////////////////////////
/// This class will show all the reserved words in a format suitable to
/// be pasted to: http://docs.moodle.org/en/XMLDB_reserved_words and
/// http://docs.moodle.org/en/Database_reserved_words
/// be pasted to: http://docs.moodle.org/19/en/XMLDB_reserved_words and
/// http://docs.moodle.org/19/en/Database_reserved_words
/// Also, it introspects te DB looking for such words and informing about
class view_reserved_words extends XMLDBAction {
+1 -1
View File
@@ -675,7 +675,7 @@ if ( !is_object($PHPCAS_CLIENT) ) {
$droptablesql[] = 'DROP TEMPORARY TABLE ' . $temptable; // sql command to drop the table (because session scope could be a problem)
execute_sql_arr($droptablesql, true, false); /// Drop temp table to avoid persistence problems later
echo "Creating temp table $temptable\n";
execute_sql('CREATE TEMPORARY TABLE ' . $temptable . ' (username VARCHAR(64), PRIMARY KEY (username)) TYPE=MyISAM', false);
execute_sql('CREATE TEMPORARY TABLE ' . $temptable . ' (username VARCHAR(64), PRIMARY KEY (username)) ENGINE=MyISAM', false);
break;
case 'postgres':
$temptable = $CFG->prefix . 'extuser';
+1 -1
View File
@@ -563,7 +563,7 @@ class auth_plugin_ldap extends auth_plugin_base {
switch (strtolower($CFG->dbfamily)) {
case 'mysql':
$droptablesql[] = 'DROP TEMPORARY TABLE ' . $temptable; // sql command to drop the table (because session scope could be a problem)
$createtemptablesql = 'CREATE TEMPORARY TABLE ' . $temptable . ' (username VARCHAR(64), PRIMARY KEY (username)) TYPE=MyISAM';
$createtemptablesql = 'CREATE TEMPORARY TABLE ' . $temptable . ' (username VARCHAR(64), PRIMARY KEY (username)) ENGINE=MyISAM';
break;
case 'postgres':
$droptablesql[] = 'DROP TABLE ' . $temptable; // sql command to drop the table (because session scope could be a problem)
+5
View File
@@ -170,6 +170,10 @@ class auth_plugin_mnet extends auth_plugin_base {
global $MNET;
require_once $CFG->dirroot . '/mnet/xmlrpc/client.php';
if (!empty($USER->realuser)) {
print_error('notpermittedtojumpas', 'mnet');
}
// check remote login permissions
if (! has_capability('moodle/site:mnetlogintoremote', get_context_instance(CONTEXT_SYSTEM))
or is_mnet_remote_user($USER)
@@ -306,6 +310,7 @@ class auth_plugin_mnet extends auth_plugin_base {
}
$remoteuser->mnethostid = $remotehost->id;
$remoteuser->firstaccess = time(); // First time user in this server, grab it here
$remoteuser->confirmed = 1;
if (!$remoteuser->id = insert_record('user', addslashes_recursive($remoteuser))) {
print_error('databaseerror', 'mnet');
+5 -10
View File
@@ -193,18 +193,13 @@ class auth_plugin_shibboleth extends auth_plugin_base {
*
*/
function logoutpage_hook() {
global $redirect;
global $SESSION, $redirect;
// Only do this if logout handler is defined
if (
isset($this->config->logout_handler)
&& !empty($this->config->logout_handler)
){
// Only do this if logout handler is defined, and if the user is actually logged in via Shibboleth
$logouthandlervalid = isset($this->config->logout_handler) && !empty($this->config->logout_handler);
if ( isset($SESSION->shibboleth_session_id) && $logouthandlervalid ) {
// Check if there is an alternative logout return url defined
if (
isset($this->config->logout_return_url)
&& !empty($this->config->logout_return_url)
){
if (isset($this->config->logout_return_url) && !empty($this->config->logout_return_url)) {
// Set temp_redirect to alternative return url
$temp_redirect = $this->config->logout_return_url;
} else {
+14 -7
View File
@@ -100,15 +100,22 @@ function schedule_backup_cron() {
$status = false;
continue;
}
// Skip courses that do not yet need backup
$skipped = !($backup_course->nextstarttime > 0 && $backup_course->nextstarttime < $now);
// Skip backup of unavailable courses that have remained unmodified in a month
$skipped = false;
if (!$course->visible && ($now - $course->timemodified) > 31*24*60*60) { //Hidden + unmodified last month
mtrace(" SKIPPING - hidden+unmodified");
set_field("backup_courses","laststatus","3","courseid",$backup_course->courseid);
$skipped = true;
if (!$skipped && !$course->visible && ($now - $course->timemodified) > 31*24*60*60) { //Hidden + settings were unmodified last month
//Check log if there were any modifications to the course content
$sql = 'SELECT l.id FROM '.$CFG->prefix .'log l WHERE '.
'l.course='. $course->id. ' AND l.time>'. ($now-31*24*60*60). " AND lower(l.action) not like '%view%'";
$logexists = record_exists_sql($sql);
if (!$logexists) {
mtrace(" SKIPPING - hidden+unmodified");
set_field("backup_courses", "laststatus", "3", "courseid", $backup_course->courseid);
$skipped = true;
}
}
//Now we backup every non skipped course with nextstarttime < now
if (!$skipped && $backup_course->nextstarttime > 0 && $backup_course->nextstarttime < $now) {
//Now we backup every non-skipped course
if (!$skipped) {
//We have to send a email because we have included at least one backup
$emailpending = true;
//Only make the backup if laststatus isn't 2-UNFINISHED (uncontrolled error)
+5 -5
View File
@@ -66,7 +66,7 @@ function backup_upgrade($oldversion=0) {
`value` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) TYPE=MyISAM COMMENT='To store backup configuration variables'");
) ENGINE=MyISAM COMMENT='To store backup configuration variables'");
}
if ($oldversion < 2003120800 and $result) {
@@ -79,7 +79,7 @@ function backup_upgrade($oldversion=0) {
`nextstarttime` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `courseid` (`courseid`)
) TYPE=MyISAM COMMENT='To store every course backup status'");
) ENGINE=MyISAM COMMENT='To store every course backup status'");
if ($result) {
$result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_log` (
@@ -89,7 +89,7 @@ function backup_upgrade($oldversion=0) {
`laststarttime` int(10) unsigned NOT NULL default '0',
`info` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='To store every course backup log info'");
) ENGINE=MyISAM COMMENT='To store every course backup log info'");
}
}
@@ -105,7 +105,7 @@ function backup_upgrade($oldversion=0) {
`new_id` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `{$CFG->prefix}backup_files_uk` (`backup_code`,`file_type`,`path`)
) TYPE=MyISAM COMMENT='To store and recode ids to user and course files.'");
) ENGINE=MyISAM COMMENT='To store and recode ids to user and course files.'");
}
if ($result) {
$result = execute_sql("DROP TABLE {$CFG->prefix}backup_ids");
@@ -120,7 +120,7 @@ function backup_upgrade($oldversion=0) {
`info` mediumtext,
PRIMARY KEY (`id`),
UNIQUE KEY `{$CFG->prefix}backup_ids_uk` (`backup_code` ,`table_name`,`old_id`)
) TYPE=MyISAM COMMENT='To store and convert ids in backup/restore'");
) ENGINE=MyISAM COMMENT='To store and convert ids in backup/restore'");
}
}
+22 -3
View File
@@ -209,10 +209,29 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
// Links to course
$searchstring = '/\$@(COURSEVIEWBYID)\*([0-9]+)@\$/';
$replacestring= $CFG->wwwroot . '/course/view.php?id=' . $restore->course_id;
$result = preg_replace($searchstring, $replacestring, $content);
// We look for it
preg_match_all($searchstring, $content, $foundset);
// If found, then we are going to look for its new id (in backup tables)
if ($foundset[0]) {
// Iterate over foundset[2]. They are the old_ids
foreach ($foundset[2] as $old_id) {
// We get the needed variables here (course id)
$rec = backup_getid($restore->backup_unique_code, 'course', $old_id);
// Personalize the searchstring
$searchstring = '/\$@(COURSEVIEWBYID)\*('.$old_id.')@\$/';
// If it is a link to itself, replace it
if (!empty($rec->new_id)) {
$replacestring = $CFG->wwwroot . '/course/view.php?id=' . $rec->new_id;
// It s a link to another course, keep it unmodified
} else {
$replacestring = $restore->original_wwwroot . '/course/view.php?id=' . $old_id;
}
// Perform the replacement
$content = preg_replace($searchstring, $replacestring, $content);
}
}
return $result;
return $content;
}
//This function is called from all xxxx_decode_content_links_caller(),
+1 -1
View File
@@ -142,7 +142,7 @@ global $CFG;
`visible` tinyint(1) not null default '0',
`configdata` text not null default '',
PRIMARY KEY(`id`)
) TYPE=MyISAM;");
) ENGINE=MyISAM;");
}
if ($oldversion < 2005090200) {
+6 -1
View File
@@ -49,7 +49,12 @@ class block_login extends block_base {
$this->content->text .= '<input type="text" name="username" id="login_username" value="'.s($username).'" /></div>';
$this->content->text .= '<div class="c1 fld password"><label for="login_password">'.get_string('password').'</label>';
$this->content->text .= '<input type="password" name="password" id="login_password" value="" /></div>';
if (!empty($CFG->loginpasswordautocomplete)) {
$this->content->text .= '<input type="password" name="password" id="login_password" value="" autocomplete="off" /></div>';
} else {
$this->content->text .= '<input type="password" name="password" id="login_password" value="" /></div>';
}
$this->content->text .= '<div class="c1 btn"><input type="submit" value="'.get_string('login').'" /></div>';
+8
View File
@@ -32,6 +32,14 @@ class block_mnet_hosts extends block_list {
return '';
}
if (!empty($USER->realuser)) {
$this->content = new stdClass();
$this->content->items = array();
$this->content->icons = array();
$this->content->footer = get_string('notpermittedtojumpas', 'mnet');
return $this->content;
}
// check for outgoing roaming permission first
if (!has_capability('moodle/site:mnetlogintoremote', get_context_instance(CONTEXT_SYSTEM), NULL, false)) {
return '';
+3 -3
View File
@@ -49,9 +49,9 @@
$eventid = optional_param('id', 0, PARAM_INT);
$eventtype = optional_param('type', 'select', PARAM_ALPHA);
$urlcourse = optional_param('course', 0, PARAM_INT);
$cal_y = optional_param('cal_y');
$cal_m = optional_param('cal_m');
$cal_d = optional_param('cal_d');
$cal_y = optional_param('cal_y', 0, PARAM_INT);
$cal_m = optional_param('cal_m', 0, PARAM_INT);
$cal_d = optional_param('cal_d', 0, PARAM_INT);
if(isguest()) {
// Guests cannot do anything with events
+10 -11
View File
@@ -41,15 +41,14 @@
require_once('../config.php');
require_once($CFG->dirroot.'/calendar/lib.php');
$from = required_param('from');
$var = required_param('var');
$value = optional_param('value');
$id = optional_param('id');
$cal_d = optional_param('cal_d');
$cal_m = optional_param('cal_m');
$cal_y = optional_param('cal_y');
$action = optional_param('action');
$type = optional_param('type');
$from = required_param('from', PARAM_ALPHA);
$var = required_param('var', PARAM_ALPHA);
$id = optional_param('id', 0, PARAM_INT);
$cal_d = optional_param('cal_d', 0, PARAM_INT);
$cal_m = optional_param('cal_m', 0, PARAM_INT);
$cal_y = optional_param('cal_y', 0, PARAM_INT);
$action = optional_param('action', '', PARAM_ALPHA);
$type = optional_param('type', '', PARAM_ALPHA);
// Initialize the session variables
calendar_session_vars();
@@ -107,7 +106,7 @@
switch($from) {
case 'event':
redirect(CALENDAR_URL.'event.php?action='.$action.'&amp;type='.$type.'&amp;id='.intval($id));
redirect(CALENDAR_URL.'event.php?action='.$action.'&amp;type='.$type.'&amp;id='.$id);
break;
case 'month':
redirect(CALENDAR_URL.'view.php?view=month'.$courseid.'&cal_d='.$cal_d.'&cal_m='.$cal_m.'&cal_y='.$cal_y);
@@ -119,7 +118,7 @@
redirect(CALENDAR_URL.'view.php?view=day'.$courseid.'&cal_d='.$cal_d.'&cal_m='.$cal_m.'&cal_y='.$cal_y);
break;
case 'course':
redirect($CFG->wwwroot.'/course/view.php?id='.intval($id));
redirect($CFG->wwwroot.'/course/view.php?id='.$id);
break;
default:
+16 -16
View File
@@ -426,7 +426,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course
}
// Now display all the calendar
for($day = 1; $day <= $display->maxdays; ++$day, ++$dayweek) {
for($aday = 1; $aday <= $display->maxdays; ++$aday, ++$dayweek) {
if($dayweek > $display->maxwday) {
// We need to change week (table row)
echo "</tr>\n<tr>";
@@ -436,7 +436,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course
// Reset vars
$cell = '';
$dayhref = calendar_get_link_href(CALENDAR_URL.'view.php?view=day&amp;course='.$courseid.'&amp;', $day, $m, $y);
$dayhref = calendar_get_link_href(CALENDAR_URL.'view.php?view=day&amp;course='.$courseid.'&amp;', $aday, $m, $y);
if(CALENDAR_WEEKEND & (1 << ($dayweek % 7))) {
// Weekend. This is true no matter what the exact range is.
@@ -448,35 +448,35 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course
}
// Special visual fx if an event is defined
if(isset($eventsbyday[$day])) {
if(count($eventsbyday[$day]) == 1) {
if(isset($eventsbyday[$aday])) {
if(count($eventsbyday[$aday]) == 1) {
$title = get_string('oneevent', 'calendar');
}
else {
$title = get_string('manyevents', 'calendar', count($eventsbyday[$day]));
$title = get_string('manyevents', 'calendar', count($eventsbyday[$aday]));
}
$cell = '<div class="day"><a href="'.$dayhref.'" title="'.$title.'">'.$day.'</a></div>';
$cell = '<div class="day"><a href="'.$dayhref.'" title="'.$title.'">'.$aday.'</a></div>';
}
else {
$cell = '<div class="day">'.$day.'</div>';
$cell = '<div class="day">'.$aday.'</div>';
}
// Special visual fx if an event spans many days
if(isset($typesbyday[$day]['durationglobal'])) {
if(isset($typesbyday[$aday]['durationglobal'])) {
$class .= ' duration_global';
}
else if(isset($typesbyday[$day]['durationcourse'])) {
else if(isset($typesbyday[$aday]['durationcourse'])) {
$class .= ' duration_course';
}
else if(isset($typesbyday[$day]['durationgroup'])) {
else if(isset($typesbyday[$aday]['durationgroup'])) {
$class .= ' duration_group';
}
else if(isset($typesbyday[$day]['durationuser'])) {
else if(isset($typesbyday[$aday]['durationuser'])) {
$class .= ' duration_user';
}
// Special visual fx for today
if($display->thismonth && $day == $d) {
if($display->thismonth && $aday == $d) {
$class .= ' today';
} else {
$class .= ' nottoday';
@@ -488,9 +488,9 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course
}
echo '<td'.$class.'>'.$cell;
if(isset($eventsbyday[$day])) {
if(isset($eventsbyday[$aday])) {
echo '<ul class="events-new">';
foreach($eventsbyday[$day] as $eventindex) {
foreach($eventsbyday[$aday] as $eventindex) {
// If event has a class set then add it to the event <li> tag
$eventclass = '';
@@ -502,9 +502,9 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course
}
echo '</ul>';
}
if(isset($durationbyday[$day])) {
if(isset($durationbyday[$aday])) {
echo '<ul class="events-underway">';
foreach($durationbyday[$day] as $eventindex) {
foreach($durationbyday[$aday] as $eventindex) {
echo '<li>['.format_string($events[$eventindex]->name,true).']</li>';
}
echo '</ul>';
+1 -1
View File
@@ -21,7 +21,7 @@
</tr>
</table>
<div class="singlebutton">
<input type="hidden" name="id" value="<?php echo $form->id ?>" />
<input type="hidden" name="id" value="<?php echo $id ?>" />
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
</div>
+1 -1
View File
@@ -54,7 +54,7 @@
} else {
$sectionname = get_section_name($course->format);
$stredit = get_string('edit', '', " $sectionname $section->section");
$strsummaryof = get_string('summaryof', '', " $sectionname $form->section");
$strsummaryof = get_string('summaryof', '', " $sectionname $section->section");
}
print_header_simple($stredit, '', build_navigation(array(array('name' => $stredit, 'link' => null, 'type' => 'misc'))), 'theform.summary' );
+1 -1
View File
@@ -53,7 +53,7 @@
}
/// Check if the course is a meta course (bug 5734)
if ($course->metacourse) {
if ($course->metacourse && !($course->guest == 2 && isguestuser())) {
print_header_simple();
notice(get_string('coursenotaccessible'), "$CFG->wwwroot/index.php");
}
+1 -1
View File
@@ -523,7 +523,7 @@ function print_log_csv($course, $user, $date, $order='l.time DESC', $modname,
header("Pragma: public");
echo get_string('savedat').userdate(time(), $strftimedatetime)."\n";
echo $text;
echo $text."\n";
if (empty($logs['logs'])) {
return true;
+2 -2
View File
@@ -71,7 +71,7 @@ class enrolment_plugin_authorize
$curcost = get_course_cost($course);
echo '<div class="mdl-align">';
echo '<p>'.get_string('paymentrequired').'</p>';
echo '<p><b>'.get_string('cost').": $curcost[currency] $curcost[cost]".'</b></p>';
echo '<p><b>'.get_string('cost').': '. $curcost['currency'] . $curcost['localizedcost'] .'</b></p>';
echo '<p><a href="'.$CFG->httpswwwroot.'/login/">'.get_string('loginsite').'</a></p>';
echo '</div>';
}
@@ -387,7 +387,7 @@ class enrolment_plugin_authorize
}
$str .= '<div class="cost" title="'.$strrequirespayment.'">'.$strcost.': ';
$str .= $currency . ' ' . $curcost['cost'].'</div>';
$str .= $currency . ' ' . $curcost['localizedcost'].'</div>';
}
return $str;
+3 -2
View File
@@ -12,10 +12,11 @@ function get_course_cost($course)
if (!empty($course->cost)) {
$cost = (float)(((float)$course->cost) < 0) ? $CFG->enrol_cost : $course->cost;
}
$cost = format_float($cost, 2);
$costlocalizeddisplay = format_float($cost, 2);
$cost = format_float($cost, 2, false);
$ret = array(
'cost' => $cost,
'localizedcost' => $costlocalizeddisplay,
'currency' => $currency
);
+2 -2
View File
@@ -157,13 +157,13 @@ function get_access_icons($course) {
continue;
}
if (! $user = get_record("user", "idnumber", $fields[2]) ) {
if (! $user = get_record("user", "idnumber", addslashes($fields[2])) ) {
$this->log .= "Unknown user idnumber in field 3 - ignoring line\n";
continue;
}
if (! $course = get_record("course", "idnumber", $fields[3]) ) {
if (! $course = get_record("course", "idnumber", addslashes($fields[3])) ) {
$this->log .= "Unknown course idnumber in field 4 - ignoring line\n";
continue;
}
+4 -4
View File
@@ -633,7 +633,7 @@ if (isset($_GET['help'])) {
echo '<div id="mssql">' . get_string('databasesettingssub_mssql', 'install');
/// Link to mssql installation page
echo "<p style='text-align:right'><a href=\"javascript:void(0)\" ";
echo "onclick=\"return window.open('http://docs.moodle.org/en/Installing_MSSQL_for_PHP')\"";
echo "onclick=\"return window.open('http://docs.moodle.org/19/en/Installing_MSSQL_for_PHP')\"";
echo ">";
echo '<img src="pix/docs.gif' . '" alt="Docs" class="iconhelp" />';
echo get_string('moodledocslink', 'install') . '</a></p>';
@@ -642,7 +642,7 @@ if (isset($_GET['help'])) {
echo '<div id="mssql_n">' . get_string('databasesettingssub_mssql_n', 'install');
/// Link to mssql installation page
echo "<p style='text-align:right'><a href=\"javascript:void(0)\" ";
echo "onclick=\"return window.open('http://docs.moodle.org/en/Installing_MSSQL_for_PHP')\"";
echo "onclick=\"return window.open('http://docs.moodle.org/19/en/Installing_MSSQL_for_PHP')\"";
echo ">";
echo '<img src="pix/docs.gif' . '" alt="Docs" />';
echo get_string('moodledocslink', 'install') . '</a></p>';
@@ -651,7 +651,7 @@ if (isset($_GET['help'])) {
echo '<div id="odbc_mssql">'. get_string('databasesettingssub_odbc_mssql', 'install');
/// Link to mssql installation page
echo "<p style='text-align:right'><a href=\"javascript:void(0)\" ";
echo "onclick=\"return window.open('http://docs.moodle.org/en/Installing_MSSQL_for_PHP')\"";
echo "onclick=\"return window.open('http://docs.moodle.org/19/en/Installing_MSSQL_for_PHP')\"";
echo ">";
echo '<img src="pix/docs.gif' . '" alt="Docs" class="iconhelp" />';
echo get_string('moodledocslink', 'install') . '</a></p>';
@@ -660,7 +660,7 @@ if (isset($_GET['help'])) {
echo '<div id="oci8po">' . get_string('databasesettingssub_oci8po', 'install');
/// Link to oracle installation page
echo "<p style='text-align:right'><a href=\"javascript:void(0)\" ";
echo "onclick=\"return window.open('http://docs.moodle.org/en/Installing_Oracle_for_PHP')\"";
echo "onclick=\"return window.open('http://docs.moodle.org/19/en/Installing_Oracle_for_PHP')\"";
echo ">";
echo '<img src="pix/docs.gif' . '" alt="Docs" class="iconhelp" />';
echo get_string('moodledocslink', 'install') . '</a></p>';
+1 -1
View File
@@ -16,7 +16,7 @@ To add more languages to Moodle, you can either:
For more information, see the Moodle Documentation:
http://docs.moodle.org/en/Translation
http://docs.moodle.org/19/en/Translation
Cheers,
+9 -5
View File
@@ -114,7 +114,7 @@ $string['configdisablecourseajax'] = 'Do not use AJAX when editing main course p
$string['configenablecalendarexport'] = 'Enable exporting or subscribing to calendars.';
$string['configenablecourserequests'] = 'This will allow any user to request a course be created.';
$string['configenableglobalsearch'] = 'This setting enables global text searching in resources and activities, it is not compatible with PHP 4.';
$string['configenablegroupings'] = 'This setting enables groupings of groups.';
$string['configenablegroupings'] = 'This setting enables the creation of groupings and the \'Available for group members only\' option. Groupings are a standard feature in Moodle 2.0 onwards whereas \'Available for group members only\' remains an experimental feature.';
$string['configenablehtmlpurifier'] = 'Use HTML Purifier instead of KSES for cleaning of untrusted text. HTML Purifier is actively developed and is believed to be more secure, but it is more resource intensive. Expect minor visual differences in the resulting html code. Please note that embed and object tags can not be enabled, MathML tags and old lang tags are not supported. ';
$string['configenablerssfeeds'] = 'This switch will enable RSS feeds from across the site. To actually see any change you will need to enable RSS feeds in the individual modules too - go to the Modules settings under Admin Configuration.';
$string['configenablerssfeedsdisabled'] = 'It is not available because RSS feeds are disabled in all the Site. To enable them, go to the Variables settings under Admin Configuration.';
@@ -209,8 +209,8 @@ $string['configcronremotepassword'] = 'This means that the cron.php script canno
</pre>If this is left empty, no password is required.';
$string['configrcache'] = 'Use the cache to store database records. Remember to set \'cachetype\' as well!';
$string['configrcachettl'] = 'Time-to-live for cached records, in seconds. Use a short (&lt;15) value here.';
$string['configrecaptchaprivatekey'] = 'String of characters used to communicate between your Moodle server and the recaptcha.net server. Obtain one for this site by visiting http://recaptcha.net';
$string['configrecaptchapublickey'] = 'String of characters used to display the reCAPTCHA element in the signup form. Generated by http://recaptcha.net';
$string['configrecaptchaprivatekey'] = 'String of characters used to communicate between your Moodle server and the recaptcha server. Obtain one for this site by visiting http://www.google.com/recaptcha';
$string['configrecaptchapublickey'] = 'String of characters used to display the reCAPTCHA element in the signup form. Generated by http://www.google.com/recaptcha';
$string['configregenloginsession'] = 'Regeneration of the session id during each login request is highly recommended for security reasons. This setting might not be compatible with some authentication plugins.';
$string['configrequestedstudentname'] = 'Word for student used in requested courses';
$string['configrequestedstudentsname'] = 'Word for students used in requested courses';
@@ -358,7 +358,7 @@ $string['enableajax'] = 'Enable AJAX';
$string['enablecalendarexport'] = 'Enable calendar export';
$string['enablecourserequests'] = 'Enable course requests';
$string['enableglobalsearch'] = 'Enable global search';
$string['enablegroupings'] = 'Enable groupings';
$string['enablegroupings'] = 'Enable groupings and \'Available for group members only\'';
$string['enablehtmlpurifier'] = 'Enable HTML Purifier';
$string['enablerecordcache'] = 'Enable Record Cache';
$string['enablerssfeeds'] = 'Enable RSS feeds';
@@ -396,6 +396,8 @@ $string['filtersettings'] = 'Manage filters';
$string['filtersettingsgeneral'] = 'General filter settings';
$string['filteruploadedfiles'] = 'Filter uploaded files';
$string['forcelogin'] = 'Force users to login';
$string['forceloginforprofileimage'] = 'Force users to login to view user pictures';
$string['forceloginforprofileimage_help'] = 'If enabled, users must login in order to view user profile pictures and the default user picture will be used in all notification emails.';
$string['forceloginforprofiles'] = 'Force users to login for profiles';
$string['forcetimezone'] = 'Force default timezone';
$string['framename'] = 'Frame name';
@@ -493,6 +495,8 @@ $string['location'] = 'Location';
$string['locationsettings'] = 'Location settings';
$string['log'] = 'Logs';
$string['loginhttps'] = 'Use HTTPS for logins';
$string['loginpasswordautocomplete'] = 'Prevent password autocompletion on login form.';
$string['loginpasswordautocomplete_help'] = 'Having this off will let users save their account password in their browser. Switching this setting on will result in your site no longer following XHTML strict validation rules.';
$string['loglifetime'] = 'Keep logs for';
$string['longtimenosee'] = 'Unsubscribe users from courses after';
$string['longtimewarning'] = '<b>Please note that this process can take a long time.</b>';
@@ -770,7 +774,7 @@ $string['uploadpicture_userupdated'] = 'Picture updated for user $a.';
$string['uploadpicture_cannotsave'] = 'Cannot save picture for user $a. Check original picture file.';
$string['updatetimezones'] = 'Update timezones';
$string['upgrade197notice'] = '<p>Moodle 1.9.7 contains a number of security fixes to user passwords and backups to protect the user data on your site. As a result some of your settings and permissions relating to backups may have changed.<br />
See the <a href=\"http://docs.moodle.org/en/Moodle_1.9.7_release_notes\" target=\"_blank\">Moodle 1.9.7 release notes</a> for full details.</p>';
See the <a href=\"http://docs.moodle.org/dev/Moodle_1.9.7_release_notes\" target=\"_blank\">Moodle 1.9.7 release notes</a> for full details.</p>';
$string['upgrade197noticesubject'] = 'Moodle 1.9.7 upgrade security notices';
$string['upgrade197salt'] = 'To reduce the risk of password theft, you are strongly recommended to set a password salt.<br />See the <a href=\"$a\" target=\"_blank\">password salting documentation</a> for details.';
$string['upgradeforumread'] = 'A new feature has been added in Moodle 1.5 to track read/unread forum posts.<br />To use this functionality you need to <a href=\"$a\">update your tables</a>.';
+2 -2
View File
@@ -125,7 +125,7 @@ $string['auth_emailnowexists'] = 'The email address you tried to assign to your
$string['auth_emailtitle'] = 'Email-based self-registration';
$string['auth_emailnoinsert'] = 'Could not add your record to the database!';
$string['auth_emailnoemail'] = 'Tried to send you an email but failed!';
$string['auth_emailrecaptcha'] = 'Adds a visual/audio confirmation form element to the signup page for email self-registering users. This protects your site against spammers and contributes to a worthwhile cause. See http://recaptcha.net/learnmore.html for more details. <br /><em>PHP cURL extension is required.</em>';
$string['auth_emailrecaptcha'] = 'Adds a visual/audio confirmation form element to the signup page for email self-registering users. This protects your site against spammers and contributes to a worthwhile cause. See http://www.google.com/recaptcha/learnmore for more details. <br /><em>PHP cURL extension is required.</em>';
$string['auth_emailrecaptcha_key'] = 'Enable reCAPTCHA element';
$string['auth_emailsettings'] = 'Settings';
$string['auth_emailupdatemessage'] = 'Dear $a->fullname,
@@ -256,7 +256,7 @@ $string['auth_ldaptitle'] = 'LDAP server';
$string['auth_ldapnotinstalled'] = 'Cannot use LDAP authentication. The PHP LDAP module is not installed.';
$string['auth_ntlmsso'] = 'NTLM SSO';
$string['auth_ntlmsso_enabled_key'] = 'Enable';
$string['auth_ntlmsso_enabled'] = 'Set to yes to attempt Single Sign On with the NTLM domain. <strong>Note:</strong> this requires additional setup on the webserver to work, see <a href=\"http://docs.moodle.org/en/NTLM_authentication\">http://docs.moodle.org/en/NTLM_authentication</a>';
$string['auth_ntlmsso_enabled'] = 'Set to yes to attempt Single Sign On with the NTLM domain. <strong>Note:</strong> this requires additional setup on the webserver to work, see <a href=\"http://docs.moodle.org/19/en/NTLM_authentication\">http://docs.moodle.org/19/en/NTLM_authentication</a>';
$string['auth_ntlmsso_ie_fastpath'] = 'Set to yes to enable the NTLM SSO fast path (bypasses certain steps and only works if the client\'s browser is MS Internet Explorer).';
$string['auth_ntlmsso_ie_fastpath_key'] = 'MS IE fast path?';
$string['auth_ntlmsso_subnet_key'] = 'Subnet';
+1 -1
View File
@@ -215,7 +215,7 @@ $string['recordsnotsaved'] = 'No entry was saved. Please check the format of the
$string['recordssaved'] = 'entries saved';
$string['requireapproval'] = 'Require approval?';
$string['requiredentries'] = 'Required entries';
$string['requiredentrieschanged'] = '<p><strong>IMPORTANT - PLEASE READ </strong></p><p>Due to a bug fix, the behaviour of database activities using the \'Required entries\' and \'Required entries before viewing settings\' settings will change. A more detailed explaination of the changes can be read on <a href=\"http://moodle.org/mod/forum/discuss.php?d=110928\" target=\"_blank\">the database module forum</a>. The expected behavior of these settings can also be read on <a href=\"http://docs.moodle.org/en/Adding/editing_a_database#Required_entries\" target=\"_blank\">Moodle Docs</a>.
$string['requiredentrieschanged'] = '<p><strong>IMPORTANT - PLEASE READ </strong></p><p>Due to a bug fix, the behaviour of database activities using the \'Required entries\' and \'Required entries before viewing settings\' settings will change. A more detailed explaination of the changes can be read on <a href=\"http://moodle.org/mod/forum/discuss.php?d=110928\" target=\"_blank\">the database module forum</a>. The expected behavior of these settings can also be read on <a href=\"http://docs.moodle.org/19/en/Adding/editing_a_database#Required_entries\" target=\"_blank\">Moodle Docs</a>.
</p><p>This change affects the following databases in your system: (Please save this list now, and after the upgrade, check that these activities still work the way that the teacher intends.)</p><strong style=\"color:red\">$a->text</strong><br/>';
$string['requiredentriestoview'] = 'Entries required before viewing';
$string['resettemplate'] = 'Reset template';
+1 -1
View File
@@ -5,7 +5,7 @@ All of it has gone now because we now use the Moodle Docs wiki.
To find out the new locations for all the information that was here, see:
http://docs.moodle.org/en/MoodleDocs_and_lang_packs
http://docs.moodle.org/19/en/MoodleDocs_and_lang_packs
http://tracker.moodle.org/browse/MDL-4912
+1 -1
View File
@@ -11,7 +11,7 @@
</head>
<body>
(For the most up-to-date version of this license, see <a href="http://docs.moodle.org/en/License">Moodle Docs</a>).
(For the most up-to-date version of this license, see <a href="http://docs.moodle.org/dev/License">Moodle Docs</a>).
<h1>Copyright License for Moodle</h1>
<blockquote>
+3 -3
View File
@@ -48,7 +48,7 @@
one of the few webhosts that does not support these features ask them why,
and consider taking your business elsewhere.</p>
<p>If you want to run Moodle on your own computer and all this looks a bit daunting,
then please take a look at <a href="http://docs.moodle.org/en/Administrator_documentation">the administrator documentation</a>.</p>
then please take a look at <a href="http://docs.moodle.org/19/en/Administrator_documentation">the administrator documentation</a>.</p>
<p>&nbsp;</p>
</div>
@@ -266,7 +266,7 @@ php_value post_max_size 2M</pre>
'1', teacher varchar(100) NOT NULL default 'Teacher', startdate int(10)
unsigned NOT NULL default '0', enddate int(10) unsigned NOT NULL default
'0', timemodified int(10) unsigned NOT NULL default '0', PRIMARY KEY (id))
TYPE=MyISAM</p>
ENGINE=MyISAM</p>
<p class="success">SUCCESS</p>
</div>
<p>...and so on, followed by: <span class="success">Main databases set up
@@ -416,7 +416,7 @@ php_value post_max_size 2M</pre>
for them using the &quot;Add a new user&quot; on the Admin page.</p>
<p>Once done, the course is ready to customise, and is accessible via the &quot;Courses&quot;
link on the home page.</p>
<p>See the &quot;<a href="http://docs.moodle.org/en/Teacher_documentation">Teacher Documentation</a>&quot; for more details
<p>See the &quot;<a href="http://docs.moodle.org/19/en/Teacher_documentation">Teacher Documentation</a>&quot; for more details
on course-building.</p>
<p>&nbsp;</p>
<p class="center"><strong>Happy exploring and happy Moodling!</strong></p>
+1 -1
View File
@@ -31,5 +31,5 @@ cannot delete the last category in a context.</li>
<ul>
<li><a href="help.php?module=question&amp;file=categorycontexts.html">Category contexts</a></li>
<li><a href="help.php?module=question&amp;file=permissions.html">Question permissions</a></li>
<li><a href="http://docs.moodle.org/en/Question_categories">Question categories help on Moodle Docs</a></li>
<li><a href="http://docs.moodle.org/19/en/Question_categories">Question categories help on Moodle Docs</a></li>
</ul>
@@ -15,5 +15,5 @@ your questions in any or all of the parent course categories).</li>
<ul>
<li><a href="help.php?module=question&amp;file=categories.html">Question categories</a></li>
<li><a href="help.php?module=question&amp;file=permissions.html">Question permissions</a></li>
<li><a href="http://docs.moodle.org/en/Question_contexts">Question contexts documentation on Moodle Docs</a></li>
<li><a href="http://docs.moodle.org/19/en/Question_contexts">Question contexts documentation on Moodle Docs</a></li>
</ul>
+1 -1
View File
@@ -258,7 +258,7 @@ $string['phpversionhelp'] = '<p>Moodle requires a PHP version of at least 4.3.0
$string['postgres7'] = 'PostgreSQL (postgres7)';
$string['postgresqlwarning'] = '<strong>Note:</strong> If you experience some connection problems, you can try to set Host Server field as
host=\'postgresql_host\' port=\'5432\' dbname=\'postgresql_database_name\' user=\'postgresql_user\' password=\'postgresql_user_password\'
and to leave empty the Database, User and Password fields. More information on <a href=\"http://docs.moodle.org/en/Installing_Postgres_for_PHP\">Moodle Docs</a>';
and to leave empty the Database, User and Password fields. More information on <a href=\"http://docs.moodle.org/19/en/Installing_Postgres_for_PHP\">Moodle Docs</a>';
$string['safemode'] = 'Safe Mode';
$string['safemodeerror'] = 'Moodle may have trouble with safe mode on';
$string['safemodehelp'] = '<p>Moodle may have a variety of problems with safe mode on, not least is that
+1
View File
@@ -208,6 +208,7 @@ $string['addtoacl'] = 'Add to Access Control';
$string['accesslevel'] = 'Access Level';
$string['ssoaccesscontrol'] = 'SSO Access Control';
$string['notpermittedtojump'] = 'You do not have permission to begin a remote session from this Moodle hub.';
$string['notpermittedtojumpas'] = 'You can\'t begin a remote session while you are logged in as another user.';
$string['notpermittedtoland'] = 'You do not have permission to begin a remote session.';
$string['authfail_nosessionexists'] = 'Authorisation failed: the mnet session does not exist.';
$string['authfail_sessiontimedout'] = 'Authorisation failed: the mnet session has timed out.';
+1 -1
View File
@@ -49,7 +49,7 @@ $string['downloadcore'] = 'Our main method of distribution is via these standard
$string['downloadcoretitle'] = 'Standard Moodle packages';
$string['downloadcvs'] = 'Another way to get the core source code is by using CVS to connect directly to one of our mirrors of the code repository used by Moodle developers. This makes upgrading very easy, even if you have made local changes to the source code.';
$string['downloadcvstitle'] = 'Moodle via CVS';
$string['downloadintro'] = 'Moodle is open source under the <a href=\"http://docs.moodle.org/en/License\">GPL licence</a>. Everything we produce is available for you to download and use for free.';
$string['downloadintro'] = 'Moodle is open source under the <a href=\"http://docs.moodle.org/dev/License\">GPL licence</a>. Everything we produce is available for you to download and use for free.';
$string['downloadlang'] = 'In current versions of Moodle, adding support for new languages has been automated from the administration menu within your site. However, for some older versions of Moodle, new language packs need to be downloaded manually.';
$string['downloadlangtitle'] = 'Language packs';
$string['downloadlogotitle'] = 'Moodle logos';
+3 -2
View File
@@ -161,7 +161,7 @@ $string['backupmetacoursehelp'] = 'If enabled, then metacourse info (inherited e
$string['backupnameformat'] = '%%Y%%m%%d-%%H%%M';
$string['backupmissinguserinfoperms'] = 'Note: This backup contains no user data. Exercise and Workshop activities will not be included in the backup, since these modules are not compatible with this type of backup.';
$string['backupnoneusersinfo'] = 'Note: This backup contains no users and so all activities have been switched to \"without user data\" mode. Exercise and Workshop activities will not be included in the backup, since these modules are not compatible with this type of backup.';
$string['backupnonisowarning'] = 'Warning: this backup is from a non-Unicode version of Moodle (pre 1.6). If this backup contains any non-ISO-8859-1 texts then they may be CORRUPTED if you try to restore them to this Unicode version of Moodle. See the <a href=\"http://docs.moodle.org/en/Backup_FAQ\">Backup FAQ</a> for more information about how to recover this backup correctly.';
$string['backupnonisowarning'] = 'Warning: this backup is from a non-Unicode version of Moodle (pre 1.6). If this backup contains any non-ISO-8859-1 texts then they may be CORRUPTED if you try to restore them to this Unicode version of Moodle. See the <a href=\"http://docs.moodle.org/19/en/Backup_FAQ\">Backup FAQ</a> for more information about how to recover this backup correctly.';
$string['backupnext'] = 'Next backup';
$string['backuporiginalname'] = 'Backup Name';
$string['backuproleassignments'] = 'Backup role assignments for these roles';
@@ -503,6 +503,7 @@ $string['emaildisable'] = 'This email address is disabled';
$string['emaildisableclick'] = 'Click here to disable all email from being sent to this address';
$string['emaildisplay'] = 'Email display';
$string['emaildisplaycourse'] = 'Allow only other course members to see my email address';
$string['emaildisplayhidden'] = 'Email hidden';
$string['emaildisplayno'] = 'Hide my email address from everyone';
$string['emaildisplayyes'] = 'Allow everyone to see my email address';
$string['emailenable'] = 'This email address is enabled';
@@ -732,7 +733,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the Moodle License information page for full details:
http://docs.moodle.org/en/License';
http://docs.moodle.org/dev/License';
$string['grade'] = 'Grade';
$string['grades'] = 'Grades';
$string['group'] = 'Group';
+1 -1
View File
@@ -3,7 +3,7 @@ $string['spamauto'] = 'Autodetect common spam patterns';
$string['spamcannotdelete'] = 'Cannot delete this user';
$string['spamcannotfinduser'] = 'No users matching your search';
$string['spamcleaner'] = 'Spam cleaner';
$string['spamcleanerintro'] = 'This script allows you to search all user profiles for certain strings and then delete those accounts which are obviously created by spammers. You can search for multiple keywords using commas (eg casino, porn)<br /><br />Moodle docs has more information about <a href=\"http://docs.moodle.org/en/Reducing_spam_in_Moodle\">Reducing spam in Moodle</a>.';
$string['spamcleanerintro'] = 'This script allows you to search all user profiles for certain strings and then delete those accounts which are obviously created by spammers. You can search for multiple keywords using commas (eg casino, porn)<br /><br />Moodle docs has more information about <a href=\"http://docs.moodle.org/19/en/Reducing_spam_in_Moodle\">Reducing spam in Moodle</a>.';
$string['spamdesc'] = 'Description';
$string['spamdeleteall'] = 'Delete all these user accounts';
$string['spamdeleteconfirm'] = 'Are you sure you want to delete this entry? You can not undo this.';
+1 -1
View File
@@ -73,7 +73,7 @@ $string['indexes'] = 'Indexes';
$string['integerincorrectlength'] = 'Incorrect length for integer field';
$string['key'] = 'Key';
$string['keys'] = 'Keys';
$string['listreservedwords'] = 'List of Reserved Words<br />(used to keep <a href=\"http://docs.moodle.org/en/XMLDB_reserved_words\" target=\"_blank\">XMLDB_reserved_words</a> updated)';
$string['listreservedwords'] = 'List of Reserved Words<br />(used to keep <a href=\"http://docs.moodle.org/19/en/XMLDB_reserved_words\" target=\"_blank\">XMLDB_reserved_words</a> updated)';
$string['load'] = 'Load';
$string['missing'] = 'Missing';
$string['missingindexes'] = 'Missing Indexes Found';
+1 -1
View File
@@ -144,7 +144,7 @@ define('CONTEXT_COURSE', 50);
define('CONTEXT_MODULE', 70);
define('CONTEXT_BLOCK', 80);
// capability risks - see http://docs.moodle.org/en/Development:Hardening_new_Roles_system
// capability risks - see http://docs.moodle.org/dev/Hardening_new_Roles_system
define('RISK_MANAGETRUST', 0x0001);
define('RISK_CONFIG', 0x0002);
define('RISK_XSS', 0x0004);
+4
View File
@@ -4942,14 +4942,18 @@ function print_plugin_tables() {
$installed_mods = get_records_list('modules', '', '', '', 'name');
$installed_blocks = get_records_list('block', '', '', '', 'name');
$plugins_installed['mod'] = array();
foreach($installed_mods as $mod) {
$plugins_installed['mod'][] = $mod->name;
}
$plugins_installed['blocks'] = array();
foreach($installed_blocks as $block) {
$plugins_installed['blocks'][] = $block->name;
}
$plugins_installed['filter'] = array();
$plugins_ondisk = array();
$plugins_ondisk['mod'] = get_list_of_plugins('mod', 'db');
$plugins_ondisk['blocks'] = get_list_of_plugins('blocks', 'db');
+1 -1
View File
@@ -1238,7 +1238,7 @@ function get_categories($parent='none', $sort=NULL, $shallow=true) {
JOIN {$CFG->prefix}context ctx
ON cc.id=ctx.instanceid AND ctx.contextlevel=".CONTEXT_COURSECAT."
JOIN {$CFG->prefix}course_categories ccp
ON (cc.path LIKE ".sql_concat('ccp.path',"'%'").")
ON ((cc.parent=ccp.id) OR (cc.path LIKE ".sql_concat('ccp.path',"'/%'")."))
WHERE ccp.id=$parent
$sort";
}
+27 -27
View File
@@ -254,7 +254,7 @@ function main_upgrade($oldversion=0) {
`userid` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) TYPE=MyISAM COMMENT='One record per course creator';");
) ENGINE=MyISAM COMMENT='One record per course creator';");
}
if ($oldversion < 2003032602) {
// Redoing it because of no prefix last time
@@ -362,7 +362,7 @@ function main_upgrade($oldversion=0) {
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `courseuserid` (course,userid)
) TYPE=MyISAM COMMENT='Stores info about how to display the course'");
) ENGINE=MyISAM COMMENT='Stores info about how to display the course'");
}
if ($oldversion < 2003050400) {
@@ -458,7 +458,7 @@ function main_upgrade($oldversion=0) {
`description` text NOT NULL,
`timemodified` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='Defines grading scales'");
) ENGINE=MyISAM COMMENT='Defines grading scales'");
}
@@ -558,7 +558,7 @@ function main_upgrade($oldversion=0) {
`timemodified` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`)
) TYPE=MyISAM COMMENT='Each record is a group in a course.'; ");
) ENGINE=MyISAM COMMENT='Each record is a group in a course.'; ");
modify_database("", "CREATE TABLE `prefix_groups_members` (
`id` int(10) unsigned NOT NULL auto_increment,
@@ -567,7 +567,7 @@ function main_upgrade($oldversion=0) {
`timeadded` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `groupid` (`groupid`)
) TYPE=MyISAM COMMENT='Lists memberships of users in groups'; ");
) ENGINE=MyISAM COMMENT='Lists memberships of users in groups'; ");
}
if ($oldversion < 2003121800) {
@@ -601,7 +601,7 @@ function main_upgrade($oldversion=0) {
UNIQUE KEY `id` (`id`),
KEY `courseid` (`courseid`),
KEY `userid` (`userid`)
) TYPE=MyISAM COMMENT='For everything with a time associated to it'; ");
) ENGINE=MyISAM COMMENT='For everything with a time associated to it'; ");
}
if ($oldversion < 2004012800) {
@@ -613,7 +613,7 @@ function main_upgrade($oldversion=0) {
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `useridname` (userid,name)
) TYPE=MyISAM COMMENT='Allows modules to store arbitrary user preferences'; ");
) ENGINE=MyISAM COMMENT='Allows modules to store arbitrary user preferences'; ");
}
if ($oldversion < 2004012900) {
@@ -637,7 +637,7 @@ function main_upgrade($oldversion=0) {
`timemodified` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `md5key` (`md5key`)
) TYPE=MyISAM COMMENT='For storing temporary copies of processed texts';");
) ENGINE=MyISAM COMMENT='For storing temporary copies of processed texts';");
}
if ($oldversion < 2004021000) {
@@ -667,7 +667,7 @@ function main_upgrade($oldversion=0) {
`timemodified` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `filtermd5key` (filter,md5key)
) TYPE=MyISAM COMMENT='For keeping information about cached data';");
) ENGINE=MyISAM COMMENT='For keeping information about cached data';");
}
if ($oldversion < 2004021500) {
@@ -865,7 +865,7 @@ function main_upgrade($oldversion=0) {
`data` text NOT null,
PRIMARY KEY (`sesskey`),
KEY (`expiry`)
) TYPE=MyISAM COMMENT='Optional database session storage, not used by default';");
) ENGINE=MyISAM COMMENT='Optional database session storage, not used by default';");
}
if ($oldversion < 2004111500) { // Update any users/courses using wrongly-named lang pack
@@ -1043,7 +1043,7 @@ function main_upgrade($oldversion=0) {
PRIMARY KEY (`id`),
KEY `useridfrom` (`useridfrom`),
KEY `useridto` (`useridto`)
) TYPE=MyISAM COMMENT='Stores all unread messages';");
) ENGINE=MyISAM COMMENT='Stores all unread messages';");
modify_database('',"CREATE TABLE `prefix_message_read` (
`id` int(10) unsigned NOT NULL auto_increment,
@@ -1057,7 +1057,7 @@ function main_upgrade($oldversion=0) {
PRIMARY KEY (`id`),
KEY `useridfrom` (`useridfrom`),
KEY `useridto` (`useridto`)
) TYPE=MyISAM COMMENT='Stores all messages that have been read';");
) ENGINE=MyISAM COMMENT='Stores all messages that have been read';");
modify_database('',"CREATE TABLE `prefix_message_contacts` (
`id` int(10) unsigned NOT NULL auto_increment,
@@ -1066,7 +1066,7 @@ function main_upgrade($oldversion=0) {
`blocked` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `usercontact` (`userid`,`contactid`)
) TYPE=MyISAM COMMENT='Maintains lists of relationships between users';");
) ENGINE=MyISAM COMMENT='Maintains lists of relationships between users';");
modify_database('', "INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'write', 'user', 'CONCAT(firstname,\" \",lastname)'); ");
modify_database('', "INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'read', 'user', 'CONCAT(firstname,\" \",lastname)'); ");
@@ -1243,7 +1243,7 @@ function main_upgrade($oldversion=0) {
`std_skipweeks` tinyint(3) NOT NULL default '0',
`std_time` varchar(5) NOT NULL default '00:00',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Rules for calculating local wall clock time for users';");
) ENGINE=MyISAM COMMENT='Rules for calculating local wall clock time for users';");
}
if ($oldversion < 2005032800) {
@@ -1257,7 +1257,7 @@ function main_upgrade($oldversion=0) {
`weight` decimal(4,2) NOT NULL default '0.00',
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`)
) TYPE=MyISAM ;");
) ENGINE=MyISAM ;");
execute_sql("CREATE TABLE `{$CFG->prefix}grade_exceptions` (
`id` int(10) unsigned NOT NULL auto_increment,
@@ -1266,7 +1266,7 @@ function main_upgrade($oldversion=0) {
`userid` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`)
) TYPE=MyISAM ;");
) ENGINE=MyISAM ;");
execute_sql("CREATE TABLE `{$CFG->prefix}grade_item` (
@@ -1280,7 +1280,7 @@ function main_upgrade($oldversion=0) {
`sort_order` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`)
) TYPE=MyISAM ;");
) ENGINE=MyISAM ;");
execute_sql("CREATE TABLE `{$CFG->prefix}grade_letter` (
@@ -1291,7 +1291,7 @@ function main_upgrade($oldversion=0) {
`grade_low` decimal(4,2) NOT NULL default '0.00',
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`)
) TYPE=MyISAM ;");
) ENGINE=MyISAM ;");
execute_sql("CREATE TABLE `{$CFG->prefix}grade_preferences` (
@@ -1301,7 +1301,7 @@ function main_upgrade($oldversion=0) {
`value` int(10) NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `courseidpreference` (`courseid`,`preference`)
) TYPE=MyISAM ;");
) ENGINE=MyISAM ;");
}
@@ -1372,7 +1372,7 @@ function main_upgrade($oldversion=0) {
`value` text NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `plugin_name` (`plugin`, `name`)
) TYPE=MyISAM
) ENGINE=MyISAM
COMMENT='Moodle modules and plugins configuration variables';");
}
@@ -1493,7 +1493,7 @@ function main_upgrade($oldversion=0) {
`requester` int(10) NOT NULL default 0,
PRIMARY KEY (`id`),
KEY `shortname` (`shortname`)
) TYPE=MyISAM;");
) ENGINE=MyISAM;");
table_column('course','','requested');
}
@@ -1506,7 +1506,7 @@ function main_upgrade($oldversion=0) {
PRIMARY KEY (`id`),
KEY `course` (`course`),
KEY `module` (`module`)
) TYPE=MyISAM;");
) ENGINE=MyISAM;");
table_column('course','','restrictmodules','int','1','','0','not null');
}
@@ -1692,7 +1692,7 @@ function main_upgrade($oldversion=0) {
UNIQUE KEY `id_user_idx` (`id`, `userid`),
KEY `post_lastmodified_idx` (`lastmodified`),
KEY `post_subject_idx` (`subject`)
) TYPE=MyISAM COMMENT='New moodle post table. Holds data posts such as forum entries or blog entries.';");
) ENGINE=MyISAM COMMENT='New moodle post table. Holds data posts such as forum entries or blog entries.';");
modify_database("","CREATE TABLE prefix_tags (
`id` int(10) unsigned NOT NULL auto_increment,
@@ -1700,7 +1700,7 @@ function main_upgrade($oldversion=0) {
`userid` int(10) unsigned NOT NULL default'0',
`text` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT ='tags structure for moodle.';");
) ENGINE=MyISAM COMMENT ='tags structure for moodle.';");
modify_database("","CREATE TABLE prefix_blog_tag_instance (
`id` int(10) unsigned NOT NULL auto_increment,
@@ -1710,7 +1710,7 @@ function main_upgrade($oldversion=0) {
`courseid` int(10) unsigned NOT NULL default'0',
`userid` int(10) unsigned NOT NULL default'0',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT ='tag instance for blogs.';");
) ENGINE=MyISAM COMMENT ='tag instance for blogs.';");
}
if ($oldversion < 2006031400) {
@@ -1799,7 +1799,7 @@ function main_upgrade($oldversion=0) {
`mtable` varchar(30),
`field` varchar(50),
PRIMARY KEY (`id`)
) TYPE=MyISAM");
) ENGINE=MyISAM");
// Add index to ensure that module and action combination is unique.
modify_database('', "ALTER TABLE prefix_log_display ADD UNIQUE `moduleaction`(`module` , `action`)");
@@ -2193,7 +2193,7 @@ function main_upgrade($oldversion=0) {
KEY `courseid` (`courseid`),
UNIQUE KEY `userid-courseid` (`userid`, `courseid`),
PRIMARY KEY (`id`)
)TYPE=MYISAM COMMENT ='time user last accessed any page in a course';", true);
)ENGINE=MyISAM COMMENT ='time user last accessed any page in a course';", true);
}
if (!empty($CFG->rolesactive) and $oldversion < 2006091212) { // Reload the guest roles completely with new defaults
+23 -1
View File
@@ -370,7 +370,7 @@ function xmldb_main_upgrade($oldversion=0) {
drop_index($table, $index);
$index->setFields(array('mnethostid', 'username'));
if (!add_index($table, $index)) {
notify(get_string('duplicate_usernames', 'mnet', 'http://docs.moodle.org/en/DuplicateUsernames'));
notify(get_string('duplicate_usernames', 'mnet', 'http://docs.moodle.org/19/en/DuplicateUsernames'));
}
unset($table, $field, $index);
@@ -3292,6 +3292,15 @@ function xmldb_main_upgrade($oldversion=0) {
}
if ($result && $oldversion < 2007101571.01) {
// Remove category_sortorder index that was supposed to be removed long time ago
$table = new XMLDBTable('course');
$index = new XMLDBIndex('category_sortorder');
$index->setAttributes(XMLDB_INDEX_UNIQUE, array('category', 'sortorder'));
if (index_exists($table, $index)) {
drop_index($table, $index);
}
// MDL-21011 bring down course sort orders away from maximum values
$sql = "SELECT id, category, sortorder from {$CFG->prefix}course
ORDER BY sortorder ASC;";
@@ -3368,6 +3377,19 @@ function xmldb_main_upgrade($oldversion=0) {
upgrade_main_savepoint($result, 2007101591.01);
}
if ($result && $oldversion < 2007101591.05) {
// Remove category_sortorder index that was supposed to be removed long time ago
$table = new XMLDBTable('course');
$index = new XMLDBIndex('category_sortorder');
$index->setAttributes(XMLDB_INDEX_UNIQUE, array('category', 'sortorder'));
if (index_exists($table, $index)) {
drop_index($table, $index);
}
upgrade_main_savepoint($result, 2007101591.05);
}
return $result;
}
+2 -2
View File
@@ -36,7 +36,7 @@
// This library should be used, exclusively, by the installation and
// upgrade process of Moodle.
//
// For further documentation, visit http://docs.moodle.org/en/DDL_functions
// For further documentation, visit http://docs.moodle.org/19/en/DDL_functions
/// Add required XMLDB constants
require_once($CFG->libdir . '/xmldb/classes/XMLDBConstants.php');
@@ -67,7 +67,7 @@
* Add a new field to a table, or modify an existing one (if oldfield is defined).
*
* WARNING: This function is deprecated and will be removed in future versions.
* Please use XMLDB (see http://docs.moodle.org/en/Development:DDL_functions ).
* Please use XMLDB (see http://docs.moodle.org/dev/DDL_functions ).
*
* Warning: Please be careful on primary keys, as this function will eat auto_increments
*
+6
View File
@@ -1677,6 +1677,12 @@ function error ($message, $link='') {
}
}
// when printing an error the continue button should never link offsite
if (stripos($link, $CFG->wwwroot) === false &&
stripos($link, $CFG->httpswwwroot) === false) {
$link = $CFG->wwwroot.'/';
}
if (!empty($link)) {
print_continue($link);
}
+66 -4
View File
@@ -32,7 +32,7 @@
/// include it yourself.
/// For more info about the functions available in this library, please visit:
/// http://docs.moodle.org/en/DML_functions
/// http://docs.moodle.org/19/en/DML_functions
/// (feel free to modify, improve and document such page, thanks!)
/// GLOBAL CONSTANTS /////////////////////////////////////////////////////////
@@ -569,6 +569,7 @@ function get_record_select($table, $select='', $fields='*') {
function get_recordset($table, $field='', $value='', $sort='', $fields='*', $limitfrom='', $limitnum='') {
if ($field) {
$value = sql_magic_quotes_hack($value);
$select = "$field = '$value'";
} else {
$select = '';
@@ -710,7 +711,7 @@ function recordset_to_array($rs) {
$objects = array();
/// First of all, we are going to get the name of the first column
/// to introduce it back after transforming the recordset to assoc array
/// See http://docs.moodle.org/en/XMLDB_Problems, fetch mode problem.
/// See http://docs.moodle.org/19/en/XMLDB_Problems, fetch mode problem.
$firstcolumn = $rs->FetchField(0);
/// Get the whole associative array
if ($records = $rs->GetAssoc(true)) {
@@ -1433,7 +1434,7 @@ function delete_records_select($table, $select='') {
* @param string $table The database table to be checked against.
* @param object $dataobject A data object with values for one or more fields in the record
* @param bool $returnid Should the id of the newly created record entry be returned? If this option is not requested then true/false is returned.
* @param string $primarykey (obsolete) This is now forced to be 'id'.
* @param string $primarykey (obsolete) This is now forced to be 'id'.
*/
function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
@@ -1447,6 +1448,14 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
if (is_array($dataobject)) {
debugging('Warning. Wrong call to insert_record(). $dataobject must be an object. array found instead', DEBUG_DEVELOPER);
$dataobject = (object)$dataobject;
} else if (is_object($dataobject)) {
// make sure there are no properties or private methods because we cast to array later,
// at the same time this undos the object references so that PHP 5 works the same as PHP 4,
// the main reason for this is BC after the dirty magic hack introduction
if ($properties = get_object_vars($dataobject)) {
$dataobject = (object)$properties;
}
unset($properties);
}
/// Temporary hack as part of phasing out all access to obsolete user tables XXX
@@ -1463,6 +1472,11 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
/// so let's unset it now before it causes any trouble later
unset($dataobject->{$primarykey});
/// Extra protection against SQL injections
foreach((array)$dataobject as $k=>$v) {
$dataobject->$k = sql_magic_quotes_hack($v);
}
/// Get an empty recordset. Cache for multiple inserts.
if (empty($empty_rs_cache[$table])) {
/// Execute a dummy query to get an empty recordset
@@ -1637,6 +1651,19 @@ function update_record($table, $dataobject) {
if (is_array($dataobject)) {
debugging('Warning. Wrong call to update_record(). $dataobject must be an object. array found instead', DEBUG_DEVELOPER);
$dataobject = (object)$dataobject;
} else if (is_object($dataobject)) {
// make sure there are no properties or private methods because we cast to array later,
// at the same time this undos the object references so that PHP 5 works the same as PHP 4,
// the main reason for this is BC after the dirty magic hack introduction
if ($properties = get_object_vars($dataobject)) {
$dataobject = (object)$properties;
}
unset($properties);
}
/// Extra protection against SQL injections
foreach((array)$dataobject as $k=>$v) {
$dataobject->$k = sql_magic_quotes_hack($v);
}
// Remove this record from record cache since it will change
@@ -1755,7 +1782,7 @@ function sql_paging_limit($page, $recordsperpage) {
*
* Note the LIKE are case sensitive for Oracle. Oracle 10g is required to use
* the caseinsensitive search using regexp_like() or NLS_COMP=LINGUISTIC :-(
* See http://docs.moodle.org/en/XMLDB_Problems#Case-insensitive_searches
* See http://docs.moodle.org/19/en/XMLDB_Problems#Case-insensitive_searches
*
* @uses $CFG
* @return string
@@ -2223,6 +2250,38 @@ function sql_ceil($fieldname) {
}
}
/**
* This hack prevents some types of SQL injections, no code should rely on this,
* do not forget to use addslashes() and addslashes_recursive() properly!
*
* The performance cost is negligible considering the security benefits and DB requests cost.
*
* @param mixed $value sql parameter value (hopefully with magic quotes)
* @return mixed sanitised value - added magic quotes if accidentally missing
*/
function sql_magic_quotes_hack($value) {
if ($value === null or $value === '') {
// performance shortcut
return $value;
}
// ignore stuff that can not be converted to string, catchable fatal error will be displayed elsewhere,
// this is intentional because we want to get the same errors as before this magic hack
if (is_object($value)) {
if (!method_exists($value, '__toString')) {
// ignore - we can not cast object to string, error will be triggered elsewhere
return $value;
}
} else if (!is_string($value)) {
// no sql injection possible in other non-string values
return $value;
}
// note: this does not change content if the content is properly escaped,
// the result is different only for strings with missing magic quotes!
return addslashes(stripslashes($value));
}
/**
* Prepare a SQL WHERE clause to select records where the given fields match the given values.
*
@@ -2238,6 +2297,9 @@ function sql_ceil($fieldname) {
* @param string $value3 the value field3 must have (requred if field3 is given, else optional).
*/
function where_clause($field1='', $value1='', $field2='', $value2='', $field3='', $value3='') {
$value1 = sql_magic_quotes_hack($value1);
$value2 = sql_magic_quotes_hack($value2);
$value3 = sql_magic_quotes_hack($value3);
if ($field1) {
$select = is_null($value1) ? "WHERE $field1 IS NULL" : "WHERE $field1 = '$value1'";
if ($field2) {
+16 -1
View File
@@ -15,6 +15,21 @@ class MoodleQuickForm_password extends HTML_QuickForm_password{
*/
var $_helpbutton='';
function MoodleQuickForm_password($elementName=null, $elementLabel=null, $attributes=null) {
global $CFG;
if (empty($CFG->xmlstrictheaders)) {
// no standard mform in moodle should allow autocomplete of passwords
// this is valid attribute in html5, sorry, we have to ignore validation errors in legacy xhtml 1.0
if (empty($attributes)) {
$attributes = array('autocomplete'=>'off');
} else if (is_array($attributes)) {
$attributes['autocomplete'] = 'off';
} else {
if (strpos($attributes, 'autocomplete') === false) {
$attributes .= ' autocomplete="off" ';
}
}
}
parent::HTML_QuickForm_password($elementName, $elementLabel, $attributes);
}
/**
@@ -48,4 +63,4 @@ class MoodleQuickForm_password extends HTML_QuickForm_password{
return $this->_helpbutton;
}
}
?>
?>
+15
View File
@@ -15,6 +15,21 @@ require_once($CFG->libdir.'/form/password.php');
class MoodleQuickForm_passwordunmask extends MoodleQuickForm_password {
function MoodleQuickForm_passwordunmask($elementName=null, $elementLabel=null, $attributes=null) {
global $CFG;
if (empty($CFG->xmlstrictheaders)) {
// no standard mform in moodle should allow autocomplete of passwords
// this is valid attribute in html5, sorry, we have to ignore validation errors in legacy xhtml 1.0
if (empty($attributes)) {
$attributes = array('autocomplete'=>'off');
} else if (is_array($attributes)) {
$attributes['autocomplete'] = 'off';
} else {
if (strpos($attributes, 'autocomplete') === false) {
$attributes .= ' autocomplete="off" ';
}
}
}
parent::MoodleQuickForm_password($elementName, $elementLabel, $attributes);
}
+5 -2
View File
@@ -33,10 +33,13 @@ class MoodleQuickForm_recaptcha extends HTML_QuickForm_input {
* </code>
*/
function MoodleQuickForm_recaptcha($elementName = null, $elementLabel = null, $attributes = null) {
global $CFG;
parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
$this->_type = 'recaptcha';
if (!empty($attributes['https'])) {
$this->_https = $attributes['https'];
if (!empty($attributes['https']) or strpos($CFG->httpswwwroot, 'https:') === 0) {
$this->_https = true;
} else {
$this->_https = false;
}
}
+20 -1
View File
@@ -106,6 +106,21 @@ class moodleform {
* @return moodleform
*/
function moodleform($action=null, $customdata=null, $method='post', $target='', $attributes=null, $editable=true) {
global $CFG;
if (empty($CFG->xmlstrictheaders)) {
// no standard mform in moodle should allow autocomplete with the exception of user signup
// this is valid attribute in html5, sorry, we have to ignore validation errors in legacy xhtml 1.0
if (empty($attributes)) {
$attributes = array('autocomplete'=>'off');
} else if (is_array($attributes)) {
$attributes['autocomplete'] = 'off';
} else {
if (strpos($attributes, 'autocomplete') === false) {
$attributes .= ' autocomplete="off" ';
}
}
}
if (empty($action)){
$action = strip_querystring(qualified_me());
}
@@ -1145,6 +1160,10 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
}
}
if (is_array($this->_constantValues)) {
$unfiltered = HTML_QuickForm::arrayMerge($unfiltered, $this->_constantValues);
}
if ($addslashes){
return $this->_recursiveFilter('addslashes', $unfiltered);
} else {
@@ -1482,7 +1501,7 @@ function validate_' . $this->_formName . '(frm) {
} else if (is_a($element, 'HTML_QuickForm_hidden')) {
return array();
} else if (method_exists($element, 'getPrivateName')) {
} else if (method_exists($element, 'getPrivateName') && !($element instanceof HTML_QuickForm_advcheckbox)) {
return array($element->getPrivateName());
} else {
+1 -1
View File
@@ -341,7 +341,7 @@ class html2text
*/
function html2text( $source = '', $from_file = false, $do_links = true, $width = 75 )
{
if ( !empty($source) ) {
if ($source !== '') {
$this->set_html($source, $from_file);
}
+15
View File
@@ -82,3 +82,18 @@ Index: lib/html2text.php
}
-- Tim Hunt 2010-11-02
4 - Make sure html2text does not destroy '0'.
index e2d0dff..9cc213d 100644
--- a/lib/html2text.php
+++ b/lib/html2text.php
@@ -335,7 +335,7 @@ class html2text
*/
function html2text( $source = '', $from_file = false, $do_links = true, $wi {
- if ( !empty($source) ) {
+ if ($source !== '') {
$this->set_html($source, $from_file);
}
-- Tim Hunt 2011-09-21
+3 -2
View File
@@ -427,13 +427,14 @@ function unmaskPassword(id) {
try {
// first try IE way - it can not set name attribute later
if (chb.checked) {
var newpw = document.createElement('<input type="text" name="'+pw.name+'">');
var newpw = document.createElement('<input type="text" autocomplete="off" name="'+pw.name+'">');
} else {
var newpw = document.createElement('<input type="password" name="'+pw.name+'">');
var newpw = document.createElement('<input type="password" autocomplete="off" name="'+pw.name+'">');
}
newpw.attributes['class'].nodeValue = pw.attributes['class'].nodeValue;
} catch (e) {
var newpw = document.createElement('input');
newpw.setAttribute('autocomplete', 'off');
newpw.setAttribute('name', pw.name);
if (chb.checked) {
newpw.setAttribute('type', 'text');
+2 -2
View File
@@ -27,7 +27,7 @@
*
* These are similar to the module interface, however, not all the the
* facilities that are available to modules are available to local code (yet).
* See also http://docs.moodle.org/en/Development:Local_customisation for more
* See also http://docs.moodle.org/dev/Local_customisation for more
* information.
*
*
@@ -81,7 +81,7 @@
* lang/en_utf8_local/moodle.php containing
* $strings['login'] = 'Sign in';
* and that will change the string 'Login' to 'Sign in'. (See also
* http://docs.moodle.org/en/Language_editing for another way to achieve this.)
* http://docs.moodle.org/19/en/Language_editing for another way to achieve this.)
*
* This mechanism can also be used to create completely new language files. For
* example, suppose you have created some code in local/myfeature.php that needs
+59 -42
View File
@@ -1115,27 +1115,28 @@ function get_user_preferences($name=NULL, $default=NULL, $otheruserid=NULL) {
* @param int $hour The hour part to create timestamp of
* @param int $minute The minute part to create timestamp of
* @param int $second The second part to create timestamp of
* @param float $timezone ?
* @param bool $applydst ?
* @param mixed $timezone Timezone modifier, if 99 then use default user's timezone
* @param bool $applydst Toggle Daylight Saving Time, default true, will be
* applied only if timezone is 99 or string.
* @return int timestamp
* @todo Finish documenting this function
*/
function make_timestamp($year, $month=1, $day=1, $hour=0, $minute=0, $second=0, $timezone=99, $applydst=true) {
$strtimezone = NULL;
if (!is_numeric($timezone)) {
$strtimezone = $timezone;
}
//save input timezone, required for dst offset check.
$passedtimezone = $timezone;
$timezone = get_user_timezone_offset($timezone);
if (abs($timezone) > 13) {
if (abs($timezone) > 13) { //server time
$time = mktime((int)$hour, (int)$minute, (int)$second, (int)$month, (int)$day, (int)$year);
} else {
$time = gmmktime((int)$hour, (int)$minute, (int)$second, (int)$month, (int)$day, (int)$year);
$time = usertime($time, $timezone);
if($applydst) {
$time -= dst_offset_on($time, $strtimezone);
//Apply dst for string timezones or if 99 then try dst offset with user's default timezone
if ($applydst && ((99 == $passedtimezone) || !is_numeric($passedtimezone))) {
$time -= dst_offset_on($time, $passedtimezone);
}
}
@@ -1222,7 +1223,8 @@ function make_timestamp($year, $month=1, $day=1, $hour=0, $minute=0, $second=0,
* @uses HOURSECS
* @param int $date timestamp in GMT
* @param string $format strftime format
* @param float $timezone
* @param mixed $timezone by default, uses the user's time zone. if numeric and
* not 99 then daylight saving will not be added.
* @param bool $fixday If true (default) then the leading
* zero from %d is removed. If false then the leading zero is mantained.
* @return string
@@ -1231,11 +1233,6 @@ function userdate($date, $format='', $timezone=99, $fixday = true) {
global $CFG;
$strtimezone = NULL;
if (!is_numeric($timezone)) {
$strtimezone = $timezone;
}
if (empty($format)) {
$format = get_string('strftimedaydatetime');
}
@@ -1247,7 +1244,11 @@ function userdate($date, $format='', $timezone=99, $fixday = true) {
$fixday = ($formatnoday != $format);
}
$date += dst_offset_on($date, $strtimezone);
//add daylight saving offset for string timezones only, as we can't get dst for
//float values. if timezone is 99 (user default timezone), then try update dst.
if ((99 == $timezone) || !is_numeric($timezone)) {
$date += dst_offset_on($date, $timezone);
}
$timezone = get_user_timezone_offset($timezone);
@@ -1289,16 +1290,15 @@ function userdate($date, $format='', $timezone=99, $fixday = true) {
*
* @uses HOURSECS
* @param int $time Timestamp in GMT
* @param float $timezone ?
* @param mixed $timezone offset time with timezone, if float and not 99, then no
* dst offset is applyed
* @return array An array that represents the date in user time
* @todo Finish documenting this function
*/
function usergetdate($time, $timezone=99) {
$strtimezone = NULL;
if (!is_numeric($timezone)) {
$strtimezone = $timezone;
}
//save input timezone, required for dst offset check.
$passedtimezone = $timezone;
$timezone = get_user_timezone_offset($timezone);
@@ -1306,8 +1306,12 @@ function usergetdate($time, $timezone=99) {
return getdate($time);
}
// There is no gmgetdate so we use gmdate instead
$time += dst_offset_on($time, $strtimezone);
//add daylight saving offset for string timezones only, as we can't get dst for
//float values. if timezone is 99 (user default timezone), then try update dst.
if ($passedtimezone == 99 || !is_numeric($passedtimezone)) {
$time += dst_offset_on($time, $passedtimezone);
}
$time += intval((float)$timezone * HOURSECS);
$datestring = gmstrftime('%B_%A_%j_%Y_%m_%w_%d_%H_%M_%S', $time);
@@ -1456,7 +1460,7 @@ function get_timezone_offset($tz) {
*
* @uses $USER
* @uses $CFG
* @param float $tz If this value is provided and not equal to 99, it will be returned as is and no other settings will be checked
* @param mixed $tz If this value is provided and not equal to 99, it will be returned as is and no other settings will be checked
* @return mixed
*/
function get_user_timezone($tz = 99) {
@@ -2737,13 +2741,13 @@ function set_moodle_cookie($thing) {
return;
}
$cookiename = 'MOODLEID_'.$CFG->sessioncookie;
$cookiename = 'MOODLEID1_'.$CFG->sessioncookie;
$days = 60;
$seconds = DAYSECS*$days;
setCookie($cookiename, '', time() - HOURSECS, $CFG->sessioncookiepath, $CFG->sessioncookiedomain, $CFG->cookiesecure);
setCookie($cookiename, rc4encrypt($thing), time()+$seconds, $CFG->sessioncookiepath, $CFG->sessioncookiedomain, $CFG->cookiesecure);
setCookie($cookiename, rc4encrypt($thing, true), time()+$seconds, $CFG->sessioncookiepath, $CFG->sessioncookiedomain, $CFG->cookiesecure);
}
/**
@@ -2755,12 +2759,12 @@ function set_moodle_cookie($thing) {
function get_moodle_cookie() {
global $CFG;
$cookiename = 'MOODLEID_'.$CFG->sessioncookie;
$cookiename = 'MOODLEID1_'.$CFG->sessioncookie;
if (empty($_COOKIE[$cookiename])) {
return '';
} else {
$thing = rc4decrypt($_COOKIE[$cookiename]);
$thing = rc4decrypt($_COOKIE[$cookiename], true);
return ($thing == 'guest') ? '': $thing; // Ignore guest account
}
}
@@ -6020,25 +6024,33 @@ function get_list_of_currencies() {
/**
* rc4encrypt
*
* @param string $data ?
* @return string
* @todo Finish documenting this function
* @param string $data Data to encrypt.
* @param bool $usesecurekey Lets us know if we are using the old or new password.
* @return string The now encrypted data.
*/
function rc4encrypt($data) {
$password = 'nfgjeingjk';
return endecrypt($password, $data, '');
function rc4encrypt($data, $usesecurekey = false) {
if (!$usesecurekey) {
$passwordkey = 'nfgjeingjk';
} else {
$passwordkey = get_site_identifier();
}
return endecrypt($passwordkey, $data, '');
}
/**
* rc4decrypt
*
* @param string $data ?
* @return string
* @todo Finish documenting this function
* @param string $data Data to decrypt.
* @param bool $usesecurekey Lets us know if we are using the old or new password.
* @return string The now decrypted data.
*/
function rc4decrypt($data) {
$password = 'nfgjeingjk';
return endecrypt($password, $data, 'de');
function rc4decrypt($data, $usesecurekey = false) {
if (!$usesecurekey) {
$passwordkey = 'nfgjeingjk';
} else {
$passwordkey = get_site_identifier();
}
return endecrypt($passwordkey, $data, 'de');
}
/**
@@ -7079,12 +7091,17 @@ function generate_password($maxlen=10) {
$filler1 = $fillers[rand(0, strlen($fillers) - 1)];
$password = $word1 . $filler1 . $word2;
} else {
$maxlen = !empty($CFG->minpasswordlength) ? $CFG->minpasswordlength : 0;
$minlen = !empty($CFG->minpasswordlength) ? $CFG->minpasswordlength : 0;
$digits = $CFG->minpassworddigits;
$lower = $CFG->minpasswordlower;
$upper = $CFG->minpasswordupper;
$nonalphanum = $CFG->minpasswordnonalphanum;
$additional = $maxlen - ($lower + $upper + $digits + $nonalphanum);
$total = $lower + $upper + $digits + $nonalphanum;
// minlength should be the greater one of the two ( $minlen and $total )
$minlen = $minlen < $total ? $total : $minlen;
// maxlen can never be smaller than minlen
$maxlen = $minlen > $maxlen ? $minlen : $maxlen;
$additional = $maxlen - $total;
// Make sure we have enough characters to fulfill
// complexity requirements
+1
View File
@@ -664,6 +664,7 @@ function olson_parse_at ($at, $set = 'set', $gmtoffset) {
$at = substr($at, 0, strlen($at)-1); // chop
}
$at = (strpos($at, ':') === false) ? $at . ':0' : $at;
list($hours, $mins) = explode(':', $at);
// GMT -- return as is!
+9 -6
View File
@@ -653,11 +653,11 @@ class PHPMailer
*/
function AddrFormat($addr) {
if(empty($addr[1]))
$formatted = $addr[0];
$formatted = preg_replace('/[\r\n]+/', '', $addr[0]); // Moodle modification
else
{
$formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" .
$addr[0] . ">";
$formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" .
preg_replace('/[\r\n]+/', '', $addr[0]) . ">"; // Moodle modification
}
return $formatted;
@@ -780,9 +780,9 @@ class PHPMailer
$result .= $this->HeaderLine("Date", $this->RFCDate());
if($this->Sender == "")
$result .= $this->HeaderLine("Return-Path", trim($this->From));
$result .= $this->HeaderLine("Return-Path", trim(preg_replace('/[\r\n]+/', '', $this->From))); // Moodle modification
else
$result .= $this->HeaderLine("Return-Path", trim($this->Sender));
$result .= $this->HeaderLine("Return-Path", trim(preg_replace('/[\r\n]+/', '', $this->Sender))); // Moodle modification
// To be created automatically by mail()
if($this->Mailer != "mail")
@@ -1190,7 +1190,10 @@ class PHPMailer
*/
function EncodeHeader ($str, $position = 'text') {
/// Start Moodle Hack - do our own multibyte-safe header encoding
/// Start Moodle Hack - do our own multibyte-safe header encoding and cleanup
$str = str_replace("\r", '', $str);
$str = str_replace("\n", '', $str);
$textlib = textlib_get_instance();
$encoded = $textlib->encode_mimeheader($str, $this->CharSet);
if ($encoded !== false) {
+41 -35
View File
@@ -2,13 +2,13 @@
/*
* This is a PHP library that handles calling reCAPTCHA.
* - Documentation and latest version
* http://recaptcha.net/plugins/php/
* {@link http://code.google.com/apis/recaptcha/docs/php.html}
* - Get a reCAPTCHA API Key
* http://recaptcha.net/api/getkey
* {@link https://www.google.com/recaptcha/admin/create}
* - Discussion group
* http://groups.google.com/group/recaptcha
*
* Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
* Copyright (c) 2007 reCAPTCHA -- {@link http://www.google.com/recaptcha}
* AUTHORS:
* Mike Crawford
* Ben Maurer
@@ -30,14 +30,17 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package moodlecore
* @copyright (c) 2007 reCAPTCHA -- {@link http://www.google.com/recaptcha}
*/
/**
* The reCAPTCHA server URL's
*/
define("RECAPTCHA_API_SERVER", "http://api.recaptcha.net");
define("RECAPTCHA_API_SECURE_SERVER", "https://api-secure.recaptcha.net");
define("RECAPTCHA_VERIFY_SERVER", "api-verify.recaptcha.net");
define("RECAPTCHA_API_SERVER", "http://www.google.com/recaptcha/api");
define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api");
define("RECAPTCHA_VERIFY_SERVER", "www.google.com");
/**
* Encodes the given data into a query string format
@@ -107,15 +110,15 @@ function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) {
$recaptchatype = optional_param('recaptcha', 'image', PARAM_TEXT);
if ($pubkey == null || $pubkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>");
}
if ($use_ssl) {
$server = RECAPTCHA_API_SECURE_SERVER;
} else {
$server = RECAPTCHA_API_SERVER;
}
if ($pubkey == null || $pubkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
}
if ($use_ssl) {
$server = RECAPTCHA_API_SECURE_SERVER;
} else {
$server = RECAPTCHA_API_SERVER;
}
$errorpart = "";
if ($error) {
@@ -175,6 +178,9 @@ function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) {
/**
* A ReCaptchaResponse is returned from recaptcha_check_answer()
*
* @package moodlecore
* @copyright (c) 2007 reCAPTCHA -- {@link http://www.google.com/recaptcha}
*/
class ReCaptchaResponse {
var $is_valid;
@@ -192,9 +198,9 @@ class ReCaptchaResponse {
*/
function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $https=false)
{
if ($privkey == null || $privkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>");
}
if ($privkey == null || $privkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
}
if ($remoteip == null || $remoteip == '') {
die ("For security reasons, you must pass the remote ip to reCAPTCHA");
@@ -210,12 +216,12 @@ function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $ht
return $recaptcha_response;
}
$response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/verify",
array (
'privatekey' => $privkey,
'remoteip' => $remoteip,
'challenge' => $challenge,
'response' => $response
$response = _recaptcha_http_post(RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify",
array (
'privatekey' => $privkey,
'remoteip' => $remoteip,
'challenge' => $challenge,
'response' => $response
),
$https
);
@@ -242,7 +248,7 @@ function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $ht
* @param string $appname The name of your application
*/
function recaptcha_get_signup_url ($domain = null, $appname = null) {
return "http://recaptcha.net/api/getkey?" . _recaptcha_qsencode (array ('domain' => $domain, 'app' => $appname));
return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname));
}
function _recaptcha_aes_pad($val) {
@@ -270,16 +276,16 @@ function _recaptcha_mailhide_urlbase64 ($x) {
/* gets the reCAPTCHA Mailhide url for a given email, public key and private key */
function recaptcha_mailhide_url($pubkey, $privkey, $email) {
if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
"you can do so at <a href='http://mailhide.recaptcha.net/apikey'>http://mailhide.recaptcha.net/apikey</a>");
}
if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
"you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
}
$ky = pack('H*', $privkey);
$cryptmail = _recaptcha_aes_encrypt ($email, $ky);
return "http://mailhide.recaptcha.net/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
$ky = pack('H*', $privkey);
$cryptmail = _recaptcha_aes_encrypt ($email, $ky);
return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
}
/**
@@ -304,7 +310,7 @@ function _recaptcha_mailhide_email_parts ($email) {
* Gets html to display an email address given a public an private key.
* to get a key, go to:
*
* http://mailhide.recaptcha.net/apikey
* http://www.google.com/recaptcha/mailhide/apikey
*/
function recaptcha_mailhide_html($pubkey, $privkey, $email) {
$emailparts = _recaptcha_mailhide_email_parts ($email);
+1 -1
View File
@@ -521,7 +521,7 @@ function rss_get_form($act='none', $url='', $rssid='', $preferredtitle='', $shar
$returnstring .= '<input type="hidden" name="user" value="'. $USER->id .'" />'."\n";
$returnstring .= '<input type="hidden" name="sesskey" value="'. sesskey() .'" />'."\n";
$returnstring .= '<br /><input type="submit" value="';
$validatestring = "<a href=\"#\" onclick=\"window.open('http://feedvalidator.org/check.cgi?url='+getElementById('block_rss').elements['url'].value,'validate','width=640,height=480,scrollbars=yes,status=yes,resizable=yes');return true;\">". get_string('validatefeed', 'block_rss_client')."</a>";
$validatestring = "<a href=\"#\" onclick=\"window.open('http://feedvalidator.org/check.cgi?url='+escape(getElementById('block_rss').elements['url'].value),'validate','width=640,height=480,scrollbars=yes,status=yes,resizable=yes');return true;\">". get_string('validatefeed', 'block_rss_client')."</a>";
if ($act == 'rssedit') {
$returnstring .= $stredit;
+17
View File
@@ -356,6 +356,23 @@ class dmllib_test extends prefix_changing_test_case {
}
function test_magic_hack() {
// test hacky sql injection protection - the resulting DB data is not really important,
// we only want to prevent SQL injections/DB errors
$obj = new stdClass();
$obj->textfield = 'lala\'';
$obj->id = insert_record($this->table, $obj);
$this->assertFalse(empty($obj->id));
$obj->textfield = 'lala\\';
$res = update_record($this->table, $obj);
$this->assertTrue($res);
$obj = get_record($this->table, 'textfield', 'lala\\');
$this->assertFalse(empty($obj));
}
}
?>
+214 -2
View File
@@ -255,7 +255,14 @@ class moodlelib_test extends UnitTestCase {
}
function test_usergetdate() {
global $USER;
global $USER, $CFG;
//Check if forcetimezone is set then save it and set it to use user timezone
$cfgforcetimezone = null;
if (isset($CFG->forcetimezone)) {
$cfgforcetimezone = $CFG->forcetimezone;
$CFG->forcetimezone = 99; //get user default timezone.
}
$userstimezone = $USER->timezone;
$USER->timezone = 2;//set the timezone to a known state
@@ -292,9 +299,214 @@ class moodlelib_test extends UnitTestCase {
$this->assertEqual($weekday,'Wednesday');
$this->assertEqual($month,'December');
//restore forcetimezone if changed.
if (!is_null($cfgforcetimezone)) {
$CFG->forcetimezone = $cfgforcetimezone;
}
//set the timezone back to what it was
$USER->timezone = $userstimezone;
}
public function test_userdate() {
global $USER, $CFG;
$testvalues = array(
array(
'time' => '1309514400',
'usertimezone' => 'America/Moncton',
'timezone' => '0.0', //no dst offset
'expectedoutput' => 'Friday, 1 July 2011, 10:00 AM'
),
array(
'time' => '1293876000 ',
'usertimezone' => 'America/Moncton',
'timezone' => '0.0', //no dst offset
'expectedoutput' => 'Saturday, 1 January 2011, 10:00 AM'
),
array(
'time' => '1293876000 ',
'usertimezone' => 'America/Moncton',
'timezone' => '99', //no dst offset in jan, so just timezone offset.
'expectedoutput' => 'Saturday, 1 January 2011, 06:00 AM'
),
array(
'time' => '1293876000 ',
'usertimezone' => 'America/Moncton',
'timezone' => 'America/Moncton', //no dst offset in jan
'expectedoutput' => 'Saturday, 1 January 2011, 06:00 AM'
),
array(
'time' => '1293876000 ',
'usertimezone' => '2',
'timezone' => '99', //take user timezone
'expectedoutput' => 'Saturday, 1 January 2011, 12:00 PM'
),
array(
'time' => '1293876000 ',
'usertimezone' => '-2',
'timezone' => '99', //take user timezone
'expectedoutput' => 'Saturday, 1 January 2011, 08:00 AM'
),
array(
'time' => '1293876000 ',
'usertimezone' => '-10',
'timezone' => '2', //take this timezone
'expectedoutput' => 'Saturday, 1 January 2011, 12:00 PM'
),
array(
'time' => '1293876000 ',
'usertimezone' => '-10',
'timezone' => '-2', //take this timezone
'expectedoutput' => 'Saturday, 1 January 2011, 08:00 AM'
)
);
//Check if forcetimezone is set then save it and set it to use user timezone
$cfgforcetimezone = null;
if (isset($CFG->forcetimezone)) {
$cfgforcetimezone = $CFG->forcetimezone;
$CFG->forcetimezone = 99; //get user default timezone.
}
//store user default timezone to restore later
$userstimezone = $USER->timezone;
// The string version of date comes from server locale setting and does
// not respect user language, so it is necessary to reset that.
$oldlocale = setlocale(LC_TIME, '0');
setlocale(LC_TIME, 'en_AU.UTF-8');
//get instance of textlib for strtolower
$textlib = textlib_get_instance();
foreach ($testvalues as $vals) {
$USER->timezone = $vals['usertimezone'];
$actualoutput = userdate($vals['time'], '%A, %d %B %Y, %I:%M %p', $vals['timezone']);
//On different systems case of AM PM changes so compare case insenitive
$vals['expectedoutput'] = $textlib->strtolower($vals['expectedoutput']);
$actualoutput = $textlib->strtolower($actualoutput);
$this->assertEqual($vals['expectedoutput'], $actualoutput,
"Expected: {$vals['expectedoutput']} => Actual: {$actualoutput},
Please check if timezones are updated (Site adminstration -> location -> update timezone)");
}
//restore user timezone back to what it was
$USER->timezone = $userstimezone;
//restore forcetimezone
if (!is_null($cfgforcetimezone)) {
$CFG->forcetimezone = $cfgforcetimezone;
}
//restore system default values.
setlocale(LC_TIME, $oldlocale);
}
public function test_make_timestamp() {
global $USER, $CFG;
$testvalues = array(
array(
'usertimezone' => '2',//no dst applyed
'year' => '2011',
'month' => '7',
'day' => '1',
'hour' => '10',
'minutes' => '00',
'seconds' => '00',
'timezone' => '99', //take user timezone
'applydst' => true, //apply dst
'expectedoutput' => '1309507200'
),
array(
'usertimezone' => '-2',//no dst applyed
'year' => '2011',
'month' => '7',
'day' => '1',
'hour' => '10',
'minutes' => '00',
'seconds' => '00',
'timezone' => '99', //take usertimezone
'applydst' => true, //apply dst
'expectedoutput' => '1309521600'
),
array(
'usertimezone' => '-10',//no dst applyed
'year' => '2011',
'month' => '7',
'day' => '1',
'hour' => '10',
'minutes' => '00',
'seconds' => '00',
'timezone' => '2', //take this timezone
'applydst' => true, //apply dst
'expectedoutput' => '1309507200'
),
array(
'usertimezone' => '-10',//no dst applyed
'year' => '2011',
'month' => '7',
'day' => '1',
'hour' => '10',
'minutes' => '00',
'seconds' => '00',
'timezone' => '-2', //take this timezone
'applydst' => true, //apply dst,
'expectedoutput' => '1309521600'
)
);
//Check if forcetimezone is set then save it and set it to use user timezone
$cfgforcetimezone = null;
if (isset($CFG->forcetimezone)) {
$cfgforcetimezone = $CFG->forcetimezone;
$CFG->forcetimezone = 99; //get user default timezone.
}
//store user default timezone to restore later
$userstimezone = $USER->timezone;
// The string version of date comes from server locale setting and does
// not respect user language, so it is necessary to reset that.
$oldlocale = setlocale(LC_TIME, '0');
setlocale(LC_TIME, 'en_AU.UTF-8');
//get instance of textlib for strtolower
$textlib = textlib_get_instance();
//Test make_timestamp with all testvals and assert if anything wrong.
foreach ($testvalues as $vals) {
$USER->timezone = $vals['usertimezone'];
$actualoutput = make_timestamp(
$vals['year'],
$vals['month'],
$vals['day'],
$vals['hour'],
$vals['minutes'],
$vals['seconds'],
$vals['timezone'],
$vals['applydst']
);
//On different systems case of AM PM changes so compare case insenitive
$vals['expectedoutput'] = $textlib->strtolower($vals['expectedoutput']);
$actualoutput = $textlib->strtolower($actualoutput);
$this->assertEqual($vals['expectedoutput'], $actualoutput,
"Expected: {$vals['expectedoutput']} => Actual: {$actualoutput},
Please check if timezones are updated (Site adminstration -> location -> update timezone)");
}
//restore user timezone back to what it was
$USER->timezone = $userstimezone;
//restore forcetimezone
if (!is_null($cfgforcetimezone)) {
$CFG->forcetimezone = $cfgforcetimezone;
}
//restore system default values.
setlocale(LC_TIME, $oldlocale);
}
}
?>
?>
+8
View File
@@ -255,5 +255,13 @@ END;
public function test_html_to_text_dont_screw_up_utf8() {
$this->assertEqual("\n\nAll the WORLDS a stage.", html_to_text('<p>All the <strong>worlds</strong> a stage.</p>'));
}
public function test_html_to_text_trailing_whitespace() {
$this->assertEqual('With trailing whitespace and some more text', html_to_text("With trailing whitespace \nand some more text", 0));
}
public function test_html_to_text_0() {
$this->assertIdentical('0', html_to_text('0'));
}
}
?>
+2165 -2112
View File
File diff suppressed because it is too large Load Diff
+72 -38
View File
@@ -308,7 +308,7 @@ function qualified_me() {
/**
* Class for creating and manipulating urls.
*
* See short write up here http://docs.moodle.org/en/Development:lib/weblib.php_moodle_url
* See short write up here http://docs.moodle.org/dev/lib/weblib.php_moodle_url
*/
class moodle_url {
var $scheme = '';// e.g. http
@@ -5841,12 +5841,20 @@ function print_error($errorcode, $module='error', $link='', $a=NULL, $extralocat
}
}
// when printing an error the continue button should never link offsite
if (stripos($link, $CFG->wwwroot) === false &&
stripos($link, $CFG->httpswwwroot) === false) {
$link = $CFG->wwwroot.'/';
}
if (!empty($CFG->errordocroot)) {
$errordocroot = $CFG->errordocroot;
} else if (!empty($CFG->docroot)) {
$errordocroot = $CFG->docroot;
$errordoclink = $CFG->errordocroot.'/en';
} else {
$errordocroot = 'http://docs.moodle.org';
$errordoclink = get_doc_root();
if (is_null($errordoclink)) {
$lang = current_language();
$errordoclink = 'http://docs.moodle.org/19/'.$lang; //no doc links set. point to default.
}
}
if (defined('FULLME') && FULLME == 'cron') {
@@ -5863,7 +5871,7 @@ function print_error($errorcode, $module='error', $link='', $a=NULL, $extralocat
$message = clean_text('<p class="errormessage">'.$message.'</p>'.
'<p class="errorcode">'.
'<a href="'.$errordocroot.'/en/error/'.$modulelink.'/'.$errorcode.'">'.
'<a href="'.$errordoclink.'/error/'.$modulelink.'/'.$errorcode.'">'.
get_string('moreinformation').'</a></p>');
if (! defined('HEADER_PRINTED')) {
@@ -6195,8 +6203,35 @@ function redirect($url, $message='', $delay=-1) {
$message = clean_text($message);
// Technically, HTTP/1.1 requires Location: header to contain the absolute path.
// (In practice browsers accept relative paths - but still, might as well do it properly.)
// This code turns relative into absolute.
if (!preg_match('|^[a-z]+:|', $url)) {
// Get host name http://www.wherever.com
$hostpart = preg_replace('|^(.*?[^:/])/.*$|', '$1', $CFG->wwwroot);
if (preg_match('|^/|', $url)) {
// URLs beginning with / are relative to web server root so we just add them in
$url = $hostpart.$url;
} else {
// URLs not beginning with / are relative to path of current script, so add that on.
$url = $hostpart.preg_replace('|\?.*$|','',me()).'/../'.$url;
}
// Replace all ..s
while (true) {
$newurl = preg_replace('|/(?!\.\.)[^/]*/\.\./|', '/', $url);
if ($newurl == $url) {
break;
}
$url = $newurl;
}
}
// Sanitise url - we can not rely on our URL cleaning
// because it does not support all valid external URLs
$url = preg_replace('/[\x00-\x1F\x7F]/', '', $url);
$url = str_replace('"', '%22', $url);
$encodedurl = preg_replace("/\&(?![a-zA-Z0-9#]{1,8};)/", "&amp;", $url);
$encodedurl = preg_replace('/^.*href="([^"]*)".*$/', "\\1", clean_text('<a href="'.$encodedurl.'" />'));
$encodedurl = preg_replace('/^.*href="([^"]*)".*$/', "\\1", clean_text('<a href="'.$encodedurl.'" />', FORMAT_HTML));
$url = str_replace('&amp;', '&', $encodedurl);
/// At developer debug level. Don't redirect if errors have been printed on screen.
@@ -6218,31 +6253,6 @@ function redirect($url, $message='', $delay=-1) {
/// when no message and header printed yet, try to redirect
if (empty($message) and !defined('HEADER_PRINTED')) {
// Technically, HTTP/1.1 requires Location: header to contain
// the absolute path. (In practice browsers accept relative
// paths - but still, might as well do it properly.)
// This code turns relative into absolute.
if (!preg_match('|^[a-z]+:|', $url)) {
// Get host name http://www.wherever.com
$hostpart = preg_replace('|^(.*?[^:/])/.*$|', '$1', $CFG->wwwroot);
if (preg_match('|^/|', $url)) {
// URLs beginning with / are relative to web server root so we just add them in
$url = $hostpart.$url;
} else {
// URLs not beginning with / are relative to path of current script, so add that on.
$url = $hostpart.preg_replace('|\?.*$|','',me()).'/../'.$url;
}
// Replace all ..s
while (true) {
$newurl = preg_replace('|/(?!\.\.)[^/]*/\.\./|', '/', $url);
if ($newurl == $url) {
break;
}
$url = $newurl;
}
}
$delay = 0;
//try header redirection first
@header($_SERVER['SERVER_PROTOCOL'] . ' 303 See Other'); //302 might not work for POST requests, 303 is ignored by obsolete clients
@@ -6957,18 +6967,16 @@ function page_doc_link($text='', $iconpath='') {
function doc_link($path='', $text='', $iconpath='') {
global $CFG;
if (empty($CFG->docroot)) {
return '';
}
$target = '';
if (!empty($CFG->doctonewwindow)) {
$target = ' target="_blank"';
}
$lang = str_replace('_utf8', '', current_language());
if (is_null($docroot = get_doc_root())) {
return '';
}
$str = '<a href="' .$CFG->docroot. '/' .$lang. '/' .$path. '"' .$target. '>';
$str = '<a href="' .$docroot. '/' .$path. '"' .$target. '>';
if (empty($iconpath)) {
$iconpath = $CFG->httpswwwroot . '/pix/docs.gif';
@@ -6980,6 +6988,32 @@ function doc_link($path='', $text='', $iconpath='') {
return $str;
}
/**
* A function that checks if docroot is set, builds and returns the docs root url according to version release.
* @return string documentation url, null if doc root isn't set (ie:during installation perhaps).
*/
function get_doc_root() {
global $CFG;
if (empty($CFG->docroot)) {
return null;
}
$lang = str_replace('_utf8', '', current_language());
if (!empty($CFG->release)) {
$release = $CFG->release;
} else {
//derive branch from the first three letters of version.php's $release with the period taken out.($CFG->release isn't populated yet during upgrade)
include($CFG->dirroot.'/version.php');
}
if (preg_match('/^(.)\.(.)/', $release, $matches)) {
$branch = $matches[1].$matches[2];
} else {
$branch = '.';
}
return $CFG->docroot. '/' .$branch. '/' .$lang;
}
/**
* Returns true if the current site debugging settings are equal or above specified level.
@@ -909,7 +909,7 @@ class XMLDBgenerator {
return $used_names[$tablename.'-'.$fields.'-'.$suffix];
}
/// Use standard naming. See http://docs.moodle.org/en/XMLDB_key_and_index_naming
/// Use standard naming. See http://docs.moodle.org/19/en/XMLDB_key_and_index_naming
$tablearr = explode ('_', $tablename);
foreach ($tablearr as $table) {
$name .= substr(trim($table),0,4);
+16 -2
View File
@@ -4,6 +4,7 @@
require_once('change_password_form.php');
$id = optional_param('id', SITEID, PARAM_INT); // current course
$return = optional_param('return', 0, PARAM_BOOL); // redirect after password change
$strparticipants = get_string('participants');
@@ -12,6 +13,19 @@
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
if ($return) {
// this redirect prevents security warning because https can not POST to http pages
if (empty($SESSION->wantsurl)
or stripos(str_replace('https://', 'http://', $SESSION->wantsurl), str_replace('https://', 'http://', $CFG->wwwroot.'/login/change_password.php') === 0)) {
$returnto = "$CFG->wwwroot/user/view.php?id=$USER->id&course=$id";
} else {
$returnto = $SESSION->wantsurl;
}
unset($SESSION->wantsurl);
redirect($returnto);
}
if (!$course = get_record('course', 'id', $id)) {
error('No such course!');
}
@@ -19,7 +33,7 @@
// require proper login; guest user can not change password
if (empty($USER->id) or isguestuser()) {
if (empty($SESSION->wantsurl)) {
$SESSION->wantsurl = $CFG->httpswwwroot.'/login/change_password.php';
$SESSION->wantsurl = $CFG->httpswwwroot.'/login/change_password.php?id=' . $id;
}
redirect($CFG->httpswwwroot.'/login/index.php');
}
@@ -54,7 +68,7 @@
redirect($changeurl);
}
$mform = new login_change_password_form();
$mform = new login_change_password_form($CFG->httpswwwroot . '/login/change_password.php');
$mform->set_data(array('id'=>$course->id));
$navlinks = array();
+1 -1
View File
@@ -35,7 +35,7 @@ if ($show_instructions) {
<div class="clearer"><!-- --></div>
<div class="form-label"><label for="password"><?php print_string("password") ?></label></div>
<div class="form-input">
<input type="password" name="password" id="password" size="15" value="" />
<input type="password" name="password" id="password" size="15" value="" <?php if (!empty($CFG->loginpasswordautocomplete)) {echo 'autocomplete="off"';} ?> />
<input type="submit" value="<?php print_string("login") ?>" />
<input type="hidden" name="testcookies" value="1" />
</div>
+1 -1
View File
@@ -26,7 +26,7 @@
//HTTPS is potentially required in this page
httpsrequired();
$mform_signup = new login_signup_form();
$mform_signup = new login_signup_form(null, null, 'post', '', array('autocomplete'=>'on'));
if ($mform_signup->is_cancelled()) {
redirect($CFG->httpswwwroot.'/login/index.php');
+1 -1
View File
@@ -996,7 +996,7 @@ function message_post_message($userfrom, $userto, $message, $format, $messagetyp
$messagehtml = NULL;
}
if (!empty($preference->message_emailaddress)) {
if (!empty($preference->message_emailaddress) and validate_email($preference->message_emailaddress)) {
$userto->email = $preference->message_emailaddress; // Use custom messaging address
}
+6
View File
@@ -19,6 +19,12 @@
$userfullname = strip_tags(required_param('name', PARAM_RAW));
$wait = optional_param('wait', MESSAGE_DEFAULT_REFRESH, PARAM_INT);
if ($wait < 1) {
//this should not happen unless someone is manually constructing URLs
//allowing a wait of 0 causes continuous GET requests
$wait = MESSAGE_DEFAULT_REFRESH;
}
$stylesheetshtml = '';
foreach ($CFG->stylesheets as $stylesheet) {
$stylesheetshtml .= '<link rel="stylesheet" type="text/css" href="'.$stylesheet.'" />';
+2 -2
View File
@@ -412,10 +412,10 @@ function ip_in_range($address, $network, $mask) {
$lnetwork = ip2long($network);
$laddress = ip2long($address);
$binnet = str_pad( decbin($lnetwork),32,"0","STR_PAD_LEFT" );
$binnet = str_pad( decbin($lnetwork), 32, "0", STR_PAD_LEFT );
$firstpart = substr($binnet,0,$mask);
$binip = str_pad( decbin($laddress),32,"0","STR_PAD_LEFT" );
$binip = str_pad( decbin($laddress), 32, "0", STR_PAD_LEFT );
$firstip = substr($binip,0,$mask);
return(strcmp($firstpart,$firstip)==0);
}
+2 -2
View File
@@ -335,8 +335,8 @@ class mnet_xmlrpc_client {
// ok, it's signed, but is it signed with the right certificate ?
// do this *after* we check for an out of date key
if (!openssl_verify($this->xmlrpcresponse, base64_decode($sig_parser->signature),
$mnet_peer->public_key)) {
$verified = openssl_verify($this->xmlrpcresponse, base64_decode($sig_parser->signature), $mnet_peer->public_key);
if ($verified != 1) {
$this->error[] = 'Invalid signature';
}
+13 -2
View File
@@ -44,11 +44,22 @@
function assignment_backup_one_mod($bf,$preferences,$assignment) {
global $CFG;
if ($assignment === 0) { //no active instances of assignment to be backed up - skip backup
return false;
}
if (is_numeric($assignment)) {
$assignment = get_record('assignment','id',$assignment);
}
if (empty($assignment->assignmenttype)) {
// No assignment type will cause fatal error below in require_once so bail out now
// Probably ended up here by restoring a course into
// a moodle without this assignmenttype
return false;
}
$status = true;
//Start mod
+6 -6
View File
@@ -839,7 +839,9 @@ class assignment_base {
$select = 'SELECT u.id, u.firstname, u.lastname, u.picture, u.imagealt,
s.id AS submissionid, s.grade, s.submissioncomment,
s.timemodified, s.timemarked,
COALESCE(SIGN(SIGN(s.timemarked) + SIGN(s.timemarked - s.timemodified)), 0) AS status ';
CASE WHEN s.timemarked > 0 AND s.timemarked >= s.timemodified THEN 1
ELSE 0 END AS status ';
$sql = 'FROM '.$CFG->prefix.'user u '.
'LEFT JOIN '.$CFG->prefix.'assignment_submissions s ON u.id = s.userid
AND s.assignment = '.$this->assignment->id.' '.
@@ -851,8 +853,6 @@ class assignment_base {
if (($auser = get_records_sql($select.$sql.$sort, $offset+1, 1)) !== false) {
$nextuser = array_shift($auser);
/// Calculate user status
$nextuser->status = ($nextuser->timemarked > 0) && ($nextuser->timemarked >= $nextuser->timemodified);
$nextid = $nextuser->id;
}
}
@@ -1168,7 +1168,9 @@ class assignment_base {
$select = 'SELECT u.id, u.firstname, u.lastname, u.picture, u.imagealt,
s.id AS submissionid, s.grade, s.submissioncomment,
s.timemodified, s.timemarked,
COALESCE(SIGN(SIGN(s.timemarked) + SIGN(s.timemarked - s.timemodified)), 0) AS status ';
CASE WHEN s.timemarked > 0 AND s.timemarked >= s.timemodified THEN 1
ELSE 0 END AS status ';
$sql = 'FROM '.$CFG->prefix.'user u '.
'LEFT JOIN '.$CFG->prefix.'assignment_submissions s ON u.id = s.userid
AND s.assignment = '.$this->assignment->id.' '.
@@ -1194,8 +1196,6 @@ class assignment_base {
$locked_overridden = 'overridden';
}
/// Calculate user status
$auser->status = ($auser->timemarked > 0) && ($auser->timemarked >= $auser->timemodified);
$picture = print_user_picture($auser, $course->id, $auser->picture, false, true);
if (empty($auser->submissionid)) {
@@ -80,11 +80,6 @@ class assignment_upload extends assignment_base {
}
if (empty($submission->timemarked)) { /// Nothing to show, so print nothing
if ($this->count_responsefiles($USER->id)) {
print_heading(get_string('responsefiles', 'assignment', $this->course->teacher), '', 3);
$responsefiles = $this->print_responsefiles($USER->id, true);
print_simple_box($responsefiles, 'center');
}
return;
}
@@ -96,7 +91,12 @@ class assignment_upload extends assignment_base {
return;
}
if ($grade->grade === null and empty($grade->str_feedback)) { /// Nothing to show yet
if ($grade->grade === null and empty($grade->str_feedback)) { // No grades to show yet
if ($this->count_responsefiles($USER->id)) { // but possibly response files to show
print_heading(get_string('responsefiles', 'assignment', $this->course->teacher), '', 3);
$responsefiles = $this->print_responsefiles($USER->id, true);
print_simple_box($responsefiles, 'center');
}
return;
}
+1 -1
View File
@@ -70,7 +70,7 @@ function choice_upgrade($oldversion) {
PRIMARY KEY (id),
UNIQUE KEY id (id),
KEY choiceid (choiceid)
) TYPE=MyISAM;")) {
) ENGINE=MyISAM;")) {
table_column('choice_answers', 'choice', 'choiceid', 'integer', '10', 'unsigned', 0, 'not null');
table_column('choice_answers', 'answer', 'optionid', 'integer', '10', 'unsigned', 0, 'not null');
+14 -1
View File
@@ -60,6 +60,7 @@ if($mform->is_cancelled()) {
print_header_simple($data->name, '', $nav,
'', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
navmenu($course, $cm), '', '');
groups_print_activity_menu($cm, "$CFG->wwwroot/mod/data/export.php?d=$d");
print_heading(format_string($data->name));
// these are for the tab display
@@ -83,13 +84,25 @@ foreach($fields as $key => $field) {
$exportdata[0][] = $field->field->name;
}
}
$groupid = groups_get_activity_group($cm);
$datarecords = get_records('data_records', 'dataid', $data->id);
ksort($datarecords);
$line = 1;
foreach($datarecords as $record) {
// get content indexed by fieldid
if( $content = get_records('data_content', 'recordid', $record->id, 'fieldid', 'fieldid, content, content1, content2, content3, content4') ) {
if($groupid) {
$select = "SELECT c.fieldid, c.content, c.content1, c.content2, c.content3, c.content4
FROM {$CFG->prefix}data_content c, {$CFG->prefix}data_records r
WHERE c.recordid = $record->id
AND r.id = c.recordid
AND r.groupid = $groupid";
} else {
$select = "SELECT fieldid, content, content1, content2, content3, content4
FROM {$CFG->prefix}data_content
WHERE recordid = $record->id";
}
if( $content = get_records_sql($select) ) {
foreach($fields as $field) {
$contents = '';
if(isset($content[$field->field->id])) {
+9 -1
View File
@@ -729,7 +729,15 @@ function data_user_outline($course, $user, $mod, $data) {
} else if ($grade) {
$result = new object();
$result->info = get_string('grade') . ': ' . $grade->str_long_grade;
$result->time = $grade->dategraded;
//datesubmitted == time created. dategraded == time modified or time overridden
//if grade was last modified by the user themselves use date graded. Otherwise use date submitted
if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
$result->time = $grade->dategraded;
} else {
$result->time = $grade->datesubmitted;
}
return $result;
}
return NULL;
+1 -1
View File
@@ -129,7 +129,7 @@ function forum_upgrade($oldversion) {
PRIMARY KEY (`id`),
KEY `user` (userid),
KEY `post` (postid)
) TYPE=MyISAM COMMENT='For keeping track of posts that will be mailed in digest form';");
) ENGINE=MyISAM COMMENT='For keeping track of posts that will be mailed in digest form';");
}
if ($oldversion < 2004070700) { // This may be redoing it from STABLE but that's OK
+9 -1
View File
@@ -62,6 +62,10 @@
error('You can\'t move to that forum - it doesn\'t exist!', $return);
}
if ($forumto->type == 'single') {
error('Cannot move discussion to a simple single discussion forum.', $return);
}
if (!$cmto = get_coursemodule_from_instance('forum', $forumto->id, $course->id)) {
error('Target forum not found in this course.', $return);
}
@@ -187,6 +191,8 @@
}
$section = -1;
$forummenu = array();
// Check forum types and eliminate simple discussions.
$forumcheck = get_records('forum', 'course', $course->id, '', 'id, type');
foreach ($modinfo->instances['forum'] as $forumcm) {
if (!$forumcm->uservisible || !has_capability('mod/forum:startdiscussion',
get_context_instance(CONTEXT_MODULE,$forumcm->id))) {
@@ -197,7 +203,9 @@
$forummenu[] = "-------------- $strsection $forumcm->sectionnum --------------";
}
$section = $forumcm->sectionnum;
if ($forumcm->instance != $forum->id) {
$forumidcompare = $forumcm->instance != $forum->id;
$forumtypecheck = $forumcheck[$forumcm->instance]->type !== 'single';
if ($forumidcompare and $forumtypecheck) {
$url = "discuss.php?d=$discussion->id&amp;move=$forumcm->instance&amp;sesskey=".sesskey();
$forummenu[$url] = format_string($forumcm->name);
}
+13 -1
View File
@@ -976,7 +976,15 @@ function forum_user_outline($course, $user, $mod, $forum) {
} else if ($grade) {
$result = new object();
$result->info = get_string('grade') . ': ' . $grade->str_long_grade;
$result->time = $grade->dategraded;
//datesubmitted == time created. dategraded == time modified or time overridden
//if grade was last modified by the user themselves use date graded. Otherwise use date submitted
if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
$result->time = $grade->dategraded;
} else {
$result->time = $grade->datesubmitted;
}
return $result;
}
return NULL;
@@ -4476,6 +4484,10 @@ function forum_user_can_post_discussion($forum, $currentgroup=null, $unused=-1,
return false;
}
if ($forum->type == 'single') {
return false;
}
if ($forum->type == 'eachuser') {
if (forum_user_has_posted_discussion($forum->id, $USER->id)) {
return false;
+45 -27
View File
@@ -40,6 +40,50 @@
die;
}
switch ($mode) {
case 'posts' :
$searchterms = array('userid:'.$user->id);
$extrasql = '';
break;
default:
$searchterms = array('userid:'.$user->id);
$extrasql = 'AND p.parent = 0';
break;
}
if ($course->id == SITEID) {
if (empty($CFG->forceloginforprofiles) || isloggedin()) {
// Search throughout the whole site.
$searchcourse = 0;
} else {
$searchcourse = SITEID;
}
} else {
// Search only for posts the user made in this course.
$searchcourse = $course->id;
}
$posts = forum_search_posts($searchterms, $searchcourse, $page*$perpage, $perpage, $totalcount, $extrasql);
$hasposts = !empty($posts);
$iscurrentuser = $user->id == $USER->id;
$specificcourseprovided = !empty($searchcourse) && $searchcourse != SITEID;
if (!$hasposts && !$iscurrentuser && !$specificcourseprovided) {
$mustlogin = (!isloggedin() && $CFG->forceloginforprofiles);
$canviewtheuser = (isloggedin() && has_capability('moodle/user:viewdetails', $usercontext));
if ($mustlogin || (!isteacherinanycourse() && !isteacherinanycourse($user->id) && !$canviewtheuser)) {
// Best to assume that the current user cannot view the requested user
// so we are careful not to give out any information.
print_header();
print_heading(get_string('noposts', 'forum'));
print_footer();
exit;
} else {
// Nothing to check here. If a course has been specified then require_course_login
// has been called OR the current user is a parent of the requested user.
}
}
add_to_log($course->id, "forum", "user report",
"user.php?course=$course->id&amp;id=$user->id&amp;mode=$mode", "$user->id");
@@ -65,36 +109,10 @@
$showroles = 1;
include($CFG->dirroot.'/user/tabs.php'); /// Prints out tabs as part of user page
switch ($mode) {
case 'posts' :
$searchterms = array('userid:'.$user->id);
$extrasql = '';
break;
default:
$searchterms = array('userid:'.$user->id);
$extrasql = 'AND p.parent = 0';
break;
}
echo '<div class="user-content">';
if ($course->id == SITEID) {
if (empty($CFG->forceloginforprofiles) || isloggedin()) {
// Search throughout the whole site.
$searchcourse = 0;
} else {
$searchcourse = SITEID;
}
} else {
// Search only for posts the user made in this course.
$searchcourse = $course->id;
}
// Get the posts.
if ($posts = forum_search_posts($searchterms, $searchcourse, $page*$perpage, $perpage,
$totalcount, $extrasql)) {
if ($posts) {
print_paging_bar($totalcount, $page, $perpage,
"user.php?id=$user->id&amp;course=$course->id&amp;mode=$mode&amp;perpage=$perpage&amp;");
+6 -6
View File
@@ -45,13 +45,13 @@ function glossary_upgrade($oldversion) {
`glossaryid` INT(10) UNSIGNED NOT NULL default '0',
`name` VARCHAR(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='all categories for glossary entries'");
) ENGINE=MyISAM COMMENT='all categories for glossary entries'");
execute_sql("CREATE TABLE `{$CFG->prefix}glossary_entries_categories` (
`categoryid` INT(10) UNSIGNED NOT NULL default '1',
`entryid` INT(10) UNSIGNED NOT NULL default '0',
PRIMARY KEY (`categoryid`, `entryid`)
) TYPE=MyISAM COMMENT='categories of each glossary entry'");
) ENGINE=MyISAM COMMENT='categories of each glossary entry'");
}
if ( $oldversion < 2003092100 ) {
@@ -87,7 +87,7 @@ function glossary_upgrade($oldversion) {
`timemodified` INT(10) UNSIGNED NOT NULL default '0',
`format` TINYINT(2) UNSIGNED NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='comments on glossary entries'");
) ENGINE=MyISAM COMMENT='comments on glossary entries'");
execute_sql(" INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('glossary', 'add comment', 'glossary', 'name') ");
execute_sql(" INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('glossary', 'update comment', 'glossary', 'name') ");
@@ -166,7 +166,7 @@ function glossary_upgrade($oldversion) {
`entryid` INT(10) UNSIGNED NOT NULL default '0',
`alias` TEXT NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='entries alias'");
) ENGINE=MyISAM COMMENT='entries alias'");
}
if ( $oldversion < 2003111500 ) {
@@ -190,7 +190,7 @@ function glossary_upgrade($oldversion) {
`sortkey` VARCHAR(50) NOT NULL default '',
`sortorder` VARCHAR(50) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Setting of the display formats'");
) ENGINE=MyISAM COMMENT='Setting of the display formats'");
// Default format
execute_sql(" INSERT INTO {$CFG->prefix}glossary_displayformats
@@ -292,7 +292,7 @@ function glossary_upgrade($oldversion) {
`sortkey` VARCHAR(50) NOT NULL default '',
`sortorder` VARCHAR(50) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Setting of the display formats'");
) ENGINE=MyISAM COMMENT='Setting of the display formats'");
//Define current 0-6 format names
$formatnames = array('dictionary','continuous','fullwithauthor','encyclopedia',
+9 -1
View File
@@ -189,7 +189,15 @@ function glossary_user_outline($course, $user, $mod, $glossary) {
} else if ($grade) {
$result = new object();
$result->info = get_string('grade') . ': ' . $grade->str_long_grade;
$result->time = $grade->dategraded;
//datesubmitted == time created. dategraded == time modified or time overridden
//if grade was last modified by the user themselves use date graded. Otherwise use date submitted
if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
$result->time = $grade->dategraded;
} else {
$result->time = $grade->datesubmitted;
}
return $result;
}
+2 -2
View File
@@ -329,12 +329,12 @@
/// Search box
if ($showcommonelements ) {
echo '<form method="post" action="view.php">';
echo '<form method="get" action="view.php">';
echo '<table class="boxaligncenter" width="70%" border="0">';
echo '<tr><td align="center" class="glossarysearchbox">';
echo '<input type="submit" value="'.$strsearch.'" name="searchbutton" /> ';
echo '<input type="submit" value="'.$strsearch.'" /> ';
if ($mode == 'search') {
echo '<input type="text" name="hook" size="20" value="'.s($hook).'" alt="'.$strsearch.'" /> ';
} else {
+2 -2
View File
@@ -11,7 +11,7 @@ $HOTPOT_TEXTSOURCE = array(
class mod_hotpot_mod_form extends moodleform_mod {
// documentation on formslib.php here:
// http://docs.moodle.org/en/Development:lib/formslib.php_Form_Definition
// http://docs.moodle.org/dev/lib/formslib.php_Form_Definition
function definition() {
// TO DO
@@ -286,7 +286,7 @@ class mod_hotpot_mod_form extends moodleform_mod {
}
function validation(&$data) {
// http://docs.moodle.org/en/Development:lib/formslib.php_Validation
// http://docs.moodle.org/dev/lib/formslib.php_Validation
global $CFG, $COURSE;
$errors = array();
+1 -1
View File
@@ -33,7 +33,7 @@ function xmldb_label_upgrade($oldversion=0) {
/// }
//===== 1.9.0 upgrade line ======//
if ($oldversion < 2007101510) {
if ($result && $oldversion < 2007101510) {
execute_sql("UPDATE {$CFG->prefix}log_display SET mtable = 'label' WHERE module = 'label'", 'false');
}
+5 -3
View File
@@ -414,8 +414,9 @@
$userresponse = implode(",", $userresponse);
$response = '';
if ($ncorrect == count($answers)-2) { // dont count correct/wrong responses in the total.
$response = reset($answers)->answer;
if ($ncorrect == count($answers) - 2) { // dont count correct/wrong responses in the total.
$answer = reset($answers);
$response = $answer->answer;
if (isset($correctpageid)) {
$newpageid = $correctpageid;
}
@@ -425,7 +426,8 @@
$correctanswer = true;
} else {
reset($answers);
$response = next($answers)->answer;
$answer = next($answers);
$response = $answer->answer;
$newpageid = $wrongpageid;
$answerid = $wronganswerid;
}
+2 -1
View File
@@ -71,7 +71,8 @@
}
}
}
if (!update_record("lesson_answers", $oldanswer)) {
// Don't return the error if it wasn't updated because original question type had no answers
if (!empty($oldanswer->id) && !update_record("lesson_answers", $oldanswer)) {
error("Update page: EOB not updated");
}
} else {
+8 -1
View File
@@ -155,7 +155,14 @@ function lesson_user_outline($course, $user, $mod, $lesson) {
} else {
$grade = reset($grades->items[0]->grades);
$return->info = get_string("grade") . ': ' . $grade->str_long_grade;
$return->time = $grade->dategraded;
//datesubmitted == time created. dategraded == time modified or time overridden
//if grade was last modified by the user themselves use date graded. Otherwise use date submitted
if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
$result->time = $grade->dategraded;
} else {
$result->time = $grade->datesubmitted;
}
}
return $return;
}
+1 -1
View File
@@ -563,7 +563,7 @@
echo "<input type=\"hidden\" name=\"pageid\" value=\"$pageid\" />";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />";
print_simple_box_start("center");
echo '<table width="100%">';
echo '<table>';
}
// default format text options
$options = new stdClass;
+18 -18
View File
@@ -110,7 +110,7 @@ function quiz_upgrade($oldversion) {
`max` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `answer` (`answer`)
) TYPE=MyISAM COMMENT='Options for numerical questions'; ");
) ENGINE=MyISAM COMMENT='Options for numerical questions'; ");
}
if ($success && $oldversion < 2003072400) {
@@ -127,7 +127,7 @@ function quiz_upgrade($oldversion) {
`norm` int(10) unsigned NOT NULL default '1',
PRIMARY KEY (`id`),
KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Options for multianswer questions'; ");
) ENGINE=MyISAM COMMENT='Options for multianswer questions'; ");
}
if ($success && $oldversion < 2003080301) {
@@ -224,7 +224,7 @@ function quiz_upgrade($oldversion) {
`multiplier` decimal(40,20) NOT NULL default '1.00000000000000000000',
`unit` varchar(50) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Optional unit options for numerical questions'; ");
) ENGINE=MyISAM COMMENT='Optional unit options for numerical questions'; ");
// Four tables for handling distribution and storage of
// individual data for dataset dependent question types
@@ -235,7 +235,7 @@ function quiz_upgrade($oldversion) {
`datasetnumber` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `category` (`category`,`userid`)
) TYPE=MyISAM COMMENT='Dataset number for attemptonlast attempts per user'; ");
) ENGINE=MyISAM COMMENT='Dataset number for attemptonlast attempts per user'; ");
$success = $success && modify_database ("", " CREATE TABLE `prefix_quiz_dataset_definitions` (
`id` int(10) unsigned NOT NULL auto_increment,
`category` int(10) unsigned NOT NULL default '0',
@@ -244,7 +244,7 @@ function quiz_upgrade($oldversion) {
`options` varchar(255) NOT NULL default '',
`itemcount` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Organises and stores properties for dataset items'; ");
) ENGINE=MyISAM COMMENT='Organises and stores properties for dataset items'; ");
$success = $success && modify_database ("", " CREATE TABLE `prefix_quiz_dataset_items` (
`id` int(10) unsigned NOT NULL auto_increment,
`definition` int(10) unsigned NOT NULL default '0',
@@ -252,14 +252,14 @@ function quiz_upgrade($oldversion) {
`value` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `definition` (`definition`)
) TYPE=MyISAM COMMENT='Individual dataset items'; ");
) ENGINE=MyISAM COMMENT='Individual dataset items'; ");
$success = $success && modify_database ("", " CREATE TABLE `prefix_quiz_question_datasets` (
`id` int(10) unsigned NOT NULL auto_increment,
`question` int(10) unsigned NOT NULL default '0',
`datasetdefinition` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `question` (`question`,`datasetdefinition`)
) TYPE=MyISAM COMMENT='Many-many relation between questions and dataset definitions'; ");
) ENGINE=MyISAM COMMENT='Many-many relation between questions and dataset definitions'; ");
// One table for new question type calculated
// - the first dataset dependent question type
@@ -272,7 +272,7 @@ function quiz_upgrade($oldversion) {
`correctanswerlength` int(10) NOT NULL default '2',
PRIMARY KEY (`id`),
KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Options for questions of type calculated'; ");
) ENGINE=MyISAM COMMENT='Options for questions of type calculated'; ");
}
if ($success && $oldversion < 2004111400) {
@@ -333,7 +333,7 @@ function quiz_upgrade($oldversion) {
`userid` int(10) unsigned NOT NULL default '0',
`timestamp` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='The mapping between old and new versions of a question';");
) ENGINE=MyISAM COMMENT='The mapping between old and new versions of a question';");
}
if ($success && $oldversion < 2005032000) {
@@ -471,7 +471,7 @@ function quiz_upgrade($oldversion) {
`sumpenalty` varchar(10) NOT NULL default '0.0',
PRIMARY KEY (`id`),
UNIQUE KEY `attemptid` (`attemptid`,`questionid`)
) TYPE=MyISAM COMMENT='Gives ids of the newest open and newest graded states';");
) ENGINE=MyISAM COMMENT='Gives ids of the newest open and newest graded states';");
/// Now upgrade some fields in states and newest_states tables where necessary
// to save time on large sites only do this for attempts that have not yet been finished.
@@ -525,7 +525,7 @@ function quiz_upgrade($oldversion) {
`maxscore` int(10) unsigned NOT NULL default '1',
PRIMARY KEY (`id`),
KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Options for RQP questions';");
) ENGINE=MyISAM COMMENT='Options for RQP questions';");
$success = $success && modify_database ('', "CREATE TABLE `prefix_quiz_rqp_type` (
`id` int(10) unsigned NOT NULL auto_increment,
@@ -535,7 +535,7 @@ function quiz_upgrade($oldversion) {
`flags` tinyint(3) NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) TYPE=MyISAM COMMENT='RQP question types and the servers to be used to process them';");
) ENGINE=MyISAM COMMENT='RQP question types and the servers to be used to process them';");
$success = $success && modify_database ('', "CREATE TABLE `prefix_quiz_rqp_states` (
`id` int(10) unsigned NOT NULL auto_increment,
@@ -544,7 +544,7 @@ function quiz_upgrade($oldversion) {
`persistent_data` text NOT NULL default '',
`template_vars` text NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='RQP question type specific state information';");
) ENGINE=MyISAM COMMENT='RQP question type specific state information';");
}
if ($success && $oldversion < 2005050300) {
@@ -568,7 +568,7 @@ function quiz_upgrade($oldversion) {
can_render tinyint(2) unsigned NOT NULL default '0',
can_author tinyint(2) unsigned NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='Information about RQP servers';");
) ENGINE=MyISAM COMMENT='Information about RQP servers';");
if ($types = get_records('quiz_rqp_types')) {
foreach($types as $type) {
$server = new stdClass;
@@ -859,7 +859,7 @@ function quiz_upgrade($oldversion) {
`answer` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Options for essay questions'");
) ENGINE=MyISAM COMMENT='Options for essay questions'");
$success = $success && modify_database ('', "
CREATE TABLE `prefix_quiz_essay_states` (
@@ -869,7 +869,7 @@ function quiz_upgrade($oldversion) {
`fraction` varchar(10) NOT NULL default '0.0',
`response` text NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='essay question type specific state information'");
) ENGINE=MyISAM COMMENT='essay question type specific state information'");
}
if ($success && $oldversion < 2005070202) {
@@ -1058,7 +1058,7 @@ function quiz_upgrade($oldversion) {
id int(10) unsigned NOT NULL auto_increment,
modulename varchar(20) NOT NULL default 'quiz',
PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='Student attempts. This table gets extended by the modules';");
) ENGINE=MyISAM COMMENT='Student attempts. This table gets extended by the modules';");
// create one entry for all the existing quiz attempts
$success = $success && modify_database ("", "INSERT INTO prefix_question_attempts (id)
SELECT uniqueid
@@ -1134,7 +1134,7 @@ function quiz_upgrade($oldversion) {
maxgrade double NOT NULL default '0',
PRIMARY KEY (id),
KEY quizid (quizid)
) TYPE=MyISAM COMMENT='Feedback given to students based on their overall score on the test';
) ENGINE=MyISAM COMMENT='Feedback given to students based on their overall score on the test';
");
$success = $success && execute_sql("

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