Compare commits

..

666 Commits

Author SHA1 Message Date
moodler f12a2ccee5 Bumping to 1.9.1 2008-05-15 06:35:11 +00:00
moodlerobot a803edf7db Updated the 19 build version to 20080515 2008-05-15 01:58:26 +00:00
robertall d80e3a0b10 MDL-14442: apply addslashes() before importing values, to allow quotes in field's values 2008-05-14 17:07:22 +00:00
stronk7 1eae64185c XHTML minor fix. MDL-14836 2008-05-14 16:42:31 +00:00
jamiesensei ac2ce35b6c MDL-14201 "Summary graph" - small improvement to robustness for sql. 2008-05-14 11:15:14 +00:00
jamiesensei 4e27090284 MDL-14822 "Quiz Report: the quiz report do not find the first attempt" needed to include quiz id in WHERE conditions. 2008-05-14 09:12:57 +00:00
dongsheng fc3992e57e "MDL-14820, escape filename, merged from mOODLE_18_STABLE" 2008-05-14 05:21:57 +00:00
dongsheng 81f7813e8b "MDL-14442, replace error() with print_error" 2008-05-14 02:47:35 +00:00
moodlerobot 941369258b Updated the 19 build version to 20080514 2008-05-14 02:03:38 +00:00
skodak c72350373c MDL-14378 When deleting course category deal with everything that depends on its context 2008-05-13 22:03:40 +00:00
skodak ade1ee0deb MDL-14378 When deleting course category deal with everything that depends on its context 2008-05-13 21:51:46 +00:00
robertall cd91db1630 MDL-14442: added error checking to update_record() and insert_record() calls 2008-05-13 15:28:37 +00:00
jamiesensei 872c8cc93f MDL-14201 Summary graph in Overview Report - needed a little more spacing between bars of graph in some cases. 2008-05-13 15:03:29 +00:00
moodler 725f4c704c Fixed RTL problem for this theme (Heading on wrong side) 2008-05-13 08:04:40 +00:00
nicolasconnault 6ec1f89e73 Updating the translate_list for YUI components. 2008-05-13 07:24:54 +00:00
moodler 498f8e8f82 MDL-14738 Roles section on course settings is now "Role renaming", with help. 2008-05-13 06:16:12 +00:00
moodler ea22498866 MDL-14811 Fixed the popup window name for HTML editor help 2008-05-13 05:35:15 +00:00
jerome 8d1c6cd682 MDL-14609 change the wording "Click here to read the Site Policy Agreement" to "Link to Site Policy Agreement" 2008-05-13 02:41:25 +00:00
moodlerobot 4f75b1b68a Updated the 19 build version to 20080513 2008-05-13 02:06:03 +00:00
stronk7 7114adb590 Avoid $_REQUEST["id"] usage. MDL-14806 2008-05-13 01:46:37 +00:00
danmarsden e41839dc50 MDL-12037 - backup does not report errors correctly in backup_module() merged from HEAD 2008-05-13 00:45:15 +00:00
stronk7 9eff824be8 Role custom names (aliases) are now preserved during backup/restore. MDL-14783 2008-05-12 23:05:33 +00:00
stronk7 58e42445d2 Restoring from courses having custom role name doesn't cause duplicate roles. MDL-14808 2008-05-12 22:53:29 +00:00
skodak 536c4f8875 MDL-14692 groupings restore logic switched - credit goes to Vitor Rocio 2008-05-12 19:56:13 +00:00
robertall 5690a10e32 MDL-14442: Import all records of a database activity that has been exported as CSV 2008-05-12 19:55:20 +00:00
skodak abe8f35a49 MDL-14692 groupings restore logic switched - credit goes to Vitor Rocio 2008-05-12 19:53:27 +00:00
stronk7 354176b5fe user preferences are not restored if user exists. MDL-12594 2008-05-12 18:00:40 +00:00
tjhunt 1fca73d04c MDL-14804 - question_list_instances is broken - It does not include the each modules lib file before doing function_exists($module->name.'_question_list_instances'). 2008-05-12 17:29:47 +00:00
tjhunt 07a7a711fa MDL-10899 - followup - need to move random questions too. 2008-05-12 15:59:03 +00:00
tjhunt 26337523fa New convinience function in accesslib: get_parent_contextid. Also, the start of some unit tests for accesslib, but only this trivial funciton, and the get_parent_contexts function it is based on. Still, it is a start. 2008-05-12 15:28:31 +00:00
skodak 21dcd628bc MDL-11719 increased size of idnumber in user table - needed for some enrolment plugins 2008-05-12 14:40:29 +00:00
skodak ed31529ce5 MDL-11719 increased size of idnumber in user table - needed for some enrolment plugins 2008-05-12 14:34:31 +00:00
skodak d3613a1235 MDL-14183 guest type role not allowed in defaultuserroleid anymore, because it was causing trouble in many places; admins must choose another role if guest role detected in this setting 2008-05-12 14:03:18 +00:00
tjhunt 247fa07654 MDL-14797 - Error when moving a course to an empty category on Postgres 2008-05-12 10:44:38 +00:00
jerome 72cecd3b85 MDL-14656 Make welcome.html XHTML compliant 2008-05-12 05:17:46 +00:00
moodlerobot 81af00fbb9 Updated the 19 build version to 20080512 2008-05-12 01:58:00 +00:00
moodlerobot f74c520b87 Automatic installer.php lang files by installer_builder (20080512) 2008-05-12 01:50:55 +00:00
stronk7 a4810441af Prevent excess of unenolments by enrol_database_sync.php. MDL-8550 2008-05-11 23:48:16 +00:00
stronk7 9c13746dab Prevent some notices and process if $CFG->emoticons is not set or empty. MDL-12414 2008-05-11 23:32:34 +00:00
moodlerobot d5d17ef33a Updated the 19 build version to 20080511 2008-05-11 01:52:51 +00:00
stronk7 1c8ec13811 Blogs preference for scheduled backup. I had this here since ages! 2008-05-10 22:05:29 +00:00
moodlerobot 0492535297 New uz installer lang 2008-05-10 02:59:26 +00:00
moodlerobot e476dc67ea file installer.php was added on branch MOODLE_19_STABLE on 2008-05-10 02:59:26 +0000 2008-05-10 02:57:14 +00:00
moodlerobot f9edb1e4e4 Updated the 19 build version to 20080510 2008-05-10 01:58:52 +00:00
diml 6a06def8a1 fixes MDL-14770, $course_id error 2008-05-09 21:50:20 +00:00
tjhunt 48b65cc309 Following the fixes for MDL-14750 and MDL-10899, do a database upgrade that fixes any bogus values in the parent or category columns of multianswer questions' subquestions. 2008-05-09 15:50:45 +00:00
tjhunt ae8701d94d MDL-14750 - Multianswer questions get broken by backup and restore becuase question->parent is not recoded properly in the database. This commit also fixes a regression introduced by the fix for MDL-5482. 2008-05-09 15:10:42 +00:00
tjhunt c31957babf MDL-10899 - There is some data associated with some questons that needs to be udpated when moving questions between categories. This commit deals with subquestions, and lays the foundation for fixing the other problem - datasets - which is files as bug 14767. 2008-05-09 15:05:38 +00:00
tjhunt b0efb18b72 Problem when editing calculated questions when installed on Postgres. 2008-05-09 15:02:25 +00:00
jamiesensei 18d7110673 Oops accidentally reverted this patch. Here it is again. "MDL-14223 "Add a column for the user's idnumber, controllable by a site-wide setting" and MDL-14224 "Add a site-wide setting to hide the user profile image from quiz reports"
The quiz overview report now respect the settings for the gradebook - whether to display idnumbers and user pictures.

Also refactored the code to build table / download content a little to reduce code duplication."
2008-05-09 13:50:24 +00:00
jamiesensei 3114a292df Merging some small differences between HEAD and the 1.9 stable branch. 2008-05-09 13:15:12 +00:00
tjhunt 86462cee30 MDL-14762 - find and update links to files in answer->feedback when moving questions between contexts. 2008-05-09 13:13:45 +00:00
jamiesensei 88a78fa926 MDL-14223 "Add a column for the user's idnumber, controllable by a site-wide setting" and MDL-14224 "Add a site-wide setting to hide the user profile image from quiz reports"
The quiz overview report now respect the settings for the gradebook - whether to display idnumbers and user pictures.

Also refactored the code to build table / download content a little to reduce code duplication.
2008-05-09 13:00:06 +00:00
jamiesensei 6c90434d03 MDL-14637 "allow activity modules to add sub menus of settings pages to admin menu" and MDL-14565 "allow quiz reports to add configuration settings to the admin tree" added a mechanism to admin/settings/plugins.php to allow modules to include a file settingstree.php instead of settings.php which will allow for more flexibility of what a module can add to the admin settings menu. 2008-05-09 06:06:29 +00:00
moodlerobot 49e6e996df Updated the 19 build version to 20080509 2008-05-09 02:00:18 +00:00
moodlerobot 7ca75c035a Automatic installer.php lang files by installer_builder (20080509) 2008-05-09 01:53:42 +00:00
danmarsden a05c7db850 MDL-14736 this doesn't need to be an error call, as the backup should still succeed - changing to use notify() instead. 2008-05-08 22:57:42 +00:00
jamiesensei bef711f560 For the overview report : MDL-14199 "Option to only show / export final grade" small improvement to UI. Include highlighted message in the form about what the current grading method is. Some changes to lang strings for overview report settings form to indicate that options affect downloaded data as well as data shown on the screen. 2008-05-08 10:10:29 +00:00
jamiesensei 50c68d01cc For the overview report : MDL-14199 "Option to only show / export final grade" small improvement to UI. Include highlighted message in the form about what the current grading method is. 2008-05-08 09:51:26 +00:00
jamiesensei 18129bbfee MDL-14198 "Make it clear which student attempt gives the final grade, if the scoring method is first, last or highest score" adding a message about the highlighting above the table. 2008-05-08 09:31:05 +00:00
jamiesensei 1a827abb0c For the overview report : MDL-14199 "Option to only show / export final grade" and MDL-14198 "Make it clear which student attempt gives the final grade, if the scoring method is first, last or highest score" Oops. Seemed to have missed out part of the patch when merging into 1.9 from HEAD. 2008-05-08 08:56:23 +00:00
jerome a85c4eefaf MDL-12300 message window does show date now 2008-05-08 03:40:47 +00:00
jerome 1d8c89c4ad MDL-14716 Install script: icon image are now displayed on the Server Checks page 2008-05-08 03:04:25 +00:00
jerome e7ee1905ff MDL-14697 Participants page OK button hidden if javascript is enabled 2008-05-08 02:42:53 +00:00
jerome 6feba15b31 MDL-12648 Undefined property: stdClass::$wwwroot on popup screen during installation 2008-05-08 02:34:38 +00:00
jerome adb2905dcc MDL-14656 Make install.php XHTML compliant 2008-05-08 02:02:36 +00:00
moodlerobot 597748ddd8 Updated the 19 build version to 20080508 2008-05-08 01:59:01 +00:00
moodlerobot 0df80ebf9c Automatic installer.php lang files by installer_builder (20080508) 2008-05-08 01:51:43 +00:00
stronk7 a8293dd818 Reverting to previous revision. MDL-14668 2008-05-07 18:27:09 +00:00
jamiesensei f39ebcea89 MDL-14734 "improve interface for deleting attempts"
* The control for deleting attempts is a drop down box with onchange javascript to submit the form, you cannot see the label to say what the drop down box does. Better to use a button. The button label is visible so you can see what it does.
* Checkboxes should be displayed when there is no attempt to delete.
* The whole column for checkboxes should be removed when no attempts are displayed ie. when showing students with no attempts.

merged from HEAD
2008-05-07 16:11:17 +00:00
jamiesensei b44c702d45 MDL-14201 "Summary graph" included a summary graph at the bottom of overview report page. Shows the distribution of grades achieved by students. If a group is selected the grades from the group are compared with the grades for all participants. 2008-05-07 14:40:57 +00:00
jamiesensei e0fb4a8743 file overviewgraph.php was added on branch MOODLE_19_STABLE on 2008-05-07 14:40:57 +0000 2008-05-07 14:38:18 +00:00
jamiesensei 839d72b06c For the overview report : MDL-14199 "Option to only show / export final grade" fixing a notice warning from the form definition
Merged from HEAD
2008-05-07 14:02:31 +00:00
tjhunt ae0561140c MDL-14727 - Do a database update to fix random questions with the wrong parent (there may be some of these floating around in people's databases becuase of MDL-5482.)
This is a backport from HEAD. Note that I have intentionally not changed version.php. There is not a spare number, and 1.9.1 is due to be released soon. It is OK for this to wait until then.
2008-05-07 13:35:53 +00:00
tjhunt bbf8fb528f MDL-14726 - rcache bit wrong in set_field 2008-05-07 13:04:39 +00:00
tjhunt d1c840e99c MDL-5482 - Backup and restore problems for match, random and truefalse question types.
All the credit goes to Paulo Matos who carefully worked out and tested this fix, and updated the patch several times over more than a year while I very slowly got around to reviewing it and checking it in.
2008-05-07 12:31:37 +00:00
skodak c8b8b71645 MDL-14724 Students cannot see discussions in forums made by teachers if timedposts enabled 2008-05-07 11:30:59 +00:00
fmarier 57d6548065 Printing ADODB error to the web server error log (MDL-14628) 2008-05-07 04:37:39 +00:00
dongsheng f1bd861709 "MDL-14668, fix course full name in activity reports, see tracker" 2008-05-07 02:58:44 +00:00
moodlerobot 84a36391d5 Updated the 19 build version to 20080507 2008-05-07 01:54:37 +00:00
jamiesensei 6131f70069 For the overview report : MDL-14199 "Option to only show / export final grade" and MDL-14198 "Make it clear which student attempt gives the final grade, if the scoring method is first, last or highest score" 2008-05-06 18:06:33 +00:00
tjhunt 7706180dbd MDL-14681 - Fix package name of question/update.php. 2008-05-06 07:34:38 +00:00
scyrma df7ef3a1a4 MDL-14654: False is a problem, zero is fine. 2008-05-06 04:59:17 +00:00
moodlerobot 0d9a6ca147 Updated the 19 build version to 20080506 2008-05-06 01:58:11 +00:00
jamiesensei beb6d00f46 For overview report - MDL-14185 "Switch to using formslib and improve the interface" and MDL-14186 "Switch to using moodle_url and eliminate the use of $SESSION global" 2008-05-05 13:18:14 +00:00
jamiesensei 9df9473d98 file overviewsettings_form.php was added on branch MOODLE_19_STABLE on 2008-05-05 13:18:14 +0000 2008-05-05 13:12:11 +00:00
thepurpleblob ae875f50eb MDL-14624:
Reverting fix. This needs proxy to have exceptions for local subnets available.
Will work on this in HEAD only
2008-05-05 08:19:50 +00:00
scyrma bdde7324d7 esthetic typo fix 2008-05-05 07:13:22 +00:00
moodlerobot 851942fb7f Updated the 19 build version to 20080505 2008-05-05 01:53:05 +00:00
stronk7 f3f11963d8 Fixing query to be cross-db. Credit goes to David Mudrak. MDL-14583 2008-05-05 00:20:32 +00:00
stronk7 187b3f885d Glossary concepts must support multilang filter (all filters, in fact).
And accesible alt texts for action buttons too. MDL-14687
2008-05-05 00:08:32 +00:00
diml bb6c0ef2cf syntax fix for MSL-14678 2008-05-04 10:48:26 +00:00
moodlerobot 284115288b Updated the 19 build version to 20080504 2008-05-04 02:03:27 +00:00
moodlerobot f50c83ff30 Automatic installer.php lang files by installer_builder (20080504) 2008-05-04 01:58:25 +00:00
moodlerobot 722e45997d New lang supported by installer: cy_utf8 2008-05-04 00:47:53 +00:00
moodlerobot 8acf33144a file installer.php was added on branch MOODLE_19_STABLE on 2008-05-04 00:47:53 +0000 2008-05-04 00:42:16 +00:00
jamiesensei 720c94fa06 MDL-14677 "should rescale the grades displayed for each question in the detailed marks view of the overview report so that all grades add up to the sum total grade" used quiz_rescale_grades function to rescale the grade properly before displaying it. Also this patch includes some general clean up and refactoring of overview report. 2008-05-03 13:43:44 +00:00
moodlerobot 877129cd0d Updated the 19 build version to 20080503 2008-05-03 01:52:19 +00:00
moodlerobot b0e8fede48 Automatic installer.php lang files by installer_builder (20080503) 2008-05-03 01:46:16 +00:00
jamiesensei aa45776dd7 MDL-14663 "link_to_popup_window displays 'Click here....' as the link text if you pass in 0 as the link text."
Also fixing the problem in link_to_popup_window function. Test for null instead of empty.
2008-05-02 16:14:11 +00:00
jamiesensei c912dab6da MDL-14666 "overview report is very inefficient when view detailed marks is selected. There are several sql queries per row." Made a new query outside the loop for adding rows. 2008-05-02 15:25:19 +00:00
jamiesensei ada7af846f MDL-14664 "sorting by question mark when viewing detailled mark in overview quiz report not working" Found that the problem ocurred when attempt.id != attempt.uniqueid as the sql was using the wrong field to join the question records.
Merged from HEAD
2008-05-02 14:23:02 +00:00
jamiesensei 833b1e0045 MDL-14663 "link_to_popup_window displays 'Click here....' as the link text if you pass in 0 as the link text."
Solved this by formatting the grade using number_format to display the grade with a number of decimal places. So for 0 we display something like 0.00 and this displays OK in link_to_popup_window.

Merged from HEAD
2008-05-02 13:29:25 +00:00
poltawski ff0b80cc36 MDL-13716 - When storing progress of scorm activity a 404 is
encountered and js failure on split. Cast to string to avoid this.

thanks to Peter Chamberlin of LJCreate
2008-05-02 10:42:53 +00:00
scyrma 22d205da7a MDL-11342: Urlencode the filepath in directory resource (merge from 1.8) 2008-05-02 08:17:27 +00:00
jerome d492819687 MDL-11382 added a link 'Profil' to the administration block 2008-05-02 05:59:16 +00:00
jerome 97aaaec647 MDL-12864 fix bad XHTML in the messaging popup 2008-05-02 05:17:16 +00:00
jerome 5e6d7b8d6b MDL-12864 fix bad XHTML in the messaging popup 2008-05-02 05:09:41 +00:00
dongsheng 443a1fee8e "MDL-14460, fix all the other get_context_instance,(use sed replace them), see tracker" 2008-05-02 04:07:27 +00:00
scyrma 303e816601 MDL-8592: Get spellchecking to work over https 2008-05-02 03:31:49 +00:00
jerome 9fc2409875 MDL-14439 IE and Opera fire the onchange when ever you move into a dropdwown list with the keyboard - this changes fix the problem. 2008-05-02 02:20:36 +00:00
jerome cbcf18e5b8 MDL-14439 Added javascript file dropdwon.js - fix IE/Opera behavior. They do not fire dropdwon menu onChange automatically anymore. 2008-05-02 02:10:29 +00:00
moodlerobot 931e9d3ec4 Updated the 19 build version to 20080502 2008-05-02 01:53:58 +00:00
scyrma 94b9899627 MDL-13424: Tags are automatically cleaned on cron run. 2008-05-02 01:12:49 +00:00
skodak 66c3b5f155 MDL-14647 fix legacy add_teacher() when approving new course; backported from HEAD 2008-05-01 22:15:44 +00:00
skodak ba3381be5d MDL-14451 removing old upgrade code from HEAD and marking upgrade line in 19 stable 2008-05-01 20:37:22 +00:00
thepurpleblob 71588440e9 Whoops... left some testing code in. 2008-05-01 12:20:39 +00:00
thepurpleblob 0393331c13 MDL-14406
Ensure 'length' field for description type questions is 0 and that
default for all questions is 0
2008-05-01 12:08:04 +00:00
dongsheng 5f3d54fc4e "MDL-7362, allow_call_time_pass_reference setting may cause bug, see tracker" 2008-05-01 08:31:20 +00:00
scyrma 7c68f9da21 MDL-3381: keeping environment.xml in sync (from 1.8) 2008-05-01 08:10:08 +00:00
jamiesensei 1ab2605768 MDL-13678 "Change default number of rows per page on quiz reports" Made a new constant to say how many attempts / questions to list per page by default. 2008-05-01 07:40:54 +00:00
jamiesensei 521601d0ce file reportlib.php was added on branch MOODLE_19_STABLE on 2008-05-01 07:40:55 +0000 2008-05-01 07:08:29 +00:00
dongsheng d4680e253a "MDL-10944, fix undefined property in chatd.php" 2008-05-01 06:53:41 +00:00
scyrma 320e91e2f8 MDL-13424 Fixes suggested by Eloy, in tag_cleanup. 2008-05-01 06:15:09 +00:00
dongsheng 0148e8be18 "MDL-14460, fix all get_context_instance" 2008-05-01 06:02:27 +00:00
scyrma b2057b4917 code beautification 2008-05-01 05:48:42 +00:00
moodler 87dc962b44 MDL-14630 Fixed the exclusion of mentees block from the "my" page 2008-05-01 05:37:56 +00:00
scyrma 20875a12e0 MDL-14590 - Spellchecker now working in the messaging system too 2008-05-01 05:16:26 +00:00
moodlerobot f8ef9c04db Updated the 19 build version to 20080501 2008-05-01 01:58:09 +00:00
moodlerobot ea9b4c707e Automatic installer.php lang files by installer_builder (20080501) 2008-05-01 01:51:55 +00:00
thepurpleblob 9c3c1ab56d MDL-14406
MNET can now establish a peer through a proxy
2008-04-30 14:34:23 +00:00
skodak 2c9a36d79c MDL-14621 indicate missing modules on modules admin page; backported from HEAD 2008-04-30 13:08:46 +00:00
skodak 967e19d6a0 MDL-14621 fix warning when module code missing and editing course; backported from HEAD 2008-04-30 12:40:25 +00:00
skodak 4a440d90b6 MDL-14621 modinfo ignores missing modules now properly; backported from HEAD 2008-04-30 12:34:33 +00:00
skodak fcfd2e8a45 MDL-14621 fixed warning when module code missing; backported from HEAD 2008-04-30 12:25:52 +00:00
poltawski 86ad0ba459 MDL-12614 - Bad regular expression matching was causing syntactically
invalid js when returning to previously attempted SCORM package.

Credit to Peter Chamberlin of ljcreate.com
2008-04-30 11:57:33 +00:00
scyrma 3ceeb19d3c MDL-14569 - Don't count related tags for the tag cloud formatting and count display 2008-04-30 08:50:58 +00:00
jamiesensei 0dd41b1891 MDL-7772 "Quiz results overview: not all combinations of Show attempts with ... & Groups settings work properly"
This patch is based on Ann Adamcik's latest code, thanks Ann. Made a couple of small changes. This is equivalent to the two patches in HEAD for the same bug.
2008-04-30 08:21:01 +00:00
scyrma 5111517c8a MDL-13424 and MDL-14544: New function tag_cleanup removes unused un-official tags, or unlinked tags. Not yet called automatically. 2008-04-30 07:34:28 +00:00
scyrma 876e35b24c Fix tag documentation and add a missing 'return true'. 2008-04-30 06:35:57 +00:00
dongsheng 79fb7ea7d3 "MDL-14460,fix get_context_instance" 2008-04-30 04:45:22 +00:00
dongsheng a5d3cae9d3 "MDL-14538, remove duplicated settings, see tracker" 2008-04-30 03:53:49 +00:00
dongsheng 4955e30c0b "MDL-14465, add a setfocus() function, see tracker, thanks, Ralf" 2008-04-30 03:43:40 +00:00
moodlerobot d75724cb1a Updated the 19 build version to 20080430 2008-04-30 01:55:05 +00:00
moodlerobot aa51ed515c Automatic installer.php lang files by installer_builder (20080430) 2008-04-30 01:48:33 +00:00
dongsheng d3397f0604 "MDL-14262, fix optional_param, and fix link in restorelib.php" 2008-04-30 01:45:45 +00:00
dongsheng 3f5636b56e "MDL-14262, fix wrong logged link, see tracker, merged from MOODLE_18_STABLE" 2008-04-30 01:13:40 +00:00
moodler ed13c57b3b Latest tags file 2008-04-29 06:51:25 +00:00
moodler 94ad221b27 MDL-13261 get_context_users_bycap and get_context_users_byrole were draft and should never have been included in accesslib in 1.9 STABLE. To avoid confusion I've removed these functions. They weren't being used by any core code ... I only hope no-one out there is using them for Moodle 1.9 modules. :-( :-( 2008-04-29 06:48:56 +00:00
scyrma 785c3ff9ac MDL-13985 - Fix previous fix to display a warning when whitespace is used in popup window name 2008-04-29 05:07:57 +00:00
scyrma d8e091627c MDL-13985 - Prevent popup windows from having a space in their name. 2008-04-29 04:04:32 +00:00
scyrma 4d6e43a1dd MDL-14588 - Prevent error message when calling function with null variable 2008-04-29 03:28:25 +00:00
scyrma fcbf9d8a95 Converted file to utf-8 2008-04-29 02:57:24 +00:00
jerome 2467402841 MDL-13815 - Course summary text is optional and empty by default now 2008-04-29 02:20:58 +00:00
moodlerobot 3c724071a5 Updated the 19 build version to 20080429 2008-04-29 01:56:19 +00:00
moodlerobot 6ad59438e1 Automatic installer.php lang files by installer_builder (20080429) 2008-04-29 01:49:53 +00:00
dongsheng cc5d09ac00 MDL-14303, add missing cmidnumber parameter. see tracker 2008-04-29 01:38:21 +00:00
stronk7 d10e856d88 Fixed old-glorious typo in wiki backup. MDL-10811 ; merged from 18_STABLE 2008-04-28 23:08:57 +00:00
poltawski 77666b4acf MDL-12614 - Bad regular expression matching was causing syntactically
invalid js when returning to previously attempted SCORM package.

Credit to Peter Chamberlin of ljcreate.com
2008-04-28 16:51:41 +00:00
diml 0df6befcd9 Contributes to MDL12324 - fixes search failure when using extended chars (non ascii) in query strings 2008-04-28 16:28:06 +00:00
scyrma 42f6931f27 MDL-14569 - Remove linked tags when deleting users. 2008-04-28 08:33:48 +00:00
scyrma f8b1eb504e MDL-14150 - Make tag:edit and tag:manage more distinct - related tags and description are now editing, renaming is managing. 2008-04-28 08:22:36 +00:00
moodlerobot 879761a29f Updated the 19 build version to 20080428 2008-04-28 01:53:12 +00:00
skodak 737498e986 MDL-14564 pg null trouble fixed by David Mudrak; merged from MOODLE_19_STABLE 2008-04-27 22:40:21 +00:00
dongsheng 9bdb39c797 MDL-14262, fix incorrect link, see tracker 2008-04-27 17:01:06 +00:00
stronk7 862d935434 glossary->id for block is now properly recoded by restore. MDL-4934 ; merged from 18_STABLE 2008-04-27 01:55:49 +00:00
moodlerobot 8ab602a484 Updated the 19 build version to 20080427 2008-04-27 01:48:54 +00:00
stronk7 39ce906768 Prevent admin tree to be showed for non-admins in 'my' page. MDL-14225 2008-04-27 00:30:17 +00:00
stronk7 6b1688b15e Implemented more accurate way to retrieve trigger names. MDL-14567 2008-04-26 22:45:04 +00:00
skodak ee90562005 MDL-14055 auth sync constants, needed for sync cleanup - backporting from HEAD 2008-04-26 13:47:30 +00:00
dongsheng e8da9c41f0 MDL-14460, fix get_context_instance, see tracker 2008-04-26 11:07:15 +00:00
moodlerobot a3af58c6f1 Updated the 19 build version to 20080426 2008-04-26 01:54:38 +00:00
stronk7 5eeebe5b48 New setting in require_login() to avoid certain scripts (file.php)
to mess $SESSION->wantsurl. MDL-14495
2008-04-25 18:52:47 +00:00
skodak 2439bedff8 MDL-14484 rerun asearchtemplate upgrade - there were reported problems on some sites 2008-04-25 15:18:54 +00:00
skodak 06f5909a8d MDL-14557 PostgreSQL+empty integer problem: user/editadvanced_form.php - credit goes to David Mudrak; merged from MOODLE_18_STABLE 2008-04-25 14:43:42 +00:00
skodak ae4e154ed9 MDL-14556 reset coursepage state after switchrole 2008-04-25 14:09:07 +00:00
skodak 8e6f40259c MDL-14475 initialised $hideshow 2008-04-25 14:01:23 +00:00
skodak 475419e555 MDL-14543 fixed broken deleting from auth sync 2008-04-25 13:20:28 +00:00
skodak 6547c735ca removing bogus //1 2008-04-25 12:24:52 +00:00
skodak d1e867d052 MDL-13401 fixed REQUEST_URI test 2008-04-25 12:23:21 +00:00
skodak daa4c6c53a MDL-14473 added missing $files param 2008-04-25 12:20:02 +00:00
moodlerobot 7632e30c4f Updated the 19 build version to 20080425 2008-04-25 01:58:27 +00:00
moodlerobot 400781874e Automatic installer.php lang files by installer_builder (20080425) 2008-04-25 01:50:32 +00:00
stronk7 be50571e93 Fixed typo causing restore to existing courses not to work. MDL-14549 2008-04-24 21:47:40 +00:00
stronk7 d25fdffd6e Prevent wrong data->notifications to be stored. Default to 0 if empty. MDL-14540 2008-04-24 17:10:03 +00:00
stronk7 6768c07ed1 Fix tag links in tag clouds. MDL-14547 2008-04-24 16:44:43 +00:00
dongsheng 4d4dc7bf1d MDL-14460, fix get_context_instance 2008-04-24 08:35:47 +00:00
scyrma 5159864bc6 MDL-3381 - Remove all remaining core calls to ctype_* functions in 1.9, and make ctype required for 2.0. 2008-04-24 03:01:30 +00:00
moodlerobot 3a13bda089 Updated the 19 build version to 20080424 2008-04-24 01:58:22 +00:00
sam_marshall e246e032da MDL-14497 Fixed several minor bugs in navmenu() 2008-04-23 17:07:44 +00:00
tjhunt fb0454d62c Eliminate direct references to $_REQUEST and $_POST in the quiz code.
Also, when you edit the quiz, and therefore any preview attempts are deleted automatically, make sure the attempts are deleted properly by calling quiz_delete_attempt on each one, rathern than leaving orphaned junk in the database.
2008-04-23 14:49:24 +00:00
tjhunt 49676c0186 Improve PHPdocs on a function. 2008-04-23 14:30:47 +00:00
tjhunt 029f59fbd1 MDL-13982 - Performance problem when deleting questions from large question banks. Thanks to Michael Spall for this fix. Merged from MOODLE_18_STABLE.
At the same time, remove direct references to $_REQUEST and $_POST in this code.
2008-04-23 13:45:40 +00:00
tjhunt da7f4c196a Tidy up whitespace. 2008-04-23 10:54:57 +00:00
thepurpleblob a2e867b092 MDL-14461:
The user must be (effectively) be logged in to use this function.
Adding the logged in check means they will be asked if they are not (like
everywhere else)
2008-04-23 08:45:29 +00:00
dongsheng 82b04884f3 MDL-14460, fix get_context_instance, see tracker 2008-04-23 08:11:31 +00:00
moodler 117e675602 MDL-14483 Use the recipient language to send email 2008-04-23 02:24:15 +00:00
dongsheng 055f9be516 MDL-14053, include custom profile fields when export user info, see tracker 2008-04-23 02:03:59 +00:00
moodlerobot 6877f88f86 Updated the 19 build version to 20080423 2008-04-23 01:58:40 +00:00
tjhunt 1dfa763a2f MDL-14352 - General feedback for descriptions not showing up on the review page, as it should. 2008-04-22 16:16:58 +00:00
tjhunt 54ee7246cc MDL-14363 - Fix a broken redirect from mod/quiz/ attempt.php to edit.php when the quiz has not questions.
Also, when the quiz has no questions, disable the Info, Reports and Preview tabs, which, in this case, just redirect back to the Edit tab anyway.

Finally, change a redirect in quiz view.php, which used a relative URL, to a full url starting $CFG->wwwroot.
2008-04-22 15:19:45 +00:00
tjhunt 89f9450834 MDL-14467 - qtype_multichoice help file in the wrong place. 2008-04-22 14:34:18 +00:00
tjhunt afe83312b2 MDL-14407 - supplimental - Deal with another way the category id can be in the URL after it is deleted. 2008-04-22 14:06:57 +00:00
skodak a2067bf38d MDL-14424 approve icon now bigger + css class added 2008-04-22 13:34:40 +00:00
skodak 0d4542e24b MDL-8188 fixed missing global $CFG 2008-04-22 13:03:37 +00:00
skodak a5c9d2e444 MDL-14137 adding minor fix for quotes in fieldname 2008-04-22 07:30:52 +00:00
dongsheng 8ea4e65638 MDL-14460, fix get_context_instance, see tracker 2008-04-22 06:16:17 +00:00
dongsheng a6bc0fd2b6 MDL-14460, fix get_context_instance, see tracker 2008-04-22 06:08:47 +00:00
moodler 98d2cd7f7a MDL-8566 My addition, I fixed the navigation on the Permalink pages to show more information
was:   Site > Blogs

now:   Site > User > Blogs > Full blog title
2008-04-22 05:55:34 +00:00
dongsheng 3ff91874a8 MDL-8566, replace permlink with permalink 2008-04-22 05:16:10 +00:00
dongsheng 84fe017f67 MDL-8566, add lang string to MOODLE_19_STABLE, see tracker 2008-04-22 04:34:24 +00:00
moodlerobot 18877525ef Updated the 19 build version to 20080422 2008-04-22 02:01:40 +00:00
stronk7 94fc397cbb Fixed typo, grrr. 2008-04-21 18:09:15 +00:00
stronk7 1b8a70860d Replace custom casting code by proper sql_cast_char2int() core function. MDL-12893 2008-04-21 18:06:59 +00:00
skodak 4aeccc8bf8 MDL-14458 - optgroups Fields and Other in search menu; removed unused search code, html labels, added option to sort by time modified 2008-04-21 14:15:30 +00:00
skodak 12999c3311 MDL-13025 added data intro text formatting without cleaning - manage activity cap already marked with XSS risk 2008-04-21 13:25:04 +00:00
pichetp ebd585bb42 MDL-14435 Removing capitals merging from head 2008-04-21 02:50:43 +00:00
moodlerobot 0ef7420b0e Updated the 19 build version to 20080421 2008-04-21 01:50:39 +00:00
stronk7 fe9384833b Replace low level $db->Concat() calls to Moodle sql_concat() cross-db alternative. MDL-13823 2008-04-20 22:13:44 +00:00
stronk7 5d75612163 Modify sql_concat() to support all elements being numeric. MDL-13823 2008-04-20 21:18:34 +00:00
skodak 1a19384b18 MDL-8474 stats upgrade now uses editing teachers only 2008-04-20 19:54:28 +00:00
skodak a0b8e7637d MDL-14446 fixed inverted read flag in threaded view 2008-04-20 19:37:28 +00:00
skodak a7285f63b4 MDL-14336 defaultsort now stored as field name in preset.xml 2008-04-20 19:21:13 +00:00
skodak 3d3f891d44 MDL-12861 overriding of database settings now optional when using presets 2008-04-20 10:08:04 +00:00
skodak bccb50caab MDL-13188 asearchtemplate.htlm in presets implemented 2008-04-20 09:28:53 +00:00
stronk7 18fe8f7b9c Restore of blogs in SITE page added. MDL-9089 2008-04-20 01:58:40 +00:00
moodlerobot a9c5278c27 Updated the 19 build version to 20080420 2008-04-20 01:48:11 +00:00
stronk7 8312d945fb Added string to restore blogs. MDL-9089 2008-04-20 01:15:54 +00:00
stronk7 aa80e16b12 Adding some missing course info when backuping blogs. MDL-9089 2008-04-19 22:40:30 +00:00
skodak 38ffb6c139 MDL-14417 fixed sql for menu adv search - multimenu already fixed today 2008-04-19 21:20:56 +00:00
skodak 91cf92265e MDL-14018 fixed ##more## icon regression, thanks Robert Allerstorfer for all the testing! 2008-04-19 21:00:26 +00:00
skodak 8713ac5fd3 MDL-14424 - approval icon is bigger again, it is possible to sort by Approved status now 2008-04-19 20:46:56 +00:00
skodak 9e5ef14437 MDL-14018 fixed ugly query - thanks Eloy 2008-04-19 18:02:39 +00:00
skodak cd42b2be8d MDL-14018 fixed regression, proper LIKE meta quoting, fix displaying when options changed 2008-04-19 16:46:50 +00:00
skodak 631c9f5c49 MDL-9907 xhtml strict 2008-04-19 16:43:21 +00:00
skodak 6ba41390ef MDL-12089 several search related problems fixed in data module 2008-04-19 15:31:16 +00:00
moodler 8118207b6f MDL-12742 Deleted language files from the block, copied english one to correct location in core lang pack. 2008-04-19 13:25:39 +00:00
skodak f021a9119f MDL-13936 forum reply refactoring and bugfixing - the forum_user_can_post() did not have discussion parameter which was a problem because the login depends on discussion group - there was a hack in discussion.php and view.php working around this, but it was not present in cron; sorry for the change of API, but it was required 2008-04-19 10:47:42 +00:00
skodak 857ec70622 MDL-14428 fixed tag cron warning 2008-04-19 09:51:53 +00:00
moodlerobot 52bb51f204 Updated the 19 build version to 20080419 2008-04-19 01:50:22 +00:00
skodak f542e41fdd MDL-13936 improved new lang string 2008-04-18 20:18:18 +00:00
skodak 6fd207292f MDL-13936 indicate that user needs group membership to add new discussion, but only if having the capability to add new discussion - previously the message was incorrectly shown even when not having the cap in separate mode, visible mode needs this message too after previous commit; new lang string added in case user selects all participants in group selector and does not have accessallgroups - the existing group membership string could not be reused 2008-04-18 19:28:49 +00:00
skodak f7e75ede04 MDL-13936 users without accessallgroups can post start discussions only in own groups if groupmode enabled in forum (either separate or visible), this was the way it worked in Moodle <1.8 2008-04-18 18:51:01 +00:00
stronk7 5d64f72c23 MDL-14072 - Prevent NULLs, empties and numbers to be processed by:
- backup_encode_absolute_links() at backup
- restore_decode_absolute_links() at restore
2008-04-18 16:55:29 +00:00
skodak 0e36e50b0b MDL-12895 frontpage participants page improvements 2008-04-18 08:28:58 +00:00
scyrma 0eca93e5be MDL-14104: generate_password() now respects password policy 2008-04-18 07:55:38 +00:00
skodak 9b231c86ec MDL-11511 adding accidentaly removed replacement during last revert 2008-04-18 07:43:18 +00:00
moodler 6c089f4a28 MDL-11323
Cleaned up the display of role aliases by extending get_assignable_roles
and get_overrideable_roles to use role_fix_names better.

The lists of assignable and overrideable are now correctly derived from the
actual context (eg activity or module) while the aliases are derived from course
that is the parent.

Some other cleanups along the way.
2008-04-18 06:18:25 +00:00
moodler fe01ad8ec0 MDL-11142 Roles upgrade was losing timestart and timeend for teachers and students (Merged from 1.7) 2008-04-18 03:31:54 +00:00
dongsheng f6f3408324 MDL-12992, keep roles tabs consistent, see tracker 2008-04-18 03:10:31 +00:00
dongsheng d72e36cce7 MDL-14137, use addslash in get_settings() and remove the second parameter of htmlspecialchars() 2008-04-18 02:11:42 +00:00
moodlerobot bcdc90679d Updated the 19 build version to 20080418 2008-04-18 01:54:30 +00:00
diml ff3af6786d Fixes MDL-14377 UTF8 misconversions in search results 2008-04-17 20:49:18 +00:00
diml 504c188064 Fixes MDL-14325 2008-04-17 20:48:16 +00:00
skodak 6c9af98401 MDL-14052 fixed course display in upcoming events block - credit goes to Greg Rodenhiser 2008-04-17 19:19:11 +00:00
diml 183eb24d8d Fixes all registered unstabilities in MDL-14325, MDL-14328 and closes those buglines.
default values for global search parameters,
command quoting issues status choosed untill better resolution,
typo error in error message
2008-04-17 19:19:04 +00:00
tjhunt be80fc7e66 MDL-14407
1. After deleting a question category, it redirects you back to a question bank URL. In some circumstances, this URL will contain a cat=nnn parameter of the category you have just deleted, which naturally leads to an error. This parameter needs to be removed.

2. When there are questions in the category that need to be moved, the category id we are moving to is not exploded on ','.
2008-04-17 15:59:47 +00:00
wildgirl bff131f52e MDL-14040 help file typo fixes reported by Ray Lawrence 2008-04-17 14:59:30 +00:00
wildgirl 00c573bbce MDL-14040 help file typo fixes reported by Ray Lawrence 2008-04-17 14:49:28 +00:00
wildgirl 257ae54b65 help file typo re-fix, thanks to Ralf Hilgenstock to pointing out the mistake 2008-04-17 13:30:54 +00:00
tjhunt bd5ec8cef4 MDL-8682 - yet another followup. The javascript still was not quite right. you cannot rely on the case of element.nodeName. 2008-04-17 13:07:34 +00:00
wildgirl 8f476f51bf help file typo fix 2008-04-17 13:07:28 +00:00
wildgirl 281295d2b9 MDL-14388 help file rewording 2008-04-17 12:20:44 +00:00
dongsheng 1987fb0808 MDL-14320, remove useless icon in edit entry page 2008-04-17 09:41:56 +00:00
moodler 0a8b14d0d7 MDL-14399 Applied RTL patches from Hebrew team without modification. They look OK to me and won't affect LTR as far as I can tell. 2008-04-17 08:28:24 +00:00
dongsheng fc0a3140db MDL-11511, use a new version to avoid potential problems. 2008-04-17 08:09:35 +00:00
scyrma f0a6326181 MDL-12860 - do input sanitization early, so as to not mess up display later 2008-04-17 08:01:40 +00:00
dongsheng 2004936d44 MDL-11511, revert changes, see tracker 2008-04-17 07:51:39 +00:00
dongsheng 850d5da191 MDL-11511, revert changes, see tracker 2008-04-17 07:38:26 +00:00
dongsheng 4b6c7b206b MDL-11511, revert the changes, see tracker 2008-04-17 07:34:57 +00:00
moodler 08b8a69610 MDL-12279 RTL fix for category number alignment 2008-04-17 07:18:27 +00:00
dongsheng 69ef0b666c MDL-11511, make logic more clear 2008-04-17 05:57:37 +00:00
dongsheng d77d361e3d MDL-11511, two new caps are introduced, see tracker 2008-04-17 05:39:47 +00:00
dongsheng c4abdd2816 MDL-14137, donot filter single and double quote anymore, see tracker 2008-04-17 02:58:03 +00:00
dongsheng 96a8c8e639 MDL-8188, add approve.gif to chameleon theme 2008-04-17 02:26:41 +00:00
moodlerobot 9e7f36a948 Updated the 19 build version to 20080417 2008-04-17 01:52:25 +00:00
moodlerobot 527f62f6af Automatic installer.php lang files by installer_builder (20080417) 2008-04-17 01:45:47 +00:00
skodak 35ef2c8919 MDL-9907 searching ilike pg compatibility fix 2008-04-16 18:56:31 +00:00
tjhunt e24aa3d6ba MDL-14392 - Notice from description question types when you don't have edit permission 2008-04-16 16:56:34 +00:00
skodak afece01121 MDL-14018 fixed searching when date order selected 2008-04-16 15:08:33 +00:00
skodak 38d6fc273a MDL-14018 fixed searching when date order selected 2008-04-16 15:07:12 +00:00
skodak f271e4112e MDL-14390 fixed saving of multiselect field type 2008-04-16 14:50:58 +00:00
tjhunt b63b26f1aa MDL-14391 - Timestart shown twice in quiz overview report, instead of timefinish 2008-04-16 14:39:39 +00:00
skodak ae65fba742 MDL-14389 fixed adv search flag storage 2008-04-16 14:08:34 +00:00
skodak 33096a7bb9 MDL-9907 searching/sorting by author name fixed when paging, MDL-14389 more transition fixes 2008-04-16 13:52:32 +00:00
skodak 05cdffa828 MDL-9907 searching/sorting by author name fixed when paging, MDL-14389 more transition fixes 2008-04-16 13:52:32 +00:00
skodak 49a60852e8 MDL-14389 fixed transition from advanced to simple view if multiple fields used 2008-04-16 13:31:00 +00:00
skodak 309b6caaa5 MDL-14018 advanced search for multiselect menu improved 2008-04-16 13:19:46 +00:00
skodak bf44458bd2 MDL-14388 shuffling the field/butting lists a bit 2008-04-16 12:29:21 +00:00
skodak 14e404f960 MDL-9758 backported timeadded and timemodified + improved lang strings 2008-04-16 12:03:28 +00:00
skodak 24ca59f03e MDL-9907 searching/sorting by author name 2008-04-16 11:44:52 +00:00
dongsheng 7c589aa751 MDL-8566, add permlink, see tracker 2008-04-16 09:04:45 +00:00
dongsheng 2904df1380 MDL-14249, to keep ods lib exactly the same with excellib, some dummy function added 2008-04-16 07:05:06 +00:00
scyrma 56f2d43291 MDL-3381 - changing call to ctype_space to remove dependency on ctype 2008-04-16 03:35:37 +00:00
dongsheng c4fcff1d13 MDL-14317, fix parameter type, see tracker, thanks Stephen 2008-04-16 03:23:09 +00:00
dongsheng 8c8660ae5c MDL-14320, improve coding style, thanks Petr 2008-04-16 02:43:04 +00:00
dongsheng 612bbdefad MDL-14367, change alt text, see tracker 2008-04-16 02:35:54 +00:00
dongsheng 4c404aa348 MDL14312, remove align attribute in table tag 2008-04-16 02:29:55 +00:00
moodlerobot eefe474a0d Updated the 19 build version to 20080416 2008-04-16 01:50:00 +00:00
skodak 075d93f958 MDL-14113 fixed forum_count_user_posts() regressions - thanks Dan! 2008-04-15 21:56:14 +00:00
stronk7 e8ee249670 Finally fixed version of lastaccess hadling.
Moved from add_to_log() to require_login(). MDL-14272
2008-04-15 21:42:50 +00:00
stronk7 afd99f1f07 Correct usage of debugging. MDL-11893 2008-04-15 21:31:10 +00:00
stronk7 7d23ab127f Fixing logic + minor formatting of email. MDL-11893 2008-04-15 20:01:27 +00:00
dongsheng 2df5a942f3 MDL-14311, fix minor html errors 2008-04-15 05:53:51 +00:00
dongsheng 6fdfabaf42 MDL-11893, append failed SQL to email, see tracker 2008-04-15 05:36:25 +00:00
dongsheng 2dd4271bcb MDL-14310, fix minor bug in html, see tracker 2008-04-15 04:21:14 +00:00
dongsheng d64cc008d2 MDL-8188, fix approve.gif icon 2008-04-15 03:53:06 +00:00
dongsheng 6fa83c2add MDL-8188, moved from mod/glossary/check.gif 2008-04-15 03:43:50 +00:00
dongsheng 97da7bed2a MDL-8188, move check.gif to pix/i/approve.gif, see tracker 2008-04-15 03:42:36 +00:00
moodler 364a7f4f98 MDL-4485 Made sure views of the online assignment are logged like the others 2008-04-15 03:40:09 +00:00
dongsheng 03506f373f file approve.gif was added on branch MOODLE_19_STABLE on 2008-04-15 03:43:50 +0000 2008-04-15 03:33:05 +00:00
dongsheng a3691d7ef1 MDL-14314, use css style to close auto-wrap 2008-04-15 03:12:30 +00:00
dongsheng 3be617a985 MDL-14320, remove icon when no file in entry, Thanks Robert 2008-04-15 02:37:29 +00:00
moodlerobot f0c8025bbc Updated the 19 build version to 20080415 2008-04-15 01:58:16 +00:00
stronk7 e5c375e29c Cleanup of phpdoc + some clarifications when specifying colors. MDL-14354 2008-04-14 22:40:55 +00:00
skodak 9032900612 MDL-13936 fixed group handling when adding new discussions 2008-04-14 19:04:00 +00:00
skodak a745c8abee MDL-14113 when adding/editing posts the target group is now visible + fixed permission check when replying (removed obsolete mygroup function) 2008-04-14 18:33:46 +00:00
skodak db4095092f MDL-14113 digest finished message now in system lang + eliminated one has_capability call 2008-04-14 17:11:24 +00:00
skodak 1de384c32d MDL-13004 post ratings in user profile page 2008-04-14 12:03:58 +00:00
skodak 15bf342ec7 MDL-14113 fixed replies regression 2008-04-14 11:32:09 +00:00
skodak db65c8ca8f MDL-14270 separate groups mode and single discussion forums == normal students can not reply 2008-04-14 09:38:04 +00:00
skodak e21607e203 MDL-14270 workaround for FF alignment issue 2008-04-14 09:30:46 +00:00
skodak aeb85c2797 MDL-14270 mode selector alignment for single discussion forums 2008-04-14 09:22:59 +00:00
skodak 354c67d262 MDL-14270 fixed regressions - fatal error in forum code 2008-04-14 08:59:50 +00:00
skodak 10f40eec25 MDL-14349 adv forum search accessibility 2008-04-14 08:50:58 +00:00
skodak 14b2880f3b MDL-12505 general advanced search cleanup + added capability test to recent activity 2008-04-14 08:04:49 +00:00
skodak be22faa965 MDL-14113 fixed notices when tracking disabled 2008-04-14 07:31:24 +00:00
moodlerobot 16f75b4eba Updated the 19 build version to 20080414 2008-04-14 01:56:13 +00:00
moodlerobot 44ad54efea Automatic installer.php lang files by installer_builder (20080414) 2008-04-14 01:50:02 +00:00
stronk7 0cb6604857 Restore to the frontpage should work now (interface). MDL-12760 2008-04-13 23:53:38 +00:00
stronk7 ac1358665d Minor fixes in the restore form when restoring from within SITEID. 2008-04-13 23:26:55 +00:00
skodak add8d12caa MDL-14346 database preset throws Fatal error 2008-04-13 23:00:38 +00:00
skodak ee57cdb57d MDL-14345 undefined contexts and sesskey in new preset_class.php 2008-04-13 22:57:09 +00:00
skodak 1bdbe3964e MDL-14342 fixed wrong quotes 2008-04-13 22:17:08 +00:00
skodak abbf392ed1 MDL-14343 fixed groups_get_user_groups() when groupings disabled 2008-04-13 21:58:31 +00:00
skodak 474ade7a7d MDL-14113 patch for multiple issues - see tracker for subtasks 2008-04-13 19:10:35 +00:00
stronk7 21de682b37 Fixed missing string on restore. MDL-14330 2008-04-13 02:03:21 +00:00
moodlerobot 9df9cacc9c Updated the 19 build version to 20080413 2008-04-13 01:50:39 +00:00
stronk7 d81585ed6a Blogs added to scheduled backup. MDL-9089 2008-04-13 01:34:06 +00:00
stronk7 67a8c620b6 Blogs backup added. MDL-9089 2008-04-13 01:25:55 +00:00
stronk7 e06a19af92 Preparing for blogs backup. New string. MDL-9089 2008-04-13 01:19:05 +00:00
stronk7 34a00a23d5 Preparing for blogs backup. Helper function. MDL-9089 2008-04-13 01:16:16 +00:00
moodlerobot 3ede3c4be6 Updated the 19 build version to 20080412 2008-04-12 01:49:01 +00:00
moodlerobot dfcb02766e Automatic installer.php lang files by installer_builder (20080412) 2008-04-12 01:42:43 +00:00
diml 93bff91055 fixes reported quote issue on $file in shel exec commands (MDL14325) 2008-04-11 23:21:35 +00:00
dongsheng 58ab8bffd3 MDL-14249, add more needed functions to excellib.php 2008-04-11 07:38:54 +00:00
scyrma 7cad8ab660 MDL-9410 - In user profile display, add http:// to web links if it's not already there 2008-04-11 06:57:26 +00:00
dongsheng 37fb4b6c7f MDL-10735, fix worksheet name, thanks our patch Mitsuhiro Yoshida 2008-04-11 05:45:59 +00:00
dongsheng b9d7e5f583 MDL-12662, fix undefined index(IIS) 2008-04-11 05:24:26 +00:00
gbateson 5a761ab83a do not show hidden HotPots on mod/hotpot.index.php 2008-04-11 05:09:01 +00:00
dongsheng 450f580012 MDL-9534, fix xmlize() call 2008-04-11 03:59:14 +00:00
moodlerobot 26687962c2 Updated the 19 build version to 20080411 2008-04-11 01:55:11 +00:00
stronk7 f4cb414111 Check for 60s interval from PHP. Save 3 queries per request. MDL-14272 2008-04-10 20:57:10 +00:00
sam_marshall 0bd80872c5 doc comment change: improved comment on download_file_content to clarify $headers 2008-04-10 12:08:28 +00:00
skodak 7152a7833f MDL-14301 wrong label - credit goes to Daniele Cordella; merged from MOODLE_19_STABLE 2008-04-10 09:07:42 +00:00
skodak 403b1e85d8 MDL-14300 unclosed input - credit goes to Daniele Cordella 2008-04-10 09:04:38 +00:00
moodler 3a23d626f3 MDL-14293 Fixed uninitialised $status variable 2008-04-10 03:33:47 +00:00
moodlerobot 08225e2a51 Updated the 19 build version to 20080410 2008-04-10 01:52:40 +00:00
dongsheng 6b533b4584 MDL-14137, replace htmlentities with htmlspecialchars 2008-04-09 06:07:06 +00:00
dongsheng d17e23ee7a MDL-12611, realign the help icon 2008-04-09 03:43:05 +00:00
dongsheng 2293c3cd02 MDL-12611, realign the metacourse help and cost help icon 2008-04-09 03:32:14 +00:00
dongsheng 9011bb8224 MDL-14128, cannot use a full string in the param. 2008-04-09 03:03:49 +00:00
dongsheng 1bed04c61b MDL-14091, fix myMoodle courses list sort order, Thanks Iñaki 2008-04-09 02:43:51 +00:00
moodlerobot 6bd99cf609 Updated the 19 build version to 20080409 2008-04-09 01:53:55 +00:00
stronk7 5c978acd07 Unset rcahe on UPDATE statements not using dmllib.php. MDL-14257 2008-04-08 23:12:08 +00:00
diml 6aba72e06f fixes slash issues that avoid finding relative pathes to converters 2008-04-08 22:01:09 +00:00
dongsheng 29a2749da5 MDL-12531, make the new member value available to all the affected plugins, thanks, Robert 2008-04-08 05:40:15 +00:00
dongsheng 96eb0bd743 MDL-14079, improve UI consistency 2008-04-08 03:47:59 +00:00
dongsheng cbb5738c23 MDL-12611, fix the alignment of help icons. 2008-04-08 03:28:21 +00:00
scyrma 061a4b01be MDL-13792 - Commiting Patch by Skodak, fixing problem with japanese characters under some conditions. This has been reported to work, if nobody else
comes foward with bugs related to this, it will need to be changed everywhere else where there is no urlencoding done at this time. (1.9 - original
patch)
2008-04-08 03:02:49 +00:00
moodlerobot 3d229827b8 Updated the 19 build version to 20080408 2008-04-08 01:57:47 +00:00
moodlerobot ceb2d03736 Automatic installer.php lang files by installer_builder (20080408) 2008-04-08 01:50:55 +00:00
dongsheng 93e32c5f7f MDL-14085, roll back some error() call 2008-04-08 01:45:25 +00:00
stronk7 1a13367f78 Respect inherited default enrol method when deciding to display the course cost. MDL-14096 2008-04-07 23:42:54 +00:00
diml d3d9d95f42 sync with HEAD/1.8 compatible 2008-04-07 21:45:07 +00:00
diml ee95c70444 sync with HEAD/1.8 compatible 2008-04-07 21:34:17 +00:00
diml ab42d25ac1 updating Zend engine to 1.5.0 2008-04-07 21:32:52 +00:00
diml 3ae9e88793 global sync to HEAD for passing fixes 2008-04-07 21:28:10 +00:00
diml c5244b4f3e file Wildcard.php was added on branch MOODLE_19_STABLE on 2008-04-07 21:32:53 +0000 2008-04-07 20:45:44 +00:00
diml 7ba9cd4a78 file Range.php was added on branch MOODLE_19_STABLE on 2008-04-07 21:32:53 +0000 2008-04-07 20:45:43 +00:00
diml be69717a20 file Insignificant.php was added on branch MOODLE_19_STABLE on 2008-04-07 21:32:53 +0000 2008-04-07 20:45:43 +00:00
diml e66bb1797e file Fuzzy.php was added on branch MOODLE_19_STABLE on 2008-04-07 21:32:53 +0000 2008-04-07 20:45:43 +00:00
diml 4a8da19c12 file LowerCaseUtf8.php was added on branch MOODLE_19_STABLE on 2008-04-07 21:32:53 +0000 2008-04-07 20:44:21 +00:00
diml fa34b952f9 file CaseInsensitive.php was added on branch MOODLE_19_STABLE on 2008-04-07 21:32:53 +0000 2008-04-07 20:43:30 +00:00
diml ef04e681c9 file LockManager.php was added on branch MOODLE_19_STABLE on 2008-04-07 21:32:52 +0000 2008-04-07 20:38:19 +00:00
skodak c6569182cc MDL-14240 reverting previous commit 2008-04-07 12:15:20 +00:00
moodlerobot e04de8e20b Updated the 19 build version to 20080407 2008-04-07 01:53:08 +00:00
mudrd8mz 5b28f2b17f MDL-13997 Correct linking between missing mode and compare mode. Backported from HEAD. 2008-04-06 19:41:59 +00:00
joseph_rezeau c07d5ff235 emoved mistakenly committed clozejr format 2008-04-06 17:46:55 +00:00
joseph_rezeau 62382645cb closejr small hack to "pseudo-export" the questions inside a category into a new, unique cloze/multianswer question - by Joseph R?zeau 2008-04-06 17:14:27 +00:00
stronk7 3a6a84b79b Enforce DOT as decimal separator for Oracle. MDL-11629 2008-04-06 15:30:17 +00:00
moodlerobot 8cfb08638b Updated the 19 build version to 20080406 2008-04-06 01:47:38 +00:00
moodlerobot bc65820fd0 Updated the 19 build version to 20080405 2008-04-05 01:33:13 +00:00
stronk7 f45a63ee62 Documenting local hack about MDL-14215 2008-04-04 22:33:39 +00:00
stronk7 7e56570572 Fixed bug preventing correct detection of enums under mysqli. MDL-14215 2008-04-04 19:53:25 +00:00
stronk7 136c064f3a Fix wrong conversion from '0' to '' in oracle_diry_hack. MDL-14182 2008-04-04 11:19:36 +00:00
dongsheng 8ccbb75512 MDL-14079, add "Hidden" string after the hidden teacher, thanks Mathieu 2008-04-04 06:40:34 +00:00
dongsheng f9c06a4b94 MDL-14177, remove the useless h1 tags 2008-04-04 06:23:21 +00:00
dongsheng 78bc1f9ce6 MDL-10662, I found these bugs when I was working on MDL-14068 2008-04-04 04:32:59 +00:00
moodlerobot 022de3941f Updated the 19 build version to 20080404 2008-04-04 01:32:47 +00:00
moodlerobot 5133ebb08c Automatic installer.php lang files by installer_builder (20080404) 2008-04-04 01:26:29 +00:00
stronk7 c98670a5e3 Fixed DST calculation when requesting explicit (parameter) timezones. MDL-14093 2008-04-03 18:01:39 +00:00
moodlerobot bd0dc7fe3d Updated the 19 build version to 20080403 2008-04-03 01:26:04 +00:00
stronk7 df681accd9 MDL-13900 - If the course or the parent category are hidden and the user hasn't the 'course:viewhiddencourses' capability, prevent access 2008-04-03 00:57:31 +00:00
thepurpleblob 282cd5aec2 Replaced some nasty 'magic numbers' with defines. 2008-04-02 13:57:56 +00:00
nicolasconnault fbf5f5c483 MDL-14026 Backported the changes to the grade help files in HEAD 2008-04-02 06:54:03 +00:00
skodak 808bdc658a fixed typo 2008-04-02 06:50:20 +00:00
skodak 832a20fc17 cvs commmit notification test - fixed tabs 2008-04-02 06:42:58 +00:00
nicolasconnault 78c05837f4 MDL-14081 Adding the fullname value to test grade_outcomes 2008-04-02 06:36:36 +00:00
skodak 9e41616dab MDL-14034 List of participants in SITE course failing... - fixed last access - credit goes to Eloy 2008-04-02 06:33:30 +00:00
dongsheng dbb82a47ca MDL-14128, remove all uses of error(get_string()) 2008-04-02 06:09:56 +00:00
moodlerobot 003f4c662a Updated the 19 build version to 20080402 2008-04-02 03:41:38 +00:00
stronk7 c4e8b525de Force download checkbox is not initialized properly, credit goes to skodak. MDL-14010 2008-04-01 22:16:50 +00:00
skodak 95245d35a6 MDL-14126 fixed undefined message 2008-04-01 19:47:47 +00:00
dongsheng 73c7b457a9 MDL-14126, cron shouldn't print html tags 2008-04-01 16:03:46 +00:00
skodak e43ed443fe MDL-10660 reverting previous changes - see tracker 2008-04-01 08:47:04 +00:00
dongsheng 5957e19ae3 MDL-14085, Make print_error() autonomous 2008-04-01 06:15:54 +00:00
dongsheng 56fcf4b1b2 MDL-14111, multilang htmlblock title 2008-04-01 06:00:09 +00:00
dongsheng ad1db4c380 MDL-14111, change it back. 2008-04-01 05:30:18 +00:00
dongsheng 38b8f21410 MDL-14085, Move error() to deprecatelib.php 2008-04-01 04:07:01 +00:00
moodlerobot 525afa8223 Updated the 19 build version to 20080401 2008-04-01 03:36:11 +00:00
dongsheng 1ac8d21f76 MDL-14111, Multilang html-block title, thanks Gordon Bateson 2008-04-01 01:34:35 +00:00
stronk7 e76ddb2da6 Prevent cloning of non-object. Delegate to parent method as fallback. MDL-14120 2008-03-31 22:50:35 +00:00
tjhunt d3bba8da1b MDL-8682 - the last commit caused a regression that stopped it working.
!something==somethingelse

is not the same as

something!==somethingelse

in javascript, it seems.
2008-03-31 15:07:16 +00:00
nicolasconnault 08cebb831a MDL-14073 New param for download_file_content: skipcertcheck. ssl now used in recaptchalib. Merging from HEAD 2008-03-31 12:17:59 +00:00
scyrma ec8f711d06 MDL-14103 - remove the call to s() - the string has to already be in html format. 2008-03-31 06:52:16 +00:00
nicolasconnault dddf8e46ef MDL-13397 Fixed the language string. Merging from HEAD 2008-03-31 06:16:09 +00:00
moodlerobot 7b05b2702e Updated the 19 build version to 20080331 2008-03-31 03:38:22 +00:00
skodak 40b3f45dec MDL-8270 ignore blocks that can not be instantiated 2008-03-30 14:35:12 +00:00
moodlerobot 0651a3115b Updated the 19 build version to 20080330 2008-03-30 03:37:10 +00:00
stronk7 1f579d5052 Not visible courses don't cause unenrolment under LDAP anymore. Credit goes to Iñaki Arenaza. MDL-14097 2008-03-30 00:44:23 +00:00
moodlerobot 4048d5cf73 Updated the 19 build version to 20080329 2008-03-29 03:30:40 +00:00
moodler 7942f4377a MDL-14086 Hide navigation tabs when being forced to complete profile 2008-03-28 06:32:13 +00:00
moodlerobot 515ae2a180 Updated the 19 build version to 20080328 2008-03-28 03:38:17 +00:00
nicolasconnault 60ddeb3f09 MDL-14065 Fixed gradebook unit tests, including a bug fix in grade_item class.
Commented out buggy backuplib tests, and replaced E_ALL with DEBUG_DEVELOPER in dmllib tests

Backporting from HEAD
2008-03-27 17:13:00 +00:00
skodak afe0df456f MDL-14077 Mails form messages not RFC2822 conform 2008-03-27 17:08:51 +00:00
skodak cb5f71b27f MDL-14074 removed obsoleted $CFG->enablerecordcache = true; backported from HEAD 2008-03-27 08:48:34 +00:00
skodak 07c2d960d0 MDL-14074 removed obsoleted $CFG->enablerecordcache = true 2008-03-27 08:35:34 +00:00
gbateson f44721b9f7 fix typo: switch (HOTPOT_DISPLAYNEXT_QUIZ)
should be: switch ($hotpot->displaynext)
2008-03-27 08:16:44 +00:00
gbateson 37b267d4ec fix hotpot version number so hotpot_update_grades is correctly triggered. New version is 2007101511 2008-03-27 07:23:31 +00:00
gbateson e55ee4ba01 force hotpot grades (pre Moodle 1.9 on 27th Mar 2008) to be updated:
(1) call "hotpot_updated_grades()" from db/upgrade.php
    (2) fix typo in "hotpot_updated_grades()" - "s.id' should be "h.id"
    (3) micro-increment version number to trigger the update
2008-03-27 03:41:43 +00:00
moodlerobot cde5a89a74 Updated the 19 build version to 20080327 2008-03-27 03:37:22 +00:00
stronk7 d86eb86faa Change tooltip text by Helen's suggestion. MDL-13940 2008-03-26 23:49:54 +00:00
thepurpleblob 24037e0f07 Fixed typo in debug message, causing notice 2008-03-26 15:11:19 +00:00
sam_marshall f1d31dfee3 MDL-14051 Changed timeout behaviour for download_file_content so curl has a read timeout 2008-03-26 12:59:51 +00:00
skodak 2feaf50aa1 MDL-14060 fixed cm caching in forum cron 2008-03-26 09:16:06 +00:00
moodlerobot f0cf5bc1d3 Updated the 19 build version to 20080326 2008-03-26 03:41:59 +00:00
moodlerobot 27e661082b Automatic installer.php lang files by installer_builder (20080326) 2008-03-26 03:28:14 +00:00
scyrma d6be0ca412 MDL-14057 - Change position of the continue button. 2008-03-26 03:00:42 +00:00
dongsheng a057fabf60 MDL-13151, add a new language string: phone2, thanks for your idea, James 2008-03-26 02:46:48 +00:00
dongsheng e4d75c6f2e MDL-12531 add institution to lockable fileds, thanks for your patch, Lgor Plisco 2008-03-26 02:26:25 +00:00
dongsheng c9f43908a4 MDL-10660, check whether memcache has been installed. 2008-03-26 02:18:53 +00:00
skodak 9e13cb7144 MDL-13360 fixed regression - notifications going more than once a day 2008-03-25 23:03:24 +00:00
jmg324 402b744fd6 added new gradebook preference for backup silently function to avoid notice errors later in backup process. 2008-03-25 15:40:27 +00:00
poltawski ffa16956e6 MDL-14050 - count(FALSE) == 1 . This was causing fatal errors when scorm_scoes were
empty.
2008-03-25 14:36:34 +00:00
scyrma 4aee1d4ecb small code cleanup 2008-03-25 09:35:56 +00:00
moodlerobot 6a6723a267 Updated the 19 build version to 20080325 2008-03-25 03:37:11 +00:00
moodlerobot 44c109eb7e Automatic installer.php lang files by installer_builder (20080325) 2008-03-25 03:25:12 +00:00
scyrma 830abccdda MDL-14041 - Hide 'manage tags' when access is not permitted 2008-03-25 01:44:54 +00:00
dongsheng bc673426bd MDL-10606 Corrected course search box id 2008-03-25 01:23:16 +00:00
stronk7 09d10cdc1a Fix visualization under FF. MDL-14039 2008-03-24 23:05:13 +00:00
stronk7 6b98139026 New string for hidden roles eye in participants page. MDL-13940 2008-03-24 22:07:15 +00:00
stronk7 be24cfe9c2 If the user has hidden role assignments, the icon should be the closed eye. MDL-13935 2008-03-24 22:04:37 +00:00
skodak 6f5d60121b MDL-14023 frontpage edit summary centering issue 2008-03-24 20:23:57 +00:00
skodak 0ea152345f MDL-14032 rewritten forum_tp_clean_read_records() - it should not run out of memory anymore + other minor memory savings 2008-03-24 19:50:26 +00:00
stronk7 1ebff51139 Restore escaped from latest tag-lib refactoring. MDL-14038 2008-03-24 16:37:46 +00:00
stronk7 8809f87505 Adding help file for forcedownload option. MDL-14010 2008-03-24 10:32:49 +00:00
stronk7 afe91850a8 Added missing string for forcedowload option. MDL-14010 2008-03-24 10:29:32 +00:00
moodlerobot a393ece095 Updated the 19 build version to 20080324 2008-03-24 03:32:53 +00:00
stronk7 612b2f8c2c Make list of participants to work on SITE course. Fix for MDL-14034 2008-03-24 01:27:50 +00:00
skodak 7912ecb1b1 MDL-14029 html2text throws tons of notices is style or script tags found 2008-03-23 16:51:05 +00:00
skodak bc0dc73d24 MDL-14027 cron sometimes hangs in rss_client block 2008-03-23 16:23:48 +00:00
skodak 2dc6c4abe2 MDL-8270 full block backup/restore - based on patches by Mark Nielsen and code in HEAD by Tim Hunt 2008-03-23 15:56:03 +00:00
skodak a18258a969 MDL-8270 full block backup/restore - based on patches by Mark Nielsen and code in HEAD by Tim Hunt 2008-03-23 15:50:08 +00:00
moodlerobot 90165e2d01 Updated the 19 build version to 20080323 2008-03-23 03:30:16 +00:00
stronk7 af0322b9b3 Update timezone rules to tzdata2008a. MDL-14024 2008-03-22 23:36:14 +00:00
skodak 4c86245c5e MDL-14008 various SUM aggregation bugfixes 2008-03-22 21:25:39 +00:00
skodak b8ad30bec7 MDL-14008 various SUM aggregation bugfixes 2008-03-22 21:19:08 +00:00
skodak c78e0578f7 MDL-14021 replaced sloppy JOIN ON TRUE with CROSS JOINs - ora or ms does not like it 2008-03-22 20:21:25 +00:00
moodlerobot 1de8fe9ea6 Updated the 19 build version to 20080322 2008-03-22 03:30:43 +00:00
ethem aebf995894 get_recordset() for performance 2008-03-21 12:08:28 +00:00
moodlerobot 440f829392 Updated the 19 build version to 20080321 2008-03-21 03:29:08 +00:00
skodak fd25cefe34 MDLSITE-320 some debug code for digest times in forum cron 2008-03-20 22:31:06 +00:00
skodak 5452f37f23 MDL-2674 minor lang improvement 2008-03-20 21:16:32 +00:00
wildgirl 34aa9e6818 MDL-2674 PHP code removed from help file, small rewording 2008-03-20 21:07:50 +00:00
wildgirl 0f3cf17a4b MDL-2674 PHP code removed from help file 2008-03-20 20:48:20 +00:00
skodak fe3987a324 MDL-13619 legacy restore revisited -fixed sortorder 2008-03-20 20:07:35 +00:00
skodak 40af907f97 MDL-13393 detect broken cm instances when doing backup - prevents trouble during restore 2008-03-20 19:39:08 +00:00
diml 30ab1999fb shooting out debug code see MDL-13993 2008-03-20 19:31:42 +00:00
skodak d3d7ba8f7a MDL-13619 legacy restore revisited 2008-03-20 19:15:38 +00:00
poltawski e4c6b6b470 MDL-13994 - lang typo, thanks to Charles Kelly 2008-03-20 12:19:26 +00:00
ikawhero 16aa360aac Fixed typo that was affecting the reordering of custom profile fields.
MDL-13909.
2008-03-20 09:14:47 +00:00
dongsheng cd3a029451 MDL-12263, under certain conditions, $catctxids is NULL, so an if statement should be here. 2008-03-20 07:16:33 +00:00
scyrma 6d8c1e5e58 MDL-13985 - removed call to get_string, translation of this string made no sense and broke badly. 2008-03-20 07:04:02 +00:00
nicolasconnault 1ca801982a MDL-13880 Overridden and excluded grades are now coloured with alternate row colours that override the default alternate row colours (gray). I also fixed the long-standing notice about aggregationposition. See attached patch. Merging from HEAD 2008-03-20 06:26:20 +00:00
moodlerobot 3f86d1c681 Updated the 19 build version to 20080320 2008-03-20 03:36:24 +00:00
scyrma f52c805656 MDL-13959 - Fix from Eloy - this makes the timezone-related functions accept an optional parameter different from the current user timezone. 2008-03-20 02:59:50 +00:00
skodak 2934dce435 MDL-13899 force resending of all assignment grades into gradebook so that the submitted and graded dates get updated 2008-03-19 23:18:59 +00:00
skodak 9bb38ad7d2 MDL-13990 ignore bogus dirs in moodledata/user during upgrade 2008-03-19 23:07:53 +00:00
skodak 567c3be0a2 MDL-13986 "User view" Activity report links are invalid - patch by Matthew Davidson 2008-03-19 22:46:48 +00:00
skodak 945fec4e6d MDL-13899 improved submission and grading date hack 2008-03-19 22:38:09 +00:00
skodak 5db52de0fa MDL-13899 assignments should be now sending proper submissions and grading dates into gradebook 2008-03-19 22:33:18 +00:00
nicolasconnault 28df24fc95 MDL-13880 Overridden and excluded grades are now coloured with alternate row colours that override the default alternate row colours (gray). I also fixed the long-standing notice about aggregationposition. See attached patch. Backporting from HEAD 2008-03-19 16:16:20 +00:00
tjhunt 50522dae6e MDL-13978 - Notice when adding a new quiz 2008-03-19 12:21:54 +00:00
skodak 0e432a1d81 MDL-13811 p() can not be used to print html text, it does plaintext only or form values & button names 2008-03-19 10:46:32 +00:00
scyrma f9bc559511 MDL-13934 - Commit patch by Eloy - prevent display of moodle docs link on redirect pages 2008-03-19 08:18:48 +00:00
scyrma ab14532e7f MDL-12093 - remove added classes - they don't help the issue and clutter the code 2008-03-19 08:15:40 +00:00
scyrma 79d3cc8589 MDL-13434 Addslashes removed, is added whenever necessary in tag/lib.php. 2008-03-19 08:11:02 +00:00
scyrma 5198be103b MDL-12235 deprecated document_file function. Not found anywhere in core. 2008-03-19 07:56:56 +00:00
moodler b6f293036f MDL-13810 Fixed check for join 2008-03-19 07:48:45 +00:00
moodlerobot da336c9649 Updated the 19 build version to 20080319 2008-03-19 03:36:36 +00:00
skodak c014235e75 MDL-13899 feedback itself is a type of grading - date graded is now affected by feedback too 2008-03-18 23:20:13 +00:00
skodak 6ace2cf04c MDL-13899 feedback itself is a type of grading - date graded is now affected by feedback too 2008-03-18 22:54:14 +00:00
skodak 688b962ee4 MDL-13610 made assignment submissions table 100% wide 2008-03-18 17:18:01 +00:00
skodak 792068fa8d MDL-11007 groupmembersonly support for glossaries 2008-03-18 17:11:53 +00:00
skodak 592d0165e9 MDL-10990 forum perf revisited - reply and post discussion buttons now back for guests 2008-03-18 17:07:00 +00:00
skodak 3f21bfb704 MDL-13807 assignment_showrecentsubmissions does not hide submissions on recent activity full report - patch by Jason Meinzer 2008-03-18 16:44:25 +00:00
skodak dda0672145 MDL-13824 use 0 for all groups - patch by ELoy 2008-03-18 16:41:53 +00:00
skodak 563392734f MDL-13921 Incorrect access given to members of group included in 2 groupings 2008-03-18 16:37:21 +00:00
nicolasconnault c77cf00618 MDL-13953 The dropdown was not populated using the same methods as elsewhere in Moodle. Backporting from HEAD 2008-03-18 16:03:00 +00:00
scyrma 0584008dc4 MDL-13594 - Fixes a display problem with "flagged" tags, code cleanup, other small fixes.
MDL-13434 - Cleaned up a bit more the api
MDL-13687 - If a manual relation is added to a tag, the opposition relation will be added at the same time.
2008-03-18 08:29:19 +00:00
skodak f8eacd07ec MDLSITE-320 digest processing should be able to continue without duplicates if fails 2008-03-18 08:26:45 +00:00
moodlerobot 13dbf19ec1 Updated the 19 build version to 20080318 2008-03-18 03:37:42 +00:00
scyrma 541b11c434 MDL-12514 - Added missing js library (thanks Johannes Albert) and fixed missing string escaping. 2008-03-18 01:20:50 +00:00
skodak 45d3c87b30 MDL-2674 adding $cm->grouping reset if groupings not restored; removed info about groups included in backup - they are always included, and there will not be any global groups/groupings 2008-03-17 21:54:47 +00:00
skodak c153af6351 MDL-2674 backup always backsup/restores groups regardless of user settings; backported from HEAD 2008-03-17 21:27:53 +00:00
skodak 8527371af3 MDL-13847 gradebook backup/restore fixes, xhtml strict fixes, other minor fixes 2008-03-17 19:36:35 +00:00
nicolasconnault 889aaef90e MDL-13743 Added realmedia support. Merging from MOODLE_18_STABLE 2008-03-17 13:14:31 +00:00
nicolasconnault ed75557ce9 MDL-13903 New file resource option for forcing the download of the file instead of embedding it. Backporting from HEAD 2008-03-17 12:56:37 +00:00
skodak 6b3281b20e MDL-13949 removed adobe reader XSS bug workaround 2008-03-17 12:35:35 +00:00
stronk7 2a5d6b8035 Glossary extended search fixed. MDL-13947 2008-03-17 12:29:13 +00:00
moodlerobot 86a226f6ca Updated the 19 build version to 20080317 2008-03-17 03:36:04 +00:00
skodak 2b47d8926a MDL-13943 improved perf when sending multiple grades into grade_update() 2008-03-16 23:21:35 +00:00
skodak 931ad967da MDL-13945 prevent fatal errors in all rs_xx functions 2008-03-16 22:46:31 +00:00
skodak 57525b9420 MDL-13944 rs_close() does not throw fatal error if rs does not exist aynmore 2008-03-16 22:06:55 +00:00
moodlerobot 267ecadfe9 Updated the 19 build version to 20080316 2008-03-16 03:34:15 +00:00
skodak 9e8a2d77ef MDL-13939 stats produce bogus role/course data if user has several different enrolments 2008-03-16 01:23:35 +00:00
diml f0bb791809 syncing with other branches block level lang packs for search. 2008-03-15 23:22:11 +00:00
skodak 435dd405d5 MDL-13866 adding warning that regrading of forums may take a while 2008-03-15 22:50:28 +00:00
stronk7 f47b53dd0a Prevent duplicate users in list when user has both visible and hidden roles. MDL-13935 2008-03-15 21:52:10 +00:00
skodak 37168eadd6 MDL-13920 adding warning that regrading of assignments may take a while 2008-03-15 18:51:50 +00:00
skodak 96015624c1 MDL-13412 Allow callers of email_to_user() to set wordwrap 2008-03-15 17:03:27 +00:00
skodak a1ac8fd963 MDL-13893 fixed hiding of editor buttons, added labels there too 2008-03-15 16:36:23 +00:00
skodak 043fd9c793 MDL-13927 indicate missing parent languages 2008-03-15 16:09:50 +00:00
skodak 72ec0c3baa MDL-13927, MDL-13938 indicate missing parent languages and allow multiselection when importing langs 2008-03-15 16:08:23 +00:00
skodak 5a79a02a79 MDL-13093 "Continue" link jumps over items 2008-03-15 15:04:29 +00:00
skodak 5d0160f8f5 MDL-13886 whitelist text-decoration in kses cleaning 2008-03-15 15:00:03 +00:00
skodak d332a153a8 MDL-13920 assignment without grades now sets text grade type, fixed overriding of feedback and overriding logic in general on grade edit page 2008-03-15 14:54:07 +00:00
moodlerobot c9cebbcdaf Updated the 19 build version to 20080315 2008-03-15 03:38:08 +00:00
moodlerobot 02c62cb3d5 Automatic installer.php lang files by installer_builder (20080315) 2008-03-15 03:23:53 +00:00
gbateson cbebda6a36 require_once $CFG->dirroot."mod/hotpot/lib.php"; // get the "hotpot_is_visible" function 2008-03-15 01:17:01 +00:00
scyrma 892174bda5 MDL-13236 fixes a regression - thanks to Steve Wright for the patch. 2008-03-14 08:19:50 +00:00
moodlerobot 098a9ff379 Updated the 19 build version to 20080314 2008-03-14 03:35:37 +00:00
moodlerobot eb2af98aaa Automatic installer.php lang files by installer_builder (20080314) 2008-03-14 03:23:15 +00:00
nicolasconnault 7ee7cb758a MDL-13796 Committing new recaptcha element. Merging from HEAD 2008-03-13 15:45:31 +00:00
sam_marshall c147575b6c MDL-13915: Fixed add_to_log when very long url is specified (now doesn't try to insert more than 100 chars into database) 2008-03-13 15:25:12 +00:00
nicolasconnault 5fd87bf13c MDL-13919 Fixed undefined variable. Merging from MOODLE_18_STABLE 2008-03-13 14:02:34 +00:00
nicolasconnault ce60661535 MDL-13300 Adds verbosity to the heading above the list of participants, showing which group is selected, and the inactivity time period, if either of these two filters are used. Merging from HEAD 2008-03-13 12:17:27 +00:00
wildgirl 976b0d2f2f MDL-12251 lang string typo fix 2008-03-13 10:22:34 +00:00
scyrma 2f06efca9a Fixed a bug introduced somewhere down the late modifications.. 2008-03-13 08:34:57 +00:00
moodlerobot 4db516ba85 Updated the 19 build version to 20080313 2008-03-13 03:37:40 +00:00
skodak 65299ae590 MDL-13845 rewritten rounding in grades classes again - rounding done also before storage into db so that we can compare the values properly and skip db updates if possible + some more optimisations 2008-03-12 19:44:39 +00:00
nicolasconnault 5673b0ce58 MDL-13796 Backported recaptcha element from HEAD. 2008-03-12 12:37:34 +00:00
nicolasconnault 19466f5699 file recaptcha.html was added on branch MOODLE_19_STABLE on 2008-03-12 12:37:34 +0000 2008-03-12 06:56:37 +00:00
moodlerobot 4646b94ab0 Updated the 19 build version to 20080312 2008-03-12 03:46:53 +00:00
moodlerobot f54f4b22a9 Automatic installer.php lang files by installer_builder (20080312) 2008-03-12 03:33:00 +00:00
skodak 0690424663 MDL-13895 incorrect title and alt on grade edit icon in gradebook reports 2008-03-11 23:58:51 +00:00
danmarsden 320ce836d1 MDL-13892 partial fix - check var first before using! 2008-03-11 19:00:38 +00:00
thepurpleblob 673e73d799 MDL-13872:
Display a dash when no grade info, suppresses notice.
2008-03-11 14:24:12 +00:00
skodak fd74d39545 MDL-13884 fixed incorrect left join, thanks Tim 2008-03-11 10:50:58 +00:00
skodak 8a55979706 MDL-13884 Students assigned at site or course category level do not appear in grader report 2008-03-11 09:50:26 +00:00
skodak a2051dc458 MDL-13885 fixed participation report problems 2008-03-11 09:20:29 +00:00
skodak e1e2d33d8a MDL-13881 fixed silly logic bug when disabling rcache - patch by Matt Clarkson 2008-03-11 09:04:29 +00:00
ethem 0b82096d87 Race condition in cron for Scheduled-Capture (very very big sites and order review enabled only).
In one cron, 250-500 orders may be processed (based on 5 minutes).
If an admin sets cron time up smaller than 5 minutes and
250-500> new transactions are made after last cron executed, it can be blocked.
Authorize cron sets up an_lastcron every time when admin/cron.php executes.
This must be set up after blocking check code.

As result, if pending orders aren't accepted with in 30 days at payment management page, they expired and users cannot enrol.
When an admin enabled order review, he is guaranteed 'Payment managers accept/deny transactions manually'.
Scheduled-Capture is designed for forgotten orders only ;)

Backported from HEAD.
2008-03-11 08:26:42 +00:00
moodlerobot 81e8e321cc Updated the 19 build version to 20080311 2008-03-11 03:50:05 +00:00
moodlerobot 6d6d43d1df Automatic installer.php lang files by installer_builder (20080311) 2008-03-11 03:32:52 +00:00
pichetp c59a69dab8 MDL-12421 rounding merging from head a little correction line 77 2008-03-10 21:29:07 +00:00
skodak 7ff4e151ed MDL-13866 scale ratings do not work in forum 2008-03-10 21:18:44 +00:00
skodak bbf2de8d3b MDL-13866 fixed stupid bug in my last commit 2008-03-10 21:17:18 +00:00
skodak 5c691fc5fc MDL-13866 fixed stupid bug in my last commit 2008-03-10 21:16:57 +00:00
skodak e694d551b5 MDL-13878 use ints for old values of scales in grader report 2008-03-10 20:24:11 +00:00
garethmorgan e83460ac86 Populated $overridableroles and $assignableroles to make roles tags accessible. MDL-13803 2008-03-10 19:01:32 +00:00
nicolasconnault 49e1894df3 MDL-13796 Most of the recaptcha implementation is done. 2008-03-10 17:21:32 +00:00
andreabix 688df1279e fixed [MDL-13181] 2008-03-10 16:27:05 +00:00
andreabix c281745c42 Fixed [MDL-12830] 2008-03-10 15:53:10 +00:00
andreabix 361536479a Added grade pass/fail colours. Fixed label line height in course page 2008-03-10 15:13:34 +00:00
pichetp 4272fc068c nextpageparam["forceregeneration"] was not implemented correctly line 582 merging
from head
2008-03-10 12:00:58 +00:00
nicolasconnault 2b00d67a44 MDL-13789 Updating index.html and editing decimalpoints.html 2008-03-10 11:27:08 +00:00
nicolasconnault 5f58a4a398 MDL-13789 Removing useless files. 2008-03-10 10:46:12 +00:00
skodak a55cfa4fa1 MDL-13866 scale ratings do not work in forum; merged from MOODLE_19_STABLE 2008-03-10 10:45:49 +00:00
nicolasconnault 3fecb85f5b MDL-13789 Removing useless files. 2008-03-10 10:41:07 +00:00
skodak f74e0556dd MDL-13866 scale ratings do not work in forum 2008-03-10 10:40:21 +00:00
nicolasconnault de5971270b MDL-13852 Fixed help string links. 2008-03-10 10:11:15 +00:00
skodak 0f332452fe MDL-13863 detect missing idnumbers in formulas after restore 2008-03-10 09:34:52 +00:00
skodak 29ed8ead20 MDL-13862 grader report - do not show column averages if error found 2008-03-10 09:32:25 +00:00
nicolasconnault 1505b92d40 MDL-13830 Added colours for gradepass and gradefail. 2008-03-10 06:36:43 +00:00
moodlerobot c1a8231dfa Updated the 19 build version to 20080310 2008-03-10 04:31:07 +00:00
gbateson 0c11a3b0df add "mp3" (used by DewPlayer) to the list of query string parameters to search for when converting relative urls to absolute urls 2008-03-10 01:35:28 +00:00
stronk7 a72cd02f9e Ensure only target groups_members are added to backup. MDL-12453 2008-03-09 17:26:25 +00:00
moodlerobot 9046955f03 Updated the 19 build version to 20080309 2008-03-09 03:50:20 +00:00
arborrow a93679c79b MDL-13593 - added statement about non case sensitivity 2008-03-09 02:40:32 +00:00
skodak 52d6376cb9 MDL-13853 automatic fixing of incorrect grade category paths 2008-03-08 23:22:34 +00:00
skodak 5ce37277d3 MDL-13853 incorrect paths when moving grade categories - affects aggregation in subcategories 2008-03-08 22:37:27 +00:00
stronk7 5b7a62a269 Wood-ize groupinfo boxes. 2008-03-08 22:28:06 +00:00
skodak 9312d39243 MDL-13851 fixed disappearing grade categories in PHP4 2008-03-08 22:11:56 +00:00
skodak 83bf96e1ee cosmetic fix for CONTEXT:SYSTEM fetching 2008-03-08 15:36:00 +00:00
skodak a24259df35 MDL-13850 fix automatic creation of course grade item 2008-03-08 15:33:49 +00:00
skodak 11ff786551 MDL-13849 add API method to use outcome in course into grade_outcome class 2008-03-08 15:29:04 +00:00
skodak e347d1c0f9 fixed db warning 2008-03-08 15:27:01 +00:00
skodak 5f72b90848 add debug code for missing course id when getting course grading category 2008-03-08 15:09:52 +00:00
skodak 6b90b67d7c MDL-13848 backup form - do not include checkboxes for mods that are not used in course 2008-03-08 15:07:59 +00:00
skodak b6e8bdbbad MDL-13842 Error migrating grades for exercise module... 2008-03-08 12:57:23 +00:00
skodak c1393f970c MDL-13845 major performance problems when regrading course 2008-03-08 12:49:49 +00:00
moodlerobot cc4f01a09a Updated the 19 build version to 20080308 2008-03-08 03:56:08 +00:00
moodlerobot 1edcd3e2e0 Automatic installer.php lang files by installer_builder (20080308) 2008-03-08 03:40:48 +00:00
tjhunt 43d565b15f MDL-13836 - When grades are imported, list users who had grades imported, but who are not currenly in the course. 2008-03-07 17:30:52 +00:00
nicolasconnault b6b9873174 MDL-12356 Patched grade_grade->is_passed() method so that it returns null when the gradepass value is null or equal to grademin, or when the finalgrade is null. 2008-03-07 14:08:27 +00:00
nicolasconnault 291a7deb3e MDL-13709 Removing unneeded file 2008-03-07 13:26:53 +00:00
wildgirl aab5a32a63 MDL-13820 help file typo fixes 2008-03-07 13:11:55 +00:00
nicolasconnault 36f9513fc6 MDL-12854 Added required rule for submission text 2008-03-07 09:17:13 +00:00
nicolasconnault b412f4ac03 MDL-13820 Removed aggregation2.html and fixed typos in aggregation.html 2008-03-07 08:54:58 +00:00
moodlerobot d0e9296d42 Updated the 19 build version to 20080307 2008-03-07 03:57:28 +00:00
moodlerobot 63e7059c90 Automatic installer.php lang files by installer_builder (20080307) 2008-03-07 03:40:05 +00:00
danmarsden e352659420 MDL-13812 choice options not shown when limit enabled. 2008-03-06 19:55:24 +00:00
ethem ea9f82462a get_recordset in cron() for performance. Backported from HEAD. 2008-03-06 17:13:23 +00:00
nicolasconnault df87047314 MDL-12182 Fixing unit tests for gradebook. Mainly a change in set_locked() arguments. 2008-03-06 13:44:47 +00:00
andreabix 38302a5459 Fixed arrow problem in IE6 2008-03-06 10:32:51 +00:00
nicolasconnault bee7fad9b6 MDL-13046 Fixed notices 2008-03-06 09:41:24 +00:00
scyrma 2e291dfa51 MDL-12860 - Patch from Joseph Rézeau, to fix a problem in the display of lesson result when using regexp. 2008-03-06 08:02:09 +00:00
gbateson eb84b02feb remove trailing whitespace on everyline and standardize line endings 2008-03-06 07:34:02 +00:00
gbateson f01e8f7c24 fix for Moodle 1.8 and 1.9 to allow students to access hidden hotpots which form part of a hotpot chain - see http://moodle.org/mod/forum/discuss.php?d=91861. In Moodle 1.8 and later the "require_login" function (lib/moodlelib.php) is stricter than in earlier versions of Moodle and checks a module's visibility and groupings access. From Moodle 2.0 on, this HotPot module does not need this fix. 2008-03-06 06:59:44 +00:00
scyrma f06680badc MDL-13795 - Proposed fix to show a nice string instead of a non-existent deadline. 2008-03-06 04:57:42 +00:00
moodlerobot 5e0289bcde Updated the 19 build version to 20080306 2008-03-06 04:07:26 +00:00
moodler d8f4ee51a5 MDL-13810 Fixed check for ul.timeaccess 2008-03-06 02:11:53 +00:00
tjhunt edd01f0e5f MDL-13794 - Reordering tool does not work if you type the same number into two boxes.
Also, fix some javascript that did not work in IE7.
2008-03-05 10:16:16 +00:00
scyrma ee8bc9d180 MDL-13791 - fix to prevent notice 2008-03-05 10:15:52 +00:00
nicolasconnault 77e95f5bd3 MDL-13787 Updated get_pref() so that it looks up a short version of the config variable (grade_ instead of grade_report_) in case the first isn't set. It also returns null if no variable is found. 2008-03-05 07:09:03 +00:00
moodler 835625bf4c Fix up display of version in footer 2008-03-05 05:34:16 +00:00
moodler 3559450d81 Make the release build display a bit neater 2008-03-05 05:27:17 +00:00
moodlerobot d98bdd3592 Updated the 19 build version to 20080305 2008-03-05 04:20:00 +00:00
scyrma 7a6df50371 MDL-13769 - Fix for postgresql 2008-03-05 01:44:33 +00:00
stronk7 74c8a06e3e Simplify anydb_escape_string() to use simple-cross-db addslashes(). MDL-13793 2008-03-04 23:40:14 +00:00
danmarsden 4b02f546ee MDL-10358 Scorm package not updating correctly - calling function in lib not included. merged from HEAD 2008-03-04 22:26:30 +00:00
danmarsden 754104acb4 MDL-11722 - incorrect string - creating new one so that other lang packs translate it correctly. 2008-03-04 20:01:39 +00:00
skodak 7e3d9f3c18 MDL-13762 some debug code and workaround for sloppy use of recordsets 2008-03-04 09:23:08 +00:00
skodak f4d0a18a41 MDL-13360 expire notification problems 2008-03-04 08:54:09 +00:00
moodlerobot b53905ab09 Updated the build version 2008-03-04 07:30:29 +00:00
moodlerobot e31601a7f9 Updated the build version 2008-03-04 07:27:36 +00:00
moodler 1e2f651f2e Bumping release name post 1.9 2008-03-04 05:38:21 +00:00
moodlerobot 1568332295 Automatic installer.php lang files by installer_builder (20080304) 2008-03-04 03:51:57 +00:00
skodak ee1cbb3856 MDL-13741 Incorrect max size shown when using course upload limit; patch by Jason Meinzer 2008-03-03 20:48:54 +00:00
skodak 6904fe1e26 MDL-13749 Front Page Calendar: Not displaying information from courses student is a member of. 2008-03-03 20:39:19 +00:00
arborrow a15965fc5f MDL-13593 - adding uploadpictures.html help file 2008-03-03 17:42:08 +00:00
nicolasconnault 79147f355b MDL-13709 Removing escape slashes. 2008-03-03 12:36:40 +00:00
moodler aaa252dbc1 Bumoping version of module too 2008-03-03 12:02:12 +00:00
moodler 6f82b46490 Bumping backup version to 1.9 release date 2008-03-03 11:55:15 +00:00
moodler 60a6ca5f38 New version and requires (same as 1.9 release) 2008-03-03 11:48:39 +00:00
moodler 3dff726aa1 New block versions for 1.9 release 2008-03-03 11:41:01 +00:00
nicolasconnault 7fa6c5f12b MDL-13709 Re-entering the admin strings 2008-03-03 11:26:07 +00:00
skodak 67fbbc6a26 MDL-13730 site setting for aggregation of scales 2008-03-03 11:02:19 +00:00
nicolasconnault 72a2effa06 MDL-13709 More lang fixes. 2008-03-03 10:50:38 +00:00
nicolasconnault 99d4c223ff MDL-13709 66 new lang files, and links to these help files have been updated wherever found. 2008-03-03 10:29:44 +00:00
nicolasconnault e0bc9f3bec MDL-13709 66 new lang files, and links to these help files have been updated wherever found. 2008-03-03 10:21:32 +00:00
wildgirl e14a0902ed MDL-12759 lang string typo fixes 2008-03-03 10:11:07 +00:00
moodler 8a1d2fdf0d Final tags for 1.9 2008-03-03 07:31:32 +00:00
nicolasconnault 4efe1f63ca MDL-13663 Updated the link to configshowquickfeedback 2008-03-03 07:27:07 +00:00
661 changed files with 18909 additions and 9784 deletions
+3 -3
View File
@@ -30,7 +30,7 @@ if (empty($CFG->auth)) {
}
if (!empty($auth) and !exists_auth_plugin($auth)) {
error(get_string('pluginnotinstalled', 'auth', $auth), $url);
print_error('pluginnotinstalled', 'auth', $url, $auth);
}
////////////////////////////////////////////////////////////////////////////////
@@ -67,7 +67,7 @@ switch ($action) {
$key = array_search($auth, $authsenabled);
// check auth plugin is valid
if ($key === false) {
error(get_string('pluginnotenabled', 'auth', $auth), $url);
print_error('pluginnotenabled', 'auth', $url, $auth);
}
// move down the list
if ($key < (count($authsenabled) - 1)) {
@@ -82,7 +82,7 @@ switch ($action) {
$key = array_search($auth, $authsenabled);
// check auth is valid
if ($key === false) {
error(get_string('pluginnotenabled', 'auth', $auth), $url);
print_error('pluginnotenabled', 'auth', $url, $auth);
}
// move up the list
if ($key >= 1) {
+2 -1
View File
@@ -50,7 +50,8 @@ if ($frm = data_submitted() and confirm_sesskey()) {
$frm = get_config("auth/$auth");
}
$user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "department", "address", "city", "country", "description", "idnumber", "lang");
$user_fields = $authplugin->userfields;
//$user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "institution", "department", "address", "city", "country", "description", "idnumber", "lang");
/// Get the auth title (from core or own auth lang files)
$authtitle = $authplugin->get_title();
+1 -1
View File
@@ -31,7 +31,7 @@
if ($config = data_submitted()) {
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
print_error('confirmsesskeybad', 'error');
}
if(!$block->has_config()) {
error('This block does not support global configuration');
+1 -1
View File
@@ -364,7 +364,7 @@
}
}
if(!empty($CFG->usetags)){
if (!empty($CFG->usetags)) {
require_once($CFG->dirroot.'/tag/lib.php');
tag_cron();
mtrace ('Executed tag cron');
+1 -1
View File
@@ -12,7 +12,7 @@
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$strdatabaseperformance = get_string("databaseperformance");
$stradministration = get_string("administration");
+1 -1
View File
@@ -13,7 +13,7 @@
$sure = optional_param('sure', 0, PARAM_BOOL);
$reallysure = optional_param('reallysure', 0, PARAM_BOOL);
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$deletedir = $CFG->dataroot; // The directory to delete!
+2 -2
View File
@@ -18,7 +18,7 @@
if ($frm = data_submitted()) {
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
print_error('confirmsesskeybad', 'error');
}
if (empty($frm->enable)) {
$frm->enable = array();
@@ -103,4 +103,4 @@
admin_externalpage_print_footer();
?>
?>
+1 -1
View File
@@ -19,7 +19,7 @@
if ($frm = data_submitted()) {
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
print_error('confirmsesskeybad', 'error');
}
if ($enrolment->process_config($frm)) {
redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
+15
View File
@@ -122,6 +122,11 @@
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="optional">
<FEEDBACK>
<ON_CHECK message="ctyperecommended" />
</FEEDBACK>
</PHP_EXTENSION>
</PHP_EXTENSIONS>
</MOODLE>
<MOODLE version="1.9">
@@ -177,6 +182,11 @@
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="optional">
<FEEDBACK>
<ON_CHECK message="ctyperecommended" />
</FEEDBACK>
</PHP_EXTENSION>
</PHP_EXTENSIONS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="question/upgrade.php" function="question_check_no_rqp_questions" level="optional">
@@ -249,6 +259,11 @@
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
</PHP_EXTENSIONS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="question/upgrade.php" function="question_check_no_rqp_questions" level="optional">
+1 -1
View File
@@ -24,7 +24,7 @@
$solution = optional_param('solution', 0, PARAM_SAFEDIR); //in fact it is class name alhanumeric and _
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$site = get_site();
+2 -2
View File
@@ -560,7 +560,7 @@
/// Check for valid admin user - no guest autologin
require_login(0, false);
$context = get_context_instance(CONTEXT_SYSTEM, SITEID);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context);
@@ -653,7 +653,7 @@
//////////////////////////////////////////////////////////////////////////////////////////////////
//// 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">'.$CFG->release.'</a> ('.$CFG->version.')<br />'.
'<a href="http://docs.moodle.org/en/Release" 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>';
+1 -1
View File
@@ -9,7 +9,7 @@
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
admin_externalpage_print_header();
print_heading('Convert all MySQL tables from MYISAM to InnoDB');
+23 -20
View File
@@ -14,7 +14,7 @@
admin_externalpage_setup('langedit');
$context = get_context_instance(CONTEXT_SYSTEM, SITEID);
$context = get_context_instance(CONTEXT_SYSTEM);
define('LANG_SUBMIT_REPEAT', 1); // repeat displaying submit button?
define('LANG_SUBMIT_REPEAT_EVERY', 20); // if so, after how many lines?
@@ -290,7 +290,10 @@
$missingcounter++;
$totalcounter->missing++;
}
if (LANG_LINK_MISSING_STRINGS && $missingstring) {
if ($translationsdiffer) {
$missingcounter++;
}
if (LANG_LINK_MISSING_STRINGS && ($missingstring || $translationsdiffer)) {
$missinglinkstart = "<a href=\"lang.php?mode=compare&amp;currentfile=$filename#missing$missingcounter\">";
$missinglinkend = '</a>';
} else {
@@ -435,7 +438,7 @@
if (isset($_POST['currentfile'])){ // Save a file
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
print_error('confirmsesskeybad', 'error');
}
$newstrings = array();
@@ -586,12 +589,13 @@
$value2 = lang_fix_value_from_file($localstring[$key]);
}
error_reporting($CFG->debug);
// Color highlighting:
// red #ef6868 - translation missing in both system and local pack
// yellow #feff7f - translation missing in system pack but is translated in local
// green #AAFFAA - translation present in both system and local but is different
$missingtarget = '';
$missingnext = '';
$missingprev = '';
$cellcolour = '';
$usetabindex = false;
if (!$value) {
// the string is not present in the pack being processed
if (!$value2) {
$cellcolour = 'class="bothmissing"';
$usetabindex = true;
@@ -606,22 +610,21 @@
'<img src="' . $CFG->pixpath . '/t/down.gif" class="iconsmall" alt="'.$strnext.'" /></a>';
$missingprev = '<a href="#missing'.($missingcounter-1).'">'.
'<img src="' . $CFG->pixpath . '/t/up.gif" class="iconsmall" alt="'.$strprev.'" /></a>';
} else {
$missingtarget = '';
$missingnext = '';
$missingprev = '';
}
} else {
if ($value <> $value2 && $value2 <> '') {
// the string is translated in the pack being processed
if ($value <> $value2 && ($uselocal || $value2 <> '')) {
$cellcolour = 'class="localdifferent"';
$usetabindex = true;
} else {
$cellcolour = '';
$usetabindex = false;
$missingcounter++;
if (LANG_DISPLAY_MISSING_LINKS) {
$missingtarget = '<a name="missing'.$missingcounter.'"></a>';
$missingnext = '<a href="#missing'.($missingcounter+1).'">'.
'<img src="' . $CFG->pixpath . '/t/down.gif" class="iconsmall" alt="'.$strnext.'" /></a>';
$missingprev = '<a href="#missing'.($missingcounter-1).'">'.
'<img src="' . $CFG->pixpath . '/t/up.gif" class="iconsmall" alt="'.$strprev.'" /></a>';
}
}
$missingtarget = '';
$missingnext = '';
$missingprev = '';
}
if ($editable) {
@@ -707,7 +710,7 @@
if (isset($_POST['currentfile'])) { // Save a file
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
print_error('confirmsesskeybad', 'error');
}
if (lang_help_save_file($saveto, $currentfile, $_POST['filedata'])) {
notify(get_string("changessaved")." ($saveto/$currentfile)", "notifysuccess");
+82 -30
View File
@@ -12,7 +12,7 @@
admin_externalpage_setup('langimport');
$mode = optional_param('mode', 0, PARAM_INT); //phase
$pack = optional_param('pack', '', PARAM_FILE); //pack to install
$pack = optional_param('pack', array(), PARAM_FILE); //pack to install
$displaylang = $pack;
$uninstalllang = optional_param('uninstalllang', '', PARAM_FILE);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
@@ -41,36 +41,45 @@
case INSTALLATION_OF_SELECTED_LANG: ///installation of selected language pack
if (confirm_sesskey()) {
if (confirm_sesskey() and !empty($pack)) {
set_time_limit(0);
@mkdir ($CFG->dataroot.'/temp/'); //make it in case it's a fresh install, it might not be there
@mkdir ($CFG->dataroot.'/lang/');
if ($cd = new component_installer('http://download.moodle.org', 'lang16',
$pack.'.zip', 'languages.md5', 'lang')) {
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
switch ($status) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new object();
$a->url = 'http://download.moodle.org/lang16/'.$pack.'.zip';
$a->dest= $CFG->dataroot.'/lang';
error(get_string($cd->get_error(), 'error', $a), 'langimport.php');
} else {
error(get_string($cd->get_error(), 'error'), 'langimport.php');
}
break;
case COMPONENT_INSTALLED:
$notice_ok[] = get_string('langpackinstalled','admin',$pack);
break;
case COMPONENT_UPTODATE:
break;
}
if (is_array($pack)) {
$packs = $pack;
} else {
notify('Had an unspecified error with the component installer, sorry.');
$packs = array($pack);
}
foreach ($packs as $pack) {
if ($cd = new component_installer('http://download.moodle.org', 'lang16',
$pack.'.zip', 'languages.md5', 'lang')) {
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
switch ($status) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new object();
$a->url = 'http://download.moodle.org/lang16/'.$pack.'.zip';
$a->dest= $CFG->dataroot.'/lang';
print_error($cd->get_error(), 'error', 'langimport.php', $a);
} else {
print_error($cd->get_error(), 'error', 'langimport.php');
}
break;
case COMPONENT_INSTALLED:
$notice_ok[] = get_string('langpackinstalled','admin',$pack);
break;
case COMPONENT_UPTODATE:
break;
}
} else {
notify('Had an unspecified error with the component installer, sorry.');
}
}
}
break;
@@ -110,6 +119,7 @@
break;
case UPDATE_ALL_LANG: //1 click update for all updatable language packs
set_time_limit(0);
//0th pull a list from download.moodle.org,
//key = langname, value = md5
@@ -188,9 +198,9 @@
$a = new stdClass();
$a->url = 'http://download.moodle.org/lang16/'.$pack.'.zip';
$a->dest= $CFG->dataroot.'/lang';
error(get_string($cd->get_error(), 'error', $a)); // not probable
print_error($cd->get_error(), 'error', "", $a); // not probable
} else {
error(get_string($cd->get_error(), 'error')); // not probable
print_error($cd->get_error(), 'error'); // not probable
}
break;
case COMPONENT_UPTODATE:
@@ -222,6 +232,28 @@
$installedlangs = get_list_of_languages(true, true);
$missingparents = array();
$oldlang = isset($SESSION->lang) ? $SESSION->lang : null; // override current lang
foreach($installedlangs as $l=>$unused) {
$SESSION->lang = $l;
$parent = get_string('parentlanguage');
if ($parent == 'en_utf8') {
continue;
}
if (strpos($parent, '[[') !== false) {
continue; // no parent
}
if (!isset($installedlangs[$parent])) {
$missingparents[$l] = $parent;
}
}
if (isset($oldlang)) {
$SESSION->lang = $oldlang;
} else {
unset($SESSION->lang);
}
if ($availablelangs = get_remote_list_of_languages()) {
$remote = 1;
} else {
@@ -245,6 +277,26 @@
notify($info, 'notifyproblem');
}
if ($missingparents) {
foreach ($missingparents as $l=>$parent) {
$a = new object();
$a->lang = $installedlangs[$l];
$a->parent = $parent;
foreach ($availablelangs as $alang) {
if ($alang[0] == $parent) {
if (substr($alang[0], -5) == '_utf8') { //Remove the _utf8 suffix from the lang to show
$shortlang = substr($alang[0], 0, -5);
} else {
$shortlang = $alang[0];
}
$a->parent = $alang[2].' ('.$shortlang.')';
}
}
$info = get_string('missinglangparent', 'admin', $a);
notify($info, 'notifyproblem');
}
}
print_box_start();
echo '<table summary="">';
echo '<tr><td align="center" valign="top">';
@@ -287,7 +339,7 @@
echo '<input name="sesskey" type="hidden" value="'.sesskey().'" />';
echo '<label for="pack">'.get_string('availablelangs','admin')."</label><br />\n";
if ($remote) {
echo '<select name="pack" id="pack" size="15">';
echo '<select name="pack[]" id="pack" size="15" multiple="multiple">';
}
foreach ($availablelangs as $alang) {
+5 -5
View File
@@ -19,7 +19,7 @@ admin_externalpage_setup('ssoaccesscontrol');
admin_externalpage_print_header();
if (!extension_loaded('openssl')) {
print_error('requiresopenssl', 'mnet', '', NULL, true);
print_error('requiresopenssl', 'mnet');
}
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
@@ -39,13 +39,13 @@ if (!empty($action) and confirm_sesskey()) {
// boot if insufficient permission
if (!has_capability('moodle/user:delete', $sitecontext)) {
error(get_string('nomodifyacl','mnet'));
print_error('nomodifyacl','mnet');
}
// fetch the record in question
$id = required_param('id', PARAM_INT);
if (!$idrec = get_record('mnet_sso_access_control', 'id', $id)) {
error(get_string('recordnoexists','mnet'), "$CFG->wwwroot/$CFG->admin/mnet/access_control.php");
print_error('recordnoexists','mnet', "$CFG->wwwroot/$CFG->admin/mnet/access_control.php");
}
switch ($action) {
@@ -60,7 +60,7 @@ if (!empty($action) and confirm_sesskey()) {
// require the access parameter, and it must be 'allow' or 'deny'
$accessctrl = trim(strtolower(required_param('accessctrl', PARAM_ALPHA)));
if ($accessctrl != 'allow' and $accessctrl != 'deny') {
error(get_string('invalidaccessparam', 'mnet') , "$CFG->wwwroot/$CFG->admin/mnet/access_control.php");
print_error('invalidaccessparam', 'mnet', "$CFG->wwwroot/$CFG->admin/mnet/access_control.php");
}
if (mnet_update_sso_access_control($idrec->username, $idrec->mnet_host_id, $accessctrl)) {
@@ -84,7 +84,7 @@ if ($form = data_submitted() and confirm_sesskey()) {
// check permissions and verify form input
if (!has_capability('moodle/user:delete', $sitecontext)) {
error(get_string('nomodifyacl','mnet'), "$CFG->wwwroot/$CFG->admin/mnet/access_control.php");
print_error('nomodifyacl','mnet', "$CFG->wwwroot/$CFG->admin/mnet/access_control.php");
}
if (empty($form->username)) {
$formerror['username'] = get_string('enterausername','mnet');
+1 -1
View File
@@ -7,7 +7,7 @@
include_once($CFG->dirroot.'/mnet/xmlrpc/client.php');
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
print_error('confirmsesskeybad', 'error');
}
admin_externalpage_setup('mnetenrol');
+1 -1
View File
@@ -6,7 +6,7 @@
require_once($CFG->libdir.'/adminlib.php');
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
print_error('confirmsesskeybad', 'error');
}
+8 -7
View File
@@ -15,17 +15,17 @@ require_capability('moodle/site:config', $context, $USER->id, true, "nopermissio
if (!extension_loaded('openssl')) {
admin_externalpage_print_header();
print_error('requiresopenssl', 'mnet', '', NULL, true);
print_error('requiresopenssl', 'mnet');
}
if (!$site = get_site()) {
admin_externalpage_print_header();
print_error('nosite', '', '', NULL, true);
print_error('nosite', '');
}
if (!function_exists('curl_init') ) {
admin_externalpage_print_header();
print_error('nocurl', 'mnet', '', NULL, true);
print_error('nocurl', 'mnet');
}
/// Initialize variables.
@@ -59,7 +59,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
if(!function_exists('xmlrpc_encode_request')) {
trigger_error("You must have xml-rpc enabled in your PHP build to use this feature.");
error(get_string('xmlrpc-missing', 'mnet'),'peers.php');
print_error('xmlrpc-missing', 'mnet','peers.php');
exit;
}
@@ -82,7 +82,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
$temp_wwwroot = clean_param($form->wwwroot, PARAM_URL);
if ($temp_wwwroot !== $form->wwwroot) {
trigger_error("We now parse the wwwroot with PARAM_URL. Your URL will need to have a valid TLD, etc.");
error(get_string("invalidurl", 'mnet'),'peers.php');
print_error("invalidurl", 'mnet','peers.php');
exit;
}
unset($temp_wwwroot);
@@ -103,7 +103,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
if (isset($form->public_key)) {
$form->public_key = clean_param($form->public_key, PARAM_PEM);
if (empty($form->public_key)) {
error(get_string("invalidpubkey", 'mnet'),'peers.php?step=update&amp;hostid='.$mnet_peer->id);
print_error("invalidpubkey", 'mnet', 'peers.php?step=update&amp;hostid='.$mnet_peer->id);
exit;
} else {
$oldkey = $mnet_peer->public_key;
@@ -116,6 +116,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
$errmsg .= $err['code'] . ': ' . $err['text'].'<br />';
}
error(get_string("invalidpubkey", 'mnet') . $errmsg ,'peers.php?step=update&amp;hostid='.$mnet_peer->id);
//print_error("invalidpubkey", 'mnet', 'peers.php?step=update&amp;hostid='.$mnet_peer->id, $errmsg);
exit;
}
}
@@ -124,7 +125,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
// PREVENT DUPLICATE RECORDS ///////////////////////////////////////////
if ('input' == $form->step) {
if ( isset($mnet_peer->id) && $mnet_peer->id > 0 ) {
error(get_string("hostexists", 'mnet', $mnet_peer->id),'peers.php?step=update&amp;hostid='.$mnet_peer->id);
print_error("hostexists", 'mnet', 'peers.php?step=update&amp;hostid='.$mnet_peer->id, $mnet_peer->id);
}
}
+1 -1
View File
@@ -10,7 +10,7 @@
$module = optional_param('module', '', PARAM_SAFEDIR);
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
print_error('confirmsesskeybad', 'error');
}
if ($module != '') {
+6 -1
View File
@@ -242,8 +242,13 @@
$class = "";
}
$extra = '';
if (!file_exists("$CFG->dirroot/mod/$module->name/lib.php")) {
$extra = ' <span class="notifyproblem">('.get_string('missingfromdisk').')</span>';
}
$table->add_data(array(
'<span'.$class.'>'.$icon.' '.$modulename.'</span>',
'<span'.$class.'>'.$icon.' '.$modulename.$extra.'</span>',
$countlink,
'<span'.$class.'>'.$module->version.'</span>',
$visible,
+1 -1
View File
@@ -51,7 +51,7 @@ class page_admin extends page_base {
// seems reasonable that the only people that can edit blocks on the admin pages
// are the admins... but maybe we want a role for this?
function user_allowed_editing() {
return has_capability('moodle/site:manageblocks', get_context_instance(CONTEXT_SYSTEM, SITEID));
return has_capability('moodle/site:manageblocks', get_context_instance(CONTEXT_SYSTEM));
}
// has to be fixed. i know there's a "proper" way to do this
+2 -2
View File
@@ -5,14 +5,14 @@
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
if (!$site = get_site()) {
redirect("index.php");
}
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
print_error('confirmsesskeybad', 'error');
}
if (!$admin = get_admin()) {
+1 -1
View File
@@ -11,7 +11,7 @@
$courseid = optional_param('courseid', 0, PARAM_INT);
require_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM));
/// Scheduled backups are disabled by the server admin
if (!empty($CFG->disablescheduledbackups)) {
+2 -2
View File
@@ -12,7 +12,7 @@
$time = optional_param('time', 0, PARAM_INT);
$numcourses = optional_param('numcourses', 20, PARAM_INT);
require_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM, SITEID)); // needed?
require_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM)); // needed?
if (empty($CFG->enablestats)) {
redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3);
@@ -43,7 +43,7 @@
$timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth);
if (empty($timeoptions)) {
error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id);
print_error('nostatstodisplay', "", $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
echo '<form action="index.php" method="post">'."\n";
+1 -1
View File
@@ -29,7 +29,7 @@
$courses = get_records_sql($sql, 0, $numcourses);
if (empty($courses)) {
error(get_string('statsnodata'),$CFG->wwwroot.'/'.$CFG->admin.'/report/course/index.php');
print_error('statsnodata', "", $CFG->wwwroot.'/'.$CFG->admin.'/report/course/index.php');
}
+1 -1
View File
@@ -17,7 +17,7 @@ require_once('ex_simple_test.php');
require_once('ex_reporter.php');
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
/* The UNITTEST constant can be checked elsewhere if you need to know
* when your code is being run as part of a unit test. */
+1 -1
View File
@@ -13,7 +13,7 @@
admin_externalpage_setup('defineroles');
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/role:manage', $sitecontext);
/// form processiong here
+1 -1
View File
@@ -11,7 +11,7 @@
admin_externalpage_setup('defineroles');
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/role:manage', $sitecontext);
/// form processiong here
+3 -21
View File
@@ -45,13 +45,11 @@
} else {
error('Invalid course id');
}
$coursecontext = $context;
} else if (!empty($courseid)){ // we need this for user tabs in user context
if (!$course = get_record('course', 'id', $courseid)) {
error('Invalid course id');
}
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
} else {
$courseid = SITEID;
@@ -60,17 +58,12 @@
require_login($course);
if ($context->contextlevel == CONTEXT_COURSE) {
require_login($context->instanceid);
} else {
require_login();
}
require_capability('moodle/role:assign', $context);
/// needed for tabs.php
$overridableroles = get_overridable_roles($context);
$assignableroles = get_assignable_roles($context); // Plain role names, may be altered later
$overridableroles = get_overridable_roles($context, 'name', ROLENAME_BOTH);
$assignableroles = get_assignable_roles($context, 'name', ROLENAME_BOTH);
/// Get some language strings
@@ -165,17 +158,6 @@
}
/// Rename some of the role names if needed
if (isset($coursecontext)) {
if ($aliasnames = get_records('role_names', 'contextid', $coursecontext->id)) {
foreach ($aliasnames as $alias) {
if (isset($assignableroles[$alias->roleid])) {
$assignableroles[$alias->roleid] = $alias->name.' ('.$assignableroles[$alias->roleid].')';
}
}
}
}
/// Process incoming role assignment
+2 -18
View File
@@ -28,13 +28,9 @@
if (!$course = get_record('course', 'id', $courseid)) {
error('Bad course ID');
}
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
} else {
$course = clone($SITE);
$courseid = SITEID;
$coursecontext = $context;
}
require_login($course);
@@ -52,8 +48,8 @@
}
/// needed for tabs.php
$overridableroles = get_overridable_roles($context);
$assignableroles = get_assignable_roles($context);
$overridableroles = get_overridable_roles($context, 'name', ROLENAME_BOTH);
$assignableroles = get_assignable_roles($context, 'name', ROLENAME_BOTH);
/// Get some language strings
@@ -155,18 +151,6 @@
include_once('tabs.php');
}
/// Rename some of the role names if needed
if (isset($coursecontext)) {
if ($aliasnames = get_records('role_names', 'contextid', $coursecontext->id)) {
foreach ($aliasnames as $alias) {
if (isset($overridableroles[$alias->roleid])) {
$overridableroles[$alias->roleid] = $alias->name.' ('.$overridableroles[$alias->roleid].')';
}
}
}
}
print_heading_with_help(get_string('overridepermissionsin', 'role', print_context_name($context)), 'overrides');
if ($roleid) {
+19 -12
View File
@@ -75,8 +75,6 @@ if ($currenttab != 'update') {
require_login($course);
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); // for role names later
$fullmodulename = get_string("modulename", $module->name);
$streditinga = get_string("editinga", "moodle", $fullmodulename);
$strmodulenameplural = get_string("modulenameplural", $module->name);
@@ -110,9 +108,6 @@ if ($currenttab != 'update') {
if ($block = get_record('block', 'id', $blockinstance->blockid)) {
$blockname = print_context_name($context);
// Prepare the last part of the breadcrumbs first
$navlinks[98] = array('name' => $blockname, 'link' => null, 'type' => 'misc');
$navlinks[99] = array('name' => $straction, 'link' => null, 'type' => 'misc');
switch ($blockinstance->pagetype) {
case 'course-view':
@@ -120,12 +115,8 @@ if ($currenttab != 'update') {
require_login($course);
if ($course->id != SITEID) {
$navlinks[0] = array('name' => $course->shortname,
'link' => "$CFG->wwwroot/course/view.php?id=$course->id",
'type' => 'misc');
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); // for role names later
}
$navlinks[] = array('name' => $blockname, 'link' => null, 'type' => 'misc');
$navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$straction: $blockname", $course->fullname, $navigation);
}
@@ -133,14 +124,30 @@ if ($currenttab != 'update') {
case 'blog-view':
$strblogs = get_string('blogs','blog');
$navlinks[0] = array('name' => $strblogs,
$navlinks[] = array('name' => $strblogs,
'link' => $CFG->wwwroot.'/blog/index.php',
'type' => 'misc');
$navlinks[] = array('name' => $blockname, 'link' => null, 'type' => 'misc');
$navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$straction: $strblogs", $SITE->fullname, $navigation);
break;
case 'tag-index':
$strtags = get_string('tags');
$navlinks[] = array('name' => $strtags,
'link' => $CFG->wwwroot.'/tag/index.php',
'type' => 'misc');
$navlinks[] = array('name' => $blockname, 'link' => null, 'type' => 'misc');
$navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$straction: $strtags", $SITE->fullname, $navigation);
break;
default:
$navlinks[] = array('name' => $blockname, 'link' => null, 'type' => 'misc');
$navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$straction: $blockname", $SITE->fullname, $navigation);
break;
}
+2 -2
View File
@@ -16,12 +16,12 @@ $adminroot =& admin_get_root(); // need all settings
$page =& $adminroot->locate($section);
if (empty($page) or !is_a($page, 'admin_settingpage')) {
error(get_string('sectionerror', 'admin'), "$CFG->wwwroot/$CFG->admin/");
print_error('sectionerror', 'admin', "$CFG->wwwroot/$CFG->admin/");
die;
}
if (!($page->check_access())) {
error(get_string('accessdenied', 'admin'));
print_error('accessdenied', 'admin');
die;
}
+1
View File
@@ -30,6 +30,7 @@ if ($hassiteconfig
$bi[] = new admin_setting_configcheckbox('backup_sche_coursefiles', get_string('coursefiles'), get_string('backupcoursefileshelp'), 0);
$bi[] = new admin_setting_configcheckbox('backup_sche_sitefiles', get_string('sitefiles'), get_string('backupsitefileshelp'), 0);
$bi[] = new admin_setting_configcheckbox('backup_sche_messages', get_string('messages', 'message'), get_string('backupmessageshelp','message'), 0);
$bi[] = new admin_setting_configcheckbox('backup_sche_blogs', get_string('blogs', 'blog'), get_string('backupblogshelp','blog'), 0);
$bi[] = new admin_setting_configselect('backup_sche_keep', get_string('keep'),
get_string('backupkeephelp'), 1, array(0 => get_string('all'), 1 => '1',
2 => '2',
+4 -2
View File
@@ -24,10 +24,12 @@ if (has_capability('moodle/grade:manage', $systemcontext)
array(GRADE_REPORT_AGGREGATION_POSITION_FIRST => get_string('positionfirst', 'grades'),
GRADE_REPORT_AGGREGATION_POSITION_LAST => get_string('positionlast', 'grades'))));
$temp->add(new admin_setting_configcheckbox('grade_hiddenasdate', get_string('hiddenasdate', 'grades'), get_string('confighiddenasdate', 'grades'), 0, PARAM_INT));
$temp->add(new admin_setting_regradingcheckbox('grade_includescalesinaggregation', get_string('includescalesinaggregation', 'grades'), get_string('configincludescalesinaggregation', 'grades'), 1));
$temp->add(new admin_setting_configcheckbox('grade_hiddenasdate', get_string('hiddenasdate', 'grades'), get_string('confighiddenasdate', 'grades'), 0));
// enable publishing in exports/imports
$temp->add(new admin_setting_configcheckbox('gradepublishing', get_string('gradepublishing', 'grades'), get_string('configgradepublishing', 'grades'), 0, PARAM_INT));
$temp->add(new admin_setting_configcheckbox('gradepublishing', get_string('gradepublishing', 'grades'), get_string('configgradepublishing', 'grades'), 0));
$temp->add(new admin_setting_configselect('grade_export_displaytype', get_string('gradeexportdisplaytype', 'grades'),
get_string('configgradeexportdisplaytype', 'grades'), GRADE_DISPLAY_TYPE_REAL,
+3 -1
View File
@@ -20,7 +20,9 @@ if ($hassiteconfig) {
foreach ($modulebyname as $strmodulename=>$module) {
$modulename = $module->name;
if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/settings.php')) {
if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/settingstree.php')) {
include($CFG->dirroot.'/mod/'.$modulename.'/settingstree.php');
} else if (file_exists($CFG->dirroot.'/mod/'.$modulename.'/settings.php')) {
// do not show disabled modules in tree, keep only settings link on manage page
$settings = new admin_settingpage('modsetting'.$modulename, $strmodulename, 'moodle/site:config', !$module->visible);
if ($ADMIN->fulltree) {
+1 -1
View File
@@ -145,7 +145,7 @@ $ADMIN->add('server', $temp);
// "http" settingpage
$temp = new admin_settingpage('http', get_string('http', 'admin'));
$temp->add(new admin_setting_configtext('framename', get_string('framename', 'admin'), get_string('configframename', 'admin'), '_top', PARAM_ALPHAEXT));
$temp->add(new admin_Setting_configcheckbox('slasharguments', get_string('slasharguments', 'admin'), get_string('configslasharguments', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('slasharguments', get_string('slasharguments', 'admin'), get_string('configslasharguments', 'admin'), 1));
$temp->add(new admin_setting_heading('webproxy', get_string('webproxy', 'admin'), get_string('webproxyinfo', 'admin')));
$temp->add(new admin_setting_configtext('proxyhost', get_string('proxyhost', 'admin'), get_string('configproxyhost', 'admin'), '', PARAM_HOST));
$temp->add(new admin_setting_configtext('proxyport', get_string('proxyport', 'admin'), get_string('configproxyport', 'admin'), 0, PARAM_INT));
+13 -3
View File
@@ -25,7 +25,9 @@ if ($hassiteconfig
get_string('authinstructions', 'auth'), ''));
$temp->add(new admin_setting_configtext('allowemailaddresses', get_string('allowemailaddresses', 'admin'), get_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('denyemailaddresses', get_string('denyemailaddresses', 'admin'), get_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('recaptchapublickey', get_string('recaptchapublickey', 'admin'), get_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('recaptchaprivatekey', get_string('recaptchaprivatekey', 'admin'), get_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS));
$ADMIN->add('authsettings', $temp);
@@ -106,13 +108,21 @@ if ($hassiteconfig
set_config('creatornewroleid', 0);
}
}
if (!$guestroles = get_roles_with_capability('moodle/legacy:guest', CAP_ALLOW)) {
$guestroles = array();
}
// we must not use assignable roles here:
// 1/ unsetting roles as assignable for admin might bork the settings!
// 2/ default user role should not be assignable anyway
$allroles = array();
$nonguestroles = array();
if ($roles = get_all_roles()) {
foreach ($roles as $role) {
$allroles[$role->id] = strip_tags(format_string($role->name, true));
$rolename = strip_tags(format_string($role->name, true));
$allroles[$role->id] = $rolename;
if (!isset($guestroles[$role->id])) {
$nonguestroles[$role->id] = $rolename;
}
}
}
@@ -121,7 +131,7 @@ if ($hassiteconfig
$temp->add(new admin_setting_configselect('guestroleid', get_string('guestroleid', 'admin'),
get_string('configguestroleid', 'admin'), $guestrole->id, $allroles));
$temp->add(new admin_setting_configselect('defaultuserroleid', get_string('defaultuserroleid', 'admin'),
get_string('configdefaultuserroleid', 'admin'), $userrole->id, $allroles));
get_string('configdefaultuserroleid', 'admin'), $userrole->id, $nonguestroles)); // guest role here breaks a lot of stuff
}
$temp->add(new admin_setting_configcheckbox('nodefaultuserrolelists', get_string('nodefaultuserrolelists', 'admin'), get_string('confignodefaultuserrolelists', 'admin'), 0));
+1 -1
View File
@@ -24,7 +24,7 @@
require_login();
require_capability('moodle/site:manageblocks', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:manageblocks', get_context_instance(CONTEXT_SYSTEM));
// first thing to do is print the dropdown menu
+1 -1
View File
@@ -6,7 +6,7 @@
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$strtimezone = get_string("timezone");
$strsavechanges = get_string("savechanges");
+1 -1
View File
@@ -32,7 +32,7 @@ admin_externalpage_setup('uploadpictures', $adminroot);
require_login();
require_capability('moodle/site:uploadusers', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:uploadusers', get_context_instance(CONTEXT_SYSTEM));
if (!$site = get_site()) {
error("Could not find site-level course");
+8 -4
View File
@@ -66,9 +66,13 @@ $returnurl = $CFG->wwwroot.'/'.$CFG->admin.'/uploaduser.php';
$bulknurl = $CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk.php';
// array of all valid fields for validation
$STD_FIELDS = array('firstname', 'lastname', 'username', 'email', 'city', 'country', 'lang', 'auth', 'timezone', 'mailformat', 'maildisplay', 'maildigest', 'htmleditor',
'ajax', 'autosubscribe', 'mnethostid', 'institution', 'department', 'idnumber', 'icq', 'phone1', 'phone2', 'address', 'url', 'description',
'oldusername', 'emailstop', 'deleted', 'password');
$STD_FIELDS = array('id', 'firstname', 'lastname', 'username', 'email',
'city', 'country', 'lang', 'auth', 'timezone', 'mailformat',
'maildisplay', 'maildigest', 'htmleditor', 'ajax', 'autosubscribe',
'mnethostid', 'institution', 'department', 'idnumber', 'skype',
'msn', 'aim', 'yahoo', 'icq', 'phone1', 'phone2', 'address',
'url', 'description', 'oldusername', 'emailstop', 'deleted',
'password');
$PRF_FIELDS = array();
@@ -94,7 +98,7 @@ if (empty($iid)) {
if ($readcount === false) {
error($cir->get_error(), $returnurl);
} else if ($readcount == 0) {
error(get_string('csvemptyfile', 'error'), $returnurl);
print_error('csvemptyfile', 'error', $returnurl);
}
// continue to form2
+1 -1
View File
@@ -233,7 +233,7 @@ class admin_uploaduser_form2 extends moodleform {
$mform->setType('phone1', PARAM_CLEAN);
$mform->setAdvanced('phone1');
$mform->addElement('text', 'phone2', get_string('phone'), 'maxlength="20" size="25"');
$mform->addElement('text', 'phone2', get_string('phone2'), 'maxlength="20" size="25"');
$mform->setType('phone2', PARAM_CLEAN);
$mform->setAdvanced('phone2');
+30 -8
View File
@@ -17,16 +17,31 @@ if (empty($SESSION->bulk_users)) {
redirect($return);
}
if ($format) {
$fields = array('id' => 'id',
'username' => get_string('username'),
'email' => get_string('email'),
'firstname' => get_string('firstname'),
'lastname' => get_string('lastname'),
'idnumber' => get_string('idnumber'),
'city' => get_string('city'),
'country' => get_string('country'));
'username' => 'username',
'email' => 'email',
'firstname' => 'firstname',
'lastname' => 'lastname',
'idnumber' => 'idnumber',
'institution' => 'institution',
'department' => 'department',
'phone1' => 'phone1',
'phone2' => 'phone2',
'city' => 'city',
'url' => 'url',
'icq' => 'icq',
'skype' => 'skype',
'aim' => 'aim',
'yahoo' => 'yahoo',
'msn' => 'msn',
'country' => 'country');
if ($extrafields = get_records_select('user_info_field')) {
foreach ($extrafields as $n=>$v){
$fields['profile_field_'.$v->shortname] = 'profile_field_'.$v->name;
}
}
switch ($format) {
case 'csv' : user_download_csv($fields);
@@ -56,6 +71,7 @@ function user_download_ods($fields) {
global $CFG, $SESSION;
require_once("$CFG->libdir/odslib.class.php");
require_once($CFG->dirroot.'/user/profile/lib.php');
$filename = clean_filename(get_string('users').'.ods');
@@ -77,6 +93,7 @@ function user_download_ods($fields) {
continue;
}
$col = 0;
profile_load_data($user);
foreach ($fields as $field=>$unused) {
$worksheet[0]->write($row, $col, $user->$field);
$col++;
@@ -92,6 +109,7 @@ function user_download_xls($fields) {
global $CFG, $SESSION;
require_once("$CFG->libdir/excellib.class.php");
require_once($CFG->dirroot.'/user/profile/lib.php');
$filename = clean_filename(get_string('users').'.xls');
@@ -113,6 +131,7 @@ function user_download_xls($fields) {
continue;
}
$col = 0;
profile_load_data($user);
foreach ($fields as $field=>$unused) {
$worksheet[0]->write($row, $col, $user->$field);
$col++;
@@ -126,6 +145,8 @@ function user_download_xls($fields) {
function user_download_csv($fields) {
global $CFG, $SESSION;
require_once($CFG->dirroot.'/user/profile/lib.php');
$filename = clean_filename(get_string('users').'.csv');
@@ -149,6 +170,7 @@ function user_download_csv($fields) {
if (!$user = get_record('user', 'id', $userid)) {
continue;
}
profile_load_data($user);
foreach ($fields as $field=>$unused) {
$row[] = str_replace($delimiter, $encdelim, $user->$field);
}
+1 -1
View File
@@ -79,7 +79,7 @@
}
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
/// Body of the script, based on action, we delegate the work
$action = optional_param ('action', 'main_view', PARAM_ALPHAEXT);
+1 -1
View File
@@ -6,7 +6,7 @@
//
// hack by Vangelis Haniotakis to handle the absence of $_SERVER['REQUEST_URI'] in IIS
//
if (!$_SERVER['REQUEST_URI']) {
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING'];
}
+2 -5
View File
@@ -487,11 +487,8 @@ if ( !is_object($PHPCAS_CLIENT) ) {
* @return array
*/
function ldap_attributes () {
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
"department", "address", "city", "country", "description",
"idnumber", "lang" );
$moodleattributes = array();
foreach ($fields as $field) {
foreach ($this->userfields as $field) {
if (!empty($this->config->{"field_map_$field"})) {
$moodleattributes[$field] = $this->config->{"field_map_$field"};
if (preg_match('/,/',$moodleattributes[$field])) {
@@ -698,7 +695,7 @@ if ( !is_object($PHPCAS_CLIENT) ) {
// find users in DB that aren't in ldap -- to be removed!
// this is still not as scalable (but how often do we mass delete?)
if (!empty($this->config->removeuser)) {
$sql = "SELECT u.id, u.username, u.email
$sql = "SELECT u.id, u.username, u.email, u.auth
FROM {$CFG->prefix}user u
LEFT JOIN $temptable e ON u.username = e.username
WHERE u.auth='cas'
+4 -4
View File
@@ -134,7 +134,7 @@ if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
<table cellspacing="0" cellpadding="5" border="0" align="center">
<table cellspacing="0" cellpadding="5" border="0">
@@ -722,7 +722,7 @@ if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right"><label for="attrcreators_key"><?php print_string('auth_ldap_attrcreators_key','auth') ?></label></td>
<td align="right"><label for="attrcreators"><?php print_string('auth_ldap_attrcreators_key','auth') ?></label></td>
<td>
@@ -742,7 +742,7 @@ if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
<tr valign="top" class="required">
<td align="right"><label for="groupecreators_key"><?php print_string('auth_ldap_groupecreators_key','auth') ?></label></td>
<td align="right"><label for="groupecreators"><?php print_string('auth_ldap_groupecreators_key','auth') ?></label></td>
<td>
@@ -825,4 +825,4 @@ print_auth_lock_options('cas', $user_fields, $help, true, true);
?>
</table>
</table>
+3 -6
View File
@@ -132,11 +132,8 @@ class auth_plugin_db extends auth_plugin_base {
* @return array
*/
function db_attributes() {
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
"department", "address", "city", "country", "description",
"idnumber", "lang" );
$moodleattributes = array();
foreach ($fields as $field) {
foreach ($this->userfields as $field) {
if (!empty($this->config->{"field_map_$field"})) {
$moodleattributes[$field] = $this->config->{"field_map_$field"};
}
@@ -241,11 +238,11 @@ class auth_plugin_db extends auth_plugin_base {
// find obsolete users
if (count($userlist)) {
$sql = "SELECT u.id, u.username, u.email
$sql = "SELECT u.id, u.username, u.email, u.auth
FROM {$CFG->prefix}user u
WHERE u.auth='db' AND u.deleted=0 AND u.username NOT IN ($quoteduserlist)";
} else {
$sql = "SELECT u.id, u.username, u.email
$sql = "SELECT u.id, u.username, u.email, u.auth
FROM {$CFG->prefix}user u
WHERE u.auth='db' AND u.deleted=0";
}
+16
View File
@@ -197,8 +197,24 @@ class auth_plugin_email extends auth_plugin_base {
* Processes and stores configuration data for this authentication plugin.
*/
function process_config($config) {
// set to defaults if undefined
if (!isset($config->recaptcha)) {
$config->recaptcha = false;
}
// save settings
set_config('recaptcha', $config->recaptcha, 'auth/email');
return true;
}
/**
* Returns whether or not the captcha element is enabled, and the admin settings fulfil its requirements.
* @abstract Implement in child classes
* @return bool
*/
function is_captcha_enabled() {
return false;
}
}
+19 -1
View File
@@ -1,7 +1,25 @@
<!-- No config needed -->
<div style="text-align: center"><?php print_string('none'); ?></div>
<?php
// set to defaults if undefined
if (!isset($config->recaptcha)) {
$config->recaptcha = false;
}
$yesno = array( get_string('no'), get_string('yes') );
?>
<table cellspacing="0" cellpadding="5" border="0">
<tr>
<td colspan="3">
<h2 class="main"><?php print_string('auth_emailsettings', 'auth') ?> </h2>
</td>
</tr>
<tr>
<td align="right"><label for="menurecaptcha"><?php print_string('auth_emailrecaptcha_key', 'auth') ?></label></td>
<td><?php choose_from_menu($yesno, 'recaptcha', $config->recaptcha, ''); ?></td>
<td><?php print_string('auth_emailrecaptcha', 'auth') ?></td>
</tr>
<?php
print_auth_lock_options('email', $user_fields, get_string('auth_fieldlocks_help', 'auth'), false, false);
+2 -5
View File
@@ -643,7 +643,7 @@ class auth_plugin_ldap extends auth_plugin_base {
// find users in DB that aren't in ldap -- to be removed!
// this is still not as scalable (but how often do we mass delete?)
if (!empty($this->config->removeuser)) {
$sql = "SELECT u.id, u.username, u.email
$sql = "SELECT u.id, u.username, u.email, u.auth
FROM {$CFG->prefix}user u
LEFT JOIN $temptable e ON u.username = e.username
WHERE u.auth='ldap'
@@ -1647,11 +1647,8 @@ class auth_plugin_ldap extends auth_plugin_base {
*/
function ldap_attributes () {
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
"department", "address", "city", "country", "description",
"idnumber", "lang" );
$moodleattributes = array();
foreach ($fields as $field) {
foreach ($this->userfields as $field) {
if (!empty($this->config->{"field_map_$field"})) {
$moodleattributes[$field] = $this->config->{"field_map_$field"};
if (preg_match('/,/',$moodleattributes[$field])) {
+2 -2
View File
@@ -450,7 +450,7 @@ if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
</tr>
<tr valign="top">
<td align="right"><label for="ntlmsso_enabled"><?php print_string('auth_ntlmsso_enabled_key','auth') ?></label></td>
<td align="right"><label for="menuntlmsso_enabled"><?php print_string('auth_ntlmsso_enabled_key','auth') ?></label></td>
<td>
<?php
choose_from_menu($yesno, 'ntlmsso_enabled', $config->ntlmsso_enabled, '0');
@@ -462,7 +462,7 @@ if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
</tr>
<tr valign="top">
<td align="right"><label for="ntlmsso_subnet"><?php print_string('auth_ntlmsso_subnet_key','auth') ?></label></td>
<td><input name="ntlmsso_subnet" id="ntlmsso_subnet" type="text" size="30" value="<?php p($config->ntlmsso_subnet) ?>"
<td><input name="ntlmsso_subnet" id="ntlmsso_subnet" type="text" size="30" value="<?php p($config->ntlmsso_subnet) ?>" />
</td>
<td>
<?php print_string('auth_ntlmsso_subnet','auth') ?>
+12 -12
View File
@@ -171,16 +171,16 @@ class auth_plugin_mnet extends auth_plugin_base {
require_once $CFG->dirroot . '/mnet/xmlrpc/client.php';
// check remote login permissions
if (! has_capability('moodle/site:mnetlogintoremote', get_context_instance(CONTEXT_SYSTEM, SITEID))
if (! has_capability('moodle/site:mnetlogintoremote', get_context_instance(CONTEXT_SYSTEM))
or is_mnet_remote_user($USER)
or $USER->username == 'guest'
or empty($USER->id)) {
error(get_string('notpermittedtojump', 'mnet'));
print_error('notpermittedtojump', 'mnet');
}
// check for SSO publish permission first
if ($this->has_service($mnethostid, 'sso_sp') == false) {
error(get_string('hostnotconfiguredforsso', 'mnet'));
print_error('hostnotconfiguredforsso', 'mnet');
}
// set RPC timeout to 30 seconds if not configured
@@ -209,7 +209,7 @@ class auth_plugin_mnet extends auth_plugin_base {
$mnet_session->expires = time() + (integer)ini_get('session.gc_maxlifetime');
$mnet_session->session_id = session_id();
if (! $mnet_session->id = insert_record('mnet_session', addslashes_object($mnet_session))) {
error(get_string('databaseerror', 'mnet'));
print_error('databaseerror', 'mnet');
}
} else {
$mnet_session->useragent = sha1($_SERVER['HTTP_USER_AGENT']);
@@ -218,7 +218,7 @@ class auth_plugin_mnet extends auth_plugin_base {
$mnet_session->expires = time() + (integer)ini_get('session.gc_maxlifetime');
$mnet_session->session_id = session_id();
if (false == update_record('mnet_session', addslashes_object($mnet_session))) {
error(get_string('databaseerror', 'mnet'));
print_error('databaseerror', 'mnet');
}
}
@@ -245,7 +245,7 @@ class auth_plugin_mnet extends auth_plugin_base {
// verify the remote host is configured locally before attempting RPC call
if (! $remotehost = get_record('mnet_host', 'wwwroot', $remotewwwroot)) {
error(get_string('notpermittedtoland', 'mnet'));
print_error('notpermittedtoland', 'mnet');
}
// get the originating (ID provider) host info
@@ -268,7 +268,7 @@ class auth_plugin_mnet extends auth_plugin_base {
list($code, $message) = array_map('trim',explode(':', $errormessage, 2));
if($code == 702) {
$site = get_site();
print_error('mnet_session_prohibited','mnet', $remotewwwroot, format_string($site->fullname));
print_error('mnet_session_prohibited', 'mnet', $remotewwwroot, format_string($site->fullname));
exit;
}
$message .= "ERROR $code:<br/>$errormessage<br/>";
@@ -291,15 +291,15 @@ class auth_plugin_mnet extends auth_plugin_base {
// TODO: refactor into a separate function
if (empty($localuser) || ! $localuser->id) {
if (empty($this->config->auto_add_remote_users)) {
error(get_string('nolocaluser', 'mnet'));
print_error('nolocaluser', 'mnet');
}
$remoteuser->mnethostid = $remotehost->id;
if (! insert_record('user', addslashes_object($remoteuser))) {
error(get_string('databaseerror', 'mnet'));
print_error('databaseerror', 'mnet');
}
$firsttime = true;
if (! $localuser = get_record('user', 'username', addslashes($remoteuser->username), 'mnethostid', $remotehost->id)) {
error(get_string('nolocaluser', 'mnet'));
print_error('nolocaluser', 'mnet');
}
}
@@ -392,7 +392,7 @@ class auth_plugin_mnet extends auth_plugin_base {
$mnet_session->expires = time() + (integer)$session_gc_maxlifetime;
$mnet_session->session_id = session_id();
if (! $mnet_session->id = insert_record('mnet_session', addslashes_object($mnet_session))) {
error(get_string('databaseerror', 'mnet'));
print_error('databaseerror', 'mnet');
}
} else {
$mnet_session->expires = time() + (integer)$session_gc_maxlifetime;
@@ -1124,7 +1124,7 @@ class auth_plugin_mnet extends auth_plugin_base {
$mnet_request->add_param($username);
$mnet_request->add_param($useragent);
if ($mnet_request->send($mnet_peer) === false) {
debugging("Server side error has occured on host $mnethostid: " .
debugging("Server side error has occured on host $mnetsession->mnethostid: " .
join("\n", $mnet_request->error));
}
}
+2
View File
@@ -14,6 +14,8 @@
require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_login();
if (!is_enabled_auth('mnet')) {
error('mnet is disabled');
}
+2 -6
View File
@@ -76,7 +76,7 @@ class auth_plugin_shibboleth extends auth_plugin_base {
// Check whether we have got all the essential attributes
if ( empty($_SERVER[$this->config->user_attribute]) ) {
error(get_string( 'shib_not_all_attributes_error', 'auth' , "'".$this->config->user_attribute."' ('".$_SERVER[$this->config->user_attribute]."'), '".$this->config->field_map_firstname."' ('".$_SERVER[$this->config->field_map_firstname]."'), '".$this->config->field_map_lastname."' ('".$_SERVER[$this->config->field_map_lastname]."') and '".$this->config->field_map_email."' ('".$_SERVER[$this->config->field_map_email]."')"));
print_error( 'shib_not_all_attributes_error', 'auth' , '', "'".$this->config->user_attribute."' ('".$_SERVER[$this->config->user_attribute]."'), '".$this->config->field_map_firstname."' ('".$_SERVER[$this->config->field_map_firstname]."'), '".$this->config->field_map_lastname."' ('".$_SERVER[$this->config->field_map_lastname]."') and '".$this->config->field_map_email."' ('".$_SERVER[$this->config->field_map_email]."')");
}
$attrmap = $this->get_attributes();
@@ -123,12 +123,8 @@ class auth_plugin_shibboleth extends auth_plugin_base {
function get_attributes() {
$configarray = (array) $this->config;
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
"department", "address", "city", "country", "description",
"idnumber", "lang", "guid");
$moodleattributes = array();
foreach ($fields as $field) {
foreach ($this->userfields as $field) {
if (isset($configarray["field_map_$field"])) {
$moodleattributes[$field] = $configarray["field_map_$field"];
}
+1 -1
View File
@@ -59,7 +59,7 @@
<tr valign="top">
<td align="right">Identity Providers:</td>
<td>
<textarea name="organization_selection" rows="10" cols="30" style="overflow: auto;" wrap="off"
<textarea name="organization_selection" rows="10" cols="30" style="overflow: auto; white-space: nowrap;"
><?php
if (!isset($config->organization_selection)){
echo 'urn:mace:organization1:providerID, Example Organization 1
+4 -4
View File
@@ -21,7 +21,7 @@
// Check whether Shibboleth is configured properly
if (empty($pluginconfig->user_attribute)) {
error(get_string( 'shib_not_set_up_error', 'auth'));
print_error('shib_not_set_up_error', 'auth');
}
/// If we can find the Shibboleth attribute, save it in session and return to main login page
@@ -66,7 +66,7 @@
}
/// Go to my-moodle page instead of homepage if mymoodleredirect enabled
if (!has_capability('moodle/site:config',get_context_instance(CONTEXT_SYSTEM, SITEID)) and !empty($CFG->mymoodleredirect) and !isguest()) {
if (!has_capability('moodle/site:config',get_context_instance(CONTEXT_SYSTEM)) and !empty($CFG->mymoodleredirect) and !isguest()) {
if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') {
$urltogo = $CFG->wwwroot.'/my/';
}
@@ -88,9 +88,9 @@
// If we can find any (user independent) Shibboleth attributes but no user
// attributes we probably didn't receive any user attributes
elseif (!empty($_SERVER['HTTP_SHIB_APPLICATION_ID'])) {
error(get_string( 'shib_no_attributes_error', 'auth' , '\''.$pluginconfig->user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\''));
print_error('shib_no_attributes_error', 'auth' , '', '\''.$pluginconfig->user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\'');
} else {
error(get_string( 'shib_not_set_up_error', 'auth'));
print_error('shib_not_set_up_error', 'auth');
}
?>
+2 -2
View File
@@ -22,7 +22,7 @@
}
} else {
require_login();
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
@@ -100,7 +100,7 @@
}
//Print header
if (has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) {
$navlinks[] = array('name' => $stradministration, 'link' => "$CFG->wwwroot/$CFG->admin/index.php", 'type' => 'misc');
$navlinks[] = array('name' => $strcoursebackup, 'link' => 'backup.php', 'type' => 'misc');
$navlinks[] = array('name' => "$course->fullname ($course->shortname)", 'link' => null, 'type' => 'misc');
+4 -3
View File
@@ -15,7 +15,7 @@
}
}
} else {
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
@@ -66,7 +66,7 @@
}
//Here we check if backup_users = None. Then, we switch off every module
//user info, user_files, logs and exercises, workshop and messages backups. A Warning is showed to
//user info, user_files, logs and exercises, workshop and messages & blogs backups. A Warning is showed to
//inform the user.
// TODO: Move this logic to one function to be shared by any (manual, scheduled) backup
if ($backupprefs->backup_users == 2) {
@@ -114,6 +114,7 @@
$backupprefs->backup_user_files = 0;
$backupprefs->backup_logs = 0;
$backupprefs->backup_messages = 0;
$backupprefs->backup_blogs = 0;
$backupprefs->backuproleassignments = array();
print_simple_box("<font color=\"red\">".get_string("backupnoneusersinfo")."</font>","center", "70%", '', "20", "noticebox");
@@ -195,7 +196,7 @@
$user_options[2] = get_string("includenoneusers");
echo $user_options[$backupprefs->backup_users].'</b>';
//Print info
$table->data = user_check_backup($id,$backupprefs->backup_unique_code,$backupprefs->backup_users,$backupprefs->backup_messages);
$table->data = user_check_backup($id,$backupprefs->backup_unique_code,$backupprefs->backup_users,$backupprefs->backup_messages, $backupprefs->backup_blogs);
print_table($table);
echo "</td></tr>";
+1 -1
View File
@@ -15,7 +15,7 @@
}
}
} else {
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
+60 -43
View File
@@ -15,7 +15,7 @@
}
}
} else {
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
@@ -67,6 +67,7 @@
$backup_site_files = optional_param('backup_site_files',1);
$backup_gradebook_history = optional_param('backup_gradebook_history', 0, PARAM_INT);
$backup_messages = optional_param('backup_messages',1);
$backup_blogs = optional_param('backup_blogs',1);
if ($count == 0) {
notice("No backupable modules are installed!");
@@ -124,7 +125,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
//Print option to select/deselect everything with 1 click.
echo "<tr>";
echo "<td align=\"right\">";
echo '<b>'.get_string("include").":</b>";
echo '<b>'.get_string("include")."</b>";
echo "</td><td>";
echo "<a href=\"javascript:void(0);\" onclick=\"selectItemInCheckboxByName('form1', 'backup_', true);\">". get_string("all")."</a>/";
echo "<a href=\"javascript:void(0);\" onclick=\"selectItemInCheckboxByName('form1', 'backup_', false);\">". get_string("none")."</a>";
@@ -142,8 +143,9 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
$modname = $mod->name;
$modbackup = $modname."_backup_mods";
//If exists the lib & function
$var = "exists_".$modname;
if (isset($$var) && $$var) {
$var = 'exists_'.$modname;
$exvar = 'exists_one_'.$modname;
if (!empty($$var) and !empty($$exvar)) {
//Print the full tr
echo "<tr class=\"r".$currentrow."\">";
echo " <td align=\"right\">&nbsp;";
@@ -166,29 +168,25 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
echo '<input type="hidden" name="'.$var.'" value="0" />';
}
echo "</td></tr>\n";
// if we have the backup_one_mod function, loop here.
$var = 'exists_one_'.$modname;
if (!empty($$var)) {
echo '<tr><td></td><td colspan="3"><table class="backup-form-instances">';
$instances = get_all_instances_in_course($modname, $course, NULL, true);
foreach ($instances as $instance) {
echo '<tr><td>';
$var = 'backup_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,1);
print_checkbox($var,$$var,$$var,$instance->name,$instance->name,'this.form.elements[\'backup_'.$modname.'\'].checked=1;');
echo '</td><td align="right">&nbsp;';
$var = 'backup_user_info_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,1);
if (empty($to)) {
print_checkbox($var,$$var,$$var,get_string('userdata'),'','this.form.elements[\'backup_user_info_'.$modname.'\'].checked=1;');
} else {
echo '<input type="hidden" name="'.$var.'" value="0" />';
}
echo '</td></tr>';
echo '<tr><td></td><td colspan="3"><table class="backup-form-instances">';
$instances = get_all_instances_in_course($modname, $course, NULL, true);
$var = $exvar;
foreach ($instances as $instance) {
echo '<tr><td>';
$var = 'backup_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,1);
print_checkbox($var,$$var,$$var,$instance->name,$instance->name,'this.form.elements[\'backup_'.$modname.'\'].checked=1;');
echo '</td><td align="right">&nbsp;';
$var = 'backup_user_info_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,1);
if (empty($to)) {
print_checkbox($var,$$var,$$var,get_string('userdata'),'','this.form.elements[\'backup_user_info_'.$modname.'\'].checked=1;');
} else {
echo '<input type="hidden" name="'.$var.'" value="0" />';
}
echo '</table></td></tr>';
echo '</td></tr>';
}
echo '</table></td></tr>';
}
}
//Line
@@ -198,7 +196,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
//Now print the Metacourse tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string ("metacourse").":";
echo '<label for="menubackup_metacourse">'.get_string ("metacourse").'</label>';
echo "</b></td><td colspan=\"2\">";
$meta_options[0] = get_string("no");
$meta_options[1] = get_string("yes");
@@ -213,7 +211,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
//Now print the Users tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string("users").":";
echo '<label for="menubackup_users">'.get_string ("users").'</label>';
echo "</b></td><td colspan=\"2\">";
$user_options[0] = get_string("all");
$user_options[1] = get_string("course");
@@ -229,7 +227,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
//Now print the Logs tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string("logs").":";
echo '<label for="menubackup_logs">'.get_string ("logs").'</label>';
echo "</b></td><td colspan=\"2\">";
$log_options[0] = get_string("no");
$log_options[1] = get_string("yes");
@@ -244,7 +242,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
//Now print the User Files tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string ("userfiles").":";
echo '<label for="menubackup_user_files">'.get_string ("userfiles").'</label>';
echo "</b></td><td colspan=\"2\">";
$user_file_options[0] = get_string("no");
$user_file_options[1] = get_string("yes");
@@ -254,10 +252,11 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
else {
$hidden_options .= '<input type="hidden" name="backup_user_files" value="0" />';
}
//Now print the Course Files tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string ("coursefiles").":";
echo '<label for="menubackup_course_files">'.get_string ("coursefiles").'</label>';
echo "</b></td><td colspan=\"2\">";
$course_file_options[0] = get_string("no");
$course_file_options[1] = get_string("yes");
@@ -269,7 +268,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
//Now print the site Files tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string ("sitefilesused").":";
echo '<label for="menubackup_site_files">'.get_string ("sitefilesused").'</label>';
helpbutton('sitefilesused', get_string('sitefilesused'));
echo "</b></td><td colspan=\"2\">";
$course_file_options[0] = get_string("no");
@@ -279,20 +278,24 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
}
// do you want grade histories to be backed up?
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string ('gradebookhistories', 'grades').":";
echo "</b></td><td colspan=\"2\">";
$gradebook_history_options[0] = get_string("no");
$gradebook_history_options[1] = get_string("yes");
choose_from_menu($gradebook_history_options, "backup_gradebook_history", $backup_gradebook_history, "");
echo "</td></tr>";
if (empty($CFG->disablegradehistory)) {
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo '<label for="menubackup_gradebook_history">'.get_string ('gradebookhistories', 'grades').'</label>';
echo "</b></td><td colspan=\"2\">";
$gradebook_history_options[0] = get_string("no");
$gradebook_history_options[1] = get_string("yes");
choose_from_menu($gradebook_history_options, "backup_gradebook_history", $backup_gradebook_history, "");
echo "</td></tr>";
} else {
$hidden_options .= '<input type="hidden" name="backup_gradebook_history" value="0" />';
}
if (empty($to) && $course->id == SITEID) {
//If we are in a SITEID backup print the Messages tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string ('messages','message').":";
echo '<label for="menubackup_messages">'.get_string ('messages', 'message').'</label>';
echo "</b></td><td colspan=\"2\">";
$mess_options[0] = get_string("no");
$mess_options[1] = get_string("yes");
@@ -302,6 +305,21 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
else {
$hidden_options .= '<input type="hidden" name="backup_messages" value="0" />';
}
if (empty($to) && $course->id == SITEID && !empty($CFG->bloglevel)) {
//If we are in a SITEID backup and blogs are enabled print the Blogs tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string ('blogs','blog').":";
echo "</b></td><td colspan=\"2\">";
$blog_options[0] = get_string("no");
$blog_options[1] = get_string("yes");
choose_from_menu($blog_options, "backup_blogs", $backup_blogs, "");
echo "</td></tr>";
}
else {
$hidden_options .= '<input type="hidden" name="backup_blogs" value="0" />';
}
}
//Now print a place to select which role assignments to back up.
@@ -311,7 +329,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
echo "<tr>";
echo "<td align=\"right\" valign=\"top\" colspan=\"2\"><b>";
echo get_string("backuproleassignments").":";
echo get_string("backuproleassignments");
echo "</b></td><td colspan=\"2\">";
$roles = get_records('role', '', '', 'sortorder');
foreach ($roles as $role) {
@@ -333,12 +351,11 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
?>
</table>
<div style="text-align:center;margin-left:auto;margin-right:auto">
<?php
/// Print captured hidden options, now that we have closed the table
echo $hidden_options;
?>
<div style="text-align:center;margin-left:auto;margin-right:auto">
<input type="hidden" name="id" value="<?php p($id) ?>" />
<input type="hidden" name="to" value="<?php p($to) ?>" />
<input type="hidden" name="backup_unique_code" value="<?php p($backup_unique_code); ?>" />
+19 -4
View File
@@ -340,6 +340,9 @@ function schedule_backup_course_configure($course,$starttime = 0) {
if (!isset($backup_config->backup_sche_messages)) {
$backup_config->backup_sche_messages = 0;
}
if (!isset($backup_config->backup_sche_blogs)) {
$backup_config->backup_sche_blogs = 0;
}
if (!isset($backup_config->backup_sche_active)) {
$backup_config->backup_sche_active = 0;
}
@@ -437,6 +440,7 @@ function schedule_backup_course_configure($course,$starttime = 0) {
$preferences->backup_course_files = $backup_config->backup_sche_coursefiles;
$preferences->backup_site_files = $backup_config->backup_sche_sitefiles;
$preferences->backup_messages = $backup_config->backup_sche_messages;
$preferences->backup_blogs = $backup_config->backup_sche_blogs;
$preferences->backup_course = $course->id;
$preferences->backup_destination = $backup_config->backup_sche_destination;
$preferences->backup_keep = $backup_config->backup_sche_keep;
@@ -507,7 +511,13 @@ function schedule_backup_course_configure($course,$starttime = 0) {
} else {
$include_message_users = false;
}
user_check_backup($course->id,$backup_unique_code,$preferences->backup_users,$include_message_users);
//Decide about include users with blogs, based on SITEID
if ($preferences->backup_blogs && $preferences->backup_course == SITEID) {
$include_blog_users = true;
} else {
$include_blog_users = false;
}
user_check_backup($course->id,$backup_unique_code,$preferences->backup_users,$include_message_users, $include_blog_users);
}
//Now calculate the logs
@@ -623,9 +633,14 @@ function schedule_backup_course_execute($preferences,$starttime = 0) {
//doing a SITE backup, let's do it
if ($status && $preferences->backup_messages && $preferences->backup_course == SITEID) {
schedule_backup_log($starttime,$preferences->backup_course," messages");
if (!$status = backup_messages($backup_file,$preferences)) {
notify("An error occurred while backing up messages");
}
$status = backup_messages($backup_file,$preferences);
}
//If we have selected to backup blogs and we are
//doing a SITE backup, let's do it
if ($status && $preferences->backup_blogs && $preferences->backup_course == SITEID) {
schedule_backup_log($starttime,$preferences->backup_course," blogs");
$status = backup_blogs($backup_file,$preferences);
}
//If we have selected to backup quizzes, backup categories and
+318 -144
View File
@@ -12,9 +12,11 @@
* @param int $backup_unique_code setting specifying what users to export (0=all, 1=needed, 2=none)
* @param int $backup_messages flag (true/false) defining if messages must be
* considered to extract needed users
* @param int $backup_blogs flag (true/false) defining if blogs must be
* considered to extract needed users
* @return array one array (key, value) sumarizing the result of the function (number of users)
*/
function user_check_backup($courseid,$backup_unique_code,$backup_users,$backup_messages) {
function user_check_backup($courseid,$backup_unique_code,$backup_users,$backup_messages,$backup_blogs) {
$context = get_context_instance(CONTEXT_COURSE, $courseid);
$count_users = 0;
@@ -25,8 +27,9 @@
} else if ($backup_users == 1) { /// Needed users
/// Calculate needed users (calling every xxxx_get_participants function + scales users)
$needed_users = backup_get_needed_users($courseid, $backup_messages);
/// Calculate needed users (calling every xxxx_get_participants function + scales users
/// + messages users + blogs users)
$needed_users = backup_get_needed_users($courseid, $backup_messages, $backup_blogs);
/// Calculate enrolled users (having course:view cap)
$enrolled_users = backup_get_enrolled_users($courseid);
@@ -83,11 +86,13 @@
//Returns every needed user (participant) in a course
//It uses the xxxx_get_participants() function
//plus users needed to backup scales.
//Also it search for users having messages and
//users having blogs
//WARNING: It returns only NEEDED users, not every
// every student and teacher in the course, so it
//must be merged with backup_get_enrrolled_users !!
function backup_get_needed_users ($courseid, $includemessages=false) {
function backup_get_needed_users ($courseid, $includemessages=false, $includeblogs=false) {
global $CFG;
@@ -150,6 +155,22 @@
}
}
//Now, add blog users if necessary
if ($includeblogs) {
include_once("$CFG->dirroot/blog/lib.php");
//Get users
$blogusers = blog_get_participants();
//Add blog users to results
if ($blogusers) {
foreach ($blogusers as $bloguser) {
//If id != 0
if ($bloguser->id !=0) {
$result[$bloguser->id]->id = $bloguser->id;
}
}
}
}
return $result;
}
@@ -585,18 +606,30 @@
} else {
fwrite ($bf,full_tag("COURSEFILES",3,false,"false"));
}
//The course files
//The site files
if ($preferences->backup_site_files == 1) {
fwrite ($bf,full_tag("SITEFILES",3,false,"true"));
} else {
fwrite ($bf,full_tag("SITEFILES",3,false,"false"));
}
//The gradebook histories
if ($preferences->backup_gradebook_history == 1) {
fwrite ($bf,full_tag("GRADEBOOKHISTORIES",3,false,"true"));
} else {
fwrite ($bf,full_tag("GRADEBOOKHISTORIES",3,false,"false"));
}
//The messages in backup
if ($preferences->backup_messages == 1 && $preferences->backup_course == SITEID) {
fwrite ($bf,full_tag("MESSAGES",3,false,"true"));
} else {
fwrite ($bf,full_tag("MESSAGES",3,false,"false"));
}
//The blogs in backup
if ($preferences->backup_blogs == 1 && $preferences->backup_course == SITEID) {
fwrite ($bf,full_tag("BLOGS",3,false,"true"));
} else {
fwrite ($bf,full_tag("BLOGS",3,false,"false"));
}
//The mode of writing the block data
fwrite ($bf,full_tag('BLOCKFORMAT',3,false,'instances'));
fwrite ($bf,end_tag("DETAILS",2,true));
@@ -608,13 +641,19 @@
fwrite ($bf, start_tag('ROLES', 1, true));
$roles = backup_fetch_roles($preferences);
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$coursecontext = get_context_instance(CONTEXT_COURSE, $preferences->backup_course);
foreach ($roles as $role) {
fwrite ($bf,start_tag('ROLE',2,true));
fwrite ($bf,full_tag('ID', 3, false, $role->id));
fwrite ($bf,full_tag('NAME',3,false,$role->name));
fwrite ($bf,full_tag('SHORTNAME',3,false,$role->shortname));
/// Calculate $role name in course
$nameincourse = role_get_name($role, $coursecontext);
if ($nameincourse != $role->name) {
fwrite ($bf,full_tag('NAMEINCOURSE', 3, false, $nameincourse));
}
// find and write all default capabilities
fwrite ($bf,start_tag('CAPABILITIES',3,true));
// pull out all default (site context) capabilities
@@ -624,6 +663,7 @@
fwrite ($bf,full_tag('NAME', 5, false, $capability));
fwrite ($bf,full_tag('PERMISSION', 5, false, $value));
// use this to pull out the other info (timemodified and modifierid)
$cap = get_record_sql("SELECT *
FROM {$CFG->prefix}role_capabilities
WHERE capability = '$capability'
@@ -910,6 +950,92 @@
}
//Print blogs info (post table, module=blog, course=0)
function backup_blogs($bf, $preferences) {
global $CFG;
$status = true;
/// Check we have something to backup
$siteblogs = count_records('post', 'module', 'blog', 'courseid', 0);
if ($siteblogs) {
$counter = 0;
/// blogs open tag
fwrite ($bf, start_tag("BLOGS",2,true));
if ($siteblogs) {
$rs_blogs = get_recordset_sql("SELECT * from {$CFG->prefix}post
WHERE module = 'blog'
AND courseid = 0");
/// Iterate over every blog
while ($blog = rs_fetch_next_record($rs_blogs)) {
/// start blog
fwrite($bf, start_tag("BLOG",3,true));
/// blog body
fwrite ($bf,full_tag("ID",4,false,$blog->id));
fwrite ($bf,full_tag("MODULE",4,false,$blog->module));
fwrite ($bf,full_tag("USERID",4,false,$blog->userid));
fwrite ($bf,full_tag("COURSEID",4,false,$blog->courseid));
fwrite ($bf,full_tag("GROUPID",4,false,$blog->groupid));
fwrite ($bf,full_tag("MODULEID",4,false,$blog->moduleid));
fwrite ($bf,full_tag("COURSEMODULEID",4,false,$blog->coursemoduleid));
fwrite ($bf,full_tag("SUBJECT",4,false,$blog->subject));
fwrite ($bf,full_tag("SUMMARY",4,false,$blog->summary));
fwrite ($bf,full_tag("CONTENT",4,false,$blog->content));
fwrite ($bf,full_tag("UNIQUEHASH",4,false,$blog->uniquehash));
fwrite ($bf,full_tag("RATING",4,false,$blog->rating));
fwrite ($bf,full_tag("FORMAT",4,false,$blog->format));
fwrite ($bf,full_tag("ATTACHMENT",4,false,$blog->attachment));
fwrite ($bf,full_tag("PUBLISHSTATE",4,false,$blog->publishstate));
fwrite ($bf,full_tag("LASTMODIFIED",4,false,$blog->lastmodified));
fwrite ($bf,full_tag("CREATED",4,false,$blog->created));
fwrite ($bf,full_tag("USERMODIFIED",4,false,$blog->usermodified));
/// Blog tags
/// Check if we have blog tags to backup
if (!empty($CFG->usetags)) {
if ($tags = tag_get_tags('post', $blog->id)) { //This return them ordered by default
/// Start BLOG_TAGS tag
fwrite ($bf,start_tag("BLOG_TAGS",4,true));
/// Write blog tags fields
foreach ($tags as $tag) {
fwrite ($bf,start_tag("BLOG_TAG",5,true));
fwrite ($bf,full_tag("NAME",6,false,$tag->name));
fwrite ($bf,full_tag("RAWNAME",6,false,$tag->rawname));
fwrite ($bf,end_tag("BLOG_TAG",5,true));
}
/// End BLOG_TAGS tag
fwrite ($bf,end_tag("BLOG_TAGS",4,true));
}
}
/// Blog comments
/// TODO: Blog comments go here (2.0)
/// end blog
fwrite($bf, end_tag("BLOG",3,true));
/// Do some output
$counter++;
if ($counter % 20 == 0) {
echo ".";
if ($counter % 400 == 0) {
echo "<br />";
}
backup_flush(300);
}
}
rs_close($rs_blogs);
}
/// blogs close tag
$status = fwrite($bf, end_tag("BLOGS",2,true));
}
return $status;
}
//Prints course's blocks info (table block_instance)
function backup_course_blocks ($bf,$preferences) {
@@ -923,27 +1049,31 @@
$pages = array();
$pages[] = page_create_object(PAGE_COURSE_VIEW, $preferences->backup_course);
// Let's see if we have to backup blocks from modules
$modulerecords = get_records_sql('SELECT name, id FROM '.$CFG->prefix.'modules');
if (!empty($CFG->showblocksonmodpages)) {
// get course structure
$course = get_record('course', 'id', $preferences->backup_course);
$modinfo =& get_fast_modinfo($course);
foreach($preferences->mods as $module) {
if(!$module->backup) {
continue;
}
foreach($preferences->mods as $module) {
if (!$module->backup) {
continue;
}
$cmods = get_records_select('course_modules', 'course = '.$preferences->backup_course.' AND module = '.$modulerecords[$module->name]->id);
if(empty($cmods)) {
continue;
}
if (empty($modinfo->instances[$module->name])) {
continue;
}
$pagetypes = page_import_types('mod/'.$module->name.'/');
if(empty($pagetypes)) {
continue;
}
$pagetypes = page_import_types('mod/'.$module->name.'/');
if (empty($pagetypes)) {
continue;
}
foreach($pagetypes as $pagetype) {
foreach($cmods as $cmod) {
$pages[] = page_create_object($pagetype, $cmod->instance);
foreach($pagetypes as $pagetype) {
foreach($modinfo->instances[$module->name] as $cm) {
if (!empty($module->instances[$cm->instance]->backup)) {
$pages[] = page_create_object($pagetype, $cm->instance);
}
}
}
}
}
@@ -951,7 +1081,7 @@
//Blocks open tag
fwrite ($bf,start_tag('BLOCKS',2,true));
while($page = array_pop($pages)) {
foreach($pages as $page) {
if ($instances = blocks_get_by_page($page)) {
//Iterate over every block
foreach ($instances as $position) {
@@ -961,26 +1091,32 @@
if(empty($blocks[$instance->blockid]->name)) {
continue;
}
$blockname = $blocks[$instance->blockid]->name;
//Give the block a chance to process any links in configdata.
if (!isset($blocks[$instance->blockid]->blockobject)) {
$blocks[$instance->blockid]->blockobject = block_instance($blocks[$instance->blockid]->name);
if (!$blockobj = block_instance($blockname, $instance)) {
// Invalid block
continue;
}
$config = unserialize(base64_decode($instance->configdata));
$blocks[$instance->blockid]->blockobject->backup_encode_absolute_links_in_config($config);
$instance->configdata = base64_encode(serialize($config));
// encode absolute links in block config
$instance->configdata = $blockobj->get_backup_encoded_config();
//Begin Block
fwrite ($bf,start_tag('BLOCK',3,true));
fwrite ($bf,full_tag('ID', 4, false,$instance->id));
fwrite ($bf,full_tag('NAME',4,false,$blocks[$instance->blockid]->name));
fwrite ($bf,full_tag('NAME',4,false,$blockname));
fwrite ($bf,full_tag('PAGEID',4,false,$instance->pageid));
fwrite ($bf,full_tag('PAGETYPE',4,false,$instance->pagetype));
fwrite ($bf,full_tag('POSITION',4,false,$instance->position));
fwrite ($bf,full_tag('WEIGHT',4,false,$instance->weight));
fwrite ($bf,full_tag('VISIBLE',4,false,$instance->visible));
fwrite ($bf,full_tag('CONFIGDATA',4,false,$instance->configdata));
// Write instance data if needed
if ($blockobj->backuprestore_instancedata_used()) {
fwrite ($bf,start_tag('INSTANCEDATA',4,true));
$status = $blockobj->instance_backup($bf, $preferences);
fwrite ($bf,end_tag('INSTANCEDATA',4,true));
}
$context = get_context_instance(CONTEXT_BLOCK, $instance->id);
write_role_overrides_xml($bf, $context, 4);
/// write role_assign code here
@@ -1087,8 +1223,18 @@
if ($selected) {
$context = get_context_instance(CONTEXT_MODULE, $tok);
//Gets course_module data from db
$course_module = get_records ("course_modules","id",$tok);
//Gets course_module data from db - verify activity exists and is enabled!
$sql = "SELECT cm.*
FROM {$CFG->prefix}course_modules cm
JOIN {$CFG->prefix}modules m ON m.id = cm.module
JOIN {$CFG->prefix}$moduletype a ON a.id = cm.instance
WHERE m.visible = 1 AND cm.id = $tok";
if (!$course_module = get_record_sql($sql)) {
// cm exists but activity instance missing - probably caused by double clicking
$tok = strtok(",");
continue;
}
//If it's the first, pring MODS tag
if ($first_record) {
fwrite ($bf,start_tag("MODS",4,true));
@@ -1097,8 +1243,8 @@
// if we're doing selected instances, check that too.
if (is_array($preferences->mods[$moduletype]->instances)
&& count($preferences->mods[$moduletype]->instances)
&& (!array_key_exists($course_module[$tok]->instance,$preferences->mods[$moduletype]->instances)
|| empty($preferences->mods[$moduletype]->instances[$course_module[$tok]->instance]->backup))) {
&& (!array_key_exists($course_module->instance,$preferences->mods[$moduletype]->instances)
|| empty($preferences->mods[$moduletype]->instances[$course_module->instance]->backup))) {
$tok = strtok(",");
continue;
}
@@ -1111,14 +1257,15 @@
//Save neccesary info to backup_ids
fwrite ($bf,full_tag("ID",6,false,$tok));
fwrite ($bf,full_tag("TYPE",6,false,$moduletype));
fwrite ($bf,full_tag("INSTANCE",6,false,$course_module[$tok]->instance));
fwrite ($bf,full_tag("ADDED",6,false,$course_module[$tok]->added));
fwrite ($bf,full_tag("SCORE",6,false,$course_module[$tok]->score));
fwrite ($bf,full_tag("INDENT",6,false,$course_module[$tok]->indent));
fwrite ($bf,full_tag("VISIBLE",6,false,$course_module[$tok]->visible));
fwrite ($bf,full_tag("GROUPMODE",6,false,$course_module[$tok]->groupmode));
fwrite ($bf,full_tag("GROUPINGID",6,false,$course_module[$tok]->groupingid));
fwrite ($bf,full_tag("GROUPMEMBERSONLY",6,false,$course_module[$tok]->groupmembersonly));
fwrite ($bf,full_tag("INSTANCE",6,false,$course_module->instance));
fwrite ($bf,full_tag("ADDED",6,false,$course_module->added));
fwrite ($bf,full_tag("SCORE",6,false,$course_module->score));
fwrite ($bf,full_tag("INDENT",6,false,$course_module->indent));
fwrite ($bf,full_tag("VISIBLE",6,false,$course_module->visible));
fwrite ($bf,full_tag("GROUPMODE",6,false,$course_module->groupmode));
fwrite ($bf,full_tag("GROUPINGID",6,false,$course_module->groupingid));
fwrite ($bf,full_tag("GROUPMEMBERSONLY",6,false,$course_module->groupmembersonly));
fwrite ($bf,full_tag("IDNUMBER",6,false,$course_module->idnumber));
// get all the role_capabilities overrides in this mod
write_role_overrides_xml($bf, $context, 6);
/// write role_assign code here
@@ -1401,54 +1548,54 @@
}
//Backup gradebook info
function backup_gradebook_info($bf,$preferences) {
function backup_gradebook_info($bf, $preferences) {
global $CFG;
require_once($CFG->libdir.'/gradelib.php');
//first make sure items are properly sorted and everything is ok
grade_category::fetch_course_tree($preferences->backup_course, true);
grade_regrade_final_grades($preferences->backup_course);
$status = true;
// see if ALL grade items of type mod of this course are being backed up
// if not, we do not need to backup grade category and associated grade items/grades
$backupall = true;
if ($grade_items = get_records_sql("SELECT * FROM {$CFG->prefix}grade_items
WHERE courseid = $preferences->backup_course
AND itemtype != 'course'
ORDER BY sortorder ASC")) {
if ($grade_items = get_records_sql("SELECT *
FROM {$CFG->prefix}grade_items
WHERE courseid = $preferences->backup_course
AND itemtype = 'mod'")) {
foreach ($grade_items as $grade_item) {
// do not restore if this grade_item is a mod, and
if ($grade_item->itemtype == 'mod') {
// get module information
// if no user data selected, we skip this grade_item
if (!backup_userdata_selected($preferences,$grade_item->itemmodule,$grade_item->iteminstance)) {
//print_object($grade_item);
$backupall = false;
break;
}
// get module information
// if no user data selected, we do not backup categories
if (!backup_userdata_selected($preferences,$grade_item->itemmodule,$grade_item->iteminstance)) {
$backupall = false;
break;
}
}
unset($grade_items); //free memory
}
//Gradebook header
fwrite ($bf,start_tag("GRADEBOOK",2,true));
$status = backup_gradebook_outcomes_info($bf, $preferences);
$status = backup_gradebook_grade_letters_info($bf,$preferences);
// Now backup grade_item (inside grade_category)
if ($backupall) {
$status = backup_gradebook_category_info($bf,$preferences);
}
$status = backup_gradebook_item_info($bf,$preferences, $backupall);
$status = backup_gradebook_grade_letters_info($bf,$preferences);
$status = backup_gradebook_outcomes_info($bf, $preferences);
$status = backup_gradebook_outcomes_courses_info($bf, $preferences);
// backup gradebook histories
if ($preferences->backup_gradebook_history) {
$status = backup_gradebook_categories_history_info($bf, $preferences);
$status = backup_gradebook_grades_history_info($bf, $preferences);
$status = backup_gradebook_items_history_info($bf, $preferences);
$status = backup_gradebook_outcomes_history($bf, $preferences);
$status = backup_gradebook_categories_history_info($bf, $preferences);
$status = backup_gradebook_items_history_info($bf, $preferences);
$status = backup_gradebook_grades_history_info($bf, $preferences);
}
//Gradebook footer
@@ -1456,17 +1603,20 @@
return $status;
}
function backup_gradebook_category_info($bf,$preferences) {
function backup_gradebook_category_info($bf, $preferences) {
global $CFG;
$status = true;
// getting grade categories, but make sure parents come before children
// because when we do restore, we need to recover the parents first
// we do this by getting the lowest depth first
$grade_categories = get_records_sql("SELECT * FROM {$CFG->prefix}grade_categories
WHERE courseid = $preferences->backup_course
AND depth > 1
ORDER BY depth ASC");
// get grade categories in proper order - specified in category grade items
$course_item = grade_item::fetch_course_item($preferences->backup_course);
$grade_categories = get_records_sql("SELECT gc.*, gi.sortorder
FROM {$CFG->prefix}grade_categories gc
JOIN {$CFG->prefix}grade_items gi
ON (gi.iteminstance = gc.id)
WHERE gc.courseid = $preferences->backup_course
AND (gi.itemtype='course' OR gi.itemtype='category')
ORDER BY gi.sortorder ASC");
if ($grade_categories) {
//Begin grade_categories tag
fwrite ($bf,start_tag("GRADE_CATEGORIES",3,true));
@@ -1500,33 +1650,32 @@
}
//Backup gradebook_item (called from backup_gradebook_info
function backup_gradebook_item_info($bf,$preferences, $backupall) {
function backup_gradebook_item_info($bf, $preferences, $backupall) {
global $CFG;
require_once($CFG->libdir . '/gradelib.php');
$status = true;
// get all the grade_items, ordered by sort order since upon restoring, it is not always
// possible to use the same sort order. We could at least preserve the sortorder by restoring
// grade_items in the original sortorder
if ($grade_items = get_records_sql("SELECT * FROM {$CFG->prefix}grade_items
WHERE courseid = $preferences->backup_course
ORDER BY sortorder ASC")) {
if ($grade_items = get_records_sql("SELECT *
FROM {$CFG->prefix}grade_items
WHERE courseid = $preferences->backup_course
ORDER BY sortorder ASC")) {
//Begin grade_items tag
fwrite ($bf,start_tag("GRADE_ITEMS",3,true));
//Iterate for each item
foreach ($grade_items as $grade_item) {
//Iterate over each item
foreach ($grade_items as $item) {
// Instantiate a grade_item object, to access its methods
$grade_item = grade_object::fetch_helper('grade_items', 'grade_item', $grade_item);
$grade_item = new grade_item($item, false);
// do not restore if this grade_item is a mod, and
if ($grade_item->itemtype == 'mod') {
// this still needs to be included, though grades can be ignored
//MDL-12463 - exclude grade_items of instances not chosen for backup
if (empty($preferences->mods[$grade_item->itemmodule]->instances[$grade_item->iteminstance]->backup)) {
continue;
}
} else if ($grade_item->itemtype == 'category') {
// if not all grade items are being backed up
// we ignore this type of grade_item and grades associated
@@ -1591,28 +1740,23 @@
global $CFG;
$status = true;
// getting grade categories, but make sure parents come before children
// because when we do restore, we need to recover the parents first
// we do this by getting the lowest depth first
$context = get_context_instance(CONTEXT_COURSE, $preferences->backup_course);
$grade_letters = get_records_sql("SELECT *
FROM {$CFG->prefix}grade_letters
WHERE contextid = $context->id");
FROM {$CFG->prefix}grade_letters
WHERE contextid = $context->id");
if ($grade_letters) {
//Begin grade_categories tag
//Begin grade_l tag
fwrite ($bf,start_tag("GRADE_LETTERS",3,true));
//Iterate for each category
//Iterate for each letter
foreach ($grade_letters as $grade_letter) {
//Begin grade_category
//Begin grade_letter
fwrite ($bf,start_tag("GRADE_LETTER",4,true));
//Output individual fields
fwrite ($bf,full_tag("ID",5,false,$grade_letter->id));
// not keeping path and depth because they can be derived
fwrite ($bf,full_tag("LOWERBOUNDARY",5,false,$grade_letter->lowerboundary));
fwrite ($bf,full_tag("LETTER",5,false,$grade_letter->letter));
//End grade_category
//End grade_letter
fwrite ($bf,end_tag("GRADE_LETTER",4,true));
}
//End grade_categories tag
@@ -1622,16 +1766,16 @@
return $status;
}
function backup_gradebook_outcomes_info($bf,$preferences) {
function backup_gradebook_outcomes_info($bf, $preferences) {
global $CFG;
$status = true;
// only back up courses already in the grade_outcomes_courses table
$grade_outcomes = get_records_sql('SELECT go.*
FROM '.$CFG->prefix.'grade_outcomes_courses goc,
'.$CFG->prefix.'grade_outcomes go
WHERE goc.courseid = '.$preferences->backup_course.'
AND goc.outcomeid = go.id');
$grade_outcomes = get_records_sql("SELECT go.*
FROM {$CFG->prefix}grade_outcomes go
JOIN {$CFG->prefix}grade_outcomes_courses goc
ON (goc.outcomeid = go.id)
WHERE goc.courseid = $preferences->backup_course");
if (!empty($grade_outcomes)) {
//Begin grade_outcomes tag
@@ -1661,35 +1805,6 @@
return $status;
}
// outcomes assigned to this course
function backup_gradebook_outcomes_courses_info($bf,$preferences) {
global $CFG;
$status = true;
// get all global outcomes (used in this course)
// and course specific outcomes
// we don't need to backup all the outcomes in this case
if ($outcomes_courses = get_records('grade_outcomes_courses', 'courseid', $preferences->backup_course)) {
//Begin grade_outcomes tag
fwrite ($bf,start_tag("GRADE_OUTCOMES_COURSES",3,true));
//Iterate for each outcome
foreach ($outcomes_courses as $outcomes_course) {
//Begin grade_outcome
fwrite ($bf,start_tag("GRADE_OUTCOMES_COURSE",4,true));
//Output individual fields
fwrite ($bf,full_tag("ID",5,false,$outcomes_course->id));
fwrite ($bf,full_tag("OUTCOMEID",5,false,$outcomes_course->outcomeid));
//End grade_outcome
fwrite ($bf,end_tag("GRADE_OUTCOMES_COURSE",4,true));
}
//End grade_outcomes tag
$status = fwrite ($bf,end_tag("GRADE_OUTCOMES_COURSES",3,true));
}
return $status;
}
function backup_gradebook_grades_info($bf,$preferences, $itemid) {
global $CFG;
@@ -1770,10 +1885,11 @@
$status = true;
// find all grade categories history
if ($chs = get_records_sql("SELECT ggh.* FROM {$CFG->prefix}grade_grades_history ggh,
{$CFG->prefix}grade_items gi
WHERE gi.courseid = $preferences->backup_course
AND ggh.itemid = gi.id")) {
if ($chs = get_records_sql("SELECT ggh.*
FROM {$CFG->prefix}grade_grades_history ggh
JOIN {$CFG->prefix}grade_items gi
ON gi.id = ggh.itemid
WHERE gi.courseid = $preferences->backup_course")) {
fwrite ($bf,start_tag("GRADE_GRADES_HISTORIES",5,true));
foreach ($chs as $ch) {
/// Grades are only sent to backup if the user is one target user
@@ -1846,8 +1962,8 @@
fwrite ($bf,full_tag("PLUSFACTOR",7,false,$ch->plusfactor));
fwrite ($bf,full_tag("AGGREGATIONCOEF",7,false,$ch->aggregationcoef));
fwrite ($bf,full_tag("SORTORDER",7,false,$ch->sortorder));
fwrite ($bf,full_tag("DISPLAY",7,false,$ch->display));
fwrite ($bf,full_tag("DECIMALS",7,false,$ch->decimals));
//fwrite ($bf,full_tag("DISPLAY",7,false,$ch->display));
//fwrite ($bf,full_tag("DECIMALS",7,false,$ch->decimals));
fwrite ($bf,full_tag("HIDDEN",7,false,$ch->hidden));
fwrite ($bf,full_tag("LOCKED",7,false,$ch->locked));
fwrite ($bf,full_tag("LOCKTIME",7,false,$ch->locktime));
@@ -1898,8 +2014,8 @@
//Get scales (common and course scales)
$scales = get_records_sql("SELECT id, courseid, userid, name, scale, description, timemodified
FROM {$CFG->prefix}scale
WHERE courseid = '0' or courseid = $preferences->backup_course");
FROM {$CFG->prefix}scale
WHERE courseid = 0 OR courseid = $preferences->backup_course");
//Copy only used scales to $backupscales. They will be in backup (unused no). See Bug 1223.
$backupscales = array();
@@ -2036,8 +2152,13 @@
$status = true;
//Get groups_members
$groups_members = get_records("groups_members","groupid",$groupid);
//Get groups_members that are being included in backup
$groups_members = get_records_sql("SELECT gm.*
FROM {$CFG->prefix}groups_members gm,
{$CFG->prefix}backup_ids bi
WHERE gm.groupid = $groupid
AND bi.backup_code = $preferences->backup_unique_code
AND bi.table_name = 'user'");
//Pring groups_members header
if ($groups_members) {
@@ -2161,7 +2282,13 @@
if (function_exists($onemodbackup)) {
foreach ($preferences->mods[$module]->instances as $instance => $object) {
if (!empty($object->backup)) {
$status = $onemodbackup($bf,$preferences,$instance);
$statusm = $onemodbackup($bf,$preferences,$instance);
if (!$statusm) {
if (!defined('BACKUP_SILENTLY')) {
notify('backup of '.$module.'-'.$object->name.' failed.');
}
$status = false;
}
}
}
} else {
@@ -2193,6 +2320,16 @@
global $CFG,$preferences;
/// MDL-14072: Prevent NULLs, empties and numbers to be processed by the
/// heavy interlinking. Just a few cpu cycles saved.
if ($content === NULL) {
return NULL;
} else if ($content === '') {
return '';
} else if (is_numeric($content)) {
return $content;
}
//Use one static variable to cache all the require_once calls that,
//under PHP5 seems to increase load too much, and we are requiring
//them here thousands of times (one per content). MDL-8700.
@@ -2236,6 +2373,25 @@
}
}
// For each block, call its encode_content_links method.
// This encodes forexample links to blocks/something/viewphp?id=666
// that are stored in other activities.
static $blockobjects = null;
if (!isset($blockobjects)) {
$blockobjects = array();
if ($blocks = get_records('block', 'visible', 1)) {
foreach ($blocks as $block) {
if ($blockobject = block_instance($block->name)) {
$blockobjects[] = $blockobject;
}
}
}
}
foreach ($blockobjects as $blockobject) {
$result = $blockobject->encode_content_links($result,$mypreferences);
}
if ($result != $content) {
debugging('<br /><hr />'.s($content).'<br />changed to<br />'.s($result).'<hr /><br />');
}
@@ -2579,6 +2735,7 @@
$preferences->backup_gradebook_history = optional_param('backup_gradebook_history', 1, PARAM_INT);
$preferences->backup_site_files = optional_param('backup_site_files',1,PARAM_INT);
$preferences->backup_messages = optional_param('backup_messages',1,PARAM_INT);
$preferences->backup_blogs = optional_param('backup_blogs',1,PARAM_INT);
$preferences->backup_course = $course->id;
$preferences->backup_name = required_param('backup_name',PARAM_FILE);
$preferences->backup_unique_code = required_param('backup_unique_code');
@@ -2761,7 +2918,7 @@
$status = backup_delete_old_data();
if (!$status) {
if (!defined('BACKUP_SILENTLY')) {
error ("An error occurred deleting old backup data");
notify ("An error occurred deleting old backup data");
}
else {
$errorstr = "An error occurred deleting old backup data";
@@ -2896,6 +3053,23 @@
}
}
//If we have selected to backup blogs and we are
//doing a SITE backup, let's do it
if ($status && $preferences->backup_blogs && $preferences->backup_course == SITEID) {
if (!defined('BACKUP_SILENTLY')) {
echo "<li>".get_string("writingblogsinfo").'</li>';
}
if (!$status = backup_blogs($backup_file,$preferences)) {
if (!defined('BACKUP_SILENTLY')) {
notify("An error occurred while backing up blogs");
}
else {
$errorstr = "An error occurred while backing up blogs";
return false;
}
}
}
//If we have selected to backup quizzes or other modules that use questions
//we've already added ids of categories and questions to backup to backup_ids table
if ($status) {
+16 -7
View File
@@ -527,11 +527,16 @@
}
} else {
//Only if status (record exists)
if ($status) {
////First strip slashes
$temp = stripslashes($status->info);
//Now unserialize
$status->info = unserialize($temp);
if (!empty($status->info)) {
if ($status->info === 'needed') {
// TODO: ugly hack - fix before 1.9.1
debugging('Incorrect string "needed" in $status->info, please fix the code (table:'.$table.'; old_id:'.$old_id.').', DEBUG_DEVELOPER);
} else {
////First strip slashes
$temp = stripslashes($status->info);
//Now unserialize
$status->info = unserialize($temp);
}
}
}
@@ -540,12 +545,15 @@
//This function is used to add slashes (and decode from UTF-8 if needed)
//It's used intensivelly when restoring modules and saving them in db
function backup_todb ($data) {
function backup_todb ($data, $addslashes=true) {
// MDL-10770
if ($data === '$@NULL@$') {
return null;
} else {
return restore_decode_absolute_links(addslashes($data));
if ($addslashes) {
$data = addslashes($data);
}
return restore_decode_absolute_links($data);
}
}
@@ -839,6 +847,7 @@
$preferences->backup_course_files = (isset($prefs['backup_course_files']) ? $prefs['backup_course_files'] : 0);
$preferences->backup_site_files = (isset($prefs['backup_site_files']) ? $prefs['backup_site_files'] : 0);
$preferences->backup_messages = (isset($prefs['backup_messages']) ? $prefs['backup_messages'] : 0);
$preferences->backup_gradebook_history = (isset($prefs['backup_gradebook_history']) ? $prefs['backup_gradebook_history'] : 0);
$preferences->backup_course = $course->id;
backup_add_static_preferences($preferences);
return $preferences;
+1 -1
View File
@@ -6,7 +6,7 @@
require_login();
require_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM));
redirect("$CFG->wwwroot/$CFG->admin/report/backups/index.php", '', 'admin', 1);
+2 -2
View File
@@ -62,7 +62,7 @@
}
}
} else {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM))) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
@@ -122,7 +122,7 @@
}
//Print header
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
$navlinks[] = array('name' => basename($file), 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
+25 -26
View File
@@ -72,31 +72,35 @@
}
foreach ($instances as $instance) {
$var = 'restore_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,0);
$$var = optional_param($var,0,PARAM_INT);
$var = 'restore_user_info_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,0);
$$var = optional_param($var,0,PARAM_INT);
}
}
}
//restoreto
$restore_restoreto = required_param('restore_restoreto');
$restore_restoreto = required_param('restore_restoreto', PARAM_INT);
//restore_metacourse
$restore_metacourse = required_param('restore_metacourse');
$restore_metacourse = required_param('restore_metacourse', PARAM_INT);
//restore_users
$restore_users = required_param('restore_users');
$restore_users = required_param('restore_users', PARAM_INT);
$restore_groups = required_param('restore_groups', PARAM_INT);
//restore_logs
$restore_logs = required_param('restore_logs');
$restore_logs = required_param('restore_logs', PARAM_INT);
//restore_user_files
$restore_user_files = required_param('restore_user_files');
$restore_user_files = required_param('restore_user_files', PARAM_INT);
//restore_course_files
$restore_course_files = required_param('restore_course_files');
$restore_course_files = required_param('restore_course_files', PARAM_INT);
//restore_site_files
$restore_site_files = required_param('restore_site_files');
$restore_site_files = required_param('restore_site_files', PARAM_INT);
//restore_gradebook_history
$restore_gradebook_history = required_param('restore_gradebook_history');
$restore_gradebook_history = required_param('restore_gradebook_history', PARAM_INT);
//restore_messages
$restore_messages = required_param('restore_messages');
$restore_messages = required_param('restore_messages', PARAM_INT);
//restore_blogs
$restore_blogs = required_param('restore_blogs', PARAM_INT);
//Check we've selected a course to restore to
$course_id = optional_param('course_id', 0, PARAM_INT);
@@ -126,11 +130,13 @@
$restore->restoreto=$restore_restoreto;
$restore->metacourse=$restore_metacourse;
$restore->users=$restore_users;
$restore->groups=$restore_groups;
$restore->logs=$restore_logs;
$restore->user_files=$restore_user_files;
$restore->course_files=$restore_course_files;
$restore->site_files=$restore_site_files;
$restore->messages=$restore_messages;
$restore->blogs=$restore_blogs;
$restore->restore_gradebook_history=$restore_gradebook_history;
$restore->course_id=$course_id;
//add new vars to restore object
@@ -170,10 +176,7 @@
}
// pass in the course category param
$cat_id = optional_param('restore_restorecatto', 0, PARAM_INT);
if ($cat_id) {
$restore->restore_restorecatto = $cat_id;
}
$restore->restore_restorecatto = optional_param('restore_restorecatto', 0, PARAM_INT);
//We have the object with data, put it in the session
$SESSION->restore = $restore;
@@ -189,7 +192,7 @@
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
} else {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM))) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
@@ -200,7 +203,7 @@
}
//Depending the selected restoreto:
// If user is a teacher (and not creator):
// If user is a teacher (and not creator) or we are restoring from within SITEID:
// 0-Current course, deleting: Put $restore->course_id and $restore->deleting (true), create the restore object
// 1-Current course, adding: Put $restore->course_id and $restore->deleting (false), create the restore object
// If the uses is a creator:
@@ -210,12 +213,9 @@
// put $restore->course_id and $restore->deleting (false), create the restore object.
// 2-New course: Create the restore object and launch the execute.
//If the user is a teacher and not a creator
//If the user is a teacher and not a creator or we are restoring from within SITEID
//if (!has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!user_can_create_courses()) {
if (!user_can_create_courses() || $id == SITEID) {
$restore->course_id = $id;
if ($restore->restoreto == 0) {
$restore->deleting = true;
@@ -225,7 +225,6 @@
}
//If the user is a creator (or admin)
//if (has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (user_can_create_courses()) {
//Set restore->deleting as needed
if ($restore->restoreto == 0) {
@@ -287,8 +286,8 @@
$changed = true;
}
}
//If we have selected user files or messages, then users must be restored too
if ($restore->user_files || $restore->messages) {
//If we have selected user files or messages or blogs, then users must be restored too
if ($restore->user_files || $restore->messages || $restore->blogs) {
$changed = 1;
}
if ($changed) {
+1 -1
View File
@@ -33,7 +33,7 @@
}
}
} else {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM))) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
+148 -65
View File
@@ -29,7 +29,7 @@
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
} else {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM))) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
@@ -77,6 +77,14 @@
$restore_users = 1;
}
if (!isset($restore_groups)) {
if (empty($CFG->enablegroupings)) {
$restore_groups = RESTORE_GROUPS_ONLY;
} else {
$restore_groups = RESTORE_GROUPS_GROUPINGS;
}
}
if (!isset($restore_logs)) {
$restore_logs = 1;
}
@@ -95,7 +103,11 @@
if (!isset($restore_messages)) {
$restore_messages = 1;
}
}
if (!isset($restore_blogs)) {
$restore_blogs = 1;
}
if (!isset($restore_restoreto)) {
if (!user_can_create_courses()) {
@@ -177,14 +189,15 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
//Print the full tr
echo "<tr>";
echo "<td align=\"right\"><b>";
echo get_string("restoreto").":</b>";
echo '<label for="menurestore_restoreto">'.get_string ('restoreto').'</label>';
echo "</b>";
echo "</td><td colspan=\"3\">";
// permission should have been checked already
/**
* if user has manageactivities in any course, we show
* if user has manageactivities in any course and we are not restoring from within SITEID
* existingcoursedeleting
* existingcourseadding
* else we show
@@ -200,14 +213,13 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
} else {
$accessinfo = get_user_access_sitewide($USER->id);
}
$mycourses = get_user_courses_bycap($USER->id, 'moodle/site:restore', $accessinfo, true);
// if the user can manage 2 or more courses,
// or if the only course the user can manage is not the current course
// if the user can manage 2 or more courses and we are not restoring from within SITEID,
// we show options for existing courses
if (count($mycourses) > 1) {
// if user can manage more than 1 course, or if user can restore to a single different course
if (count($mycourses) > 1 && $id != SITEID) {
$restore_restoreto_options[0] = get_string("existingcoursedeleting");
$restore_restoreto_options[1] = get_string("existingcourseadding");
// else if the user can write to current course
@@ -221,6 +233,9 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
$restore_restoreto_options[2] = get_string("newcourse");
}
/// Acummulator for hidden options and proper XHTML output
$hidden_options = '';
choose_from_menu($restore_restoreto_options, "restore_restoreto", $restore_restoreto, "");
echo "</td></tr>";
if (user_can_create_courses()) { //display these fields conditionally
@@ -228,46 +243,53 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
// find the list of cates user can edit
echo "<tr valign=\"top\" >";
echo "<td align=\"right\">";
print_string('category');
echo " :</td>";
echo '<label for="menurestore_restorecatto">'.get_string ('category').'</label>';
echo "</td>";
echo "<td>";
choose_from_menu(get_creatable_categories(), "restore_restorecatto", $course_header->category->id, "");
// Category selection isn't alowed if restoring from within SITEID course
if ($id != SITEID) {
make_categories_list($categories, $parents);
choose_from_menu($categories, "restore_restorecatto", $course_header->category->id, "");
} else {
print_string('notavailable');
echo '<input type="hidden" name="restore_restorecatto" id="menurestore_restorecatto" value="0" />';
}
echo "</td>";
echo "</tr>";
echo "<tr valign=\"top\" >";
echo "<td align=\"right\">";
print_string("shortname");
echo " :</td>";
echo "<td><input type=\"text\" name=\"shortname\" maxlength=\"100\" size=\"20\" value=\"$form1->shortname\" alt=\"".get_string("shortname")."\" />" ;
echo '<label for="shortnamefield">'.get_string ('shortname').'</label>';
echo "</td>";
echo "<td><input type=\"text\" id=\"shortnamefield\" name=\"shortname\" maxlength=\"100\" size=\"20\" value=\"$form1->shortname\" alt=\"".get_string("shortname")."\" />" ;
helpbutton("courseshortname", get_string("shortname")) ;
if (isset($err["shortname"])) formerr($err["shortname"]);
echo "</td>";
echo "</tr>";
echo "<tr valign=\"top\" >";
echo "<td align=\"right\">";
print_string("fullname");
echo " :</td>";
echo "<td><input type=\"text\" name=\"fullname\" maxlength=\"254\" size=\"50\" value=\"$form1->fullname\" alt=\" ".get_string("fullname")."\" />" ;
echo '<label for="fullnamefield">'.get_string ('fullname').'</label>';
echo "</td>";
echo "<td><input type=\"text\" id=\"fullnamefield\" name=\"fullname\" maxlength=\"254\" size=\"50\" value=\"$form1->fullname\" alt=\" ".get_string("fullname")."\" />" ;
helpbutton("coursefullname", get_string("fullname")) ;
if (isset($err["fullname"])) formerr($err["fullname"]);
echo"</td></tr>";
echo "<tr valign=\"top\"> ";
echo "<td align=\"right\"> ";
print_string("startdate");
echo ":</td><td>";
echo "</td><td>";
/// Show the roll dates option only if the backup course has a start date
/// (some formats like main page, social..., haven't it and rolling dates
/// from 0 produces crazy dates. MDL-10125
if ($form1->startdate) {
print_date_selector("startday", "startmonth", "startyear", $form1->startdate);
helpbutton("coursestartdate", get_string("startdate"));
} else {
print_string('notavailable');
echo '<input type="hidden" name="startyear" value="0" />';
echo '<input type="hidden" name="startmonth" value="0" />';
echo '<input type="hidden" name="startday" value="0" />';
}
helpbutton("coursestartdate", get_string("startdate"));
echo "</td></tr>";
}
//Line
@@ -277,7 +299,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
//Print option to select/deselect everything with 1 click.
echo "<tr>";
echo "<td align=\"right\">";
echo '<b>'.get_string("include").":</b>";
echo '<b>'.get_string("include")."</b>";
echo "</td><td>";
echo "<a href=\"javascript:void(0);\" onclick=\"selectItemInCheckboxByName('form1', 'restore_', true);\">".
get_string("all")."</a>/";
@@ -378,25 +400,27 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
//Now print the Metacourse tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string("metacourse").":";
echo '<label for="menurestore_metacourse">'.get_string ("metacourse").'</label>';
echo "</b></td><td colspan=\"2\">";
//If metacourse are in the backup file, show menu, else fixed to no
if ($info->backup_metacourse == "true") {
$metacourse_options = array();
$metacourse_options[0] = get_string("no");
$metacourse_options[1] = get_string("yes");
choose_from_menu($metacourse_options, "restore_metacourse", $restore_metacourse, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" name=\"restore_metacourse\" value=\"0\" />";
echo "<input type=\"hidden\" id=\"menurestore_metacourse\" name=\"restore_metacourse\" value=\"0\" />";
}
echo "</td></tr>";
//Now print the Users tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string("users").":";
echo '<label for="menurestore_users">'.get_string ("users").'</label>';
echo "</b></td><td colspan=\"2\">";
//If some user is present in the backup file
if ($info->backup_users == "all" or $info->backup_users == "course") {
$user_options = array();
//If all users are in the backup file
if ($info->backup_users == "all") {
$user_options[0] = get_string("all");
@@ -406,58 +430,85 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
choose_from_menu($user_options, "restore_users", $restore_users, "");
} else {
echo get_string("none");
echo "<input type=\"hidden\" name=\"restore_users\" value=\"2\" />";
echo "<input type=\"hidden\" id=\"menurestore_users\" name=\"restore_users\" value=\"2\" />";
}
echo "</td></tr>";
//Now print the Groups tr (assume there is no $info->backup_groups)
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
$helplink = helpbutton('grouprestore', get_string('groups'), '', true, false, '', true);
if (empty($CFG->enablegroupings)) {
echo '<label for="menurestore_groups">'.get_string ("groups").'</label>'.$helplink;
echo "</b></td><td colspan=\"2\">";
$group_options[RESTORE_GROUPS_NONE] = get_string('no');
$group_options[RESTORE_GROUPS_ONLY] = get_string('yes');
} else {
echo '<label for="menurestore_groups">'.get_string ('groupsgroupings', 'group').'</label>'.$helplink;
echo "</b></td><td colspan=\"2\">";
$group_options[RESTORE_GROUPS_NONE] = get_string('none');
$group_options[RESTORE_GROUPS_ONLY] = get_string('groupsonly', 'group');
$group_options[RESTORE_GROUPINGS_ONLY] = get_string('groupingsonly', 'group');
$group_options[RESTORE_GROUPS_GROUPINGS] = get_string('groupsgroupings', 'group'); //all.
} /*else {
echo get_string('none');
echo "<input type=\"hidden\" name=\"restore_groups\" value=\"2\" />";
}*/
choose_from_menu($group_options, 'restore_groups', $restore_groups, '');
echo "</td></tr>";
//Now print the Logs tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string("logs").":";
echo '<label for="menurestore_logs">'.get_string ("logs").'</label>';
echo "</b></td><td colspan=\"2\">";
//If logs are in the backup file, show menu, else fixed to no
if ($info->backup_logs == "true") {
$log_options = array();
$log_options[0] = get_string("no");
$log_options[1] = get_string("yes");
choose_from_menu($log_options, "restore_logs", $restore_logs, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" name=\"restore_logs\" value=\"0\" />";
echo "<input type=\"hidden\" id=\"menurestore_logs\" name=\"restore_logs\" value=\"0\" />";
}
echo "</td></tr>";
//Now print the User Files tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string ("userfiles").":";
echo '<label for="menurestore_user_files">'.get_string ("userfiles").'</label>';
echo "</b></td><td colspan=\"2\">";
//If user files are in the backup file, show menu, else fixed to no
if ($info->backup_user_files == "true") {
$user_file_options = array();
$user_file_options[0] = get_string("no");
$user_file_options[1] = get_string("yes");
choose_from_menu($user_file_options, "restore_user_files", $restore_user_files, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" name=\"restore_user_files\" value=\"0\" />";
echo "<input type=\"hidden\" id=\"menurestore_user_files\" name=\"restore_user_files\" value=\"0\" />";
}
echo "</td></tr>";
//Now print the Course Files tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string ("coursefiles").":";
echo '<label for="menurestore_course_files">'.get_string ("coursefiles").'</label>';
echo "</b></td><td colspan=\"2\">";
echo "<input type=\"hidden\" name=\"backup_unique_code\" value=\"$backup_unique_code\" />";
echo "<input type=\"hidden\" name=\"file\" value=\"$file\" />";
//If course files are in the backup file, show menu, else fixed to no
if ($info->backup_course_files == "true") {
$course_file_options = array();
$course_file_options[0] = get_string("no");
$course_file_options[1] = get_string("yes");
choose_from_menu($course_file_options, "restore_course_files", $restore_course_files, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" name=\"restore_course_files\" value=\"0\" />";
echo "<input type=\"hidden\" id=\"menurestore_course_files\" name=\"restore_course_files\" value=\"0\" />";
}
echo "</td></tr>";
@@ -465,54 +516,81 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
//Now print the Site Files tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string ("sitefiles").":";
echo '<label for="menurestore_site_files">'.get_string ("sitefiles").'</label>';
echo "</b></td><td colspan=\"2\">";
//If site files are in the backup file, show menu, else fixed to no
if (isset($info->backup_site_files) && $info->backup_site_files == "true") {
$site_file_options = array();
$site_file_options[0] = get_string("no");
$site_file_options[1] = get_string("yes");
choose_from_menu($site_file_options, "restore_site_files", $restore_site_files, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" name=\"restore_site_files\" value=\"0\" />";
echo "<input type=\"hidden\" id=\"menurestore_site_files\" name=\"restore_site_files\" value=\"0\" />";
}
echo "</td></tr>";
// do you want grade histories to be restored?
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo get_string ('gradebookhistories', 'grades').":";
echo "</b></td><td colspan=\"2\">";
$gradebook_history_options[0] = get_string("no");
$gradebook_history_options[1] = get_string("yes");
choose_from_menu($gradebook_history_options, "restore_gradebook_history", $restore_gradebook_history, "");
echo "</td></tr>";
//Now print the Messages tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
if (empty($CFG->disablegradehistory)) {
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo '<label for="menurestore_gradebook_history">'.get_string ('gradebookhistories', 'grades').'</label>';
echo "</b></td><td colspan=\"2\">";
if (isset($info->gradebook_histories) && $info->gradebook_histories == "true") {
$gradebook_history_options = array();
$gradebook_history_options[0] = get_string("no");
$gradebook_history_options[1] = get_string("yes");
choose_from_menu($gradebook_history_options, "restore_gradebook_history", $restore_gradebook_history, "");
} else {
echo get_string("no");
echo "<input type=\"hidden\" id=\"menurestore_gradebook_history\" name=\"restore_gradebook_history\" value=\"0\" />";
}
echo "</td></tr>";
} else {
$hidden_options .= '<input type="hidden" name="restore_gradebook_history" value="0" />';
}
//This tr is slighty different. Everything becomes hidden if
//we haven't messages is the backup, to avoid confusions to users.
//If messages are in the backup file, show menu, else fixed to no and show nothing
if ($info->backup_messages == "true") {
echo get_string ('messages','message').":";
//Also, messaging must be enabled in the destination site
if (isset($info->backup_messages) && $info->backup_messages == "true" && !empty($CFG->messaging)) {
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo '<label for="menurestore_messages">'.get_string ('messages', 'message').'</label>';
echo "</b></td><td colspan=\"2\">";
$message_options = array();
$message_options[0] = get_string("no");
$message_options[1] = get_string("yes");
choose_from_menu($message_options, "restore_messages", $restore_messages, "");
echo "</td></tr>";
} else {
echo "&nbsp;</b></td><td colspan=\"2\">";
echo "<input type=\"hidden\" name=\"restore_messages\" value=\"0\" />";
$hidden_options .= '<input type="hidden" name="restore_messages" value="0" />';
}
echo "</td></tr>";
//This tr is slighty different. Everything becomes hidden if
//we haven't blogs is the backup, to avoid confusions to users.
//If blogs are in the backup file, show menu, else fixed to no and show nothing
//Also, blogs must be enabled in the destination site
if (isset($info->backup_blogs) && $info->backup_blogs == "true" && !empty($CFG->bloglevel)) {
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo '<label for="menurestore_blogs">'.get_string ('blogs', 'blog').'</label>';
echo "</b></td><td colspan=\"2\">";
$blog_options = array();
$blog_options[0] = get_string("no");
$blog_options[1] = get_string("yes");
choose_from_menu($blog_options, "restore_blogs", $restore_blogs, "");
echo "</td></tr>";
} else {
$hidden_options .= '<input type="hidden" name="restore_blogs" value="0" />';
}
}
?>
</table>
<hr/>
<hr />
<?php
print_heading(get_string('rolemappings'));
@@ -521,8 +599,8 @@ $xml_file = $CFG->dataroot."/temp/backup/".$backup_unique_code."/moodle.xml";
$info = restore_read_xml_info($xml_file);
// fix for MDL-9068, front page course is just a normal course
$siterolesarray = get_assignable_roles (get_context_instance(CONTEXT_COURSE, $course->id), "shortname");
$siterolesnamearray = get_assignable_roles (get_context_instance(CONTEXT_COURSE, $course->id), "name");
$siterolesarray = get_assignable_roles (get_context_instance(CONTEXT_COURSE, $course->id), "shortname", ROLENAME_ORIGINAL);
$siterolesnamearray = get_assignable_roles (get_context_instance(CONTEXT_COURSE, $course->id), "name", ROLENAME_ORIGINAL);
$allroles = get_records('role');
echo ('<table width="100%" class="restore-form-instances">');
@@ -533,24 +611,25 @@ if ($info->backup_moodle_version < 2006092801) {
/// Editting teacher
echo ('<tr><td align="right">');
print_string('defaultcourseteacher');
echo '<label for="menudefaultteacheredit">'.get_string ('defaultcourseteacher').'</label>';
echo ('</td><td algin="left">');
// get the first teacheredit legacy
$roles = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM, SITEID));
$roles = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM));
$editteacher = array_shift($roles);
$editteacher = reset($roles);
choose_from_menu ($siterolesarray, "defaultteacheredit", $editteacher->id, 'new role', '', '0');
echo ('</td></tr>');
/// Non-editting teacher
echo ('<tr><td align="right">');
echo '<label for="menudefaultteacher">'.get_string ('noneditingteacher').'</label>';
print_string('noneditingteacher');
echo ('</td><td algin="left">');
// get the first teacheredit legacy
$roles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM, SITEID));
$teacher = array_shift($roles);
$roles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM));
$teacher = reset($roles);
choose_from_menu ($siterolesarray, "defaultteacher", $teacher->id, 'new role', '', '0');
echo ('</td></tr>');
@@ -558,11 +637,11 @@ if ($info->backup_moodle_version < 2006092801) {
/// Student
echo ('<tr><td align="right">');
print_string('defaultcoursestudent');
echo '<label for="menudefaultstudent">'.get_string ('defaultcoursestudent').'</label>';
echo ('</td><td algin="left">');
// get the first teacheredit legacy
$roles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM, SITEID));
$roles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM));
$studentrole = array_shift($roles);
choose_from_menu ($siterolesarray, "defaultstudent", $studentrole->id, 'new role', '', '0');
@@ -582,7 +661,7 @@ if ($info->backup_moodle_version < 2006092801) {
$mappableroles = $siteroleschoicearray;
echo ('<tr><td align="right">');
echo $role->name." (".($role->shortname).")";
echo '<label for="menuroles_'.$roleid.'">'.$role->name." (".($role->shortname).")".'</label>';
echo ('</td><td align="left">');
/// first, we see if any exact role definition is found
@@ -616,6 +695,10 @@ echo ('</table>'); // end of role mappings table
?>
<br />
<div style="text-align:center">
<?php
/// Print captured hidden options, now that we have closed the table
echo $hidden_options;
?>
<input type="hidden" name="id" value="<?php p($id) ?>" />
<input type="hidden" name="launch" value="check" />
<input type="hidden" name="fromform" value="1" />
@@ -701,4 +784,4 @@ function restore_is_samerole($testroleid, $rolefromxml) {
}
return true;
}
?>
?>
+1 -1
View File
@@ -25,7 +25,7 @@
}
}
} else {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM))) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
+1560 -945
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -7,7 +7,7 @@
require_login();
require_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM));
//Check site
if (!$site = get_site()) {
+1 -1
View File
@@ -6,7 +6,7 @@
/// database (backup_version) to determine whether upgrades should
/// be performed (see db/backup_*.php)
$backup_version = 2007122700; // The current version is a date (YYYYMMDDXX)
$backup_version = 2008030300; // The current version is a date (YYYYMMDDXX)
$backup_release = '1.9'; // User-friendly version number
?>
@@ -3,7 +3,7 @@
class block_activity_modules extends block_list {
function init() {
$this->title = get_string('activities');
$this->version = 2006011300;
$this->version = 2007101509;
}
function get_content() {
+4 -26
View File
@@ -3,7 +3,7 @@
class block_admin extends block_list {
function init() {
$this->title = get_string('administration');
$this->version = 2004081200;
$this->version = 2007101509;
}
function get_content() {
@@ -213,31 +213,9 @@ class block_admin extends block_list {
}
}
/// Should the following two be in this block?
/// View own activity report
// if ($course->showreports) {
// $this->content->items[]='<a href="user.php?id='.$this->instance->pageid.'&amp;user='.$USER->id.'">'.get_string('activityreport').'</a>';
// $this->content->icons[]='<img src="'.$CFG->pixpath.'/i/report.gif" alt="" />';
// }
/// Edit your own profile
// $fullname = fullname($USER, has_capability('moodle/site:viewfullnames', $context));
// $editmyprofile = '<a title="'.$fullname.'" href="'.$CFG->wwwroot.'/user/edit.php?id='.$USER->id.'&amp;course='.$this->instance->pageid.'">'.get_string('editmyprofile').'</a>';
// if (empty($USER->description)) {
// //Accessibility: replace non-standard <blink> with CSS (<a> makes title visible in IE).
// $text = get_string('profile').' '.get_string('missingdescription');
// $this->content->items[]= $editmyprofile.' <a title="'.$text.'" class="useredit blink">*<span class="accesshide">'.$text.'</span></a>';
// } else {
// $this->content->items[]= $editmyprofile;
// }
// $this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
/// Link to the user own profile
$this->content->items[]='<a href="'.$CFG->wwwroot.'/user/view.php?id='.$USER->id.'&amp;course='.$course->id.'">'.get_string('profile').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
return $this->content;
}
@@ -8,7 +8,7 @@ class block_admin_bookmarks extends block_base {
function init() {
$this->title = get_string('adminbookmarks');
$this->version = 2006090300;
$this->version = 2007101509;
}
function applicable_formats() {
+3 -3
View File
@@ -12,7 +12,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
$bookmarks = explode(',', get_user_preferences('admin_bookmarks'));
if (in_array($section, $bookmarks)) {
error(get_string('bookmarkalreadyexists','admin'));
print_error('bookmarkalreadyexists','admin');
die;
}
@@ -28,7 +28,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
set_user_preference('admin_bookmarks', $bookmarks);
} else {
error(get_string('invalidsection','admin'));
print_error('invalidsection','admin');
die;
}
@@ -40,7 +40,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
}
} else {
error(get_string('invalidsection','admin'));
print_error('invalidsection','admin');
die;
}
+4 -4
View File
@@ -16,7 +16,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
$key = array_search($section, $bookmarks);
if ($key === false) {
error(get_string('nonexistentbookmark','admin'));
print_error('nonexistentbookmark','admin');
die;
}
@@ -38,12 +38,12 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
}
error(get_string('nobookmarksforuser','admin'));
print_error('nobookmarksforuser','admin');
die;
} else {
error(get_string('invalidsection', 'admin'));
print_error('invalidsection', 'admin');
die;
}
?>
?>
+6 -3
View File
@@ -12,7 +12,7 @@ class block_admin_tree extends block_base {
function init() {
global $PAGE;
$this->title = get_string('administrationsite');
$this->version = 2006090300;
$this->version = 2007101509;
$this->currentdepth = 0;
$this->divcounter = 1;
$this->tempcontent = '';
@@ -22,8 +22,11 @@ class block_admin_tree extends block_base {
}
function applicable_formats() {
//TODO: add 'my' only if user has role assigned in system or any course category context
return array('site' => true, 'admin' => true, 'my' => true);
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
return array('site' => true, 'admin' => true, 'my' => true);
} else {
return array('site' => true, 'admin' => true);
}
}
function preferred_width() {
+3 -3
View File
@@ -7,7 +7,7 @@ class block_blog_menu extends block_base {
function init() {
$this->title = get_string('blockmenutitle', 'blog');
$this->content_type = BLOCK_TYPE_TEXT;
$this->version = 2004112000;
$this->version = 2007101509;
}
function get_content() {
@@ -51,7 +51,7 @@ class block_blog_menu extends block_base {
$addentrylink = '';
$coursearg = '';
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
if ($COURSE->id != SITEID) {
@@ -121,4 +121,4 @@ class block_blog_menu extends block_base {
}
}
?>
?>
+2 -2
View File
@@ -8,7 +8,7 @@ require_once($CFG->dirroot .'/blog/lib.php');
class block_blog_tags extends block_base {
function init() {
$this->version = 2006032000;
$this->version = 2007101509;
$this->title = get_string('blocktagstitle', 'blog');
}
@@ -80,7 +80,7 @@ class block_blog_tags extends block_base {
$sql .= 'AND p.id = ti.itemid ';
// admins should be able to read all tags
if (!has_capability('moodle/user:readuserblogs', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!has_capability('moodle/user:readuserblogs', get_context_instance(CONTEXT_SYSTEM))) {
$sql .= 'AND (p.publishstate = \'site\' or p.publishstate=\'public\') ';
}
$sql .= "AND ti.timemodified > {$timewithin} ";
@@ -3,7 +3,7 @@
class block_calendar_month extends block_base {
function init() {
$this->title = get_string('calendar', 'calendar');
$this->version = 2004081200;
$this->version = 2007101509;
}
function preferred_width() {
@@ -32,11 +32,14 @@ class block_calendar_month extends block_base {
// It definitely needs SOME comment here!
$courseshown = $COURSE->id;
if($courseshown == SITEID) {
if ($courseshown == SITEID) {
// Being displayed at site level. This will cause the filter to fall back to auto-detecting
// the list of courses it will be grabbing events from.
$filtercourse = NULL;
$groupeventsfrom = NULL;
$SESSION->cal_courses_shown = calendar_get_default_courses(true);
calendar_set_referring_course(0);
} else {
// Forcibly filter events to include only those from the particular course we are in.
$filtercourse = array($courseshown => $COURSE);
@@ -3,7 +3,7 @@
class block_calendar_upcoming extends block_base {
function init() {
$this->title = get_string('upcomingevents', 'calendar');
$this->version = 2004052600;
$this->version = 2007101509;
}
function get_content() {
@@ -44,6 +44,8 @@ class block_calendar_upcoming extends block_base {
// the list of courses it will be grabbing events from.
$filtercourse = NULL;
$groupeventsfrom = NULL;
$SESSION->cal_courses_shown = calendar_get_default_courses(true);
calendar_set_referring_course(0);
} else {
// Forcibly filter events to include only those from the particular course we are in.
$filtercourse = array($courseshown => $COURSE);
+2 -2
View File
@@ -5,7 +5,7 @@ include_once($CFG->dirroot . '/course/lib.php');
class block_course_list extends block_list {
function init() {
$this->title = get_string('courses');
$this->version = 2004111600;
$this->version = 2007101509;
}
function has_config() {
@@ -25,7 +25,7 @@ class block_course_list extends block_list {
$this->content->footer = '';
$icon = "<img src=\"$CFG->pixpath/i/course.gif\"".
" class=\"icon\" alt=\"".get_string("course")."\" />";
" class=\"icon\" alt=\"".get_string("coursecategory")."\" />";
$adminseesall = true;
if (isset($CFG->block_course_list_adminview)) {
@@ -3,7 +3,7 @@
class block_course_summary extends block_base {
function init() {
$this->title = get_string('pagedescription', 'block_course_summary');
$this->version = 2004052600;
$this->version = 2007101509;
}
function specialization() {
@@ -8,7 +8,7 @@ class block_glossary_random extends block_base {
function init() {
$this->title = get_string('blockname','block_glossary_random');
$this->version = 2005040500;
$this->version = 2007101509;
}
@@ -226,5 +226,17 @@ class block_glossary_random extends block_base {
return false;
}
/**
* Executed after block instance has been created, we use it to recode
* the glossary config setting to point to the new (restored) one
*/
function after_restore($restore) {
/// We need to transform the glossary->id from the original one to the restored one
if ($rec = backup_getid($restore->backup_unique_code, 'glossary', $this->config->glossary)) {
$this->config->glossary = $rec->new_id;
$this->instance_config_commit();
}
}
}
?>
+49 -8
View File
@@ -4,7 +4,7 @@ class block_html extends block_base {
function init() {
$this->title = get_string('html', 'block_html');
$this->version = 2004123000;
$this->version = 2007101509;
}
function applicable_formats() {
@@ -12,7 +12,7 @@ class block_html extends block_base {
}
function specialization() {
$this->title = isset($this->config->title) ? $this->config->title : get_string('newhtmlblock', 'block_html');
$this->title = isset($this->config->title) ? format_string($this->config->title) : format_string(get_string('newhtmlblock', 'block_html'));
}
function instance_allow_multiple() {
@@ -36,14 +36,55 @@ class block_html extends block_base {
return $this->content;
}
function backup_encode_absolute_links_in_config(&$config) {
$config->text = backup_encode_absolute_links($config->text);
/**
* Will be called before an instance of this block is backed up, so that any links in
* any links in any HTML fields on config can be encoded.
* @return string
*/
function get_backup_encoded_config() {
/// Prevent clone for non configured block instance. Delegate to parent as fallback.
if (empty($this->config)) {
return parent::get_backup_encoded_config();
}
$data = clone($this->config);
$data->text = backup_encode_absolute_links($data->text);
return base64_encode(serialize($data));
}
function restore_decode_absolute_links_in_config(&$config) {
$oldtext = $config->text;
$config->text = restore_decode_absolute_links($oldtext);
return $config->text != $oldtext;
/**
* This function makes all the necessary calls to {@link restore_decode_content_links_worker()}
* function in order to decode contents of this block from the backup
* format to destination site/course in order to mantain inter-activities
* working in the backup/restore process.
*
* This is called from {@link restore_decode_content_links()} function in the restore process.
*
* NOTE: There is no block instance when this method is called.
*
* @param object $restore Standard restore object
* @return boolean
**/
function decode_content_links_caller($restore) {
global $CFG;
if ($restored_blocks = get_records_select("backup_ids","table_name = 'block_instance' AND backup_code = $restore->backup_unique_code AND new_id > 0", "", "new_id")) {
$restored_blocks = implode(',', array_keys($restored_blocks));
$sql = "SELECT bi.*
FROM {$CFG->prefix}block_instance bi
JOIN {$CFG->prefix}block b ON b.id = bi.blockid
WHERE b.name = 'html' AND bi.id IN ($restored_blocks)";
if ($instances = get_records_sql($sql)) {
foreach ($instances as $instance) {
$blockobject = block_instance('html', $instance);
$blockobject->config->text = restore_decode_absolute_links($blockobject->config->text);
$blockobject->config->text = restore_decode_content_links_worker($blockobject->config->text, $restore);
$blockobject->instance_config_commit($blockobject->pinned);
}
}
}
return true;
}
}
?>
+1 -3
View File
@@ -5,7 +5,7 @@ class block_loancalc extends block_base {
function init() {
$this->title = get_string('loancalc','block_loancalc');
$this->content_type = BLOCK_TYPE_TEXT;
$this->version = 2005022100;
$this->version = 2007101509;
}
function get_content() {
@@ -150,8 +150,6 @@ function comp(v) { // general entry point for all cases
} // function comp
//]]>
</script>
<h1></h1>
<form method="post" id="vbankform" action="">
<table>
<tr>
+1 -1
View File
@@ -3,7 +3,7 @@
class block_login extends block_base {
function init() {
$this->title = get_string('login');
$this->version = 2006102700; //TODO
$this->version = 2007101509;
}
function applicable_formats() {
+3 -3
View File
@@ -4,11 +4,11 @@ class block_mentees extends block_base {
function init() {
$this->title = get_string('blockname', 'block_mentees');
$this->version = 2007030900;
$this->version = 2007101509;
}
function applicable_formats() {
return array('all' => true, 'my' =>false, 'tag' => false);
return array('all' => true, 'tag' => false);
}
function specialization() {
@@ -49,4 +49,4 @@ class block_mentees extends block_base {
return $this->content;
}
}
?>
?>
+1 -1
View File
@@ -3,7 +3,7 @@
class block_messages extends block_base {
function init() {
$this->title = get_string('messages','message');
$this->version = 2004122800;
$this->version = 2007101509;
}
function get_content() {
+1 -1
View File
@@ -3,7 +3,7 @@
class block_mnet_hosts extends block_list {
function init() {
$this->title = get_string('mnet_hosts','block_mnet_hosts') ;
$this->version = 2006112100;
$this->version = 2007101509;
}
function has_config() {
+90 -13
View File
@@ -130,25 +130,102 @@ class block_base {
}
/**
* Will be called before an instance of this block is backed up, so that any links in
* any links in any HTML fields on config can be encoded. For example, for the HTML block
* we need to do $config->text = backup_encode_absolute_links($config->text);.
* Enable custom instance data section in backup and restore.
*
* If return true, then {@link instance_backup()} and
* {@link instance_restore()} will be called during
* backup/restore routines.
*
* @param object $config the config field for an insance of this class.
*/
function backup_encode_absolute_links_in_config(&$config) {
* @return boolean
**/
function backuprestore_instancedata_used() {
return false;
}
/**
* Undo the effect of backup_encode_absolute_links_in_config. For exmaple, in the
* HTML block we need to do $config->text = restore_decode_absolute_links($config->text);
* Allows the block class to have a backup routine. Handy
* when the block has its own tables that have foreign keys to
* other tables (example: user table).
*
* Note: at the time of writing this comment, the indent level
* for the {@link full_tag()} should start at 5.
*
* @param object $config the config field for an insance of this class.
* @return boolean return true if something has changed, so the database can be updated,
* false if not, for efficiency reasons.
* @param resource $bf Backup File
* @param object $preferences Backup preferences
* @return boolean
**/
function instance_backup($bf, $preferences) {
return true;
}
/**
* Allows the block class to restore its backup routine.
*
* Should not return false if data is empty
* because old backups would not contain block instance backup data.
*
* @param object $restore Standard restore object
* @param object $data Object from backup_getid for this block instance
* @return boolean
**/
function instance_restore($restore, $data) {
return true;
}
/**
* Will be called before an instance of this block is backed up, so that any links in
* in config can be encoded. For example config->text, for the HTML block
* @return string
*/
function restore_decode_absolute_links_in_config(&$config) {
return false;
function get_backup_encoded_config() {
return base64_encode(serialize($this->config));
}
/**
* Return the content encoded to support interactivities linking. This function is
* called automatically from the backup procedure by {@link backup_encode_absolute_links()}.
*
* NOTE: There is no block instance when this method is called.
*
* @param string $content Content to be encoded
* @param object $restore Restore preferences object
* @return string The encoded content
**/
function encode_content_links($content, $restore) {
return $content;
}
/**
* This function makes all the necessary calls to {@link restore_decode_content_links_worker()}
* function in order to decode contents of this block from the backup
* format to destination site/course in order to mantain inter-activities
* working in the backup/restore process.
*
* This is called from {@link restore_decode_content_links()} function in the restore process.
*
* NOTE: There is no block instance when this method is called.
*
* @param object $restore Standard restore object
* @return boolean
**/
function decode_content_links_caller($restore) {
return true;
}
/**
* Return content decoded to support interactivities linking.
* This is called automatically from
* {@link restore_decode_content_links_worker()} function
* in the restore process.
*
* NOTE: There is no block instance when this method is called.
*
* @param string $content Content to be dencoded
* @param object $restore Restore preferences object
* @return string The dencoded content
**/
function decode_content_links($content, $restore) {
return $content;
}
/**
+1 -1
View File
@@ -3,7 +3,7 @@
class block_news_items extends block_base {
function init() {
$this->title = get_string('latestnews');
$this->version = 2005030800;
$this->version = 2007101509;
}
function get_content() {
+1 -1
View File
@@ -8,7 +8,7 @@
class block_online_users extends block_base {
function init() {
$this->title = get_string('blockname','block_online_users');
$this->version = 2006030100;
$this->version = 2007101509;
}
function has_config() {return true;}
+1 -1
View File
@@ -3,7 +3,7 @@
class block_participants extends block_list {
function init() {
$this->title = get_string('people');
$this->version = 2004052600;
$this->version = 2007101509;
}
function get_content() {
+1 -1
View File
@@ -10,7 +10,7 @@ define('B_QUIZRESULTS_GRADE_FORMAT_ABS', 3);
class block_quiz_results extends block_base {
function init() {
$this->title = get_string('formaltitle', 'block_quiz_results');
$this->version = 2005082300;
$this->version = 2007101509;
}
function applicable_formats() {
@@ -3,7 +3,7 @@
class block_recent_activity extends block_base {
function init() {
$this->title = get_string('recentactivity');
$this->version = 2004042900;
$this->version = 2007101509;
}
function get_content() {
+4 -1
View File
@@ -19,7 +19,7 @@
function init() {
$this->title = get_string('feedstitle', 'block_rss_client');
$this->version = 2007080101;
$this->version = 2007101509;
$this->cron = 300; /// Set min time between cron executions to 300 secs (5 mins)
}
@@ -330,6 +330,9 @@
mtrace(' ' . $rec->url . ' ', '');
/// Fetch the rss feed, using standard magpie caching
/// so feeds will be renewed only if cache has expired
// sometimes the cron times out on moodle.org during fetching,
// there is a 5s limit in magpie which should work, but does not sometimes :-(
@set_time_limit(60);
if ($rss = fetch_rss($rec->url)) {
mtrace ('ok');
} else {
@@ -27,7 +27,7 @@ if (isset($_SERVER['HTTP_REFERER'])) {
// Ensure that the logged in user is not using the guest account
if (isguest()) {
error(get_string('noguestpost', 'forum'), $referrer);
print_error('noguestpost', 'forum', $referrer);
}
@@ -63,7 +63,7 @@ if (!empty($id)) {
$context = get_context_instance(CONTEXT_COURSE, $id);
}
} else {
$context = get_context_instance(CONTEXT_SYSTEM, SITEID);
$context = get_context_instance(CONTEXT_SYSTEM);
}
@@ -102,6 +102,7 @@ if ($act == 'updfeed') {
error(get_string('noguestpost', 'forum').
' You are not allowed to make modifications to this RSS feed at this time.',
$referrer);
//print_error('noguestpost', 'forum', $referrer, 'You are not allowed to make modifications to this RSS feed at this time.');
}
@@ -225,6 +226,7 @@ if ($act == 'updfeed') {
error(get_string('noguestpost', 'forum').
' You are not allowed to make modifications to this RSS feed at this time.',
$referrer);
//print_error('noguestpost', 'forum', $referrer, 'You are not allowed to make modifications to this RSS feed at this time.');
}
$file = $CFG->dataroot .'/cache/rsscache/'. $rssid .'.xml';

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