Compare commits

..

2133 Commits

Author SHA1 Message Date
moodler e5b21c96b2 Moodle 1.5.4 - yay! 2006-05-21 08:00:05 +00:00
moodler 0df8e06a76 I'm in a rush, unfortunately, but here are Martin Langhoff's auto-generated
change list items integrated into the other stuff.

It's not pretty but it's probably getting close to complete.
2006-05-21 07:59:15 +00:00
moodler 414b660d26 Added release notes from documentation wiki 2006-05-21 07:11:59 +00:00
stronk7 5e0bf81737 This was really old and it's useful to determine versions... 2006-05-20 00:08:42 +00:00
martinlanghoff 78f6c5d5c0 login: Changing passwords now works when logged in as guest 2006-05-18 00:49:36 +00:00
vyshane 61e86f7f16 Fixed Bug #5354 - Gradebook [DropXLowest and Exclude] 2006-05-16 04:07:47 +00:00
skodak 9a817ca1ab better cleaning of post title SC#251 revisited; backported from MOODLE_16_STABLE 2006-05-15 14:49:24 +00:00
skodak 4e13cae284 better cleaning of post title SC#251; backported from MOODLE_16_STABLE 2006-05-15 14:35:13 +00:00
urs_hunkler 9bc5c7f85e patch for prototype compatibility 2006-05-14 09:22:24 +00:00
gustav_delius 569936ac79 Making sure timelimit is converted to integer before being written to database, otherwise postgreSQL complains. Closing bug 5401 2006-05-13 17:28:28 +00:00
stronk7 344c9e0034 Now, when a single forum is restored and no user data was created,
the initial discussion/post is automatically generated. Bug 5418.
(http://moodle.org/bugs/bug.php?op=show&bugid=5418)
2006-05-06 16:53:14 +00:00
moodler 61d575f3d3 Fixed: Bug #5164 - Assignment email lacks student name 2006-05-03 08:19:43 +00:00
moodler 7cb1f891c4 An old fix for optional_variable use 2006-05-02 08:04:11 +00:00
moodler f41ab276c7 Old addition never checked in 2006-05-02 07:59:38 +00:00
moodler e2b4f1f361 Changed all files to DOS and added some Id tags 2006-05-02 05:57:12 +00:00
stronk7 49ee0aa3be One debug line killed! :-/ 2006-04-30 10:05:17 +00:00
stronk7 8397552338 Too much restrictive optional_param was producing
some undesired efects with formats. Bug 4858.
(http://moodle.org/bugs/bug.php?op=show&bugid=4858)
2006-04-30 10:02:23 +00:00
stronk7 206afb4c2e entrylist format now show the 'send ratings' button. Bug 4915.
(http://moodle.org/bugs/bug.php?op=show&bugid=4915)

Merged from HEAD
2006-04-30 09:44:26 +00:00
exe-cutor c6e8932e50 Fixed a bug that was not yet merged for stable version 2006-04-27 11:48:25 +00:00
ethem a83254c3e1 1 - Shorter coding. I like short codes. Martin D had made longer before.
2 - Create indexes sliently.
2006-04-27 08:21:17 +00:00
ethem c58f510d09 Shorter coding. I like short codes. Martin D had made longer before. 2006-04-26 15:31:28 +00:00
urs_hunkler 9d08fbc3fd bug #5347 - JS code after page end??? corrected 2006-04-26 14:58:32 +00:00
ethem 08cdce7e5e SQL file contains all upgrades. 2006-04-26 11:18:50 +00:00
ethem 594d381aa2 SQL file contains all upgrades. 2006-04-26 10:20:07 +00:00
moodler 5c8708ef3a Removed forecolor hilitecolor in htmleditor 2006-04-26 08:05:46 +00:00
skodak 9ce42fa860 fixed typo bug #4527; backported from HEAD 2006-04-23 23:17:14 +00:00
urs_hunkler 7fec43e72f Bug #4315 - Use current_theme() instead of the $CFG-theme 2006-04-23 18:53:15 +00:00
ethem 44f68ae516 Create indexes sliently. 2006-04-23 10:23:27 +00:00
ethem 825bae0a90 WE use postgres7.sql, not mysql.sql... 2006-04-23 09:40:56 +00:00
koenr 0ae9d84183 New and modified strings from Ling 2006-04-23 06:51:19 +00:00
moodler d5cc30d905 DON't show notices on new installs 2006-04-23 04:43:54 +00:00
moodler 1f36f2dbc5 Fix for bug 5190 and a warning 2006-04-23 03:46:28 +00:00
moodler ebbc59e575 Latest tags file for stable 2006-04-23 02:56:14 +00:00
toyomoyo 9190ff6e4e fix for 4977 2006-04-21 07:01:33 +00:00
moodler 0a8223b036 Bug 5223 fix 2006-04-21 04:26:08 +00:00
martinlanghoff d866cc69da Backported from HEAD: Skodak's short tag fixes. 2006-04-20 22:40:11 +00:00
martinlanghoff 77a08a9c43 weblib:validate_email() - emails with trailing dot in the local-part (user.@host.com) are invalid as per rfc822 2006-04-20 22:30:53 +00:00
moodler e8b719403a Merged formatting improvement from HEAD 2006-04-19 12:49:23 +00:00
mchurch 68156b0c36 Fixed bug that wouldn't allow a user who's response was deleted from taking the questionnaire again. 2006-04-18 19:34:56 +00:00
moodler 705834be9e Merged fix for bug 5230 from HEAD 2006-04-18 09:47:30 +00:00
moodler f7beddbab8 Fix for Estonian bug #5239 2006-04-18 09:38:42 +00:00
moodler b9f1a09443 Fixed some wrongly defined "parentlanguage" strings 2006-04-17 05:29:49 +00:00
moodler 5da6fbd00f Character set fix for bug 5010 2006-04-16 16:03:57 +00:00
moodler 80682fab3a 1) Removed timeout when processing digests (can be long) bug 4532
2) Cleaned up logic for tracking cleaning (use set_config function)
2006-04-13 12:05:02 +00:00
moodler c9c2d4741d print_header should never happen twice on a page - see bug 4198 2006-04-10 14:43:06 +00:00
vyshane b839781a95 Fix for Bug #5057 - hidden teachers aren't completely hidden 2006-04-10 07:48:34 +00:00
moodler e761ca0c54 Added navmenu to loginas page 2006-04-09 07:27:27 +00:00
moodler c781c781fb Clean up of forum_user_can_view_post() 2006-04-07 14:50:12 +00:00
ikawhero 794bdefb1c Fix to logic for require_login so guest access to courses works. 2006-04-07 01:46:05 +00:00
moodler b7678dfebe Reduce possible notices from bad calls 2006-04-06 16:43:48 +00:00
moodler e53b9f76aa Undone the effect of Patrick Lee's check in for bug 4074. 2006-04-06 05:26:33 +00:00
moodler e86bd81b37 Added an index on course_sections that some old sites might not have 2006-04-05 13:39:50 +00:00
gustav_delius ab4595f640 Prevent student from seeing quiz when closed, bug 5070 2006-04-05 09:49:17 +00:00
moodler a33c2b909b Allow RSS feeds everywhere 2006-04-05 08:36:49 +00:00
ethem f28c6f05b0 IIS https fix. It doesn't recognize empty($_SERVER['HTTPS']). 2006-04-05 07:54:10 +00:00
moodler 7832b22767 FIxing some blank lines as per bug 5095 2006-04-05 06:41:13 +00:00
moodler bb7232305f Changed all the requires to require_once, solves some problems 2006-04-05 03:16:48 +00:00
moodler 4d90cfeadb Fixed some Javascript errors 2006-04-05 02:41:49 +00:00
bobopinna 4a7b01c061 Fixed two problems in AICC importing 2006-03-30 06:50:44 +00:00
gustav_delius fb6dd5f2b1 Reverted Martin's encryption of the key in the responses table for now until we are sure all potential problems have been ironed out. See discussion at http://security.moodle.org/mod/forum/discuss.php?d=178 2006-03-29 10:13:36 +00:00
gustav_delius 3b7d7fe9c0 Moving <td>, fixing bug 5019 2006-03-29 08:46:03 +00:00
moodler f2feb260f7 A fix for SC178. The match question is now encrypted slightly. 2006-03-29 06:11:50 +00:00
koenr 28680c9b32 some documentation missing 2006-03-28 09:20:27 +00:00
michaelpenne a60906a298 [BugFix] Multiple essays were not showing for grading: http://moodle.org/mod/forum/discuss.php?d=41999#195580 2006-03-28 00:37:42 +00:00
gustav_delius e475c02f33 Fixed tolerance problem, see bug 3225 2006-03-27 16:39:55 +00:00
ethem 9e3e2938fc First time install detection. 2006-03-27 09:50:39 +00:00
ethem 6682f3a231 Close tag ?> was forgotten. But it wasn't cause a problem. 2006-03-27 09:34:36 +00:00
moodler be1cd60e93 Improved date range 2006-03-27 05:15:53 +00:00
moodler 5e253a13bb Some extensions to print_time_selector() etc to make them more compatible
with 1.6  (so they can return strings)
2006-03-27 03:40:39 +00:00
mjollnir_ b5c8bf7a26 Since there was no pg support for enrol/authorize until later, the versioning was screwey in postgres, so check the table exists first before trying to add columns to it, create it if it is not there 2006-03-26 22:57:42 +00:00
moodler 1e3787c407 Fix for the infamous zero problem in short answers.
You can now have answers that are "0"
2006-03-26 15:01:00 +00:00
gustav_delius 7649c6ff5c Turned off regrading of quizzes that have the attemptonlast option set because of the bug reported in http://moodle.org/mod/forum/discuss.php?d=42029#194212 2006-03-26 08:16:18 +00:00
moodler be0cfa86bf Added Yahoo and MSN to allowed search engines 2006-03-25 07:34:37 +00:00
moodler 12be03f0fd Added missing text 2006-03-23 01:28:01 +00:00
koenr 008eb2cc15 fix for bug #4885: spaces were missing before and after $a 2006-03-22 08:13:14 +00:00
stronk7 427b2f0c21 Some excess of security was causing Bug 4713.
(http://moodle.org/bugs/bug.php?op=show&bugid=4713)
2006-03-21 20:07:13 +00:00
thepurpleblob 35c808396a Fixed hardcoded filepath. Bug #4544. 2006-03-21 16:50:07 +00:00
ethem 2efe76b0b3 Merged from HEAD 2006-03-21 13:37:44 +00:00
moodler a5a520fdc1 Speedup! get_timezone_record wasn't caching! :-) 2006-03-20 09:36:09 +00:00
moodler eb759836b0 Fixed bug 4928 - editing text outside of textarea! 2006-03-16 10:05:36 +00:00
vyshane bdd7aedc44 Updated print_textarea() 2006-03-16 04:10:44 +00:00
skodak ff84313378 fixed typo PARAM_CLEAR; backported from HEAD 2006-03-15 18:11:13 +00:00
vyshane 0e2445d398 Fixed undefined variable notice. 2006-03-15 08:43:51 +00:00
vyshane ace6341d83 Fixed bug in use_html_editor(). HTMLArea is now displayed correctly even when
$name is not supplied.
2006-03-15 08:31:57 +00:00
vyshane d9f5169972 Modified use_html_editor() and print_editor_config() so that the database
module is compatible with Moodle 1.5 stable.
2006-03-15 07:48:53 +00:00
vyshane 760b407069 Added insertAtCursor() function. So far this function is only used by the
datbase module.
2006-03-15 07:45:19 +00:00
moodler 7caf140453 Applied fix for bug 4639 - thanks 2006-03-14 04:11:54 +00:00
moodler 07264dd81f A series of old fixes never committed 2006-03-13 12:52:39 +00:00
koenr ffa4458986 new nn strings from Thormod 2006-03-10 12:55:03 +00:00
moodler 6e8070f46e Added rss_get_url() to 1.5 to help support data module 2006-03-10 09:05:02 +00:00
moodler 3bf1bd27fc Updated copyright notice 2006-03-10 08:26:05 +00:00
moodler 8a2cc7a379 New files from Aidan for 1.5 2006-03-10 07:27:54 +00:00
moodler 1fbe1f7ced Updates from Aidan 2006-03-10 07:26:39 +00:00
koenr 0e6d35a167 new strings from Tormod 2006-03-08 18:40:27 +00:00
moodler d28d58dc75 Added support for having a linked tab even if it is currently selected. 2006-03-08 06:22:53 +00:00
skodak e7546a2233 fixed includes in included files - see bug #4891; backported from HEAD 2006-03-07 23:44:02 +00:00
skodak 8857a374e4 improved kses cleaning of html SC#204 2006-03-02 21:35:13 +00:00
dhawes cbb0a49aa7 removed secondary cache to close bug 4625 2006-03-02 17:06:49 +00:00
koenr 18357f7118 emailconfirmation doesn't support lastname
see bug 4869
2006-03-02 11:13:18 +00:00
moodler 6c3adcf7f9 Fixed some typos 2006-03-01 09:12:43 +00:00
moodler 528d1ca043 Merged feature to email database connection erorrs to someone into stable 2006-03-01 09:09:03 +00:00
gustav_delius b21be43f6b Committed fix for bug 4829 2006-02-28 20:44:44 +00:00
skodak 24d9df692e prevent unwanted password change here SC#225 2006-02-28 20:25:59 +00:00
moodler 3fb68fb075 Fixing Bug #4849.
Committed by Vy-Shane Sin Fat
2006-02-28 03:53:59 +00:00
michaelpenne 7e42b04bbc [Fix] $navigation and $grade_value were undefined when lesson was added to site main page 2006-02-24 21:27:51 +00:00
michaelpenne f0ebc0976f [BugFix] Bug #4174 - Lesson Essay Question Can't be Graded when attempt not finished 2006-02-24 20:25:36 +00:00
michaelpenne c200adccf6 [BugFix] Bug #4216 - cancel button 2006-02-24 19:19:11 +00:00
mjollnir_ 4c6dc44de1 Fixing a problem reported about self enrolment in child courses and not being able to access the parent without logging in and out again at http://moodle.org/mod/forum/post.php?reply=185699 2006-02-23 22:14:22 +00:00
moodler f0172f52cf Fixed some English grammatical errors 2006-02-20 03:16:52 +00:00
gustav_delius 02dd661361 Backported fix for bug 4217 to STABLE 2006-02-19 21:47:42 +00:00
koenr e4ac8267b9 Lots of changes by Dmitry Pupinin 2006-02-17 23:34:48 +00:00
toyomoyo 3ceb1580b5 better fix for 4360 2006-02-17 01:30:47 +00:00
gustav_delius ddf32e386a Bug in "Prevent late submissions" setting fixed, thanks to Samuli, see bug 4780 2006-02-16 22:00:32 +00:00
gustav_delius 2caa75465e Bug in "Prevent late submissions" setting fixed, thanks to Samuli, see bug 4780 2006-02-16 21:53:41 +00:00
gustav_delius e94270f61d Applied fixes from bug 4319. Thanks to Jaroslav 2006-02-15 08:56:06 +00:00
patrickslee 3ab5df5a97 Re-formatted the imporved flat file enorlment description 2006-02-15 03:27:23 +00:00
toyomoyo ff306b2645 fix for 4360 2006-02-15 02:15:31 +00:00
gustav_delius 32ddabcb9f Sorry, I was a bit hasty in my last commit. 2006-02-15 00:21:58 +00:00
gustav_delius 33dde42697 Don't apply lateness check when teacher previews. Bug 4495 2006-02-15 00:19:12 +00:00
mjollnir_ 41fb3602d3 Committing a fix to the get_course_mods warning that I fixed in head yesterday but forgot to commit here. 2006-02-14 23:48:58 +00:00
gustav_delius 181d29fefb backported fixes from HEAD, closing bug 4688 2006-02-14 22:55:11 +00:00
gustav_delius b0d1fa4ff8 Rounding errors could lead to "Partially correct" for correct answers, see http://moodle.org/mod/forum/discuss.php?d=39548 2006-02-14 19:18:07 +00:00
skodak 1a0fe7131a backported notice fix from HEAD 2006-02-13 21:20:36 +00:00
toyomoyo 633fe52763 fix for 4724 2006-02-13 01:36:26 +00:00
patrickslee 71767f13f9 Imporved the documentation for flatfile enrolment plugin on the configuration page 2006-02-13 00:30:02 +00:00
gustav_delius aa6bdce1ff Added missing percentages to the grade selector, closing bug 4250 2006-02-12 22:37:20 +00:00
gustav_delius aff698756b Avoid error messages in case $quiz->sumgrades is zero, closing bug 4454 2006-02-12 21:02:18 +00:00
gustav_delius aa9e82825c removed two method definitions that are used for the editing form
removed an extraneous addslashes
2006-02-11 16:42:49 +00:00
gustav_delius c8a6cdb32e get_actual_response() method for cloze question type contributed by Jean-Michel, see http://moodle.org/mod/forum/discuss.php?d=27730#181773
Also merged some comments from HEAD
2006-02-11 16:17:57 +00:00
moodler 27cc4df4d1 Added missing statement: require_once('locallib.php'); 2006-02-10 03:56:42 +00:00
gustav_delius affcbadb7a Added defaults to database fields needed by msyql 5 2006-02-09 12:29:43 +00:00
gustav_delius e4bcb36474 Added default = '' to various text fields because otherwise I get warnings since I upgraded to mysql 5 2006-02-09 12:18:37 +00:00
michaelpenne 178f9028fd [Fixed] Bug #1187 2006-02-08 20:38:00 +00:00
koenr 945eb217b4 fix for this discussion http://moodle.org/mod/forum/discuss.php?d=39248 2006-02-08 10:13:57 +00:00
koenr 1a320e8140 new files and strings for no moodle 1.5.3 from tormod - some XHTML issues to be solved 2006-02-08 10:02:58 +00:00
patrickslee 71397cc9f0 Show category list rather than the whole list of courses if there is only one category and with more than 200 courses in it
Otherwise we will have a HUGE list of courses flooding our browser.
2006-02-08 04:19:56 +00:00
moodler 6aa427a253 Fixed missing close tag 2006-02-07 00:56:41 +00:00
moodler 4d76481659 Fix missing closing tag 2006-02-07 00:52:36 +00:00
gustav_delius b9b2939acd Fixing wrong language string name, see bug 4254 2006-02-06 21:41:31 +00:00
gustav_delius dc2bfe815d Added addslashes 2006-02-06 21:29:20 +00:00
mjollnir_ 6f4b73112d Fixing bug #4345: quiz report perf issues I fixed last year not working on mysql 3.23. We have JOIN ... ON for INNER JOIN but not JOIN in mysql 3.23. Not merging to 1.6 as requirements are bumped 2006-02-06 20:54:56 +00:00
moodler 8e11a7290c Latest versions from head 2006-02-06 10:00:44 +00:00
koenr c03c64d685 file block_attendance.php was added on branch MOODLE_15_STABLE on 2006-02-17 23:34:47 +0000 2006-02-06 09:14:23 +00:00
koenr c6833b0e6c file quiz_analysis.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:11 +00:00
koenr 73f9745b0e file webquest.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:11 +00:00
koenr a84c94658b file wiki.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:11 +00:00
koenr 40473e4af7 file timezones.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:11 +00:00
koenr c6d8f693f7 file block_rss_client.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 68cf317656 file block_course_list.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 3e5f001ba4 file block_online_users.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr ed55d58b2c file grades.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr dbb3a2c7b6 file matching.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 5a089497ec file hotpot.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 07bd956435 file install.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 79cdc1ce64 file block_search_forums.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 73b8d053bd file appointment.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 94e2614632 file block_html.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 6f96033490 file message.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 9cddcb2365 file block_glossary_random.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 9236c5f572 file emailprotect.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr be5c4c8902 file calendar.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr d4c00d4e00 file flashcard.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 8e27eea26b file activitynames.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 92c07b4a66 file block_course_summary.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr 95e0d416a8 file block_social_activities.php was added on branch MOODLE_15_STABLE on 2006-02-08 10:02:58 +0000 2006-02-06 09:14:10 +00:00
koenr afca273014 file block_rss_client.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr d928921a65 file README was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 02b7f813fa file exercise.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr de7f0b94e6 file block_course_list.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 60459b55a5 file auth.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 9cbaa1783d file countries.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 2796f927f7 file block_online_users.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 41d4d4d2b0 file assignment.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr a4b6786d19 file attendance.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 8fc3d8f208 file webquest.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 300ff5f792 file editor.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 74503992e0 file chat.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 7117601050 file matching.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 64a5e30034 file forum.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 80f2de83c9 file hotpot.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr c3c292dd8f file dialogue.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 39826dd8d6 file survey.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 63a714c536 file choice.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 3245d74f2a file multilang.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 4e68f63f16 file block_html.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 01986cae05 file moodle.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 6a2a6a3077 file block_course_summary.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 17def53fd2 file admin.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr dfae7ea7ac file calendar.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 212cee1740 file flashcard.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 6599fbec10 file block_social_activities.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 18463f013a file glossary.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 824ae0c599 file activitynames.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 9a537b93cd file workshop.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr bffe533dad file quiz.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr 95ede38b57 file error.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr b07e7223b1 file block_quiz_results.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr ff499ff2cd file lesson.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr df4e998d1f file block_section_links.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
koenr b432bd3300 file resource.php was added on branch MOODLE_15_STABLE on 2006-03-10 12:55:03 +0000 2006-02-06 09:14:10 +00:00
moodler 9faf1249c0 file webquest.php was added on branch MOODLE_15_STABLE on 2006-03-10 07:27:54 +0000 2006-02-06 09:13:59 +00:00
moodler bfef9df662 file tex.php was added on branch MOODLE_15_STABLE on 2006-03-10 07:27:54 +0000 2006-02-06 09:13:59 +00:00
moodler c87eeb190c file algebra.php was added on branch MOODLE_15_STABLE on 2006-03-10 07:27:54 +0000 2006-02-06 09:13:59 +00:00
moodler dd768d9569 file emailprotect.php was added on branch MOODLE_15_STABLE on 2006-03-10 07:27:54 +0000 2006-02-06 09:13:59 +00:00
moodler f17588726e file block_quiz_results.php was added on branch MOODLE_15_STABLE on 2006-03-10 07:27:54 +0000 2006-02-06 09:13:59 +00:00
gustav_delius 00aad1aee6 Fixed a potential bug that would have hit if one quiz would have had two random questions for the same category, one of which was set to recurse into subcategories and the other not.
At the same time this improves performance because no longer all the potential questions are loaded from the database but only their ids.
2006-02-05 21:50:37 +00:00
stronk7 e034804630 Perform one aditional check to avoid one, in my opinion,
bad behaviour of PHP5.

Merged from MOODLE_HEAD
2006-02-05 10:13:36 +00:00
gustav_delius d336b1888d Fix for bug 4678 contributed by rwmoore 2006-02-05 00:34:49 +00:00
stronk7 ad03392414 Latest functionalities (feedback messages, bypass tests...) added.
Merged from MOODLE_HEAD
2006-02-04 19:19:37 +00:00
stronk7 28ce8fa510 Updating to last xml version available (from HEAD) 2006-02-04 19:17:05 +00:00
bobopinna 3a19de6dd2 Fixed lesson status skin support 2006-02-03 08:51:13 +00:00
moodler 8eae75e36f Moved ENvironment line and made consistent 2006-02-03 07:52:32 +00:00
moodler e986ef72e5 Added a space 2006-02-03 07:37:45 +00:00
moodler 7773aa2406 Added simple webstatus icon for skype 2006-02-03 07:28:34 +00:00
mjollnir_ 3c9d0038dd Moved check_dir_exists function from backup/lib.php to moodlelib 2006-02-02 20:29:34 +00:00
mjollnir_ 50c38beb53 Fixing bug#4659 - don't make upload directories unless there's something to save 2006-02-01 20:01:25 +00:00
stronk7 17b04836ac Solved one bug when decoding encoded links for
resource->reference
(http://moodle.org/mod/forum/discuss.php?d=38801)
2006-02-01 19:08:13 +00:00
gustav_delius cc18f37b11 fixed grammar problem reported by Nicole Hansen in bug 4515 2006-01-30 22:57:26 +00:00
gustav_delius d80fcee1b4 Fixed alignment of form elements in IE 2006-01-30 21:04:31 +00:00
gustav_delius cb10ac600f Fixed alignment of module icon so it looks correct also in Firefox 2006-01-30 20:42:37 +00:00
moodler 4765def7b5 Fixed some missing tags 2006-01-30 03:31:48 +00:00
moodler 5a2d6616db Fixed the missing .highlight 2006-01-30 03:21:18 +00:00
defacer 5bb82b2c37 Fix for bug 4627:
Hide "change password" link in admin block if the user is restricted.
Not a security issue, as the script doesn't allow you to change your
password even if you go there by typing in the URL.

Credits for report & patch go to Joseph Rezeau.
2006-01-28 19:41:22 +00:00
stronk7 67f74d8964 Solving double addslashes to DB when the site is running with
magic_quotes_gpc() disabled (because Moodle addslashes to
everything). Not a pretty hack, but it seems to work.
(http://moodle.org/mod/forum/discuss.php?d=38127)
2006-01-27 22:59:41 +00:00
julmis 65f0d15c41 Adding bug fix for Bug 4562. Fix posted by sgarcia. 2006-01-25 23:41:11 +00:00
stronk7 fa4a720513 Raising MySQL minimum version to 4.1.16 2006-01-25 15:50:56 +00:00
moodler 3ae1f350f7 Fix Bug #4626 - weblib.php: $course object conversion error in &quot;print_footer &quot; function 2006-01-24 01:38:02 +00:00
michaelpenne 7fe2010ceb [Fixed] A problem with storing the answerid for numerical questions. Discussion here: http://moodle.org/mod/forum/discuss.php?d=37537 2006-01-24 00:45:25 +00:00
mjollnir_ 96c4004598 Fixing bug #4621 typos in mysql 3.23 workaround in message backup. Does not need merge to HEAD, old mysql support out 2006-01-23 22:50:46 +00:00
moodler aacc5fb9f2 Extra text for 'guestnosubmit' 2006-01-23 02:39:34 +00:00
moodler b066183e3a Extra fix for bug #4604. Guests see different message, instead of "You have not submitted anything" 2006-01-23 02:34:51 +00:00
stronk7 06493b4e9c Backporting some lang files from HEAD to 1.5 so new environment
stuff and installation strings were showed properly.
2006-01-22 19:05:51 +00:00
stronk7 916d67e854 Backport the current_charset() function to 1.5 to be able to
run MoodleWindowInstaller without modifications.
2006-01-22 18:16:44 +00:00
stronk7 45fbcf1088 Changed harcoded 'admin' to $CFG->admin 2006-01-21 00:17:19 +00:00
stronk7 ce0a539a54 Now results of check_moodle_environment() are
cached, saving us of some work when the script
is called more than once per request (install)
2006-01-20 18:49:39 +00:00
stronk7 4dfed138d2 First field must be unique in every select. Bug 4619.
(http://moodle.org/bugs/bug.php?op=show&bugid=4619)
2006-01-20 15:07:04 +00:00
stronk7 449b6e984d Moving environment stuff to 1.5 2006-01-19 16:16:19 +00:00
skodak 7b62df3807 remove upload form for guests - backported from HEAD 2006-01-19 15:25:20 +00:00
stronk7 c4a006cc6b file environmentlib.php was added on branch MOODLE_15_STABLE on 2006-01-19 16:15:04 +0000 2006-01-19 11:10:26 +00:00
moodler 1a273b4765 Removed submit online assignment button for guest. (bug: 4604) 2006-01-19 02:38:54 +00:00
stronk7 6840f49faf Now course shortname is searched too, to avoid duplicates over it.
Bug 4607
(http://moodle.org/bugs/bug.php?op=show&bugid=4607)
2006-01-19 00:20:55 +00:00
stronk7 794b137865 file environment.php was added on branch MOODLE_15_STABLE on 2006-01-19 16:16:19 +0000 2006-01-18 23:05:07 +00:00
moodler 40e9f144fc Guests can no longer submit an online assignment (Bug 4604) 2006-01-18 04:44:25 +00:00
moodler ebbc9a1a15 Guests can no longer submit online assignment (bug 4604) 2006-01-18 04:33:05 +00:00
stronk7 6c094570f5 file environment.xml was added on branch MOODLE_15_STABLE on 2006-01-19 16:16:19 +0000 2006-01-16 22:06:15 +00:00
ikawhero 67e1763897 Quiz summary text shouldn't be cleaned as only entered by teacher. 2006-01-16 06:19:38 +00:00
moodler 2c7f710d08 added missing semicolon in &nbsp (bug#4592) 2006-01-16 04:45:26 +00:00
martinlanghoff 17729fc82e readfile_chunked() - do not timeout on slow (dial up) clients, and flush buffers explicitly to avoid hogging memory when ob is on 2006-01-16 04:01:14 +00:00
moodler 5703ba58e6 added missing semicolon in &nbsp (bug#4592) 2006-01-16 03:05:47 +00:00
stronk7 fe36756ae0 Now ewiki supports initial load of contents from course file area.
Original preg_match() was a bit strange so I've replaced it with
clean_filename() + !is_dir() check. Bug 3830.
(http://moodle.org/bugs/bug.php?op=show&bugid=3830)
2006-01-15 11:55:59 +00:00
michaelpenne 9250c7f917 [Changed/BugFix] Now when a teacher edits a page with the "Edit page contents" button and then saves or cancels, s/he gets redirected back to the lesson navigation. This will help to streamline the editing.
[Fixed] The cancel button on the edit page now works.

[Fixed] "Edit page contents" button works on the first page now.
2006-01-13 19:51:45 +00:00
michaelpenne 451e99a000 [BugFix] Bug #4586 in the moodle bug tracker 2006-01-13 19:26:36 +00:00
defacer 4eec54f20e Merging from HEAD:
Fix for bug discussed here:
http://moodle.org/mod/forum/discuss.php?d=37545

Very slight version bump, in line with what we do for mods with db updates.
2006-01-13 16:34:25 +00:00
stronk7 1237e64d63 Solved one problem with frames and activitynames filter.
(http://moodle.org/mod/forum/discuss.php?d=28382)
2006-01-11 15:21:02 +00:00
mjollnir_ 1e751f6b77 Metacourse unenrolling: fixes bug #4541 2006-01-10 01:19:28 +00:00
patrickslee 2f816b5565 Wrong default data for $CFG->changepassword 2006-01-09 03:44:31 +00:00
moodler 517604e213 Fixed Bug #4536 : error in optional_param 2006-01-09 01:54:16 +00:00
stronk7 8cfab83435 We were beint too much extrict and concepts can contain quotes and
other characters. Bug 4543.
(http://moodle.org/bugs/bug.php?op=show&bugid=4543)
2006-01-07 12:29:29 +00:00
moodler 58625e508f Nicer presentation of quiz questions 2006-01-06 07:24:51 +00:00
moodler 3a78cf04dd Fixed Bug #4533 - Max upload size at course level ignored.
Modified around line 835

$upload_max_filesize = get_max_upload_file_size($CFG->maxbytes, $course->maxbytes);

Added second parameter to function get_max_upload_file_size, so that it takes max size for a course into consideration.
2006-01-06 05:14:27 +00:00
ethem 2e37b629ae Address Verification System (AVS). 2006-01-05 16:04:28 +00:00
toyomoyo c697c81289 puts a limit to number of students displayed (20). 2006-01-04 05:21:15 +00:00
toyomoyo 04fc63e104 fix for bug #4431 (site level forums) 2006-01-04 03:04:01 +00:00
martinlanghoff 6c533543a8 AdoDB tests cleanup after Secunia Advisory SA18267 2006-01-03 20:44:42 +00:00
martinlanghoff ae3c8f147e Fix for Secunia Advisory SA18267, plus some logging of suspicious activity. 2006-01-03 20:40:58 +00:00
gbateson 3a8bce5468 allow import of HP5 quizzes (including JBC and old JQuiz) 2006-01-02 14:38:01 +00:00
gbateson 14b348d178 for JCloze import, defaultgrade (per gap)= 1, and defaultgrade (per exercise) = number of gaps 2005-12-31 14:53:33 +00:00
gbateson aa35bd0991 removed weighting from questiontext in JCloze import 2005-12-31 14:01:13 +00:00
gbateson 95f4edce44 fixed import of JCloze into quiz module as a MULTIANSWER question 2005-12-31 10:37:26 +00:00
mjollnir_ e2a03f553b Fixing bug 4524: typo 2005-12-30 19:45:14 +00:00
patrickslee 81ed299094 fixed $cfg->forceloginforprofiles logic SC#207. Backported from HEAD 2005-12-29 00:56:00 +00:00
moodler c0e4f222fb FIxed stupid little typo that has been annoying me 2005-12-26 08:43:06 +00:00
toyomoyo 80bcfaad68 added a string "changes saved" after quickgrade - bug #4504 2005-12-23 06:36:54 +00:00
moodler acd04dd6cc Further fixes to the fix for bug 4431, to allow guests to see posts 2005-12-22 10:04:42 +00:00
ikawhero 0731d9caf0 Missing sesskey parameter 2005-12-22 00:13:43 +00:00
toyomoyo 8d3cb4a274 fixes a bug, wrong param type for $page 2005-12-21 03:24:26 +00:00
toyomoyo 963eb95d49 bug fix for #4431, added function forum_user_can_view_post in lib.php 2005-12-20 05:11:24 +00:00
toyomoyo 0916a1993e fix bug #4490, no defaut values for db fields 2005-12-19 02:09:56 +00:00
toyomoyo f4141a0267 fixes a bug that students in group can not remove page 2005-12-16 07:12:40 +00:00
mjollnir_ 0441f512f5 Fixing warning (http://moodle.org/mod/forum/discuss.php?d=36226#167658 - not applicable to HEAD 2005-12-14 22:09:20 +00:00
patrickslee d3322e6d98 Moved the new functions added for Bug #4074 to datalib.php 2005-12-13 19:32:53 +00:00
stronk7 f6dccf0d2a Updated to newest version. Solved one important bug.
(http://bugs.typo3.org/view.php?id=2020)
2005-12-13 17:13:40 +00:00
patrickslee ed0a01982a Fixed courses and subcategories in an invisible category being visible (Bug #4074) 2005-12-13 03:33:46 +00:00
martinlanghoff eed0f0b94d auth/ldap: Fix support for AD -- thanks to Inaki, in more than one sense ;-) 2005-12-12 04:57:23 +00:00
martinlanghoff d6c2c60294 auth/cas: fixed a syntax error casting -- credits to Nigel McNie 2005-12-12 03:21:11 +00:00
mjollnir_ 01ac9a36d9 Accounts that are created with no authentication shouldn't allow non alphanumeric usernames, fixing in login/index.php as the auth library can't pass error messages. Fixes bug #4192 2005-12-12 03:16:42 +00:00
mjollnir_ cf1d28e2d0 Fixing a fatal error in updating a wiki (lib.php included twice ) 2005-12-11 21:29:42 +00:00
toyomoyo 13fbf0b43e fix for bug #4455 2005-12-09 05:27:18 +00:00
moodler 33b3fc9fc8 Rolled back, wrong solution for bug Bug #4431 2005-12-08 06:46:23 +00:00
moodler a8adeff529 Adding if statement to verify whether user can see postings or not (Bug #4431) 2005-12-08 05:00:41 +00:00
defacer d45dbbda40 XHTML fix, pointed out by James Ballard here:
http://moodle.org/mod/forum/discuss.php?d=35830
2005-12-07 14:59:31 +00:00
moodler b3188b3069 Replaced optional_var with optional_param 2005-12-07 06:20:20 +00:00
moodler cf08dfbbda eplaced optional_var with optional_param 2005-12-07 05:57:19 +00:00
moodler c06eaa6c53 Replaced optional_var with optional_param 2005-12-07 03:29:55 +00:00
moodler 140222739f Removed optional_var 2005-12-07 03:18:00 +00:00
gustav_delius f9212cb330 Removed some code that had not function and produced a warning. 2005-12-06 23:57:31 +00:00
patrickslee 05348f162f Fixed an SQL query compatibility issue in quiz module 2005-12-06 21:12:46 +00:00
patrickslee 67a10d9b40 Fixed a typo in quiz_category_object->output_edit_single_table() 2005-12-06 21:01:32 +00:00
patrickslee 3317eeaed0 Fixed some kind of typo prevented sumgrades grounding to work 2005-12-06 20:49:42 +00:00
moodler 474de04841 Removed optional_variable 2005-12-06 05:19:36 +00:00
moodler 736d441da3 Removed optional_param 2005-12-06 05:14:21 +00:00
moodler c534ba0019 Changing from optional_variable to optional_param 2005-12-06 04:54:55 +00:00
gbateson f843154f8b use "optional_param" instead of outdated "optional_variable" 2005-12-06 03:41:22 +00:00
patrickslee 098901627b Fixed a bug caused hotpot module not restoring attempts properly 2005-12-06 02:33:47 +00:00
stronk7 88535c6753 Now delete_instance() in resource classes receives the
full $resource record instead of the $id alone. Needed
to be able to specialize such method in some resource types.
2005-12-05 23:59:24 +00:00
ethem 2d49ed8505 Fix invalid \r\n\r\n in https request introduced in 2005071601. 2005-12-05 09:40:02 +00:00
moodler 5ad193da55 Added autocomplete=off in form tag to fix (Bug #4423 - Short Answer Quiz Q's Saving Form Entries) 2005-12-05 06:14:21 +00:00
moodler cebb99bb29 Added autocomplete=off in form tag to avoid browser autocomplete (bug:4423) 2005-12-05 06:05:02 +00:00
moodler 62d851c6ae Changes to new-style parameter checking 2005-12-05 04:51:55 +00:00
moodler 77631f8515 New-style parameter checking 2005-12-05 04:35:25 +00:00
moodler 322bcbe3d4 Optional parameter fixes 2005-12-05 04:19:31 +00:00
mjollnir_ 3abf63d47b Better fix to change_password.php - primary admin can change their OWN password, the form displays the error for other admins trying to change the primary password (before it failed silently) and external auth admin change password works too! 2005-12-04 23:00:37 +00:00
mjollnir_ 179736fec9 Backing out last patch - needs fixing differently 2005-12-04 22:42:03 +00:00
mjollnir_ 0bbef3919c Fixing problem where admins couldn't change their password (with external auth) 2005-12-04 22:30:17 +00:00
moodler b444e02dc2 Modified the rather scary new messages printed here. 2005-12-04 13:03:38 +00:00
ethem 5a989ca47e \r\n fix. 2005-12-04 10:45:11 +00:00
ethem b571581488 login_https is required in version 2005071601 for security reasons. 2005-12-02 14:12:26 +00:00
ethem 95ebc7c4b3 httpsrequired string. 2005-12-02 12:17:47 +00:00
ethem 00f3ef99b4 Some changes:
- allow_internal is not need anymore. Shows two option if enrolment key of course is set.
- login_https is required for payment pages. My credit card is important. If you haven't a certificate forgot this module. (security)
- Expiry date of credit card is more friendly :).
2005-12-02 12:14:39 +00:00
ethem 3b864d850e Postgres support and some indexes for speed. 2005-12-02 11:45:36 +00:00
toyomoyo 6365776cc8 made a mistake earier on =( 2005-12-02 02:34:08 +00:00
toyomoyo 2b0ba67d31 fixes bug 4400 2005-12-02 02:23:07 +00:00
toyomoyo f560b24c61 added function is_restricted_user - bug 4400 2005-12-02 02:22:15 +00:00
paca70 ad25a2d8fe Prevent error messages if groupdn does not exists 2005-11-29 12:14:08 +00:00
ikawhero f5c751f525 Removed old THEME variable. 2005-11-28 22:31:09 +00:00
stronk7 114e550c35 Merged from HEAD. To be showed in the Windows Installer. 2005-11-28 20:22:07 +00:00
moodler 1523c9d2f4 Added some more CSS hooks for the correctness feedback 2005-11-28 04:21:00 +00:00
toyomoyo 768d51a61e fix bug #4366 2005-11-28 02:26:01 +00:00
toyomoyo 79dbfb855d makes autologinguest possible at site level 2005-11-28 02:19:12 +00:00
gbateson 8bd05834ac micro-increment version number to 2.0.10 2005-11-27 01:46:14 +00:00
gbateson 5edd281eaf corrected adjustment of relative URLs in <EMBED> tag 2005-11-27 01:41:15 +00:00
defacer 482bad4e8b Merging from HEAD:
Fix for bug 4371 (also SC#199):

Now manually created users with admin privileges and force change password
cannot change their username with impunity.
2005-11-26 01:01:56 +00:00
toyomoyo 68e8fb7df0 fix for bug 4067 2005-11-25 08:42:12 +00:00
toyomoyo 01004e9d1e fix for bug 4067 - allow user to update assignment when not yet marked 2005-11-25 08:34:25 +00:00
moodler fd5e633e83 fix for bug #4314 2005-11-25 07:09:04 +00:00
moodler e05a3e14c1 fix for bug #4206 2005-11-24 02:50:42 +00:00
mjollnir_ 7398207f4b Delayed merge from HEAD - If tablelib is going to do fullname voodoo, allow default sort field to be firstname/lastname 2005-11-23 21:10:51 +00:00
stronk7 20cfdcef31 Log actions must be strored to DB without &amp;
print_log() takes care of it! Bug 3853.
(http://moodle.org/bugs/bug.php?op=show&bugid=3853)
2005-11-23 09:39:31 +00:00
moodler 8cd04c6d9f fixes bug #4354 2005-11-22 03:44:55 +00:00
stronk7 a1235e9d49 shorten_text() AFTER format properly. See bug 4355.
(http://moodle.org/bugs/bug.php?op=show&bugid=4355)
2005-11-21 15:40:53 +00:00
ethem 647d7ca7c0 file postgres7.php was added on branch MOODLE_15_STABLE on 2005-12-02 11:45:36 +0000 2005-11-21 14:09:52 +00:00
stronk7 061e5eb815 Prevent a warning when params is empty. Bug 4328.
(http://moodle.org/bugs/bug.php?op=show&bugid=4328)

Merged from MOODLE_HEAD
2005-11-21 13:18:03 +00:00
stronk7 bae2c2a470 Now the section "jumpto" menu (showed in collapse mode), supports
the multilang filter. Bug 4341.
(http://moodle.org/bugs/bug.php?op=show&bugid=4341)
2005-11-19 19:58:30 +00:00
stronk7 32c8bf5b3d Print performance info if exists and $CFG->perfdebug is enabled. 2005-11-19 18:21:58 +00:00
moodler 7229d893bb Fix for bug 4351. New parasmeter for get_record_sql to disable
auto-added LIMIT (in case we are using our own)
2005-11-19 15:33:19 +00:00
moodler d51b23b113 Bumping version beyond 1.5.3 2005-11-19 13:27:35 +00:00
stronk7 1b258734f6 Solved bug found when trying to backup all users!
(http://moodle.org/mod/forum/discuss.php?d=27105)
2005-11-19 00:26:36 +00:00
mjollnir_ c36d93026e Fixing bug 4345: merging problem when fixing bug 4303 2005-11-18 21:02:33 +00:00
stronk7 b565aa835e Mimic changes from "Ought to mention the improved assignment grading!"
Merged from HEAD
2005-11-18 16:22:56 +00:00
moodler 621fedf85c Ought to mention the improved assignment grading! 2005-11-18 14:49:14 +00:00
skodak 07d9001c08 xxx_param() fix 2005-11-18 10:54:45 +00:00
skodak f72b6e915a some more fixes for assignment grading 2005-11-18 10:24:50 +00:00
moodler babfcd1c17 fixes bug#4086, spelling mistake 2005-11-18 08:20:38 +00:00
julmis 176ff2b517 Commenting out gz_handler since it seem to cause problems
more on http://moodle.org/mod/forum/discuss.php?d=34376
2005-11-17 19:30:50 +00:00
stronk7 5ebb4f2d42 A bit later, but here it's release info.
Merged from HEAD.
2005-11-17 18:02:40 +00:00
martignoni 527e0131d0 Merge docs folder 2005-11-17 13:41:35 +00:00
julmis ae6c928926 Adding required_param or optional_param to clean up id's 2005-11-17 10:27:16 +00:00
moodler d1edf55639 Updated with notices about recent issues 2005-11-17 07:55:34 +00:00
moodler c54b5d6ebc Bumping to 1.5.3 for IMMINENT RELEASE. REALLY!! 2005-11-17 07:25:25 +00:00
moodler 9851f4d091 Added Petr's code for some checking for the insecure situation of
- register_globals = on  and
  - magic_quotes_gpc = off

with slight rewording changes

SC 193
2005-11-17 07:10:51 +00:00
moodler b2a1bc9fc9 Checked in Petr Skoda's fix for SC189.
It worked for us!
2005-11-17 06:44:10 +00:00
moodler 630d7b7b4d JUst tidying up layout ... functionally the same 2005-11-17 06:38:17 +00:00
mjollnir_ 25c741d659 Fixing misnamed variable in forgot password link in login block 2005-11-17 02:30:17 +00:00
mjollnir_ 50d7a3a52e Pulling in a missing global CFG in datalib:execute_sql (affects CFG->dblogerror) 2005-11-17 02:26:49 +00:00
stronk7 38271961ae Now courses are viewable by idnumber. Credits to Paolo Oprandi.
(http://moodle.org/mod/forum/discuss.php?d=18442)
2005-11-16 23:20:08 +00:00
stronk7 4a2aeccb2b Some typos solved. :-| 2005-11-16 23:03:34 +00:00
skodak c5431f8858 Fixed bug #4038 encoding problems when grading 2005-11-16 22:54:30 +00:00
stronk7 4ac66d6105 Updated a bit to explain how the multilang filter works. 2005-11-16 19:50:36 +00:00
skodak 901ba3c01d added basic validation of jump parameter 2005-11-16 16:44:39 +00:00
skodak 7a12269386 quoting type 2005-11-16 16:33:45 +00:00
skodak 8dc163f571 cleaning of parameter name before use SC#188 2005-11-16 15:20:57 +00:00
mjollnir_ 5609431181 Another fix to the perf printing patch from earlier. I didn't realise that 'no' in the context of perf means 7 ;) 2005-11-16 02:11:52 +00:00
mjollnir_ 9661a67c66 Fixing merging problem in the quiz report fix ealier - disabling wrong checkbox for site course quizes 2005-11-16 01:37:08 +00:00
skodak 0582eb58c8 no page flip after fastgrade saving, allow hiding of grade or comment column when fastgrading, do not update db when no changes in fastgrade 2005-11-15 23:43:52 +00:00
skodak 2055e78fe2 removed ugly/dangerous hack assert_var_set() 2005-11-15 23:37:17 +00:00
skodak c635c9c087 PARAM_BOOL now detects on and off values 2005-11-15 23:20:59 +00:00
mjollnir_ d50bb68692 Fixing bug 4303 - quiz reports dying on large enrolments - getting all users into an array and imploding it into an IN() replaced with joins. This changes the functionality SLIGHTLY in two ways - 1. show students with no attempts now JUST shows students with no attempts, rather than both. Show students with no attempts is now disabled for the site course as is not really relevant and could be ridiculously large 2005-11-15 22:07:39 +00:00
patrickslee 498ef90f7b More restrictions on enrol/unenrol of meta courses. Thanks to Bug #4057 2005-11-15 21:53:39 +00:00
skodak ace9977578 cleaning of parameter name before use SC#188 2005-11-15 21:47:18 +00:00
skodak c8a38c86ce Bug #4049 - Gradebook: Category names with a dot in them don't work correctly 2005-11-15 21:40:18 +00:00
mjollnir_ 9c9d5ae18f Better logic for printing perf info in the footer - should be distinct from the validation stuff 2005-11-15 21:32:30 +00:00
mjollnir_ 8df570f284 Fixing up the missing perfdebug string in admin, turning perf on in the default footer using $CFG->perfdebug 2005-11-15 21:21:53 +00:00
mjollnir_ 23eb2bbc57 Fixing typo in 1.5.3 release notes s/plugi/plugin/ 2005-11-15 21:19:11 +00:00
skodak 83fa1948c2 XSS prevention in older PHP versions SC#190 2005-11-15 18:20:15 +00:00
stronk7 feb3dff674 Clarify a bit one item. 2005-11-15 08:47:57 +00:00
martinlanghoff 61da36a863 153 release notes done -- bonus commit with hidden roll-of-honour 2005-11-15 07:21:24 +00:00
martinlanghoff ebb8f1b45c work-in-progress 153 release notes -- added notes about the commits from the last 2~3 days 2005-11-15 07:19:05 +00:00
martinlanghoff 580427eb72 work-in-progress 153 release notes -- part 3 2005-11-15 07:03:38 +00:00
martinlanghoff 952b4986c4 work-in-progress 153 release notes -- part 2 2005-11-15 06:22:04 +00:00
martinlanghoff 220dfe69ad work-in-progress 153 release notes 2005-11-15 05:47:46 +00:00
patrickslee 5f7baedd19 Added an IE specific rule in layout CSS to prevent command icons hidden behind HTMLArea generated tables
When inserting table in HTMLArea, if the table is set to align to left or right, IE will make the table float so the command button will be hidden behind it.

So a IE specific rule is added in layout CSS to set command buttons clear on both side. This will apply to all themes based on the standard layout. And other browsers are not affected/needed.
2005-11-15 02:58:30 +00:00
skodak bab2c5b8ce added register_globals off as recommended setting 2005-11-14 22:57:03 +00:00
skodak 51028ee868 add GLOBALS overwrite protection and improved magic_quotes_gpc hack SC#191, SC#184, SC#92 2005-11-14 22:43:48 +00:00
defacer 83cd002a8e Eloy's unchecked_vars admin page. 2005-11-14 16:21:41 +00:00
defacer 8de0b6879e Patching the patch, should be good now! 2005-11-14 16:15:40 +00:00
defacer def35d35d7 Eloy's detect_unchecked_vars patch, slightly modified. See SC#184. 2005-11-14 16:06:40 +00:00
mjollnir_ a7db9eb28e Merged from HEAD: fixing bug 4244: rss client block long titles and broken editing link. Partly backporting daryls fix, part my own fix 2005-11-14 02:35:56 +00:00
mjollnir_ ed2de86926 (delayed) merge from HEAD: fixing bug#4199 2005-11-14 02:30:49 +00:00
skodak 6c7bfbc7af temporary fix for XSS SC#189 2005-11-14 00:11:15 +00:00
mjollnir_ 122b18f02f Getting directory sizes with du - use escapeshellarg on the file/directory as unzipping files on the server can result in filenames that need escaping 2005-11-13 21:19:05 +00:00
urs_hunkler 953727c4c8 changed to unix file format. 2005-11-13 17:23:06 +00:00
urs_hunkler f54b9b94de changed $CFG-theme to current_theme() to make the theme working as course or session theme, see Bug #4315 2005-11-13 17:05:58 +00:00
defacer 2ac8f379c3 Merging all my latest changes and fixes from HEAD related to SC#187. 2005-11-13 04:53:47 +00:00
defacer a945eab2c2 Merging from HEAD:
Now get_sql_sort can be called static-function-imitation style as well.
Necessary to solve SC#187 gracefully.
2005-11-13 04:45:23 +00:00
defacer 14c3063dcc Merging my latest commits from HEAD, which include:
Fixing XHTML stuff
Skodak's patch from SC#187 without the HACK ALERT part

The "Next" buttons in grading windows don't get you where you 'd
expect right now, but please see SC#187 before doing anything about it.
2005-11-13 03:50:28 +00:00
martinlanghoff aa910f60b0 Display warning when magic_quotes_gpc=off _and_ register_globals=on -- tidyup wordwrap and center it proper. 2005-11-12 05:30:23 +00:00
martinlanghoff 2193242b48 Display warning when magic_quotes_gpc=off _and_ register_globals=on 2005-11-12 05:25:39 +00:00
defacer c10ac049cc Better retrieval of table sortorder when not done directly through
the table class, see SC#187.
2005-11-12 03:01:05 +00:00
gbateson 9ee129e4dd adjust relative URLs in <SCRIPT> tags; use ClueCaption as text on clue buttons (hitherto it was always set to "?") 2005-11-11 06:46:47 +00:00
skodak 0e3a277b02 fixed simple header bug #3406, patch submitted by samulik 2005-11-11 01:24:38 +00:00
skodak 6c10695f24 fixed loglive paging related bug #4116, patch submitted by samulik 2005-11-10 22:21:40 +00:00
skodak 26a6d6db3e fixed paging related bug #2715, based on patch submitted by samulik 2005-11-10 22:03:51 +00:00
skodak 8ab4f3001f fixed login block at http://site/index.php when secure forms on - bug #4305 2005-11-10 21:40:10 +00:00
patrickslee b5ec2ec12f Fixed a misspelling in help index 2005-11-10 20:46:05 +00:00
patrickslee afb39ad0c4 Added contextual help for meta course 2005-11-10 20:40:56 +00:00
skodak 53ec9ce362 typo bug #4308 2005-11-10 10:17:33 +00:00
moodler 932e5b4a69 Bump for imminent 1.5.3 2005-11-10 08:18:16 +00:00
moodler 722d5c0378 Upgraded to ADOdb 4.66. All the tests on my local server went fine,
so I hope nothing unexpected surfaces before 1.5.3.  Please test!
2005-11-10 08:04:35 +00:00
patrickslee 4caea37161 Converted forum help index file to linux line breaks 2005-11-10 03:26:56 +00:00
skodak 749de1c140 cleaning as assignment types SC#182 continued 2005-11-10 00:20:57 +00:00
skodak 259502e542 cleaning as assignment types SC#182 2005-11-10 00:14:01 +00:00
skodak ab68c36639 fixed incorrect assignment grades in gradebook when custom scales bug #4279 2005-11-09 22:38:26 +00:00
skodak 3e403b7950 fixed grades display in assignment/index.php when using different scales 2005-11-09 22:24:11 +00:00
skodak 977f038738 fixed grading when secure forms on bug #4300 2005-11-09 21:35:46 +00:00
thepurpleblob 18320d9331 Uneccessary call to build category list that was grinding systems to a
halt with large numbers of categories.
2005-11-09 16:11:54 +00:00
stronk7 41e5c5abc5 Split line into two separated commands to allow people with
chmod disabled to run backup/restore code. Credits go to
Grigory Rubtsov. Bug 4299.
(http://moodle.org/bugs/bug.php?op=show&bugid=4299)
2005-11-08 19:31:19 +00:00
moodler 9a75e63326 Undoing accidental change 2005-11-08 05:13:07 +00:00
moodler 8993348790 Resource summary is no longer preceded with newline. Suggested by Grigory Rubtsov
(grb at sentence dot ru) - Bug 4275
2005-11-08 03:07:28 +00:00
moodler 2917dfb9dc Added check to avoid notices when trying to get grades from an assignment
that didn't have any grades yet.    bug 4287

Also, using datalib function to create LIMIT statement when displaying
submissions
2005-11-08 01:44:49 +00:00
moodler a68d660a45 fix for bug 4278 2005-11-07 09:18:34 +00:00
moodler ae93996398 fix for bug 4284 2005-11-07 05:45:30 +00:00
martinlanghoff 186288dea5 user/edit: Better error handling when loading auth libs.
Check with empty() to avoid casting the string to int, and provide
useful info in the debug log.
2005-11-07 00:44:21 +00:00
martinlanghoff e7cfc5325f auth/ldap: Better warnings and handling of updaging multi-source LDAP fields
+ Raise a warning if the auth_ldap_get_entries for one user record
   returns more than one record (!?)
 + Resolved some subtle bugs when updating a remote LDAP repo from user
   updates. The logic is now simpler too.
 + Simplified the code that compares old/new values
2005-11-07 00:38:23 +00:00
stronk7 f5d2ef9543 Now both empty search strings and 1 letter search strings works fine in
the glossary. Terms are hilighted properly (but 1 letter terms, because
it's a hilight limitation). Bug 4274.
(http://moodle.org/bugs/bug.php?op=show&bugid=4274)
2005-11-06 20:00:22 +00:00
skodak 8bb94c53eb fixed bug 3532 - canceling of activity movement thanks to jcodina 2005-11-05 22:05:23 +00:00
skodak c2d8cd210f messaging - fixed page encoding in headers 2005-11-05 10:45:58 +00:00
skodak b60d39b96e fixed bug #4030 - filemtime for time modified 2005-11-04 11:29:14 +00:00
skodak d9ac8ca2e0 fixed choose disappearing after file delete 2005-11-04 10:53:41 +00:00
thepurpleblob b87c2adc76 Brought in line with HEAD version to get rid of data_submitted() function.
A bit of HTML cleaning up too. Fixes incompatibility with secureforms.
2005-11-04 10:04:04 +00:00
skodak 4483596d79 fixed encoding of page title of framed resources 2005-11-04 09:55:46 +00:00
moodler 7d255d1602 More notices fixed 2005-11-04 06:49:20 +00:00
moodler 2eb607bedb Fixed a number of bugs:
- zero grade vs no grade now works, no grade is stored as -1 in database
  - student modification time was being updated by teacher in quickgrade
  - sundry notices
2005-11-04 06:40:12 +00:00
moodler 15422ee0c2 fixes bug #4268 2005-11-04 06:22:47 +00:00
skodak b17e29b38e fixed input validation in admin and formating+cleaning in diff and editing SC#160 2005-11-03 23:38:51 +00:00
moodler 5ee8a752c4 Widened the window a bit more, bug #4146 2005-11-03 09:38:36 +00:00
moodler 38cdb67293 Fixing up the assignment grading interface to make it more usable.
- grade buttons are now links
  - popup window has teacher comments at the top
  - popup window can now cycle through all users without leaving the window
  - new quickgrading feature to grade inline in one go
  - can choose page size
2005-11-03 06:19:29 +00:00
moodler 912127a158 Standard menus can now be part of tabindex sequences for keyboard accessibility 2005-11-03 05:01:31 +00:00
michaelpenne 42521dbff4 Added some content to the help file. 2005-11-02 20:38:54 +00:00
patrickslee f7d818d5c5 Fixed a wrong call to add_teacher in LDAP plugin 2005-11-02 20:34:00 +00:00
skodak 11889a8466 Fixed course searching with quotes - SC#180 - minor related fix 2005-11-02 15:40:59 +00:00
skodak e0dbbecedb Fixed course searching with quotes - SC#180 2005-11-02 15:25:38 +00:00
moodler bc7e72c9b3 Adding group mode and visibility buttons to assignment!!! 2005-11-02 03:59:20 +00:00
mjollnir_ f253e2575f Fixing warning in course import (part of bug 4199) 2005-11-02 02:25:45 +00:00
stronk7 71deda82fe Changed one call to gethostbyaddr() to use numeric
ip instead. Such information is only stored in DB
(page->author) and not critical at all. Suggested
by Derry in http://moodle.org/mod/forum/discuss.php?d=32171
because it was causing important delays when clients
weren't DNS-registered.
2005-11-01 17:45:26 +00:00
skodak f6ce611ce4 fixed access rights of creators during restore SC#177 2005-11-01 17:23:21 +00:00
skodak 682a3999d7 fixed course ID and quoting of the search string SC#179; typo :-( 2005-11-01 15:56:32 +00:00
skodak 393abfad48 fixed course ID and quoting of the search string SC#179 2005-11-01 15:53:17 +00:00
moodler 78a2e3d249 Show the right path with REQUEST_URI 2005-11-01 06:52:51 +00:00
skodak 398f365cb8 fixed warnings and param cleaning, prevention of mailing of empty reports SC#147 2005-10-31 22:48:04 +00:00
martinlanghoff 985cd79efa Updated the definition of 'member' for AD - thanks to I?aki for the tip! 2005-10-31 22:43:44 +00:00
skodak 6d306766c9 fixed slashing of javascript strings SC#174 2005-10-31 22:12:06 +00:00
skodak 164099fd14 merged cleaning of array params from HEAD 2005-10-31 22:10:09 +00:00
patrickslee df7f761f53 Block normal users to gain access to meta courses 2005-10-31 20:31:57 +00:00
skodak 25340ceab1 fixed warnings/errors in latest PHP versions 2005-10-30 22:14:03 +00:00
patrickslee 46dc437f66 Reverting commits just made. They are not intended to be in MOODLE_15_STABLE 2005-10-30 22:05:30 +00:00
patrickslee 80fc4f88be DB upgrade script to clean up enrol field for user_students and user_teachers 2005-10-30 21:36:19 +00:00
skodak f0a73113d5 fixed sql quoting SC#145 2005-10-29 21:52:01 +00:00
skodak 3fca3da072 fixed cleaning before editing SC#163 2005-10-29 21:38:39 +00:00
skodak 239f82915a fixed caching + cleanup in format_text() SC#172 2005-10-29 21:30:29 +00:00
skodak c637903591 fixed script parameters + some warnings SC#150 2005-10-29 16:40:54 +00:00
skodak e85a6623a1 fix for preferred_width_xx initialization SC#169 2005-10-29 16:33:19 +00:00
skodak f25f387188 cleaning of parameter, initialized variable SC#168 2005-10-29 16:15:22 +00:00
ikawhero c56218c8ce Question numbers in the header were in the incorrect order when downloading
results as an Excel spreadsheet.
2005-10-28 03:30:11 +00:00
ikawhero 4d64df82cb Missing language file copied over from HEAD 2005-10-28 03:10:43 +00:00
patrickslee 5ec4333086 Fixed dis-ordered displaying for quiz overview report when no soring is specified 2005-10-28 02:12:45 +00:00
patrickslee e89b542b1b Fixed a mis-usage (typo?) of get_admin() in paypal module 2005-10-27 02:20:11 +00:00
patrickslee 88fb90e9b4 Added default argument value for grade_category_select() to prevent error when calling without arguments 2005-10-26 22:28:26 +00:00
mjollnir_ 5ed1a6d692 Now the login block uses the same logic for forgot password as the login page does 2005-10-26 21:18:41 +00:00
defacer 8b68aaf1f6 Merging from HEAD:
Fixing all incoming parameters when editing course groups as per SC#171.
2005-10-26 13:49:06 +00:00
defacer b7535a6e23 Merging from HEAD:
A slight improvement for my last edit, which could trigger a small bug.

I should go out and drink more often, it helps debugging! ;-)
2005-10-25 01:56:37 +00:00
defacer bf617f07a6 Merging from HEAD:
Fix for bug 3794:

Times in chat messages are now displayed correctly to all users, with each
user's timezone and DST status taken into account.
2005-10-24 17:31:40 +00:00
defacer 34225def25 Merging from HEAD:
Fix for bug 4203:

When adding recurring events, if the event title contained an apostrophe
then only the first event of the series would get created. Tricky bad
interaction with add_to_log, the reporter for this should get a prize. ;-)
2005-10-24 17:15:30 +00:00
julmis faf8922009 Fixing Bug #4201, cursor movement on IE. 2005-10-24 14:11:30 +00:00
moodler 0232fdd58c Use notify instead of error() 2005-10-23 16:02:23 +00:00
stronk7 5e41163054 Methods aren't static due to the Typo3 structure. 2005-10-22 16:15:21 +00:00
urs_hunkler 070515ce42 I reworked the timer JavaScript and the CSS properties. The floating of
the timer now works in MSIE, Firefox and Opera the same way. The first correction was not sufficient.
2005-10-22 15:29:05 +00:00
defacer f77efbe3be Fix for bug 4127:
In the course participants page, selecting an initials filter in one course
and then moving to another (the filter would propagate) could result in few
or no results being displayed. The teacher would then have no way of
resetting the filter and viewing all (or possibly any) participants.

Fixed by making each course participant page independent. They no longer
share sort orders, collapsed column state, or initials filters.
2005-10-21 01:13:56 +00:00
defacer 74d60e20ba Fix for bug 4143:
If a user was a teacher, they didn't see any events from courses
where they were students.

I 'm back at looooooong last! :)
2005-10-21 00:26:06 +00:00
thepurpleblob 7770beee55 & should have been &amp; (of course) 2005-10-20 07:58:09 +00:00
mjollnir_ 96bf2d385f Fixing bug 4199: import course data should only allow you to import from a course that you're already a teacher in, unless you're at least a creator 2005-10-20 00:19:24 +00:00
thepurpleblob 9a94d087a8 Strange missing parameter - bug #4121 2005-10-19 05:41:44 +00:00
martinlanghoff 1ff64b7f60 If wwwroot is unset, log something before dying 2005-10-18 03:28:20 +00:00
stronk7 e72c81ab82 Initial commit of Typo3 charset libraries and Moodle's textlib.class code. 2005-10-17 15:37:42 +00:00
stronk7 abcd6d503e Fixed one important bug in restore of gradebook that was
preventing it to finish in a lot of situations.
(http://moodle.org/mod/forum/discuss.php?d=31461)
2005-10-16 11:30:33 +00:00
stronk7 f784666c93 Solve some wrong CVS Id tags 2005-10-15 10:37:01 +00:00
stronk7 44de4fd8a8 Updated to 2.4 Final. From notes: This resolve a lots of bad formated archive errors. 2005-10-15 09:57:18 +00:00
michaelpenne cd60a00cf9 Removed a notice warning when lessons are created in a course with no category (eg: home page) 2005-10-14 19:26:21 +00:00
patrickslee 2382dae103 On a rare case courses will have duplicate sections those have the same id. Added some code to re-order sections if this is found when moving sections 2005-10-14 03:10:21 +00:00
skodak e5df73c53e quick fix for the problems with p() and s() - SC#167 2005-10-13 20:09:54 +00:00
paca70 3cd3c343ea Updates 2005-10-13 10:27:05 +00:00
paca70 8dfbb77f3c Update 2005-10-13 08:36:33 +00:00
stronk7 282f2e5b22 SC#162 2005-10-12 19:24:30 +00:00
mjollnir_ 04c9c465f9 Execute some updates silently (dropping non existent columns in workshop) bug 2964 2005-10-12 02:15:23 +00:00
patrickslee 763f3766a8 Fixed various bugs in add_teacher() those caused the function not populating record correctly 2005-10-10 21:39:43 +00:00
skodak 4bcb6f1043 fixed parameter use SC#157 2005-10-09 19:49:47 +00:00
skodak 82329ca01e fixed indent - SC#158 2005-10-09 19:38:57 +00:00
skodak ae4f432615 missing semicolon 2005-10-09 18:28:30 +00:00
skodak 8e5cde5461 better input validation - SC#165 2005-10-09 07:09:26 +00:00
michaelpenne cb5c5a1bfe Reverted grading back to 1.4.X for when custom scoring is turned OFF 2005-10-07 20:34:27 +00:00
stronk7 70156ee3d4 Typo. Bug 3917. Credits for liling! B-)
(http://moodle.org/bugs/bug.php?op=show&bugid=3917)
2005-10-06 17:37:58 +00:00
stronk7 0715864e36 Now hidden courses are showed dimmed in the restore process. Bug 4152.
(http://moodle.org/bugs/bug.php?op=show&bugid=4152)
2005-10-06 17:20:58 +00:00
martinlanghoff 2cf2079188 Fix for bug 3141 - Can't update external data with LDAP authentication 2005-10-06 02:23:40 +00:00
martinlanghoff 67149b4d2c Fix for bug 3992 - LDAP password including a quote does not work - credits go to Kita 2005-10-06 02:18:16 +00:00
stronk7 01ce0aa3a8 Now entries containing apostrophes can be exported to main glossay
and deleted without problems. Bug 4136.
(http://moodle.org/bugs/bug.php?op=show&bugid=4136)
2005-10-05 18:23:25 +00:00
mudrd8mz 50c9c95ea6 Merged from HEAD 2005-10-05 11:23:51 +00:00
mudrd8mz 60f08f5ccc file quiz_analysis.php was added on branch MOODLE_15_STABLE on 2005-10-05 11:23:51 +0000 2005-10-05 10:58:08 +00:00
mudrd8mz a55a4c8c31 Merged from HEAD 2005-10-05 07:50:10 +00:00
mjollnir_ dde5cbbdfd Fixing the mass migrate postgres upgrade to be silent in quiz. Added a fix to a previous rename table that breaks pg_dump & pg_restore (incorrectly named sequence) 2005-10-05 01:35:14 +00:00
mjollnir_ 38f78e158c Fixing sortorder typo 2005-10-04 21:26:01 +00:00
dhawes 24f9eb47b1 backported to 1.5 stable from HEAD - bugfix for bug 3980 2005-10-03 14:15:57 +00:00
patrickslee dd7a3aaedf Improved number rounding for grades fix 2005-10-02 21:57:53 +00:00
gustav_delius b483d8c81e fixed a help button 2005-10-01 13:36:06 +00:00
mindforge 1eff1e081c Changed the review 'scores' option to also take effect on the standard feedback displayed at the bottom of a question. 2005-10-01 11:07:15 +00:00
julmis 1d9b22c497 Adding charset to header 2005-10-01 00:46:28 +00:00
julmis 38453bb238 Adding gz_handler for a bit faster loading time. 2005-10-01 00:05:12 +00:00
mjollnir_ 70f6f8b708 Much better namespace collision fix to apacheloguser thing 2005-09-29 23:39:52 +00:00
mjollnir_ 98f052303f Fixing up the log apache user patch from the otherday - problem with variable scope 2005-09-29 21:53:48 +00:00
stronk7 66fd3fb7ff Modified clone() method to work better under PHP 4. Credit goes to Julian. 2005-09-29 16:36:02 +00:00
mindforge 7b838d2a97 Fixed addslashes and stripslashes of responses. Now slashes are stripped in quiz_extract_responses, leading to an improvement in grading (before " a man's world" would have been graded as "a man\'s world").
In order for the responses to be written to the database correctly the function quiz_save_question_sessions adds slashes again before writing the data to the database (and before passing it to the questiontype method save_session_and_responses) and strips them again after all the work is done, thus leaving the responses fields unmodified for the subsequent code.

An additional benefit of this change is that answer fields that are automatically filled after a submit don't get more and more slashes added (e.g. ' used to become \' after the first and \\\' after the second commit).
2005-09-29 11:06:47 +00:00
patrickslee 1f508431dd Removed a block of redundant code in participants list 2005-09-29 01:40:12 +00:00
mjollnir_ 85508791a6 Adding default for new config option pathtodu. Related to bug 4107 2005-09-29 00:34:25 +00:00
mindforge 494b416d7b Fixed two minor bugs in the random questiontype. 2005-09-28 22:39:26 +00:00
mindforge e56820d225 Added code to delete records from quiz_newest_states when a quiz instance is deleted. 2005-09-28 22:35:54 +00:00
michaelpenne 1d44f3a5d7 Fixed errors in logic and lack of isteacher() check as pointed out by Petr Skoda 2005-09-27 17:27:05 +00:00
adamtpaw 0b32d159da update Moodle 1.5 2005-09-27 13:27:58 +00:00
adamtpaw 0674d7ba48 Update for Moodle 1.5 2005-09-27 13:16:54 +00:00
adamtpaw 9ee425fa14 update for Moodle 1.5 2005-09-27 13:10:51 +00:00
mjollnir_ 73ec9fb26e Logging apache user now takes into account loginas 2005-09-27 05:24:43 +00:00
mindforge db504824f8 A better fix for bug #4110 and the previous one undone. 2005-09-26 12:31:23 +00:00
mindforge 8bcbac0126 Possible fix for bug #4110. 2005-09-26 11:22:08 +00:00
mindforge b4d2ebf952 Improved dispaly of correct answers in the calculated questiontype. 2005-09-26 09:24:45 +00:00
mindforge f9bec1f2e7 Another improvement on regrading. The code thought that grading for a question changed if the grade was like 1/3. The precision in the database is different than the newly calculated grade, so now we round both values to 5 decimal places, which should fix this problem. 2005-09-26 09:18:22 +00:00
mindforge 72d09c0a5a Improved regrading (raw_grades were compared in order to determine whether the grading of a question changed, now grade is used, which also catches if penalties are turned on/off in the quiz settings) 2005-09-26 09:14:33 +00:00
mindforge 254fdebbc9 Silenced notices produced by flush() and ob_flush() in regrading code. 2005-09-26 09:10:52 +00:00
mindforge b5ee139f78 Little fix in the grading logic (this should only have affected numerical questions with mre than one answer as can be used in cloze). 2005-09-25 21:03:12 +00:00
skodak 184e03b294 new session timeout handling 2005-09-23 18:28:15 +00:00
moodler 76c4cabbfe Removed error() from a place that was actually being called from workshop_cron
and thus stopping cron sometimes.

Also some code layout cleanup
2005-09-23 09:23:00 +00:00
mjollnir_ 681d95c495 Backported Martin's sortorder fix from HEAD. Apparently this is a better fix than the one from a few days ago 2005-09-23 04:33:47 +00:00
martinlanghoff a6349a6d1f courses/sortorder: syntax fix to cope with bad sortorder values 2005-09-22 03:12:14 +00:00
stronk7 4a9f162f17 <span> tags are now allowed inside post->subject. Bug 4099.
(http://moodle.org/bugs/bug.php?op=show&bugid=4099)
2005-09-21 21:27:11 +00:00
urs_hunkler 03f6e19c61 Added CSS properties for Firefox for fixed placement of the timer. It is a preliminarily fix. Please follow Bug #4053. 2005-09-21 14:15:15 +00:00
gbateson 577bd6a9f2 renumbered steps 1,2,3,3,4 => 1,2,3,4,5
signalled steps 3 and 4 as not required for Moodle 1.5 and later
2005-09-21 00:31:52 +00:00
stronk7 cbb0dd34d9 Now the ALL link in the paging bar is under the
glossary->showall setting control. Bug 4072.
(http://moodle.org/bugs/bug.php?op=show&bugid=4072)
2005-09-20 16:59:29 +00:00
gbateson 7fc7e9645f removed XSS hole caused by "urldecode" 2005-09-20 11:57:53 +00:00
julmis d27162c0cd XSS fix
- added optional_param for id
2005-09-20 08:55:58 +00:00
bobopinna b455078417 Fixed a problem 2005-09-20 06:43:26 +00:00
skodak d994263946 fixed IE and https problems 2005-09-19 17:09:06 +00:00
patrickslee 290c1e61cc Added some number rounding for grades to prevent PostgreSQL errors 2005-09-19 00:09:25 +00:00
patrickslee f89c3674bb Corrected some table/field names 2005-09-19 00:07:57 +00:00
dlnsk e8ca86ffb7 *** empty log message *** 2005-09-17 17:41:10 +00:00
gustav_delius 8b0d0c1756 Fix for bug 3995 2005-09-17 13:03:24 +00:00
gustav_delius 9111a763bd Fix for bug 4019 and some other XHTML issues 2005-09-17 12:28:38 +00:00
gustav_delius d00c2e2310 Fixed bug 4052 2005-09-17 12:00:20 +00:00
martinlanghoff 085366cfa0 auth/ldap fix typo - thanks to Skodak for spotting it! 2005-09-16 23:29:26 +00:00
mindforge e2823d208a As discussed in the thread http://moodle.org/mod/forum/discuss.php?d=30628 (and others) the limitation to 10 answers in a question is problematic for some users.
From this commit onwards match, multichoice and shortanswer questiontypes will
(a) display all defined answers (e.g. from an import with more than 10 answers) and
(b) to always display at least one empty answer field.
2005-09-16 10:06:58 +00:00
thepurpleblob 1a87ac6a6c Fixed problem with courseid not being passed. 2005-09-16 10:02:42 +00:00
thepurpleblob d40177d7a2 Taken check for too many answers out. Julian has fixed the edit screens. 2005-09-16 09:46:02 +00:00
thepurpleblob a9a26d5a45 Added string for 'importmaxerror' 2005-09-16 09:34:58 +00:00
thepurpleblob 89aa5d49ee Maximum number of answers now governed by constant in locallib.php not
by hardcoded value.
2005-09-16 09:30:54 +00:00
mindforge a4df55c815 Small fix to the previous commit (< becomes <=). 2005-09-16 09:24:50 +00:00
mindforge a67c2e0a33 As discussed in the thread http://moodle.org/mod/forum/discuss.php?d=30628 (and others) the limitation to 10 answers in a question is problematic for some users. I modified the match questiontype to (a) display all defined answers (e.g. from an import with more than 10 answers) and (b) to always display one additional empty answer field. 2005-09-16 09:12:25 +00:00
gustav_delius 435241d385 Fixed bug 4077 2005-09-16 07:26:48 +00:00
moodler 7de8f45ae9 Merged from head 2005-09-16 02:25:59 +00:00
gbateson 9086a17e15 fixed "hotpot_print_recent_activity to use "hp=" instead of "id=" in links to attempted quizzes 2005-09-16 00:43:44 +00:00
gbateson 60bdcfa990 new version number: 2.0.9 2005-09-16 00:30:56 +00:00
gbateson efd7fc31b9 fixed "hotpot_print_recent_mod_activity" to use "hp=" instead of "id=" in link to recent attempted quiz 2005-09-16 00:22:37 +00:00
mindforge 14be3fe259 Added dropdown to allow sorting the question list on the quiz editing page in different ways. This also allows defining a custom sortorder in the URL. 2005-09-14 11:09:32 +00:00
ikawhero cdf5d7b047 Incorrect value being passed to header function. 2005-09-14 07:20:47 +00:00
mjollnir_ 5d8323d57c Login block should be more discerning about offering signup link. Fixed to be more in line with the login page 2005-09-13 22:21:20 +00:00
thepurpleblob 1122563591 Check if html editor is enabled before checking htmleditor setting from screen.
Removes notice if editor not in use (therefore field  was not displayed)
2005-09-13 13:49:27 +00:00
julmis d0491a1fef Faster version check for Gecko and work-a-round for "No IDN" problem. 2005-09-13 11:49:40 +00:00
martignoni e687c5421c Merge from HEAD 2005-09-13 09:41:57 +00:00
martignoni 6ae7fca715 Merge form HEAD 2005-09-13 09:40:30 +00:00
skodak 919a058edb formal RFC151 compliance 2005-09-12 18:43:49 +00:00
stronk7 65b2ea05b1 Added support for new styles in chat window. 2005-09-11 10:01:22 +00:00
urs_hunkler 4a75fb028c Eloy added hooks to the chat mes frame. I adde the basic CSS properties and values for colors and positioning to the "Modules: Chat" sections of the two CSS files. Update 1.5 too. 2005-09-11 06:15:18 +00:00
stronk7 bcfdf5f0e6 Extended theme support to the chat window. Bug 3376.
(http://moodle.org/bugs/bug.php?op=show&bugid=3376)
2005-09-10 22:51:38 +00:00
adamtpaw 84fdfffb13 Polish version for Moodle 1.5 STABLE 2005-09-10 20:47:43 +00:00
moodler 7b9f8f652b JUst a bump because it's been a while. 2005-09-10 14:38:52 +00:00
stronk7 43ea696c77 Now both p() and s() respect html entities. 2005-09-10 10:59:19 +00:00
martignoni 1ba6745de0 file removepages.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
martignoni 2d1880e449 file wikitype.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
martignoni 1817713a44 file strippages.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
martignoni 3679ac38b7 file initialcontent.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
martignoni 29a71fa1d0 file wikilinkoptions.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
martignoni ec22a2b3bb file mods.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
martignoni c6188b29ef file setpageflags.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
martignoni 0be47a3364 file revertpages.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
martignoni 7d0b581589 file revertauthorfieldpattern.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
martignoni 6a5ef2899e file wikiname.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
martignoni 710f3399df file wikiusage.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
martignoni 0cf2d8903d file studentadminoptions.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-09 20:41:13 +00:00
moodler 93bcfb18a8 iAdded some CSS for blocks config editing bug 4045 2005-09-09 16:51:29 +00:00
mindforge c99e2d2c66 Changed use of htmlspecialchars() to s(). 2005-09-09 16:47:33 +00:00
moodler 6549d34a38 Addition CSS id, merged from head 2005-09-09 16:24:41 +00:00
moodler 4498b48aee Don't diaplay zero dates at all in user reports 2005-09-09 16:15:20 +00:00
moodler 769ffdfdca Don't calculate date when it's zero 2005-09-09 16:01:04 +00:00
skodak d16b5bb763 new handling of session timeouts - part 1 2005-09-09 15:12:42 +00:00
paca70 fddbea82ac To get rid of some cosmetic (hopefully) error messages. 2005-09-09 11:29:11 +00:00
skodak 17e941b48a reverting previous patch - see http://moodle.org/mod/forum/discuss.php?d=26970 2005-09-09 11:08:41 +00:00
paca70 7aaabae78e Corrected some typos and mistakes 2005-09-09 10:42:08 +00:00
gbateson e0a53b4d0a removed line which was crippling quizzes with HTML in questions or answers
added check to detect when no grades were returned in the database
2005-09-09 01:03:10 +00:00
martinlanghoff 59b5352b51 auth/ldap: fixed typo in auth_user_activate() - bug #3594 - thanks to ze @ nbox.org 2005-09-09 00:25:50 +00:00
mjollnir_ 1068ba8d27 Much more sophisticated IP address cleansing 2005-09-08 23:04:10 +00:00
mjollnir_ d9ab06ca32 Merged from HEAD: Fix to bug 4026 and 3913. Credit: jjg7 at humboldt dot edu 2005-09-08 21:31:41 +00:00
mindforge 7ece83dec6 Fixed an unreported bug. 2005-09-08 18:00:53 +00:00
martinlanghoff 68dfdae36e Fix for bug 4031 -- fix typo 2005-09-07 23:23:08 +00:00
martinlanghoff fce45181d7 Fix for bug 4031 -- stupid mistake of using get_record_select() when I mean get_record() - see the bug entry for more details 2005-09-07 22:48:48 +00:00
mjollnir_ 4e9cc4842f Performance fix: in postgres, sometimes indexes are not used because of type casting. block_instance.pageid is a big int field so the index wasn't being used. Wrapping in '' prevents the typecast. See http://www.postgresql.org/docs/7.4/interactive/datatype.html#DATATYPE-INT for more information 2005-09-07 22:00:16 +00:00
adamtpaw a072684a96 Moodle 1.5.2 -nowe pliki pomocy 2005-09-07 19:20:24 +00:00
adamtpaw 7505cd1cd2 Moodle 1.5.2 2005-09-07 19:14:29 +00:00
stronk7 b12e186c04 Some RSS readers seems to have problems with that wrong p tag. 2005-09-07 17:06:25 +00:00
mindforge 9fe710159f Fix for the issue described in http://moodle.org/mod/forum/discuss.php?d=30192 2005-09-07 13:59:28 +00:00
martignoni 74971fdad9 file htmlmode.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-07 09:51:35 +00:00
martignoni 62ade7827c file ewikiacceptbinary.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-07 09:51:35 +00:00
martignoni 9d7dde3c97 file checklinks.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-07 09:51:35 +00:00
martignoni 73292a8393 file howtowiki.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-07 09:51:35 +00:00
martignoni 637c9cd330 file index.html was added on branch MOODLE_15_STABLE on 2005-09-13 09:41:57 +0000 2005-09-07 09:51:35 +00:00
adamtpaw 2b4090c4fe POlska wersja dla Moodle 1.5.2 - niekompletna, ale prace trwaja. 2005-09-07 06:56:27 +00:00
martinlanghoff dc2a68b4d7 enrol/db - bug 3912 - Re-add the enrolment to $user->student[] - should fix things for good. 2005-09-07 06:36:32 +00:00
martinlanghoff 0aff0bf622 Fix for bug 4011 -- a MySQL specific workaround did not work with database names with hyphens, and broke the whole plugin for other databases. This patch fixes both issues. 2005-09-07 06:03:53 +00:00
mjollnir_ 72ed1089dd Further tidyup to the cleanremoteaddr function I added - some thing were getting through 2005-09-07 04:45:52 +00:00
mjollnir_ e1fede4e63 Better fix to the messaging problem. Will make mysql <4 users happy too. Credit for php workaround:Eloy 2005-09-07 04:43:05 +00:00
patrickslee fe18e430f7 Finally the *correct* fix for the looping problem. Thanks to Penny 2005-09-07 04:22:03 +00:00
martinlanghoff 6cd6568f84 make_categories_list(): initialize variables correctly to cover up for broken call convention. Passing unset variables by ref to be populated is a BAD idea. Do The Right Thing and Return your function output or there'll be no dessert for you. 2005-09-06 22:24:31 +00:00
patrickslee 6fcc3fab2c The report_session_error() fix does not work all the times. Proper fix here. 2005-09-06 22:15:42 +00:00
mjollnir_ fa1ce50ec8 Backing out a previous patch of mine - bad merge with our local copy 2005-09-06 21:23:09 +00:00
patrickslee 67ba380ec9 Fixed a rare problem that report_session_error() causes a redirection loop 2005-09-05 23:46:08 +00:00
stronk7 e42b787931 Avoid empty or unlinkable activity names. 2005-09-05 22:33:07 +00:00
moodler f21b4c1c2b Silent header (no errors) 2005-09-05 16:33:30 +00:00
moodler 235089d15f Removed blank line 2005-09-05 16:29:38 +00:00
moodler fa27bb7c22 Including lib.php to make default for forumtracking work 2005-09-05 05:31:49 +00:00
mjollnir_ 926a759c71 Performance fix for get_directory_size: new config option for path to du - if we have it, use that instead. MUCH faster on directories with a lot of files 2005-09-05 05:30:53 +00:00
mjollnir_ c11d468cc1 Fixing up a bug in the log selector to do with optionally showing all users in the dropdown when over COURSE_MAX_USERS_PER_DROPDOWN 2005-09-04 21:07:23 +00:00
moodler 9e525f53b3 Some new files 2005-09-03 07:51:57 +00:00
moodler 2099bab6a0 Merged latest copies from HEAD 2005-09-03 07:51:06 +00:00
julmis 57a1c1af6a Fixing array_change_key_case errors.
- Function present in version PHP 4 >= 4.2.0, PHP 5
2005-09-02 07:50:28 +00:00
martinlanghoff a705afc7da auth/ldap - sync_users script bugfix x2: it was deleting fields that were not supposed to be synched to ldap and it was failing to set auth_forcepasswordchange 2005-09-02 06:55:28 +00:00
martinlanghoff f159f93bc7 enrol/ldap - fix course auto-creation to work with the new blocks infrastructure. doh! (thanks penny!) 2005-09-02 06:50:11 +00:00
martinlanghoff 8ade954b60 auth - bugfixes: update_userinfo() did not truncate values, and did not have proper errorhandling; user creatiwas passing an id to set_user_preference when we wanted an object 2005-09-02 06:42:33 +00:00
martinlanghoff e1a3a68059 forums/trackreads: Small optimizations to forum_tp_can_track_forums() 2005-09-02 06:36:39 +00:00
martinlanghoff 63b8c597f6 forums/trackreads: Postgres-optimized query - from many minutes to a few milliseconds 2005-09-02 06:30:24 +00:00
mjollnir_ c6a37a3185 Add an index where we really need it - block_instance.pagetype 2005-09-02 04:58:57 +00:00
stronk7 73d68a033d Strip control chars from being sent to the XML file.
Only tab, newline and return are allowed in XML 1.0.
This feature is controlled by $CFG->backup_strip_controlchars.

Please, test it!
2005-09-02 00:01:22 +00:00
mjollnir_ 18c26f97ef Fixing bug 3977: sort of. Check for mysql >= 4 or postgres, do a smarter query with a UNION. Otherwise, do the same old query. This is not very good for mysql 3.23 users with large datasets, but not much else I can do. 2005-08-31 23:57:37 +00:00
mjollnir_ e2629fc12d Preventing another warning. In some cases in the calendar blocks, resource filtering gets called with no courseid 2005-08-31 06:13:13 +00:00
martinlanghoff d5e5544448 auth/db: Better support for utf-8 user data. 2005-08-31 05:59:31 +00:00
mjollnir_ c3a70f83b1 Avoid a warning when displaying multichoice quiz questions 2005-08-31 05:24:17 +00:00
mjollnir_ f2179d4688 prevent stuff being sent to the browser before config.php being included 2005-08-31 02:29:52 +00:00
bobopinna 0ba7a5cab6 First working release 2005-08-30 11:47:21 +00:00
bobopinna 8d351c3e92 Fixed a bud with next and prev sco search 2005-08-30 11:46:38 +00:00
moodler b109aa6efa Fix for bug 3958 and google overactivity 2005-08-30 09:34:42 +00:00
mindforge f40cc4a843 Fix for bug #3986 2005-08-30 08:50:09 +00:00
defacer 0be62652d1 Merging from HEAD:
Fix for bug 3981 (also quite lively discussed at
http://moodle.org/mod/forum/discuss.php?d=29564):

When the user was not logged in and was not a guest, DST compensation was not
being done. I guess deciding to store the computationally expensive DST cache
in $USER was a major oops on my part. I 've moved everything to $SESSION and
now it works as it should.
2005-08-30 03:31:17 +00:00
michaelpenne 71c47913a0 FIXED: Removed Notice Warning. Sometimes an attempt's answerid field is not set because the answer that the student entered does not match any of the answers for the question. This error comes up for Numerical and Short answer question types. 2005-08-29 22:06:55 +00:00
michaelpenne 66fbb3b10f FIXED: Bug with reporting numerical question types. 2005-08-29 19:45:23 +00:00
paca70 5578e1bd26 New files and correction from Mikko NUrminen and others.
Thanks all
2005-08-29 15:43:47 +00:00
gustav_delius 9122a1e62d Fix for missing action icons, reported in http://moodle.org/mod/forum/discuss.php?d=28466#139179 2005-08-26 20:46:57 +00:00
thepurpleblob 26996407cb Suppress some 'missing course object' messages, and fix bug #3899 2005-08-26 11:58:34 +00:00
thepurpleblob 55fdf029ab Import now passes $course object to import/export format object. 2005-08-26 11:33:08 +00:00
gustav_delius e45b5f24d4 Fixed bug 3950 2005-08-26 08:53:13 +00:00
gustav_delius c5c3568d89 fix for bug 3953 provided by Jean-Michel 2005-08-26 07:56:54 +00:00
martinlanghoff 8e0b42fb88 enrolment fixes: We now have better handling of the enrol field when dealing with student enrolments. This fixes bugs 3912 and 3974. NOTE that enrol_student() now defaults to manual - this is to support the different pages that call enrol_student() to still work correctly when external enrolments are in use, by recording the enrolments as manual. Enrolment plugins are expected to know better and pass the correct parameter. 2005-08-26 06:07:42 +00:00
mjollnir_ 8ba12d576a Escape strings for database. SC # 145 2005-08-26 05:28:55 +00:00
mjollnir_ 9f65fc2b27 Fixing typo in call to get_record that was causing a lot of noise in the db error log 2005-08-26 04:53:24 +00:00
mjollnir_ 12c40a2f66 Backticks are not postgres friendly! :( 2005-08-26 04:41:33 +00:00
martinlanghoff 9595bf588a enrol/ldap - fixed default objectclass, and we can now bind non-anonymously 2005-08-26 04:09:41 +00:00
martinlanghoff 8a9e5ac327 Long-pending rollback_sql() 2005-08-26 03:57:30 +00:00
julmis 4d20567f61 Adding escapeshellarg to aspell path 2005-08-25 07:44:05 +00:00
julmis 399d7b3acb Adding escapeshellarg to aspell path. 2005-08-25 07:43:21 +00:00
martinlanghoff 2a069aa1f2 auth/ldap: Fixed handling of multi-source field mapping. Now fields with non-empty values have precedence over empty fields, regardless of order. Fields will be set to empty only if all ldap source fields are empty. 2005-08-25 04:56:13 +00:00
mjollnir_ 289cf90737 Fixing another postgres problem. With distinct, you can't order by a field not in the select field list 2005-08-25 00:02:49 +00:00
mjollnir_ cef4a0e828 Fixing typo in postgres-fixing patch from a couple days ago 2005-08-24 23:47:51 +00:00
patrickslee bd22fdfbdb Wrong parameter order in function definition 2005-08-24 23:05:23 +00:00
defacer dc9ec4e135 Merging from HEAD:
Changing some hardwired 1s to SITEID. Is the madness ever going to end?
Use 1 as a magic number in code, pay the price...

I think I also improved the security around there.
2005-08-23 20:47:34 +00:00
defacer 4dde75c7d7 Merging from HEAD:
Repeat events are now created correctly even if the DST change boundary
is crossed between repeats.
2005-08-23 20:08:21 +00:00
mjollnir_ 65ebc47636 Backticks are NOT ALLOWED in postgres! 2005-08-23 06:46:35 +00:00
mjollnir_ 5747bf91e5 Fixing metacourses to work in mysql 3.23 series. At same time, set enrolment type to 'metacourse' so as not to break some external enrolment (eg ldap) plugins 2005-08-23 05:33:12 +00:00
defacer 398b3a2b83 Two things:
Mergin bugfix from HEAD:
Site events were being created for $course->id = 1 even when SITEID != 1.

And also:
Allow <span> in event titles, someone may be using multilang there.
2005-08-23 02:48:11 +00:00
moodler 514c862489 Fixed some code formatting while passing through 2005-08-21 15:41:03 +00:00
moodler c8ef1ce0f6 Fix for nasty data corruption bug 3915 2005-08-21 15:40:11 +00:00
mjollnir_ 7e61008580 Clean up IP addresses from getremoteaddr. Otherwise we sometimes get weird results from proxies and inserts into mdl_log and mdl_user fail 2005-08-18 01:44:10 +00:00
martinlanghoff e2d7747f10 Blocks upgrade - reduce memory consumption by a few GB and (postgres only) halve database traffic. 2005-08-18 00:01:39 +00:00
mjollnir_ 05746e64f2 Fixing a postgres error. You can't sort by a field that isn't in the select list when you have distinct 2005-08-17 23:16:34 +00:00
martinlanghoff c53889ff42 LDAP servers being down or unavailable should not prevent login - we now fail with a notice() rather than with an error() 2005-08-17 22:35:45 +00:00
moodler 1a6649ec70 file quiz_responses.php was added on branch MOODLE_15_STABLE on 2005-09-03 07:51:57 +0000 2005-08-17 13:37:53 +00:00
moodler 69c0d07455 file block_search_forums.php was added on branch MOODLE_15_STABLE on 2005-09-03 07:51:57 +0000 2005-08-17 13:37:53 +00:00
moodler d205e11ef2 file quiz_analysis.php was added on branch MOODLE_15_STABLE on 2005-09-03 07:51:57 +0000 2005-08-17 13:37:53 +00:00
moodler 301d3a4509 file grades.php was added on branch MOODLE_15_STABLE on 2005-09-03 07:51:57 +0000 2005-08-17 13:37:53 +00:00
moodler 7f45789999 file timezones.php was added on branch MOODLE_15_STABLE on 2005-09-03 07:51:57 +0000 2005-08-17 13:37:53 +00:00
moodler 84c0444376 file enrol_authorize.php was added on branch MOODLE_15_STABLE on 2005-09-03 07:51:57 +0000 2005-08-17 13:37:53 +00:00
moodler 9547937448 file currencies.php was added on branch MOODLE_15_STABLE on 2005-09-03 07:51:57 +0000 2005-08-17 13:37:53 +00:00
thepurpleblob bbeffa6ff8 Whoops - forgot to remove (commented out at least) debugging code. 2005-08-17 10:34:54 +00:00
thepurpleblob 64fdd835fb For changing password, default change password was selected rather than
for the auth method actually used by the user.
2005-08-17 10:31:46 +00:00
thepurpleblob 6a239dbe87 Call to clear force change password flag passed $user object rather
than user id, so it would never be cleared.
2005-08-17 10:27:50 +00:00
mindforge d67775e55a Fixed bug #3884. 2005-08-16 12:43:34 +00:00
martinlanghoff 42fd23bc3a Unset the changepassword flag for the _right_ user, even if we are masquerading an account 2005-08-16 03:19:38 +00:00
martinlanghoff 29ad8bfe68 Tell insert record we don't care about inserted id 2005-08-16 00:42:42 +00:00
martinlanghoff 8b7291eff5 Fixed DOS newlines. 2005-08-15 23:21:40 +00:00
patrickslee a3c092c96d Mass cleanup of bad postgres upgrade scripts 2005-08-15 22:30:47 +00:00
martinlanghoff 0b7c884132 Enable reset password functinoality for LDAP and other external auth mechanisms as promised in the auth config page 2005-08-15 22:27:47 +00:00
mindforge cf0371143c Enabling $options->correct_responses for multianswer questions. I.e. highlighting of correct answers can now be turned off. 2005-08-15 11:48:57 +00:00
mindforge d3a126d9c0 Fix for the bug described in the discussions http://moodle.org/mod/forum/discuss.php?d=26526 and http://moodle.org/mod/forum/discuss.php?d=27274 2005-08-15 11:36:43 +00:00
danmarsden 9bb1bdbc9c Fixes for Bug #3876, Bug #3816 2005-08-14 21:56:16 +00:00
moodler 744da696ef Renamed mkdir to makedir to help some high-security blockers 2005-08-14 02:26:13 +00:00
moodler 347b01bcd9 Merged 1.6 version into 1.5 because bugs were fixed 2005-08-13 16:43:45 +00:00
moodler 9c23c88ee6 Merging from HEAD 2005-08-13 16:34:14 +00:00
martinlanghoff 812fe4c5fc Temp table now matches idnumber length with username - thanks to Yves Roy for pointing this out. 2005-08-12 02:30:30 +00:00
martinlanghoff fe1acc35e7 Fix calls to enrol_student() and add_teacher() where nulls were being passed erroneously - credits to jeff graham 2005-08-12 01:47:56 +00:00
patrickslee 83847ae5b1 Fixed a serious bug in table_column() that modified column not having NOT NULL for postgres 2005-08-11 23:50:13 +00:00
martinlanghoff 4fd1373c7e Fix for small syntax error that was hiding debug info from an error msg. #3527 - Credits to cangussu@gmail.com 2005-08-11 23:01:12 +00:00
martinlanghoff 44944d8466 Fix for using dn as idnumber - thanks fo Jeff Graham - http://moodle.org/mod/forum/discuss.php?d=28840 2005-08-11 22:42:46 +00:00
mjollnir_ 04f1658794 When fetching child courses for a metacourse, order by shortname (unless just counting) 2005-08-11 04:24:15 +00:00
mjollnir_ e14b9cd27c Changing the js timer in quiz to call the form by name rather than index. People who have forms in the headers (ie logout buttons) run into problems otherwise 2005-08-11 03:38:08 +00:00
urs_hunkler 6412c0b872 added ".mod-quiz " to three properties because the quiz style was in conflict with other Moodle pages. 2005-08-10 20:39:15 +00:00
martinlanghoff d3af23581d Added the missing $userold, now detecting updates (and pushing them out to LDAP) should work. 2005-08-10 05:34:08 +00:00
patrickslee 80729b01d0 Fixed a bug in postgres block upgrade script messing up with block ids 2005-08-10 05:28:46 +00:00
moodler 8bc776ba4f Slightly mkore reobust in the case where https was already being used
for the whole site.      bug 3848
2005-08-09 15:14:49 +00:00
mjollnir_ 4eb27d4a74 Fixing another group by postgres error. You can't put fields into the select that aren't in the group by unless they're functions like max 2005-08-09 04:50:02 +00:00
bobopinna 494538afb3 Fixed include path for xml2array.class.php 2005-08-08 08:37:55 +00:00
michaelpenne eab678f193 Fixed Bug #3652 - Gradebook catagory detail group view not working. 2005-08-04 22:08:08 +00:00
dhawes 40c61f1f01 merging in fix for bug 3478 2005-08-04 02:24:17 +00:00
stronk7 14f03b6f8b Now forum-start tracking,
forum-mark read and
    forum-prune post
log actions are restored properly.
Part of bug 3582.
(http://moodle.org/bugs/bug.php?op=show&bugid=3852)
2005-08-03 19:49:19 +00:00
stronk7 d65d9f925d Now course-guest, user-login and user-logout
log actions are restored properly.
Plus some problem with double &amp; entities solved.
Part of bug 3582.
(http://moodle.org/bugs/bug.php?op=show&bugid=3852)
2005-08-03 19:02:00 +00:00
stronk7 623b5e548d Now chat-talk log actions are restored properly.
Part of bug 3582.
(http://moodle.org/bugs/bug.php?op=show&bugid=3852)
2005-08-03 18:27:46 +00:00
patrickslee 8585ef8726 Removed/added/moved redundant/missing/misplaced page headers/footers 2005-08-03 00:09:33 +00:00
mjollnir_ 14f872baec Postgres doesn't happily convert NULL to 0 for int fields, so we set it manually. Credit: Patrick Li 2005-08-02 22:47:57 +00:00
mjollnir_ 84325f54bd Adding a length limit to input field in line with db field size 2005-08-02 22:39:49 +00:00
mindforge c735b8fe65 Copied a bugfix from 1.6 that hadn't been synchronized. Fixes bug #3804 2005-08-02 13:32:19 +00:00
ethem f358efc1f4 file postgres7.sql was added on branch MOODLE_15_STABLE on 2005-12-02 11:45:36 +0000 2005-08-02 08:23:52 +00:00
patrickslee f899b4a6d3 Fixed postgres structure problem as in http://moodle.org/mod/forum/discuss.php?d=28077 2005-08-02 04:08:37 +00:00
moodler 5cdb11e46f Implemented accessibiility fix bug 3662 2005-08-01 16:49:32 +00:00
moodler f82b708d08 Merged from HEAD. Not used in STABLE, but doesn't hurt to have them 2005-08-01 08:51:38 +00:00
moodler f9e95ccfbc file lib.php was added on branch MOODLE_15_STABLE on 2005-08-01 08:51:38 +0000 2005-08-01 08:49:33 +00:00
moodler 088e28666f Added sso hook (not used by anything but helps some hacking) 2005-08-01 08:39:09 +00:00
moodler 29d550cc82 Added original word as title to the blacked-out version. This is because
the filter can obscure actual important words by mistake (eg Dickens)
and there needs to be some way to recover the meaning.
2005-07-30 08:54:43 +00:00
moodler 43ba708ecc Bug 3800, affected large backups 2005-07-29 16:57:24 +00:00
stronk7 553ba0a568 file moodlelogo-med-white.gif was added on branch MOODLE_15_STABLE on 2005-11-28 20:22:07 +0000 2005-07-29 15:47:46 +00:00
moodler 28dee4658e file enrol_authorize.php was added on branch MOODLE_15_STABLE on 2005-09-03 07:51:57 +0000 2005-07-29 14:26:04 +00:00
moodler 4681fd95fe file login.php was added on branch MOODLE_15_STABLE on 2005-08-01 08:51:38 +0000 2005-07-29 08:06:01 +00:00
moodler bf4a11dd4b file expired.php was added on branch MOODLE_15_STABLE on 2005-08-01 08:51:38 +0000 2005-07-29 08:06:01 +00:00
urs_hunkler 303117213e merged from 1.6 2005-07-29 07:15:06 +00:00
urs_hunkler e23430c180 Enlarged the font-size of the calender popup and added the styles to gray out hidden sections on the course page.
My font tag hack to avoid that old font tags overwrite the styles killed all font formating in the resources written with HTML Editor. The Editor formats font sizes with font tags. It also makes pages failing the XHTML tests. Is really no other Editor out?
2005-07-27 19:42:29 +00:00
gustav_delius 87e29596d5 fix for bug 3822 provided by razzor 2005-07-27 17:19:20 +00:00
urs_hunkler c82f9b36bf changed the autolink style from a transparent background to light orange background and an orange underline. 2005-07-26 15:45:41 +00:00
mudrd8mz 4967ac0df4 file enrolperiod.html was added on branch MOODLE_15_STABLE on 2005-10-05 07:50:10 +0000 2005-07-26 08:35:45 +00:00
mudrd8mz 78d5bf65c8 file coursehiddensections.html was added on branch MOODLE_15_STABLE on 2005-10-05 07:50:10 +0000 2005-07-26 08:35:45 +00:00
mudrd8mz 572ac6f799 file courseidnumber.html was added on branch MOODLE_15_STABLE on 2005-10-05 07:50:10 +0000 2005-07-26 08:35:45 +00:00
bobopinna fffc5d6351 Fixed a bug in reaching masteryscore (score are float) 2005-07-26 06:32:47 +00:00
bobopinna 12801f73f7 Fixed a problem in AICC course tracking 2005-07-26 06:18:23 +00:00
bobopinna 97a305e3b2 Fixed a bug in masteryscore evaluation 2005-07-26 06:15:33 +00:00
michaelpenne d9ef8ddef6 removed a condition in an if statement that does not belong. This is another part of the fix for this forum post: http://moodle.org/mod/forum/discuss.php?d=27908 2005-07-25 18:50:39 +00:00
gustav_delius a8181107eb Fix for question numbering provided by razzor, bug 3807 2005-07-25 14:16:36 +00:00
moodler 68bdb2856a Also support language files in install/lang (but just for installation) 2005-07-25 11:25:05 +00:00
stronk7 1fa4ec0345 Escaping some double quotes I added recently... :-(
Merged from HEAD
2005-07-25 09:58:27 +00:00
moodler f7da20c95c On site level, don't bother checking course->guest etc 2005-07-25 09:03:17 +00:00
stronk7 3bd148acbc Now message forum RSS Feeds are using the category. Useful under
some RSS agregators able to group messages.
Credits go to Dmitry Pupinin.
Bug 3654
(http://moodle.org/bugs/bug.php?op=show&bugid=3654)
2005-07-24 23:07:29 +00:00
stronk7 e55407bfd4 Added support to RSS 2.0 categories. Credits go to Dmitry Pupinin.
Bug 3654
(http://moodle.org/bugs/bug.php?op=show&bugid=3654)
2005-07-24 23:02:36 +00:00
stronk7 81013d9eff Added the $Id$ tag 2005-07-24 10:27:29 +00:00
stronk7 bba72664cc Added $Id tag. 2005-07-24 10:01:40 +00:00
ikawhero c34efb3b8c Don't run the cleanup code if we are upgrading from a version that does
not already have an assignment type field. Bug 3801.
2005-07-23 10:49:50 +00:00
gustav_delius 890a6a5be3 The fixes for the item analysis plug-in that were assembled by Jean-Michel, see http://moodle.org/mod/forum/discuss.php?d=27553 2005-07-23 07:46:59 +00:00
defacer 3b80afab63 Fix for bug 3793:
Prevent warning message when configuring a glossary_random block in a
course which has no glossaries.
2005-07-23 00:52:47 +00:00
michaelpenne aef6766f3f Removed development code that accidentally got committed. Sorry. It appears the code was only in mod/lesson/view.php and lang/en/lesson.php 2005-07-22 22:01:54 +00:00
michaelpenne 3793147e59 removed some lang entries that do not belong 2005-07-22 21:58:43 +00:00
michaelpenne 128660712b removed some lang entries that do not belong 2005-07-22 21:46:47 +00:00
gustav_delius ffd834a5c2 Resetting the timout counter to avoid the timeouts reported at http://moodle.org/mod/forum/discuss.php?d=24790#129431 2005-07-22 20:40:31 +00:00
moodler d7387d3c3f Reverting bad version number to avoid errors (bug 3798) 2005-07-22 16:55:58 +00:00
ikawhero c2960fa279 file quiz_responses.php was added on branch MOODLE_15_STABLE on 2005-10-28 03:10:43 +0000 2005-07-22 11:41:11 +00:00
gustav_delius 3c4b7700e5 Improvements contributed by Jean-Michel Vedrine, see http://moodle.org/mod/forum/post.php?reply=130818.
- you can change # of attempts per page displayed on screen
- you can download results to Excel/text file, including detailed grades if you check this option.
2005-07-22 09:25:11 +00:00
moodler a3071d58ac Deleteing mistakenly-added currencies table from enrol_authorize 2005-07-22 07:25:49 +00:00
moodler a6c9107b45 Checked in fix for bad version from yesterday 2005-07-22 07:12:31 +00:00
moodler a698ecd735 Fixed dates 2005-07-22 07:04:27 +00:00
moodler 015eeaaccb Whoooooops! Fixing mistaken date from yesterday!!! 2005-07-22 07:03:04 +00:00
moodler 744d60e6bb Ethem made some mistakes here
- made some new tables and other changes for this module in STABLE

   - used a database to store language strings

   - made changes that required CORE changes in STABLE to work


I'm resetting this module to how it was in Moodle 1.5 ... Ethem if you
could reapply any FIXES only to this module then we can look at how to
add currencies properly in 1.6.
2005-07-22 06:57:54 +00:00
stronk7 691a3375a2 Now paging of older versions is showed and working properly. It was
really buggy! One string added to wiki lang file too. Bug 3750.
(http://moodle.org/bugs/bug.php?op=show&bugid=3750)
2005-07-21 23:38:07 +00:00
stronk7 ade1548ded Try to maintain user preferences synchronised between DB and $USER. 2005-07-21 18:46:42 +00:00
moodler d928302750 Use clone when copying this variable, just to be safe. 2005-07-21 16:43:30 +00:00
moodler 9bb3bc4e98 Run the online assignment cleanup code automatically on an upgrade. (SE) 2005-07-21 11:00:34 +00:00
moodler 6be6289f54 Fixes database errors from faulty Journal to Online Assignment upgrade code
from 1.4 to 1.5.1
Script can be run at any time.
(SE)
2005-07-21 10:59:29 +00:00
moodler 0f7f8271ba file oacleanup.php was added on branch MOODLE_15_STABLE on 2005-07-21 10:59:29 +0000 2005-07-21 10:28:30 +00:00
thepurpleblob ac00624f97 Fixed bug where path to exported file could be incorrect in non en languages. 2005-07-21 09:25:29 +00:00
thepurpleblob 96157e7986 Tidy up of import/export function layout to match coding standard 2005-07-21 08:48:48 +00:00
defacer b586f7cda2 All this time, table_column() didn't handle CHAR fields correctly! :o 2005-07-20 17:42:55 +00:00
moodler 7c109f7b2c file grades.php was added on branch MOODLE_15_STABLE on 2005-09-03 07:51:57 +0000 2005-07-20 17:29:29 +00:00
defacer 18e4e2d5c7 Fix for bug 3637:
Certain obscure cases of using PHP accelerators (probably has to do with
OS and PHP version as well, but it's not certain) caused an error to be
displayed when importing data from "local pagelib" files with "debug" turned
on. The error was bogus, but error() stopped the page from being displayed.

Thanks to James P. Dugal the from University of Louisiana at Lafayette for
identifying and helping to solve the problem!
2005-07-20 17:22:13 +00:00
moodler c94bf7e55a Whoops, forgot to check this in 2005-07-20 16:36:50 +00:00
thepurpleblob 486ca471fb Remove long answer check - does not seem to be requires as db field is 'text'
Fixed notices caused by uninitialised $question variable
2005-07-20 08:01:17 +00:00
moodler 1c36cd23bd Fixed paging on forum search 2005-07-20 06:42:02 +00:00
moodler 4452e1ace9 Fix for finding multi-line links in HTML code
Thanks German!  http://moodle.org/mod/forum/discuss.php?d=27630
2005-07-20 01:55:00 +00:00
defacer 309ed997b3 Slight "correctness" correction. 2005-07-19 23:43:42 +00:00
thepurpleblob 5c15bd839f Empty feedback array added for multiple choice questions, needed by underlying
quiz library.
Still some notices in this that need looking at
2005-07-19 07:59:16 +00:00
patrickslee 9021f8168a Fixed when $cm is NULL, postgres still reports error. From HEAD 2005-07-18 22:41:48 +00:00
ethem 1cfdb3c2c9 httpsrequired for credit card pages. 2005-07-18 17:12:18 +00:00
michaelpenne 6b8fdfd03e Fixed bug with displaying the gradebook when it is only set to show percent to students
as described here http://moodle.org/mod/forum/discuss.php?d=27521
thanks to Nikki Macfarlane for detailed info
2005-07-18 15:51:44 +00:00
ethem 4b4f3038e1 Merged updates from stable 2005-07-18 09:32:33 +00:00
martignoni 6a9c9a090b Merge from head 2005-07-16 13:10:15 +00:00
mindforge d4a87bc0a1 Synchronized with 1.6 version. 2005-07-16 11:17:19 +00:00
mindforge 5617a70288 Removed redundant ->order field from randomsamatch. 2005-07-16 11:13:43 +00:00
mindforge 08bdd05d61 Made sure that the answers are compared in the order they are provided by the question editor (ORDER BY id ASC), so that an asterisk can be used to catch any incorrect responses in order to provide feedback. 2005-07-16 10:47:39 +00:00
defacer 73b60981af Robustness check from Marko Korhonen (bug 3751):
Don't print a warning if $rss->items is empty.
2005-07-16 00:16:26 +00:00
moodler 9f02856794 Bump! 2005-07-15 19:55:02 +00:00
moodler 64a129a4f6 Checking in changed files. Wierd merge but files all look OK :-/ 2005-07-15 19:46:48 +00:00
moodler 7e6bc94ad2 This merge went wierd ... files with no diffs coming up as changed 2005-07-15 19:31:05 +00:00
moodler b498108933 Updates 2005-07-15 19:19:36 +00:00
moodler 472a880aac Merged updates from head 2005-07-15 18:50:16 +00:00
moodler d0f6d395cf Merged some changes from HEAD 2005-07-15 18:41:01 +00:00
moodler 5beaf7799d Added MP3 player 2005-07-15 18:40:04 +00:00
moodler 23d27ffd09 Added Andy's latest MP3 player (fixes the ID3 non-display problem) 2005-07-15 18:37:15 +00:00
moodler 6a0ecb49b9 Added release notes for 1.5.2 2005-07-15 18:22:58 +00:00
moodler 1989dfae9c Assignment is now a good citizen and will install new submodules nicely 2005-07-15 17:26:21 +00:00
moodler 1ef5fb3886 Added capability for Moodle to upgrade activity submodules automatically 2005-07-15 17:22:51 +00:00
moodler 78275891b4 Avoid using $USER->lastIP, to avoid wierd case problem with different db
http://moodle.org/mod/forum/discuss.php?d=18662
2005-07-15 16:30:02 +00:00
moodler 036110e055 Reduced fields for config_plugins from 255 to 100
http://moodle.org/mod/forum/discuss.php?d=26794#129389
2005-07-15 13:03:20 +00:00
stronk7 b7ab75c6bf Added .required to show some boxes properly. 2005-07-15 11:36:35 +00:00
stronk7 8886ee0942 Updated preventpassindb to work properly.
(sometimes db password wasn't being updated
to 'not cached' properly).
2005-07-15 11:11:08 +00:00
stronk7 5d789427fe Bump. Now signup page is 100% HTTPS if required. 2005-07-15 00:25:27 +00:00
stronk7 c11e28959d Bump. Now change password page is 100% HTTPS if required. 2005-07-15 00:16:30 +00:00
stronk7 87d7fdc584 Bump. Now forgot password page is 100% HTTPS if required. 2005-07-15 00:09:52 +00:00
ikawhero 0e48704206 Use absolute path name for include. Bug 3660. 2005-07-15 00:04:08 +00:00
stronk7 a4e53fb1f4 Added HTTPSPAGEREQUIRED support to some mail functions. 2005-07-15 00:00:07 +00:00
stronk7 5e7012bc32 Bump. Now login page is 100% HTTPS if required. 2005-07-14 22:52:48 +00:00
stronk7 8fdba9a133 Core changes finished. Now javascripts URLs support
HTTPSPAGEREQUIRED properly. Ready to start protecting pages.
2005-07-14 22:33:45 +00:00
stronk7 7facd141a8 Some minor changes in print_header() and page_id_and_class()
to dinamically support HTTPSPAGEREQUIRED pages.
2005-07-14 22:27:59 +00:00
stronk7 9c87a260b6 HTTPSPAGEREQUIRED and CFG->httpswwwroot added to
support 100% SSL pages.
2005-07-14 20:09:10 +00:00
urs_hunkler 8ae05f2387 fixed Bug #3529 - Round corners break slightly in a block with an optional title bar in edit mode. samuli's proposal was perfect. 2005-07-14 19:48:03 +00:00
stronk7 4de514f468 Add the httpsrequired() function to be 100% SSL in some pages. 2005-07-14 19:39:23 +00:00
urs_hunkler 5d87b5d826 added ".mod-scorm" before all properties to focus their action on the scorm module. Otherwise the properties can produce strange effects at other moodle pages. 2005-07-14 19:04:34 +00:00
urs_hunkler c6dd61eb2d reduced the lineheight of the links in the sideblock to the same size the text. 2005-07-14 18:01:51 +00:00
urs_hunkler b70ba1648d removed unused files 2005-07-14 16:32:06 +00:00
mindforge 83ba3e7007 Fixed a redundant use of ->order. 2005-07-14 16:26:54 +00:00
urs_hunkler 172d47a14c updated the theme. optimized it for display on pda and smartphone with the browser configured to rearange the page elements among each other. Tested on a Sony TH55 PDA with the NetFront browser. 2005-07-14 16:26:25 +00:00
moodler c54473ea39 Merged fix for bug 3181 from head 2005-07-14 16:01:23 +00:00
stronk7 191e4336d1 One help string corrected. 2005-07-14 15:43:28 +00:00
stronk7 2a0bb0af92 Interface for SC#106 2005-07-14 15:20:40 +00:00
stronk7 208af78ccd SC#106 2005-07-14 15:16:03 +00:00
mindforge 11cbf773ea Minor improvements to match and multianswer. 2005-07-14 12:04:55 +00:00
moodler 1ae1e84ec5 Allow Altavista in as guest too 2005-07-14 04:16:04 +00:00
moodler 4714df2e67 file editingacomment.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:41 +0000 2005-07-14 02:38:11 +00:00
moodler 97d8cdf4f6 file editingacomment.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:38 +0000 2005-07-14 02:38:11 +00:00
julmis f7a669d89c Do not intercept ctrl + v in gecko and let browser's own editor to handle it.
It's a bubblegum fix but partly takes care of pasting problem in Mozilla/Firefox
2005-07-13 20:52:12 +00:00
bobopinna f8a6a83698 The new xml parsing class 2005-07-13 20:13:45 +00:00
bobopinna 28a774b13e Fixed some manifest parsing problems and a structure display bug 2005-07-13 20:11:56 +00:00
gustav_delius 901d0f94a8 old version tried to use $CFG before loading config.php 2005-07-13 16:55:15 +00:00
moodler e80ca6fb8d Allow Babelfish in to translate 2005-07-13 16:40:48 +00:00
moodler b8b0f6dbe9 file regrading.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:41 +0000 2005-07-13 16:25:42 +00:00
moodler 687a4c0557 file regrading.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:38 +0000 2005-07-13 16:25:41 +00:00
moodler c322b22437 Allow userid to be left out when calling this page 2005-07-13 14:20:29 +00:00
mindforge be66bb9645 Fix for the multiple addslashes issue described in http://moodle.org/mod/forum/discuss.php?d=27171#128398 2005-07-13 12:43:41 +00:00
dlnsk b6c8102625 Added 2005-07-13 08:12:12 +00:00
michaelpenne 9aca363c1a Bug 3531 fixed 2005-07-12 23:09:47 +00:00
skodak 6bb0231b7b fixed up link when selecting 2005-07-12 19:26:59 +00:00
skodak acef19a1e7 fixed submission logging, email notification for online 2005-07-12 19:14:23 +00:00
skodak 42dc0e903b removed file pop-ups 2005-07-12 18:58:01 +00:00
skodak 14637fc14f removed file pop-ups 2 2005-07-12 18:51:45 +00:00
moodler 0b4362228b Gah, now it's fixed properly 2005-07-12 17:09:48 +00:00
moodler 9abb5a2390 file nattachments.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:41 +0000 2005-07-12 16:59:40 +00:00
moodler 003991588b file nattachments.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:38 +0000 2005-07-12 16:59:40 +00:00
skodak 7f8337032d removed file pop-ups 2005-07-12 15:36:08 +00:00
moodler c41a30806a Fixed my fix from earlier 2005-07-12 15:09:48 +00:00
skodak 54902ff056 fixed html emails 2005-07-12 14:35:29 +00:00
skodak 854e6f0b2c unset unmodified text fields SC#140 + popup fix 2005-07-12 13:06:56 +00:00
moodler 641649b051 FIxed bug 3383 ... intro texts no longer center-justified in standard 2005-07-12 12:40:00 +00:00
moodler bc6c0782e9 Fix for problem with lang names containing 8 Thanks Eloy 2005-07-12 12:26:55 +00:00
moodler 0ef1487687 Fix for bug 3736 2005-07-12 11:36:50 +00:00
moodler e1ace7dd20 Trim comment to remove extra space before using in Javascript statements 2005-07-12 09:48:42 +00:00
moodler 7e78d96097 Better yet, don't update student text at all 2005-07-12 09:03:29 +00:00
moodler 27619c6598 FIxed the problem with online assignments containing quotes 2005-07-12 09:00:27 +00:00
skodak 6ba567ac63 new parameter forcedownload 2005-07-12 08:01:59 +00:00
moodler 5bccb31ec7 Escaped text output during relinking, as per SC 139 2005-07-12 07:53:02 +00:00
moodler efed457566 Added escaping of possible raw HTML displayed to admins SC139 2005-07-12 07:42:43 +00:00
moodler f20d4d22e9 Journal is disabled by default on new installations 2005-07-12 07:10:41 +00:00
moodler e92893695d Corrected the journal -> Assignment upgrade!!! :-( 2005-07-12 06:56:22 +00:00
moodler fa19bf31ea file agreeassessments.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:41 +0000 2005-07-11 16:37:50 +00:00
moodler 5e816a727e file agreeassessments.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:38 +0000 2005-07-11 16:37:50 +00:00
gustav_delius ae89234a65 Undid some of Julian's changes that refer to a non-existent database field. 2005-07-11 14:20:42 +00:00
moodler 65c8ff4d85 file assessmentend.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:41 +0000 2005-07-11 04:48:19 +00:00
moodler 8a699d416d file assessmentend.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:38 +0000 2005-07-11 04:48:19 +00:00
skodak c1bf1d81a9 fixed resubmit logic and students can review their online assignment through file.php 2005-07-10 18:40:55 +00:00
skodak 0c2a8be918 fixed bug 3606, thanks Ilshat Fattakhov 2005-07-10 17:30:32 +00:00
moodler 0e5947dc2f file showinggrades.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:41 +0000 2005-07-10 15:27:08 +00:00
moodler 231765c8ba file showinggrades.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:38 +0000 2005-07-10 15:27:08 +00:00
mindforge fe97411051 Improved error message, again. 2005-07-10 12:53:19 +00:00
mindforge cdb21087da Fixed an error message that contained a reference to an old object. 2005-07-10 12:42:42 +00:00
stronk7 a74f39abcb The hardcode limit of 1000 was breaking long pages display in Moodle.
I've changed it to a variable limit depending of the page lenght. Bug 3039.
(http://moodle.org/bugs/bug.php?op=show&bugid=3039)
2005-07-09 16:39:46 +00:00
skodak 82ff36e758 fixed $posthtml - see bug#3868 2005-07-09 13:36:38 +00:00
moodler 1d68b9b631 file handlingofretakes.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:40 +0000 2005-07-09 13:09:37 +00:00
moodler 0c51f82bba file handlingofretakes.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:37 +0000 2005-07-09 13:09:36 +00:00
skodak eaf0b2d89f fixed grading bug#1517 and some other typos 2005-07-09 12:31:01 +00:00
skodak 47bd45c3f7 fixed 'AS' for PostgreSQL 2005-07-09 09:40:46 +00:00
skodak 0ab0450f92 fixed ';;' 2005-07-09 09:03:15 +00:00
skodak de59c77a9b fixed PostgreSQL warning 2005-07-09 08:21:54 +00:00
skodak 9e6091197b fixed s() p() for values false, number 0, and string '0'; '' from s() caused troubles in PostgreSQL 2005-07-09 07:12:41 +00:00
skodak ca478f374d fixed resubmit logic 2005-07-09 06:59:44 +00:00
moodler fe859633e8 file navigation.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:46:14 +0000 2005-07-08 15:51:00 +00:00
moodler 6e66067f5f file analysistable.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:46:14 +0000 2005-07-08 15:51:00 +00:00
moodler 2c5ed3d234 file reportselector.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:46:14 +0000 2005-07-08 15:51:00 +00:00
moodler 58314eeec4 file mods.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:46:14 +0000 2005-07-08 15:51:00 +00:00
moodler 7c789e82c1 file mediaplayers.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:46:14 +0000 2005-07-08 15:51:00 +00:00
moodler 75f8ac4310 file forceplugins.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:46:14 +0000 2005-07-08 15:51:00 +00:00
moodler efda10c098 file index.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:46:14 +0000 2005-07-08 15:51:00 +00:00
moodler 86756eef37 file responsestable.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:46:14 +0000 2005-07-08 15:51:00 +00:00
moodler 9ccba19a12 file outputformat.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:46:14 +0000 2005-07-08 15:51:00 +00:00
moodler b26eb35a28 file shownextquiz.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:46:14 +0000 2005-07-08 15:51:00 +00:00
mindforge 42c19f0e8d Fix for bug #3707. 2005-07-08 11:37:55 +00:00
mindforge c1b6ab8118 Fixed bug described in http://moodle.org/mod/forum/discuss.php?d=26880 (missing addslashes before DB insert). 2005-07-08 10:17:27 +00:00
stronk7 4027500f9d Updated to 1.5.1
Merged from HEAD
2005-07-08 08:17:13 +00:00
moodler 52bc379ce5 Added HR 2005-07-08 07:43:49 +00:00
moodler 11fe3a4d74 Change && to AND to help PostgreSQL 2005-07-08 07:40:57 +00:00
moodler 5f2099b846 Merged from HEAD 2005-07-08 07:32:09 +00:00
defacer df1cbe9f48 Three improvements:
1. $nomoodlecookie = true. I just found out about this undocumented(?) hack(?)
   in lib/setup.php which is the perfect way to suppress some warnings. We
   don't need a session cookie for the chatd.

2. If allow_call_time_pass_reference is Off, socket_getpeername can't work.

3. Suppress "call time pass by reference is deprecated" messages for
   socket_getpeername, we don't have any choice here.
2005-07-08 03:50:30 +00:00
gustav_delius a26a0e25dd A better fix for bug 3520 2005-07-08 00:14:13 +00:00
stronk7 1ab72c8499 Latest changed applied.
Merged from HEAD (for 1.5.1)
2005-07-07 22:43:37 +00:00
gustav_delius 4fad07671c Fixed bug 3520 2005-07-07 18:07:09 +00:00
moodler 2e6e9b8bdb Updated release to 1.5.1 2005-07-07 17:42:30 +00:00
moodler ec96bbc3e9 Added new files from HEAD 2005-07-07 17:38:15 +00:00
moodler 1e41ee920e Adding new files from HEAD 2005-07-07 16:14:38 +00:00
moodler 1ede1981b8 Added new files from HEAD 2005-07-07 16:00:50 +00:00
moodler 437a4bf65b New files from HEAD 2005-07-07 15:59:09 +00:00
moodler 2f495119f9 Updated from stable 2005-07-07 15:57:38 +00:00
moodler d00727cc52 Added from HEAD 2005-07-07 15:57:12 +00:00
moodler f0c3da1e7e Updates copied from HEAD 2005-07-07 15:49:51 +00:00
moodler 798488d5ff file maxattempts.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:40 +0000 2005-07-07 15:40:17 +00:00
moodler 16c346df93 file maxattempts.html was added on branch MOODLE_15_STABLE on 2005-07-15 19:45:37 +0000 2005-07-07 15:40:16 +00:00
gustav_delius f29752571b Added another 'continue' (or 'close this window') button towards the top of the review page, as requested in bug 3695 2005-07-07 14:53:15 +00:00
gustav_delius 73f25e0fca removed php notice 2005-07-07 14:51:54 +00:00
gustav_delius d404868d2b Quiz title and attempt number are now shown on one line as requested in bug 3696 2005-07-07 14:39:30 +00:00
gustav_delius b974afac9c Can now delete answers in multiple choice questions, fixing bug 3707 2005-07-07 14:19:55 +00:00
moodler c9ab45220c file modattempts.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:04 +0000 2005-07-07 08:58:29 +00:00
moodler e9bd42a226 file modattempts.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:02 +0000 2005-07-07 08:58:29 +00:00
moodler c3e7db99f9 file quiz_analysis.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:29:55 +0000 2005-07-07 08:37:13 +00:00
moodler 83fade0c0a file timezones.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:29:55 +0000 2005-07-07 08:37:13 +00:00
moodler 004b18ddb1 Merged changes from HEAD 2005-07-07 06:32:55 +00:00
gustav_delius c5a48a8908 There was a bug when a student reattempted a quiz based on a previous attempt that was already correct. Now fixed. 2005-07-06 22:34:45 +00:00
gustav_delius 8264da3c50 Fixed bug 3684 2005-07-06 19:26:19 +00:00
gustav_delius 5cbc7a8b67 Get rid of a PHP notice 2005-07-06 18:00:56 +00:00
moodler f022a9ba9c file overallocation.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:06 +0000 2005-07-06 16:01:33 +00:00
moodler ecf0c6af79 file overallocation.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:03 +0000 2005-07-06 16:01:32 +00:00
skodak c6dba19212 added word count display 2005-07-06 14:02:58 +00:00
moodler db83128e9d Switching off image border for now 2005-07-06 13:25:15 +00:00
moodler 8d3b909251 Fixed a link in forum post footer 2005-07-06 13:17:32 +00:00
moodler c01706d2d9 file assessmentstart.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:38 +0000 2005-07-06 11:10:49 +00:00
moodler c550d531b9 file submissionstart.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:38 +0000 2005-07-06 11:10:49 +00:00
moodler 1c63afd97e file submissionend.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:38 +0000 2005-07-06 11:10:49 +00:00
moodler e86ac958ef file releasegrades.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:38 +0000 2005-07-06 11:10:49 +00:00
moodler 89a44c34ba file assessmentend.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:38 +0000 2005-07-06 11:10:49 +00:00
moodler 50bdf52662 file size.html was added on branch MOODLE_15_STABLE on 2005-07-07 06:32:54 +0000 2005-07-06 10:49:27 +00:00
moodler 694df151b4 file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 06:32:54 +0000 2005-07-06 10:49:27 +00:00
skodak 445ec0d7e5 max upload size not shown to students 2005-07-06 10:14:22 +00:00
skodak 033cc8a223 Bug #3596 - Secureforms yes breaks online assignment 2005-07-06 09:51:37 +00:00
skodak f497c755aa compatibility hack for Moodle Cron, cookies not deleted, but set to "deleted" 2005-07-06 08:40:52 +00:00
gustav_delius 9182889ff9 In the past questions on the right hand side of the editing screen were previewed with the default settings whereas those on the left hand side were previewed with the quiz settings. That did create confusion among users so now questions will always be previewed with the quiz settings. 2005-07-06 07:32:59 +00:00
urs_hunkler 851ae37718 added class for userpic for better formatting via CSS in 2 additional lines 2005-07-06 06:54:58 +00:00
urs_hunkler 82aac29073 added class for userpic for better formatting via CSS 2005-07-06 06:31:20 +00:00
moodler 09d4003426 Updated tags file 2005-07-06 06:09:53 +00:00
moodler 75129c58b5 file lessondefault.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:04 +0000 2005-07-06 05:56:21 +00:00
moodler f2f438ac79 file lessondefault.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:02 +0000 2005-07-06 05:56:21 +00:00
defacer 4830bb4c53 Fixed the annoying "...and the 1 Journals you had..." message when you have
no Journals at all, because I was tired of seeing it.

count(false) is 1 and not 0.
2005-07-06 00:46:14 +00:00
defacer dca2e99977 Fix for bug 3616:
layout-table wasn't closed correctly for teachers and guests.
2005-07-06 00:35:37 +00:00
moodler 98774fcb6b file size.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:43 +0000 2005-07-05 18:04:27 +00:00
moodler 75108389bc file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:43 +0000 2005-07-05 18:04:27 +00:00
moodler 677c077839 file advancedsettings.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:42 +0000 2005-07-05 18:02:45 +00:00
moodler 3719d2e2ec file cost.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:42 +0000 2005-07-05 18:02:45 +00:00
moodler e0b6f1b499 file cvs.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:41 +0000 2005-07-05 18:00:10 +00:00
moodler 6ac4900f6c file features.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:41 +0000 2005-07-05 17:59:24 +00:00
moodler ab4f0d249b file upgrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:41 +0000 2005-07-05 17:58:32 +00:00
skodak e13b1d135f disabled cookie check when alternate login url used 2005-07-05 17:14:29 +00:00
skodak d994661015 code cleanup - see SC#129 2005-07-05 16:59:29 +00:00
stronk7 561216b9c5 With the latest feature I introduced to filterlib (the ability
to specify a replacement phrase instead of printing the linked
phrase I introduced a bug about text being showed with the
case of the concept instead of the case of the text under case
insensitive filtering. Detected and solved now. Bug 3688.
(http://moodle.org/bugs/bug.php?op=show&bugid=3688)
caseCVS: ----------------------------------------------------------------------
2005-07-05 16:39:50 +00:00
moodler 7b78a84785 file maxhighscores.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:04 +0000 2005-07-05 13:12:42 +00:00
moodler 44af81f7a7 file maxhighscores.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:02 +0000 2005-07-05 13:12:41 +00:00
bobopinna 0ec5a6d1f8 Fixed an API Initialization error 2005-07-05 09:33:01 +00:00
bobopinna 4eaf7d4cb2 Changed scoid passing method from SESSION to POST 2005-07-05 09:13:57 +00:00
bobopinna d5567f7328 Fixed a typo 2005-07-05 09:13:07 +00:00
bobopinna d63eab1287 Updated RoadmaP 2005-07-05 09:12:01 +00:00
bobopinna ecf7b75f77 Fixed a problem with old tracking data removing 2005-07-05 09:11:12 +00:00
skodak a6e2a2300a fixed comments - SC #61 2005-07-05 08:27:55 +00:00
skodak 85b6606215 fixed searching - SC #61 2005-07-05 08:17:29 +00:00
skodak e012c1f164 initialize array $auth_options SC #127 2005-07-05 07:58:38 +00:00
skodak 7a6b6d5f19 added validation for themename - see SC #101 2005-07-05 07:49:30 +00:00
skodak 6049058f5e fixed problem when removing due date or adding due date to existing assignment 2005-07-05 06:28:53 +00:00
skodak 88cfea17a9 code cleanup - see SC #110 2005-07-05 05:44:23 +00:00
moodler 3cb97ea9fb file size.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:03:08 +0000 2005-07-05 02:50:03 +00:00
moodler 1cd5223e73 file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:03:08 +0000 2005-07-05 02:50:03 +00:00
moodler f8f2157fa1 file analysisdownload.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:03:08 +0000 2005-07-05 02:50:03 +00:00
stronk7 e07fcc6ef8 Bump. New and improved relinking system available.
No changes at DB layer so I'm free to update the version
and maintain it syncronished with HEAD, isn't it?
2005-07-04 22:31:04 +00:00
stronk7 bec56a397f Now workshop are working under the new system to relink. Bug 3678.
(http://moodle.org/bugs/bug.php?op=show&bugid=3678)
2005-07-04 22:23:00 +00:00
skodak e940f40580 Removed text cleanup from print_textarea(), text from students must be cleaned before display - not here, because it interferes with resources, books etc. 2005-07-04 20:22:57 +00:00
skodak 3fa1abaa40 new PARAM_SAFEDIR - fast cleaning for directories used in include() and require() such as themes, plug-ins, formats... 2005-07-04 19:48:26 +00:00
stronk7 69731e2cc5 Improved automatic relinking in backup and restore. Credits go to skodak.
Complete refactoring of the system that was really awful (my fault!).
Now everything is in its place and working like a charm, making things really
easier to be implemented and amplied. Bug 3678
(http://moodle.org/bugs/bug.php?op=show&bugid=3678)
(http://moodle.org/mod/forum/discuss.php?d=26530)
2005-07-04 17:34:24 +00:00
skodak 6cd4abdac1 fixed output when config-dist.php called directly SC #779 2005-07-04 17:00:46 +00:00
urs_hunkler 11b1927bd4 I deleted the table property "cellspacing=10", because it made the loginpage look different in MSIE (with spaces between the cells) and in Firefox (without spaces between the cells). Some themes therefore looked broken in MSIE. 2005-07-04 16:09:07 +00:00
moodler c8aec2b7bb file analysisdownload.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-07-04 12:57:30 +00:00
moodler a73917523e file timed.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:37 +0000 2005-07-04 12:56:20 +00:00
moodler aa31415e59 file width.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:37 +0000 2005-07-04 12:56:20 +00:00
moodler 1c4bcba381 file slideshow.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:37 +0000 2005-07-04 12:56:20 +00:00
moodler a7d9cb49e0 file practice.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:37 +0000 2005-07-04 12:56:20 +00:00
moodler 5e99e6706d file usepassword.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:37 +0000 2005-07-04 12:56:20 +00:00
moodler 11d03ce9ab file review.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:37 +0000 2005-07-04 12:56:20 +00:00
moodler 4d7bf254fc file tree.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:37 +0000 2005-07-04 12:56:20 +00:00
moodler 55d79da54f file password.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:37 +0000 2005-07-04 12:56:20 +00:00
moodler a00e29d60a file lessondefault.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-07-04 12:56:20 +00:00
moodler 06114e7b15 file height.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-07-04 12:56:20 +00:00
moodler bd97afd006 file maxtime.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-07-04 12:56:20 +00:00
moodler 8fe324726c file maxhighscores.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-07-04 12:56:20 +00:00
moodler 4ece33a9a2 file deleteattempts.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-07-04 12:56:20 +00:00
moodler 6e1af255df file highscores.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-07-04 12:56:20 +00:00
moodler c008505902 file bgcolor.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-07-04 12:56:20 +00:00
moodler babcb224b4 file modattempts.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-07-04 12:56:20 +00:00
moodler 4fbdff9cde file displayleft.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-07-04 12:56:20 +00:00
moodler 1e563d8e1e file ongoing.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-07-04 12:56:20 +00:00
moodler afb96b0d7f file custom.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-07-04 12:56:20 +00:00
moodler 79bf17b640 file analysisoptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:38:15 +0000 2005-07-04 08:28:45 +00:00
skodak cbac6369e3 typos in switch - semicolon after 'main' 2005-07-04 07:07:44 +00:00
moodler 0365831211 file size.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:05 +0000 2005-07-04 05:05:32 +00:00
moodler 85cedef306 file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:05 +0000 2005-07-04 05:05:32 +00:00
moodler 6bf829136a file size.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:03 +0000 2005-07-04 05:05:31 +00:00
moodler 602174a3dc file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:03 +0000 2005-07-04 05:05:31 +00:00
bobopinna 9a62345785 Fixed a bug in report counting 2005-07-03 07:12:36 +00:00
bobopinna b36185320d Fixed a problem with altered chars in UTF-8 2005-07-03 07:11:44 +00:00
skodak 6c2ba19cdd not used anymore, please fix SC #99 before any use 2005-07-02 20:23:36 +00:00
moodler 356f30227a file exceptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 06:32:49 +0000 2005-07-01 23:22:39 +00:00
moodler 4689a3cd66 file student.html was added on branch MOODLE_15_STABLE on 2005-07-07 06:32:49 +0000 2005-07-01 23:22:39 +00:00
moodler 4aa8faabdb file teacher.html was added on branch MOODLE_15_STABLE on 2005-07-07 06:32:49 +0000 2005-07-01 23:22:39 +00:00
moodler e9ea8708b6 file preferences.html was added on branch MOODLE_15_STABLE on 2005-07-07 06:32:49 +0000 2005-07-01 23:22:39 +00:00
michaelpenne b3faa81ad1 Fixed a bug with the grade_get_module_link where wouldn't return any results
Fixed styles for grade tables to be class="grades" for both category and overall view
Fixed styles with overall view to alternate row styles everyline rather than every three
2005-07-01 20:06:07 +00:00
moodler f2760822ab file size.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:08 +0000 2005-07-01 11:39:45 +00:00
moodler 727ad2124d file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:08 +0000 2005-07-01 11:39:45 +00:00
mindforge 56459ea6e1 Fixed problem with automatic feedback, when 3x 33.33% didn't yield "Correct" but "Partially correct". Now the displayed (rounded)values are used, so the text should be in sync with the awarded grade. See also http://moodle.org/mod/forum/discuss.php?d=26584 2005-07-01 09:19:05 +00:00
defacer a328acd2f2 Improving Eloy's radio- and checkbox- generating functions to automagically
use <label>s with unique ids for improved usability. See discussion at
http://moodle.org/mod/forum/discuss.php?d=26139
2005-07-01 03:52:59 +00:00
martinlanghoff 6f095c04a9 enrol/ldap: (merge from HEAD) bugfixes suggested by Jeff Graham here http://moodle.org/mod/forum/post.php?reply=124170 -- fixes course creation not pulling summaries, form errors in ldap_search_sub, calls to deprecated blocks_get_default_blocks() and DB errors when inserting new enrolments. With these fixes, it may even work. 2005-07-01 02:51:15 +00:00
mindforge 0591a08cf1 Fixed problem with label tag in single answer multichoice questions. 2005-06-30 07:51:44 +00:00
defacer dd05085802 Getting the hardwired <i> out of the "post edited by" HTML and putting it
in CSS. I have been meaning to do this for something like 3 eons now...
2005-06-29 23:59:41 +00:00
defacer 8d8c444f9d Tiny visual improvement 2005-06-29 23:58:15 +00:00
michaelpenne 9f0b60ed6f Forgot to add a require for lesson's locallib.php and change a require from quiz's lib.php to quiz's locallib.php 2005-06-29 23:11:03 +00:00
michaelpenne 603a35322a Numerical import was still looking at min/max arrays. I changed it so numerical will now subtract the tolerance from the answer to get the min and add the tolerance to the answer to get the max 2005-06-29 23:05:28 +00:00
michaelpenne 9160e17321 FIXED: was calling an old quiz class name for importing. Updated it to call the new class name 2005-06-29 23:05:13 +00:00
michaelpenne 6deece3386 Display bug with lesson branch tables with slideshow mode on 2005-06-29 18:49:01 +00:00
stronk7 7992d2032c Now the restore form page is a bit more easy to use. Bug 1430.
(http://moodle.org/bugs/bug.php?op=show&bugid=1430)
2005-06-29 18:23:48 +00:00
michaelpenne fb2371cea7 FIXED: at End of Lesson with review on produced two warnings. Now they are gone 2005-06-29 18:11:01 +00:00
moodler 08f89eca4d file category.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:16:14 +0000 2005-06-29 17:50:53 +00:00
moodler cfb1b6cc26 file exceptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:16:14 +0000 2005-06-29 17:50:53 +00:00
moodler f90015cf76 file letter.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:16:14 +0000 2005-06-29 17:50:53 +00:00
moodler 4b37b038ca file weight.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:16:14 +0000 2005-06-29 17:50:53 +00:00
moodler 096da37850 file student.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:16:14 +0000 2005-06-29 17:50:53 +00:00
moodler 6f738c12bd file teacher.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:16:14 +0000 2005-06-29 17:50:53 +00:00
moodler dc7ebee343 file preferences.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:16:14 +0000 2005-06-29 17:50:53 +00:00
moodler 57d3f3d924 file autocontinue.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:50 +0000 2005-06-29 17:50:49 +00:00
moodler f50c21e36a file browsemode.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:50 +0000 2005-06-29 17:50:49 +00:00
moodler c3633061ff file height.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:50 +0000 2005-06-29 17:50:49 +00:00
moodler c1f0c0b5fa file maxgrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:50 +0000 2005-06-29 17:50:49 +00:00
moodler 20c2b54542 file width.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:50 +0000 2005-06-29 17:50:49 +00:00
moodler 8e0508945c file summary.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:50 +0000 2005-06-29 17:50:49 +00:00
moodler f2a26e4d66 file package.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:50 +0000 2005-06-29 17:50:49 +00:00
moodler e895355a17 file grademethod.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:50 +0000 2005-06-29 17:50:49 +00:00
moodler 1941ca6586 file rqp.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:40 +0000 2005-06-29 17:50:48 +00:00
moodler d64da4713d file penaltyscheme.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:40 +0000 2005-06-29 17:50:48 +00:00
moodler 2b5f8fd827 file questionsperpage.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:40 +0000 2005-06-29 17:50:48 +00:00
moodler ea76c04ee9 file penalty.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:38 +0000 2005-06-29 17:50:48 +00:00
moodler c63db8b61d file itemanalysis.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:38 +0000 2005-06-29 17:50:48 +00:00
moodler a92af1e3ad file analysisoptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:38 +0000 2005-06-29 17:50:48 +00:00
moodler 2c5b0f8154 file adaptive.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:38 +0000 2005-06-29 17:50:48 +00:00
moodler 1d4392b33f file analysisdownload.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:38 +0000 2005-06-29 17:50:48 +00:00
moodler 44501b674c file trackingtype.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:38 +0000 2005-06-29 17:50:45 +00:00
moodler ca02fba3e5 file authchange.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:37 +0000 2005-06-29 17:50:44 +00:00
moodler 25d21f0821 file category.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:37 +0000 2005-06-29 17:50:44 +00:00
moodler 91cbd9b2ab file cost.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:37 +0000 2005-06-29 17:50:44 +00:00
moodler 54c5330c1a file commentinline.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:37 +0000 2005-06-29 17:50:42 +00:00
moodler aa004b4cfe file types.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:37 +0000 2005-06-29 17:50:42 +00:00
moodler 7fd73b41ed file trackingtype.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:00:37 +0000 2005-06-29 17:50:42 +00:00
stronk7 4eb4ad04db Now the restore form page is a bit more easy to use. Bug 1430.
(http://moodle.org/bugs/bug.php?op=show&bugid=1430)
2005-06-29 16:56:23 +00:00
stronk7 3fc29386af SC#126 2005-06-29 16:14:40 +00:00
moodler b38c5f2aaf file assessmentofexamples.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 29a698998b file submissionofexamples.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 01c47c874b file selfassessment.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler e19f672835 file analysisofassessments.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler c7ac64d2db file gradingassessments.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 346dd8ca80 file leaguetable.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler ec60a0d59a file finalgrades.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 398d4a8db2 file ungradedassessments_teacher.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler b514da01a0 file nelements.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 5c0375b658 file elements.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 12d4023e43 file resubmit.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler dee7fd6048 file gradingsubmissions.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler e685ded405 file overallocation.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 20f32ed028 file breakdownoffinalgrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 671d4819bc file includeteachersgrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 65b95660c0 file nassessmentsofteachersexamples.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler c8d01fb2e3 file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 0168d3c716 file calculatingfinalgrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler c991030e0a file assignmenttype.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 1dcef80b9f file editingacomment.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler a6c50876a3 file includeself.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler ed103c1a63 file ungradedassessments_student.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 8982c7d343 file addingacomment.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 63e9fa8bdb file specimen.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler e1f41e2260 file grading.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler d928959877 file managing.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 0507e988a6 file showinggrades.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler e12cda81ef file gradingstrategy.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 5c07ac6a7a file nassessmentsofstudentsubmissions.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
moodler 8b3943e0b5 file anonymous.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:53 +0000 2005-06-29 12:13:11 +00:00
stronk7 da64b6a98e Added one new string to be used by the m4w installer. 2005-06-29 09:18:07 +00:00
moodler e2c77dd01f file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:52 +0000 2005-06-29 08:56:51 +00:00
bobopinna 6c94871c56 Fixed a problem with some item title 2005-06-29 08:43:51 +00:00
bobopinna e61fd9ab16 Fixed bug 3443 and the file not found error on restored scorms 2005-06-29 07:10:17 +00:00
stronk7 3471fa7ba0 Added a function to print a standard html checkbox 2005-06-28 16:52:46 +00:00
mindforge 7f80097841 Partial fix for bug #3604. Fixed backup/restore for multianswer questions. States still don't get restored correctly! 2005-06-28 12:43:50 +00:00
moodler 20c4d467b8 file penalty.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:53 +00:00
moodler 6d26b502ae file popup.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:53 +00:00
moodler 989b4dd302 file itemanalysis.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:53 +00:00
moodler 9ee9f0bb08 file requiresubnet.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:53 +00:00
moodler 03f91c22c6 file penaltyscheme.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:53 +00:00
moodler b79eee4520 file questiondatasets.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:53 +00:00
moodler 566b2664e2 file questionsperpage.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:53 +00:00
moodler bcb91f2abd file requirepassword.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:53 +00:00
moodler c529fcdbe1 file rqp.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:53 +00:00
moodler 1de5a75c8c file review2.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:53 +00:00
moodler 251514b4bb file categories_edit.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:52 +00:00
moodler 8e815df623 file export.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:52 +00:00
moodler 0aeb823dc4 file calculated.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:52 +00:00
moodler c3ee28c440 file decimalpoints.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:38 +0000 2005-06-28 07:04:52 +00:00
moodler 893345b32b file adaptive.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:37 +0000 2005-06-28 07:04:52 +00:00
bobopinna b7119d1440 Fixed a upgrade bug with field timelimitaction 2005-06-28 06:57:57 +00:00
urs_hunkler f046c91c6e added the CSS for the black border around the userpicture and the grouppicture for the online user block 2005-06-27 17:37:08 +00:00
urs_hunkler a8c8fbf706 ?dded the CSS for the black border around the userpicture and the grouppicture 2005-06-27 17:31:59 +00:00
moodler 91c21f2b1b file enrol_ldap.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:40 +0000 2005-06-27 13:02:26 +00:00
moodler 44bb2a6e0e file size.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:37 +0000 2005-06-27 07:58:16 +00:00
moodler 9c11d36fe9 file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:37 +0000 2005-06-27 07:58:16 +00:00
bobopinna 6a7aa3f9c0 Fixed a problem with previous sco button 2005-06-27 07:33:59 +00:00
bobopinna 1cc24851a2 Fixed a problem with lesson_status setting 2005-06-27 07:32:36 +00:00
urs_hunkler ff19ce674d update of the readme text. 2005-06-27 06:02:14 +00:00
danmarsden e1b434b129 Bug #3623 - doesn't like when $value = 0 2005-06-27 01:03:50 +00:00
stronk7 76adec164b Solved a problem where the '1' string was being cached to ''
because we concatenate true and it's evaluated like 1.
Bug 3623.
(http://moodle.org/bugs/bug.php?op=show&bugid=3623)
2005-06-27 00:21:59 +00:00
stronk7 6eff731b3c Added the choose_from_radio() function to
display groups of radiobuttons in a central way.
Part of bug 1430.
(http://moodle.org/bugs/bug.php?op=show&bugid=1430)
2005-06-27 00:15:12 +00:00
stronk7 c196b29413 Avoid some backslashes causing problems with some browsers. Bug 3463.
(http://moodle.org/bugs/bug.php?op=show&bugid=3463)
2005-06-26 16:43:31 +00:00
stronk7 2e390fcb96 Added readme and screenshot to Wood Theme. 2005-06-26 15:45:37 +00:00
moodler b6cec9e900 file autocontinue.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:43 +0000 2005-06-26 14:10:24 +00:00
moodler ead1951a57 file browsemode.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:43 +0000 2005-06-26 14:10:24 +00:00
moodler a0680c868b file height.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:43 +0000 2005-06-26 14:10:24 +00:00
moodler 73e5412854 file maxgrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:43 +0000 2005-06-26 14:10:24 +00:00
moodler 2affe0355e file width.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:43 +0000 2005-06-26 14:10:24 +00:00
moodler 727a216d59 file summary.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:43 +0000 2005-06-26 14:10:24 +00:00
moodler 829f54d594 file package.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:43 +0000 2005-06-26 14:10:24 +00:00
moodler eb707720f1 file grademethod.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:43 +0000 2005-06-26 14:10:24 +00:00
stronk7 2cdcb56958 Now the entry being commented is showed when
adding comments for non-approved entries. Bug 3638.
(http://moodle.org/bugs/bug.php?op=show&bugid=3638)
2005-06-26 09:31:10 +00:00
julmis b1192638c2 Fixing Bug 3576
- bad grammar, so I've been told ;-)
2005-06-26 06:15:55 +00:00
stronk7 1e4ffe8752 Added some top margins for two glossary pages. 2005-06-25 19:13:18 +00:00
stronk7 43bee0ad7e Changed one table header. 2005-06-25 17:08:17 +00:00
stronk7 f4d8478a9d Now $CFG->allowobjectembed is working properly. Admins
will ignore this setting. Bug 3608.
(http://moodle.org/bugs/bug.php?op=show&bugid=3608)
2005-06-25 15:39:12 +00:00
fiedorow b70ea3c680 Fix for broken no authentication 2005-06-25 13:20:30 +00:00
fiedorow 3eb93697aa Compatibility fix for glossary 2005-06-24 18:04:52 +00:00
gustav_delius 3d6fb28178 Changed "Later, while the quiz is still open" to "While the quiz is still open", see http://moodle.org/mod/forum/discuss.php?d=26311 2005-06-24 16:41:44 +00:00
gustav_delius 0c6e298228 Removed the "Continue" button from the attempt page, see http://moodle.org/mod/forum/discuss.php?d=25972 2005-06-24 16:23:32 +00:00
fiedorow e2d7af8412 Fix for broken guest shortcut 2005-06-24 15:28:29 +00:00
thepurpleblob 6482f073ac Added empty feedback array to prevent error when questions are saved. 2005-06-24 13:17:03 +00:00
thepurpleblob 425e7df6ee tolerance being picked up from 'old' place in object. Fixed. 2005-06-24 13:01:42 +00:00
gustav_delius 79cc5ce839 XHTML compliance 2005-06-24 12:53:45 +00:00
thepurpleblob 43079e1883 Seems 'core' classes changed to 'internal' folder in latest version. I
simply changed the path in the class. How this never show up........
2005-06-24 12:47:55 +00:00
moodler 1edb6e3555 file philosophy.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:41 +0000 2005-06-24 10:26:09 +00:00
gustav_delius 3693b82020 changed & to &amp; 2005-06-24 08:02:06 +00:00
gustav_delius e80ad3b374 quoted two attributes for XHTML compliance 2005-06-24 07:52:26 +00:00
stronk7 a00cd5ad53 Take out one "white" use. Bug 3610. Credits are for Helen Foster.
(http://moodle.org/bugs/bug.php?op=show&bugid=3610)
2005-06-23 20:12:59 +00:00
fiedorow a23b767ebb Sorry, committed wrong version 2005-06-23 15:22:38 +00:00
fiedorow d79aa15c71 Bug fix for bug #3614 2005-06-23 15:18:11 +00:00
moodler 07a40e5714 file window.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:42 +0000 2005-06-23 13:17:00 +00:00
fiedorow b4ddf27cdd Bug fix for bug #3613 2005-06-23 12:23:21 +00:00
moodler 32855b4019 file future.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:41 +0000 2005-06-23 11:38:55 +00:00
fiedorow e26aaed2a4 Fix for bug #3607 2005-06-23 11:29:34 +00:00
thepurpleblob 5fe35ab0e3 improved name of function - clean_getstring_data() - and call it only
is data is actually defined.
2005-06-23 09:02:45 +00:00
stronk7 6add2dbfc7 Changed to use the new replacementphrase attribute so
bad words are replaced with a strlen(phrase) number
of **** characters. Bug 3605.
(http://moodle.org/bugs/bug.php?op=show&bugid=3605)
2005-06-22 23:33:08 +00:00
stronk7 aadb24e091 Add a new attribute to the filterobject class.
Now it supports a replacementphrase to be passed
so, the original phrase will be replaced. Nothing happens
if empty. Part of bug 3605.
(http://moodle.org/bugs/bug.php?op=show&bugid=3605)
2005-06-22 23:21:26 +00:00
mindforge 88170baf19 Implemented the suggestion from http://moodle.org/mod/forum/discuss.php?d=26139. The label element is now used in the multichoice and truefalse questiontypes in order to allow clicking on the answer text to select the according checkbox/radiobutton. 2005-06-22 11:21:46 +00:00
michaelpenne 0d6254cd8d Made the shortanswer qtype grading much more reliable. Change to preg_match to speed things up. Also do a preg_quote on the teacher supplied answer to prevent confusion in the preg_match statements (before + signs and the like were causing the preg_match statements to fail). 2005-06-21 22:36:35 +00:00
michaelpenne 0719af8aac Bug Fix: The code for dealing with the * character for shortanswer question type was lost. I downloaded 1.4.5+ and merged the shortanswer grading code into 1.6 dev. 2005-06-21 21:56:50 +00:00
thepurpleblob 1a08f75e50 Improved 'cleaning' of optional data parameter in get_string() to include objects 2005-06-21 12:29:03 +00:00
moodler 9ef1ef1869 file webquest.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:09 +0000 2005-06-21 10:28:40 +00:00
moodler 447a482619 file tex.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:08 +0000 2005-06-21 10:28:40 +00:00
moodler 1058cca34c file block_rss_client.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:08 +0000 2005-06-21 10:28:40 +00:00
moodler 1a750b6307 file enrol_ldap.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:08 +0000 2005-06-21 10:28:40 +00:00
moodler 1d05050c6c file emailprotect.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:08 +0000 2005-06-21 10:28:40 +00:00
moodler 2ffa17100e file simplemail.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:08 +0000 2005-06-21 10:28:40 +00:00
moodler 881075b287 file message.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:08 +0000 2005-06-21 10:28:40 +00:00
moodler 2a386c0d74 file block_simplemail_information.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:08 +0000 2005-06-21 10:28:40 +00:00
gustav_delius e546494f92 fixed error in sql syntax 2005-06-21 07:05:51 +00:00
urs_hunkler c273a2f31f _ some space above the userpiicture added in #user-edit and user-view.
_ rmoved the border above the link in the rss sideblock
2005-06-21 06:08:03 +00:00
moodler dffc320511 file README.txt was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:12 +0000 2005-06-20 18:13:12 +00:00
moodler 2852f047aa file default.ttf was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:12 +0000 2005-06-20 18:13:12 +00:00
moodler e0a9d6b93a file attendance.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:11 +0000 2005-06-20 18:13:12 +00:00
moodler 32abe3255a file timezones.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:11 +0000 2005-06-20 18:13:12 +00:00
moodler c2533292f0 file moodle.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:11 +0000 2005-06-20 18:13:12 +00:00
moodler 7b82fe3699 file calendar.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:11 +0000 2005-06-20 18:13:12 +00:00
moodler ab4333e1c9 file admin.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:57:11 +0000 2005-06-20 18:13:12 +00:00
moodler b2326e175a file README was added on branch MOODLE_15_STABLE on 2005-07-07 17:16:12 +0000 2005-06-20 18:13:11 +00:00
mindforge 12fcbb1fab Added possibility to escape #, ~ and } to the cloze questiontype. This is necessary so that in the answers HTML entities can be used (e.g. &#601; can now be included in an answer if it is written &\#601;). See also bug 3553. 2005-06-20 13:15:24 +00:00
moodler 7a8a43763d file message.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:40 +0000 2005-06-20 12:35:19 +00:00
thepurpleblob df677142d9 Fixed typo. See bug #3573 2005-06-20 09:14:32 +00:00
thepurpleblob ecc0c8b802 Escape % signs in get_string() function optional parameter. Bug #3527 2005-06-20 09:08:48 +00:00
thepurpleblob fc823bf378 Added missing sesskey field to module config screen 2005-06-20 08:26:17 +00:00
moodler 524b4ec865 file docstyles.css was added on branch MOODLE_15_STABLE on 2005-07-07 17:16:13 +0000 2005-06-20 08:16:38 +00:00
moodler 06a56158a6 file translation.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:41 +0000 2005-06-20 08:15:25 +00:00
mjollnir_ 89394c8d6f fixing bug 3569: current workaround= one query for postgres, one for mysql. probably a better way to do it when someone has more time 2005-06-20 04:32:04 +00:00
defacer 0757dc7cec Adding default sort order to participant lists to reinstate 1.4-style behavior. 2005-06-20 03:45:49 +00:00
defacer d10b0ae93e Augment tablelib so that it can accept a default sort order. 2005-06-20 03:43:25 +00:00
mjollnir_ f0ee6c7b0b Fixing postgres upgrade to match postgres7.sql (bug 3547) 2005-06-19 21:38:04 +00:00
mjollnir_ 9d7b35c73c Renaming index to match table (rqp_type) more on 3547 2005-06-19 21:30:09 +00:00
mjollnir_ 32321469bc Fixing typo on index for rqp type (bug 3547) 2005-06-19 21:27:57 +00:00
stronk7 33c895943e Checking some fields because they were breaking restore of old courses.
Bug 3444
(http://moodle.org/bugs/bug.php?op=show&bugid=3444)
2005-06-19 18:26:08 +00:00
moodler fd466ef02d file timezones.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:40 +0000 2005-06-19 17:51:06 +00:00
stronk7 b92e44c50d Now the cancel button goes to the course (or site) page. Bug 2817.
(http://moodle.org/bugs/bug.php?op=show&bugid=2817)
2005-06-19 17:50:53 +00:00
moodler 80fec54702 file enrol_authorize.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:40 +0000 2005-06-19 17:45:04 +00:00
moodler d4d9b7adbe file block_rss_client.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:40 +0000 2005-06-19 17:43:44 +00:00
moodler 233993afd3 file block_search_forums.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:40 +0000 2005-06-19 17:43:44 +00:00
moodler f27efbf4b2 file block_quiz_results.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:40 +0000 2005-06-19 17:43:44 +00:00
moodler c952ea8d4b file block_html.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:40 +0000 2005-06-19 17:42:50 +00:00
stronk7 221f65b6c3 Now glossary ratings display user links in a new page. 2005-06-19 17:32:22 +00:00
stronk7 d437835d78 Order by rating now works. See bug 3566.
(http://moodle.org/bugs/bug.php?op=show&bugid=3566)
2005-06-19 17:12:31 +00:00
stronk7 cf2b886d4d Using the time class properly. 2005-06-19 16:45:11 +00:00
stronk7 4031b89e9b Some styles changed to show consistently the author and
time information.
2005-06-19 16:27:27 +00:00
stronk7 39952eee06 Now the name of the authors is a link to the user page.
To be a bit more like forum posts Bug 2809.
(http://moodle.org/bugs/bug.php?op=show&bugid=2809)
2005-06-19 15:23:54 +00:00
stronk7 c5d569c6af Now + and - search terms are properly highlighted
under glossary searches. This was broken recently
solving some non-iso problems.
2005-06-19 14:44:58 +00:00
moodler 327df50025 file custom.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:09 +0000 2005-06-19 12:47:04 +00:00
moodler de311acd1d file authchange.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:44 +0000 2005-06-18 16:35:36 +00:00
moodler 3408a01243 file coursefullname.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:44 +0000 2005-06-18 16:35:36 +00:00
moodler 3b5271f34f file advancedsettings.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:44 +0000 2005-06-18 16:35:36 +00:00
moodler bf87cc5594 file courseavailability.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:44 +0000 2005-06-18 16:35:36 +00:00
moodler 3da5aee8ab file courseidnumber.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:44 +0000 2005-06-18 16:35:36 +00:00
moodler 13ff917186 file courseshortname.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:44 +0000 2005-06-18 16:35:36 +00:00
moodler 79aa2098a5 file coursecategory.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:44 +0000 2005-06-18 16:35:36 +00:00
moodler 83d86ba626 file surveys.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:44 +0000 2005-06-18 16:33:14 +00:00
moodler a5c0415580 file scorm.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:43 +0000 2005-06-18 14:35:55 +00:00
stronk7 770d88ced5 Some changes added (see bug 3188).
- Added correct encoding.
   - Make page XHTML 1.0 Frameset compliant
Credits go to sunner_sun.
(http://moodle.org/bugs/bug.php?op=show&bugid=3188)
2005-06-18 09:59:39 +00:00
urs_hunkler 96393dd450 removed the .block_rss_client .title correcture bcause I have changed the styles.php of the block. 2005-06-18 08:00:14 +00:00
urs_hunkler a0c2d453c7 I removed letter-spacing because some browsers are not able to display the text correct when using a small amount for spacing. 2005-06-18 07:58:19 +00:00
moodler 965d344017 file teacher.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:04 +0000 2005-06-17 17:37:23 +00:00
moodler 02948ab08b file teacher.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:01 +0000 2005-06-17 17:37:22 +00:00
stronk7 abcb2346b7 One style is not necessary. Delete it. 2005-06-17 17:05:32 +00:00
mindforge 4809b5ea1d Fixed problem with tolerance in cloze numerical questions. 2005-06-17 16:36:13 +00:00
moodler fd2beb3383 file respondenttype.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:52 +0000 2005-06-17 15:37:10 +00:00
moodler 86ea9f3820 file questionnaireid.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:52 +0000 2005-06-17 15:35:15 +00:00
moodler 92d7d849e9 file qtype.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:52 +0000 2005-06-17 15:34:02 +00:00
moodler 01a661a5b2 file qmanage.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:52 +0000 2005-06-17 15:32:57 +00:00
moodler 23b6f32087 file timerestrict.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:52 +0000 2005-06-17 15:28:54 +00:00
moodler bb8a86d2a7 file options.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:52 +0000 2005-06-17 15:26:46 +00:00
moodler fa498fc83b file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:52 +0000 2005-06-17 15:25:17 +00:00
moodler 0b16c0de19 file limit.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:52 +0000 2005-06-17 15:24:10 +00:00
moodler 29d263f26d file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:52 +0000 2005-06-17 15:22:37 +00:00
moodler d630d32338 file chatting.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:52 +0000 2005-06-17 15:17:10 +00:00
moodler 07799f187b file width.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:54 +0000 2005-06-17 15:06:39 +00:00
moodler d072f34f5a file summary.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:53 +0000 2005-06-17 15:05:26 +00:00
moodler bf2dc956fa file package.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:53 +0000 2005-06-17 15:04:23 +00:00
moodler 9fb48afe1a file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:53 +0000 2005-06-17 15:03:11 +00:00
moodler cf4f33c352 file maxgrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:53 +0000 2005-06-17 15:01:33 +00:00
moodler a554e7c33c file height.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:53 +0000 2005-06-17 14:59:58 +00:00
moodler 40ea07e4d0 file browsemode.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:53 +0000 2005-06-17 14:58:16 +00:00
urs_hunkler 6f96b83473 removed padding-top from title, which made the title of the sideblock higher than the other ones. 2005-06-17 06:26:45 +00:00
moodler 88639aa1c8 file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 06:12:01 +00:00
moodler 829dc9522c file maxgrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 06:10:38 +00:00
moodler 1ee838b5ee file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 06:09:41 +00:00
moodler 226b5a8e12 file hours.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 06:08:35 +00:00
moodler 4c023bf561 file grade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 06:07:36 +00:00
moodler 319f61e0d2 file dynsection.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 06:06:43 +00:00
moodler 54b02a56a7 file choosedays.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 06:05:30 +00:00
moodler 6b20b6587a file autoattend.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 06:04:03 +00:00
moodler cbcee839e2 file types.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 06:01:05 +00:00
moodler 17f2f65a05 file resubmit.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 05:59:59 +00:00
moodler 579a6b8ff8 file emailteachers.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 05:44:39 +00:00
moodler c6fab7af24 file commentinline.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 05:43:35 +00:00
moodler 29b46bfc99 file assignmenttype.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:51 +0000 2005-06-17 05:42:10 +00:00
moodler 76c8cbd44e file analysisdownload.html was added on branch MOODLE_15_STABLE on 2005-07-07 06:32:51 +0000 2005-06-16 22:42:51 +00:00
moodler b5e241a788 file letter.html was added on branch MOODLE_15_STABLE on 2005-07-07 06:32:49 +0000 2005-06-16 22:42:49 +00:00
moodler 1fc6bb6ee3 file deleteattempts.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:04 +0000 2005-06-16 20:28:28 +00:00
moodler 45bcdfa9db file deleteattempts.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:02 +0000 2005-06-16 20:28:28 +00:00
fiedorow ee74d5e92a Security fix: stop guest uploading 2005-06-16 17:16:53 +00:00
moodler df256b30e0 file category.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:03:09 +0000 2005-06-16 12:34:47 +00:00
mjollnir_ c0f988a1e5 Another postgres fix -- this time forums were not being displayed 2005-06-16 03:11:51 +00:00
mjollnir_ 61cf7b168b html_entity_decode segfaults in php 4.3.1 on an empty variable... documented in bug 3508. credit: Eloy & Jose Luis Daz 2005-06-16 02:57:58 +00:00
mjollnir_ 61fd69b8ae Fix for bug 3508 -- only do the clam log on backup/restore for restoring course/user/group files, not for temp backup data 2005-06-16 02:32:42 +00:00
moodler 49d7755163 file features.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:44 +0000 2005-06-16 00:05:13 +00:00
moodler 49b2930b8d file upgrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:44 +0000 2005-06-16 00:03:42 +00:00
moodler cf5b77cd85 file minquestions.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:04 +0000 2005-06-15 23:57:52 +00:00
moodler 34853e7bc5 file minquestions.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:02 +0000 2005-06-15 23:57:52 +00:00
michaelpenne 5a1ca11989 Fixed a problem with quotes in short answers 2005-06-15 22:51:31 +00:00
mjollnir_ 8f3e3695e3 Fixing bug 3502 - 2 postgres problems - one in db creation (my fault) and one in '' instead of 0 for int in sql query 2005-06-15 22:36:20 +00:00
michaelpenne 7070d53107 Fixed a bug with clusters. If you enter a cluster after a page it would throw a
navigation error.  It now enters the cluster properly.
2005-06-15 22:34:31 +00:00
urs_hunkler d673f73a37 corrected the CSS. It is not enough to set the outer class once at the begining of a comma separated list of CSS stylings. Every item must contain the full series of classes or ids, only the properties are following once. 2005-06-15 19:26:33 +00:00
stronk7 1687749a16 Minor tweaks applied 2005-06-15 15:55:41 +00:00
stronk7 dfc6579e1e One collapse:separate used to debug is now out. 2005-06-15 00:32:54 +00:00
stronk7 d27c760508 Modified the grades visualisation to make use
of styles a bit better. Works fine under standard
and wood personalise it aparently without problems.

Sure it can be improved...!
2005-06-15 00:24:24 +00:00
stronk7 9629cc6d78 More changes. Gradebook is working with some basic styles.
And things have been simplified a bit.
2005-06-15 00:06:34 +00:00
moodler 0eed750d84 file student.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:04 +0000 2005-06-14 21:25:40 +00:00
moodler 5f87491394 file student.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:01 +0000 2005-06-14 21:25:40 +00:00
defacer 9b8a859781 Fix for bug 3510:
Due to stupidly copy/pasting some code, deleting a block instance could,
under some circumstances, throw a fatal error.
2005-06-14 20:32:40 +00:00
michaelpenne d031cf09b0 put in two !== instead of != to compare NULL values 2005-06-14 17:40:46 +00:00
defacer 70057cf44f Fix for bug 3467: Adding "single discussion forum" was broken. Now works. 2005-06-14 15:50:13 +00:00
djachenko d36fc3561d submitassignment 2005-06-14 10:16:24 +00:00
moodler 276ce5fb85 file weight.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:04 +0000 2005-06-14 02:26:52 +00:00
moodler 1a26550217 file weight.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:01 +0000 2005-06-14 02:26:52 +00:00
stronk7 964556fdb6 Survey and grades implemented
(some changes to grades will arrive tomorro with some
defaut styles to show thigs a bit better)
2005-06-14 00:31:36 +00:00
gustav_delius 4fb6abdd28 changed more relative filenames to absolute, see bug 3483 2005-06-13 22:06:25 +00:00
stronk7 cbe80a54c1 forums, glossaries and assignment are now displayed properly. 2005-06-13 19:54:28 +00:00
stronk7 d48f9fcfda Adding some header classes for 1 table. 2005-06-13 19:35:19 +00:00
gustav_delius ba2e6a32ea replaced relative links to absolute links because some web servers get confused, see bug 3483 2005-06-13 18:22:32 +00:00
stronk7 cc7d926e11 Wood styles are now in more pages... 2005-06-13 17:56:36 +00:00
mindforge aec645efcd Fixed bug #3481 2005-06-13 09:39:49 +00:00
moodler f5897334fb file block_search_forums.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:47 +0000 2005-06-13 06:34:20 +00:00
moodler 33fefcb567 file grades.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:47 +0000 2005-06-13 06:34:20 +00:00
defacer 85ad80a03f Implementing Dan Marsden's great idea for additional hooks when block
instances are deleted (bug 3446). Going a step further and adding hooks
for when block instances are created.

This probably counts as adding features to a STABLE, but I wanted to
give any future blocks that use this as much back-compat as possible.
2005-06-13 03:29:47 +00:00
defacer 9b1e8d728a Adding a little more checking to the session switching trap code.
I 've come across a problem where:

1. You have an "old" (say 1.3.5?) Moodle installation.
2. You are logged in as admin.
3. You suddenly switch to using a 1.5+ codebase with
   the SAME database, WITHOUT LOGGING OUT FIRST.

In this situation, I was presented with a deadlock. I could not do
anything because "my session had expired", and I could not even
log OUT to clear my session. In fact it was just reloading the
"session expired page" all the time.

If it weren't for debug = On which causes a notice in these
circumstances, it would be fracking difficult to understand what
was going on.

With this small addition, you can at least visit your login page
and log in anew, so problem fixed.

I believe this was talked about in the forums lately? Not sure.
2005-06-13 02:50:46 +00:00
defacer 230783ba85 While researching bug 3478:
Consolidated handling of the incoming courseid parameter, as it was easy
to make an error the way this was written before.

In general, this script looks like it needs to be streamlined.
2005-06-13 02:35:38 +00:00
defacer fa62ca18e8 Fix for bug 2925:
When editing is turned on, the Main Menu should always display and give
the option of adding resources/activities in section 0 of the site.

Bad optimization code caused the drop downs to not be shown if there
was no section 0 (i.e., the site never had a news forum or an activity
in the Main Menu block).

FINALLY! :)

PS: Version bump, so that we know if people have the latest version of
the block. I 'm going to bump versions from now on when bugs are fixed.
2005-06-13 01:56:25 +00:00
moodler 51f4d70284 file analysisoptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:05 +0000 2005-06-13 01:31:15 +00:00
moodler 575ba2443d file analysisdownload.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:05 +0000 2005-06-13 01:31:15 +00:00
moodler 9a7af7f0c9 file analysisdownload.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:03 +0000 2005-06-13 01:31:15 +00:00
moodler 3104265b51 file analysisoptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:03 +0000 2005-06-13 01:31:14 +00:00
defacer abb7e59d46 Fixing a notice when $CFG->forum_trackreadposts doesn't exist (when editing
the admin account during installation, for example).
2005-06-13 00:44:43 +00:00
mjollnir_ d7083e8737 Email bounce handling: fixing md5 validation bug 2005-06-13 00:16:55 +00:00
moodler e03ec5ca2a file grades.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:50 +0000 2005-06-12 22:02:58 +00:00
moodler 84d3c29dad file enrol_ldap.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:50 +0000 2005-06-12 22:02:58 +00:00
moodler 37de8a3494 file message.php was added on branch MOODLE_15_STABLE on 2005-07-07 15:45:50 +0000 2005-06-12 22:02:58 +00:00
moodler b89ad2fc1e file analysisdownload.html was added on branch MOODLE_15_STABLE on 2005-07-07 15:59:07 +0000 2005-06-12 20:04:45 +00:00
moodler 89a660aaba file analysisoptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:53 +0000 2005-06-12 17:37:07 +00:00
moodler 60b482f67f file analysisdownload.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:53 +0000 2005-06-12 17:37:07 +00:00
gustav_delius 3a60417d9d Help files from Enrique, slightly modified. Closing bug 3432 2005-06-12 13:49:37 +00:00
moodler d96c4f3aa9 Some small change in making defaults for fronmt page 2005-06-11 18:58:37 +00:00
moodler 8dbd402a97 Change default front page format to be courses 2005-06-11 18:57:09 +00:00
moodler c8b383e37a Added slight spacer on login page 2005-06-11 18:34:36 +00:00
moodler 903d01ccb4 Added extra CSS styles so Eloy can do cool stuff in Wood theme
Main sections now have added "main", and separator sections
have "separator".
2005-06-11 18:23:43 +00:00
mindforge 3ed1ef582f The calculated question wizard has been restructured/rewritten. A new question is now only saved when the first dataset item is added. And hopefully the code is somewhat clearer and easier to understand. Additionally it all works through the (slightly adapted) standard question.php mechanisms and doesn't hack around it. 2005-06-11 13:16:57 +00:00
moodler eceda4634f file timezones.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:36 +0000 2005-06-11 12:26:26 +00:00
moodler becc6bfc56 file block_search_forums.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:36 +0000 2005-06-11 12:14:55 +00:00
moodler 25618ea469 file README.txt was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:50 +0000 2005-06-11 12:10:42 +00:00
moodler fe1c4e6d89 file default.ttf was added on branch MOODLE_15_STABLE on 2005-07-07 17:05:50 +0000 2005-06-11 12:10:42 +00:00
julmis e0675c474f Fixing cut 'n' paste mozilla confirm line again... 2005-06-11 11:01:03 +00:00
moodler 0f49980a0e file philosophy.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:52 +0000 2005-06-11 00:54:15 +00:00
moodler e74466b0a0 file intro.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:52 +0000 2005-06-11 00:54:15 +00:00
moodler cb0b4be6b7 file other.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:52 +0000 2005-06-11 00:54:15 +00:00
moodler a2b2a68587 file coding.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:52 +0000 2005-06-11 00:54:15 +00:00
moodler 65a4df9d55 file future.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:52 +0000 2005-06-11 00:54:15 +00:00
moodler 84ea026b4c file background.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:52 +0000 2005-06-11 00:54:15 +00:00
moodler f608db22a8 file features.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:52 +0000 2005-06-11 00:54:15 +00:00
moodler c9abc270f2 file text.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:11:47 +0000 2005-06-11 00:21:35 +00:00
moodler 8a2e373a63 file initialcontent.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-11 00:21:35 +00:00
moodler c803207669 file ewikiacceptbinary.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-11 00:21:35 +00:00
moodler 2b9c339fe6 file wikiname.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-11 00:21:35 +00:00
moodler bceea57e1d file howtowiki.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-11 00:21:35 +00:00
moodler b05de5d96a file wikiusage.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-11 00:21:35 +00:00
moodler 849e4bf620 file window.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-11 00:21:34 +00:00
moodler c596036229 file penalty.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-11 00:21:34 +00:00
moodler 07f7a76fb7 file random.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-11 00:21:34 +00:00
moodler ea8acc1cdc file maxgrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-11 00:21:34 +00:00
moodler 907d3d2ef7 file requiresubnet.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-11 00:21:34 +00:00
moodler e1ee24102f file export.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-11 00:21:34 +00:00
moodler 5957cbb539 file correctanswers.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-11 00:21:34 +00:00
moodler ef907c4840 file feedback.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-11 00:21:34 +00:00
moodler 7d748cfae1 file import.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-11 00:21:33 +00:00
moodler 5f8d3a3664 file minquestions.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-11 00:21:33 +00:00
moodler fbed5b62ee file overview.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-11 00:21:33 +00:00
moodler dc8c752c5d file maxanswers.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-11 00:21:33 +00:00
moodler 0b286cf21e file custom.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:57 +0000 2005-06-11 00:21:33 +00:00
moodler 76f24be0a5 file usedynalink.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-11 00:21:33 +00:00
moodler 1b1b729eb9 file entbypage.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-11 00:21:33 +00:00
moodler f532678fe2 file rsstype.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-11 00:21:33 +00:00
moodler e301c30ae8 file attachment.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-11 00:21:33 +00:00
moodler 4f310cd444 file usedynalinkentry.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-11 00:21:33 +00:00
moodler 86e44d10ee file forumtype.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-11 00:21:32 +00:00
moodler 92262dcb59 file subscription2.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-11 00:21:32 +00:00
moodler 7ee5671e18 file aliases2.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-11 00:21:32 +00:00
moodler c179fe2aa7 file grading.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-11 00:21:31 +00:00
moodler 53363a8365 file closedialogue.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-11 00:21:31 +00:00
moodler 42bc1ad5fe file chatting.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:54 +0000 2005-06-11 00:21:30 +00:00
moodler ce62d03091 file dynsection.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-11 00:21:30 +00:00
moodler e187b9391d file files.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:11:46 +0000 2005-06-11 00:21:29 +00:00
moodler c5c9ef2004 file choosedays.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-11 00:21:29 +00:00
moodler c3d609a3f2 file cookies.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-11 00:21:29 +00:00
moodler 7024225764 file questions.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-11 00:21:29 +00:00
moodler ca52c559a3 file writing.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-11 00:21:29 +00:00
moodler 22da13bd0a file html.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-11 00:21:29 +00:00
moodler 29fe9e516e file text.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-11 00:21:29 +00:00
moodler f2e652004f file quiz_analysis.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:28 +00:00
moodler 1d660f65e4 file questionnaire.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:28 +00:00
moodler 357532c491 file wiki.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:28 +00:00
moodler 24cf7e4dc5 file timezones.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:28 +00:00
moodler ef3064ee84 file block_rss_client.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 0bcf2a3561 file block_search_forums.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 806e50b3c7 file block_course_list.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler de488ea4dd file block_glossary_random.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 0971a70695 file block_online_users.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 1fdb043504 file grades.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 649333df15 file enrol_paypal.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler fac088a544 file enrol_ldap.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 4f667d4209 file hotpot.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 1404dd0e18 file install.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 50033d9128 file emailprotect.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 469b28034b file message.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 38238a83da file appointment.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 40b145b1aa file block_html.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler f70e4ac4b0 file block_course_summary.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 2c95341c64 file calendar.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler a4fa13ef70 file block_social_activities.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 0fdef6bcdf file enrol_database.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 5ef7459355 file enrol_flatfile.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler ea41487667 file enrol_authorize.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 76a0d881b9 file activitynames.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 5d0fa584ca file block_quiz_results.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 8c43043fdc file enrol_internal.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 6b47cfd866 file block_section_links.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:51 +0000 2005-06-11 00:21:27 +00:00
moodler 468e60dda3 file questionoption.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:04 +0000 2005-06-10 23:55:12 +00:00
moodler 7d7b5a6a66 file questionoption.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:02 +0000 2005-06-10 23:55:11 +00:00
ecastrolt 101ff90760 *** empty log message *** 2005-06-10 18:42:29 +00:00
moodler 9df3490a99 file quiz_analysis.php was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:43 +0000 2005-06-10 17:28:17 +00:00
moodler 938cd0f631 file future.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:12:44 +0000 2005-06-10 17:25:00 +00:00
julmis 4e712f7bd6 Fixing cut 'n' paste headache... Auts...
Multilined error message wasn't working well.
2005-06-10 17:14:05 +00:00
ecastrolt 6228beb135 *** empty log message *** 2005-06-10 17:04:56 +00:00
stronk7 8e1314c7a2 Reordering styles a bit....to find them easily. 2005-06-10 15:35:31 +00:00
moodler 52fd07555f file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-10 15:16:00 +00:00
moodler 01e87a4673 file timerestrict.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-10 15:16:00 +00:00
moodler fd9329e7f7 file options.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-10 15:16:00 +00:00
moodler c1db910dda file limit.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-10 15:16:00 +00:00
moodler 14249f8441 file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-10 15:16:00 +00:00
moodler 06469948a7 file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler 478ca9a9e2 file removepages.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler b9f436c930 file wikitype.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler 5a644bd7d3 file strippages.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler 0de476e235 file htmlmode.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler b2b719935f file wikilinkoptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler 5f6c0b1e98 file setpageflags.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler 937d7b52c5 file revertpages.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler a1b3c3e4cf file checklinks.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler 168873c341 file revertauthorfieldpattern.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler 782aa08eaa file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler d517d25943 file studentadminoptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:04:13 +00:00
moodler 7251542cd8 file label.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:11:47 +0000 2005-06-10 15:03:56 +00:00
moodler 7b41d89fe4 file html.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:11:46 +0000 2005-06-10 15:03:56 +00:00
moodler d361e66afc file file.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:11:46 +0000 2005-06-10 15:03:56 +00:00
moodler 48753e1a1f file directory.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:11:46 +0000 2005-06-10 15:03:56 +00:00
moodler 88637d4c73 file timeopen.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:03:55 +00:00
moodler f4acdcc176 file truefalse.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:03:55 +00:00
moodler deea1d84d9 file timelimit.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:03:55 +00:00
moodler b7f278fe1d file types.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:03:55 +00:00
moodler dcfd0dff70 file summary.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:03:55 +00:00
moodler 3be1259eb9 file parameters.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:59 +0000 2005-06-10 15:03:55 +00:00
moodler 88d295948d file shufflequestions.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:55 +00:00
moodler 981ceefdf7 file categories_edit.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler adad4fd9f0 file popup.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler c2f03bc722 file randomsamatch.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler bd6b9530ef file match.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 964d6dc73d file attempts.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 96b39e79bb file numerical.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 969bf35c2f file categories.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler f39917d8d9 file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 6d1e31c34b file multichoice.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 2bb01a4e58 file requirepassword.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 824816e06f file adaptive.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 5a2658ca41 file questiontypes.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler eac6bc964d file calculated.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 4f68b47504 file decimalpoints.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 7341e97c93 file review2.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 98227d36e1 file shuffleanswers.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 4d48860e68 file shortanswer.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler be9e88091a file description.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 8b0aa6ffb3 file repeatattempts.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 40f0a960f7 file grademethod.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:54 +00:00
moodler 16975e3616 file questionoption.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 4e6f474a58 file maxpages.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 6532f6b856 file retake.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler a1357fc970 file lessondefault.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 1feaffe800 file useeditor.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 5b645d1016 file height.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 91d602fb1a file timed.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler dcefa09e57 file maxtime.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 2b429140e8 file width.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 5e3d6406e9 file maxattempts.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 9ce6c24791 file handlingofretakes.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 25aeb72573 file maxhighscores.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 80a147e820 file slideshow.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 09dac5eebb file practice.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 3f6ae60106 file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 8b8b5f43ee file nextpageaction.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 32741d16c0 file usepassword.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler b10dc2d6ba file review.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 2aa6346fa9 file jumpto.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 301ff2fe75 file highscores.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 9c45d35790 file tree.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 18bb2e0325 file password.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler c8c6addcac file modattempts.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler dd4bba5a50 file ongoing.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:58 +0000 2005-06-10 15:03:53 +00:00
moodler 4aecfad306 file grade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:57 +0000 2005-06-10 15:03:53 +00:00
moodler f3fb3a2b2d file bgcolor.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:57 +0000 2005-06-10 15:03:53 +00:00
moodler 088a5e5e12 file deleteattempts.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:57 +0000 2005-06-10 15:03:53 +00:00
moodler 1dd72d43c3 file displayleft.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:57 +0000 2005-06-10 15:03:53 +00:00
moodler 35ca4ed7ee file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:57 +0000 2005-06-10 15:03:52 +00:00
moodler 323f1e49e2 file casesensitive.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler de20d6f610 file editalways.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler c3258231df file importcategories.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 917cc0fca4 file globalglossary.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 5c64d1cdd3 file rssarticles.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 1aed3e931b file studentcanpost.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 1636626882 file allowprintview.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler dbfb58b629 file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler b09e69a0b0 file shows.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 3c09aeec29 file mainglossary.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 7bc7f28148 file linkcategory.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 5f32625c01 file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 2c329933cc file allowduplicatedentries.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 6f4f6fe13c file destination.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler d15b1bd91e file defaultapproval.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 57efcbc6dd file filetoimport.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 7f407d1f3f file description.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 4996d3d28c file allowcomments.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 6128c50b39 file displayformat.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler e167032c03 file fullmatch.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:52 +00:00
moodler 89a8b837ed file leaguetable.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler eb7b88ea9d file submissionofdescriptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler b357805a0d file usemax.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler 8d48260f84 file leaguetablenames.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler b0846bc19a file grade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler e36af790df file usepassword.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler 740d5f70d7 file specimen.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler e9d0bcbcfd file gradingstrategy.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler 73a1ee602a file password.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler aa1b2fcd73 file gradinggrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler 2c0717e001 file maxattachmentsize.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler fb283cda43 file allowdiscussions.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler 901e6b6e6b file attachment.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler 9aaaed344c file rsstype.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:56 +0000 2005-06-10 15:03:51 +00:00
moodler 34648c65c3 file info.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-10 15:03:50 +00:00
moodler 8d87913195 file dialoguetype.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-10 15:03:50 +00:00
moodler 6216697b79 file addsubject.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-10 15:03:50 +00:00
moodler e510af822e file multiple.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-10 15:03:50 +00:00
moodler 9ee255715d file deleteafter.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-10 15:03:50 +00:00
moodler 1161f96fb1 file maildefault.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:55 +0000 2005-06-10 15:03:50 +00:00
moodler 16124ac3f5 file hours.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:54 +0000 2005-06-10 15:03:49 +00:00
moodler 490e05c698 file maxgrade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:54 +0000 2005-06-10 15:03:49 +00:00
moodler 5e69cf407f file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:54 +0000 2005-06-10 15:03:49 +00:00
moodler 579769bded file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:54 +0000 2005-06-10 15:03:49 +00:00
moodler d0f1967418 file grade.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:49 +00:00
moodler d3332366f1 file autoattend.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:49 +00:00
moodler dac4e79866 file resubmit.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:49 +00:00
moodler f353928ad3 file commentinline.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:49 +00:00
moodler 07f2bb581e file mods.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:49 +00:00
moodler 0cc653c3a7 file assignmenttype.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:49 +00:00
moodler 0607dc743c file types.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:49 +00:00
moodler 075433aef3 file index.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:49 +00:00
moodler 96ba4407f6 file emailteachers.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:49 +00:00
moodler 407c22a76f file teachers.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:48 +00:00
moodler b18baa0c89 file richtext.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:48 +00:00
moodler 8f5bc35905 file textformat.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:48 +00:00
moodler bb1b4b4784 file uploadusers.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:48 +00:00
moodler 52a40768b2 file reading.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:48 +00:00
moodler a597bebb84 file groupmode.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:47 +00:00
moodler 6066fdd301 file directorypaths.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:47 +00:00
moodler 1324f3c6af file groupmodeforce.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:10:53 +0000 2005-06-10 15:03:47 +00:00
stronk7 d7f7862841 Not used finally by the theme... Removed. 2005-06-10 14:50:58 +00:00
stronk7 725200b03a Problems with 1.5Beta backups solved by Bobo. B-) 2005-06-10 14:16:12 +00:00
stronk7 c40bd6ac20 Generate properly RSS column. It was breaking styled (colored) rows. 2005-06-10 09:03:02 +00:00
bobopinna b2d5b92b96 Fixed a problem with some 1.5 beta backup files 2005-06-10 06:35:01 +00:00
stronk7 f2bb550ac0 Some classes added and minor chage to links to be able to
difference them form plain text.
2005-06-10 00:47:01 +00:00
stronk7 58ed94fd9c Some classes and styles added to show everything properly. 2005-06-09 23:50:33 +00:00
stronk7 ea858dd7a0 Added one deleted br... 2005-06-09 23:39:27 +00:00
stronk7 5821db186e Now icons, comments and ratings are showed properly in entrylist format.
Bug 3455
(http://moodle.org/bugs/bug.php?op=show&bugid=3455)
2005-06-09 23:30:08 +00:00
stronk7 14e02c54ef Separate icons a bit... 2005-06-09 23:27:19 +00:00
michaelpenne 4226f24829 Bug: fixed a problem with the date completed value and a problem with processing shortanswer/numerical question types 2005-06-09 21:54:55 +00:00
michaelpenne ebe63af223 Discovered a bug with lesson grades. While calculating the grade, intval was used to truncate the decimals from the grade. intavl is now replaced with round. round will now round the grade to 5 decimal places. The database only holds int(3). So, this has been changed to float to hold decimal numbers. We have found this to be much more accurate when converting the stored percentage in the database back to a point value (before this fix, users were getting numbers like 46.5 points instead of their original 47 points due to an inaccurate percent value). Files changed for this fix include:
locallib.php
report.php
version.php
view.php
db/mysql.php
db/mysql.sql
db/postgres7.php
db/postgres7.sql
2005-06-09 21:26:21 +00:00
moodler 24fc7d266f Disabled tab hover for IE since it slowed down the whole site 2005-06-09 21:07:02 +00:00
thepurpleblob f04eda06be Added a chunk on defensive/secure coding. With due deference to
Petr Skoda from which a lot of it was stolen.
2005-06-09 18:51:49 +00:00
stronk7 957f001f04 Fixed two typos (in one line!) :-o
Testing changes before commit is always interesting... :-P
2005-06-09 16:27:46 +00:00
moodler 716111f60e file exceptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:04 +0000 2005-06-09 16:12:20 +00:00
moodler 58c28f0269 file exceptions.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:01 +0000 2005-06-09 16:12:20 +00:00
thepurpleblob 382c50809b Removed use of assert function for session objects. 2005-06-09 13:58:41 +00:00
moodler 3608b0f6f5 Hide tabs when setting up initial admin user 2005-06-09 13:00:36 +00:00
moodler 014d8a9ab8 If no courses exist, then present a helpful button to make one. 2005-06-09 12:53:56 +00:00
moodler 377c6fa437 Default theme during setup is standardwhite, not standard 2005-06-09 12:53:14 +00:00
moodler 2535c5777d file quiz_analysis.php was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000 2005-06-09 11:58:07 +00:00
thepurpleblob 2fbfbcdd7b Use of 'register_global' type functionality removed and replaced with
required_param() and optional_param().
2005-06-09 09:39:26 +00:00
moodler d3753d4c37 Added some extra images I fotgot 2005-06-09 09:24:52 +00:00
moodler ab8734e816 Removed moz styles 2005-06-09 09:23:47 +00:00
moodler 9c855ec4f0 Added Eloy's excellent Wood theme!!!
Eloy, can you add a README.txt ?
2005-06-09 08:28:28 +00:00
moodler b7e133298d Fixed display bug in themes list 2005-06-09 08:23:26 +00:00
moodler 2e0a1774b9 Removed some old themes not being maintained yet 2005-06-09 08:09:13 +00:00
moodler cf885520e7 Updated Metal for 1.5 2005-06-09 08:06:40 +00:00
moodler 36c83a5057 file itemanalysis.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:05 +0000 2005-06-09 06:23:49 +00:00
moodler ba98e4b6b1 file itemanalysis.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:03 +0000 2005-06-09 06:23:48 +00:00
moodler 478625d186 file rqp.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:05 +0000 2005-06-09 04:07:19 +00:00
moodler d19a3b1fe2 file rqp.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:59:03 +0000 2005-06-09 04:07:16 +00:00
paca70 c313f211c0 Updates 2005-06-08 17:22:00 +00:00
moodler a0c477deef Merged changes from HEAD 2005-06-08 14:30:00 +00:00
watcanz 5b0f288d95 Fixed image path problem
Restored tags for moodle heading.
2005-06-08 12:20:54 +00:00
moodler 441c87bcb9 file createcontent.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:47 +0000 2005-06-08 10:47:50 +00:00
moodler ce111128d3 file respondenteligible.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:47 +0000 2005-06-08 10:10:25 +00:00
moodler b22f9bac31 file realm.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:47 +0000 2005-06-08 10:10:25 +00:00
moodler 13c9933c8f file closedate.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:47 +0000 2005-06-08 10:10:25 +00:00
moodler b9b203357e file mods.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:47 +0000 2005-06-08 10:10:25 +00:00
moodler 499ac00af3 file resume.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:47 +0000 2005-06-08 10:10:25 +00:00
moodler d4268066cb file opendate.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:47 +0000 2005-06-08 10:10:25 +00:00
moodler a9da346030 file background.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-08 08:55:35 +00:00
moodler 7fdd558af0 file teachers.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-08 06:17:52 +00:00
moodler c90930bf10 file textformat.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-08 06:17:52 +00:00
moodler c53755d7c4 file uploadusers.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-08 06:17:52 +00:00
moodler 4249a9a8d0 file text.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-08 06:17:52 +00:00
paca70 bc55fae7b9 Updates 2005-06-08 06:02:52 +00:00
moodler 5f0ea84bbb file default.ttf was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:53 +0000 2005-06-08 05:20:15 +00:00
moodler 9f8d9231fe file message.php was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:52 +0000 2005-06-08 05:20:15 +00:00
moodler edf1c2d30d file block_rss_client.php was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:51 +0000 2005-06-08 05:20:15 +00:00
moodler 81bfee2947 file enrol_ldap.php was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:51 +0000 2005-06-08 05:20:15 +00:00
moodler 8df6f37dc0 file block_html.php was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:51 +0000 2005-06-08 05:20:15 +00:00
moodler 58cfbd4a84 file block_category_tree.php was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:51 +0000 2005-06-08 05:20:15 +00:00
moodler 7530078651 file block_quiz_results.php was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:51 +0000 2005-06-08 05:20:15 +00:00
moodler 6406c48cd8 file richtext.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-08 04:06:46 +00:00
moodler 58f33bd7cd file questions.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-08 02:26:48 +00:00
moodler 317311d645 file writing.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-08 02:26:48 +00:00
moodler b4e2cde355 file reading.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-08 02:26:48 +00:00
moodler cb5e71a635 file letter.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:50 +0000 2005-06-07 23:46:10 +00:00
moodler c8b589bb29 file letter.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:49 +0000 2005-06-07 23:46:10 +00:00
martinlanghoff 9fd70b1ac3 Merged in readfile_chunked() patch -- much lower memory footprint, same CPU usage, works around PHP5 bug in readfile() 2005-06-07 23:43:04 +00:00
martinlanghoff 6eabcba137 Auth fields were not being re-fetched on every login as expected. Fixed. 2005-06-07 23:19:45 +00:00
gustav_delius 530b8335f1 Fixed a typo 2005-06-07 21:43:32 +00:00
michaelpenne 699c28ff92 Bug 1650 fixed: help button calling the wrong help file 2005-06-07 20:58:47 +00:00
michaelpenne 257f67470b Bug 3022 Fixed: got rid of uppercase tags 2005-06-07 20:48:41 +00:00
gustav_delius 2876a137d8 Temporarily switching off "Save as new question" button until bug 3445 is fixed 2005-06-07 20:44:59 +00:00
paca70 52c1134dd4 Added missing as junk words 2005-06-07 17:30:38 +00:00
moodler ffb7b55ea4 file groupmode.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-07 17:03:42 +00:00
moodler 09206b48f2 file mods.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-07 17:03:42 +00:00
moodler 2fea1d8480 file groupmodeforce.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-07 17:03:42 +00:00
moodler 30cb9ab4b5 file cookies.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-07 15:44:54 +00:00
moodler da84ec2f77 file html.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-07 15:44:54 +00:00
moodler 615824e242 file index.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-07 15:44:54 +00:00
moodler f08cbc787f file directorypaths.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-07 15:44:54 +00:00
moodler 69ae7d08af file philosophy.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-07 15:44:53 +00:00
moodler 25a9851943 file intro.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-07 15:44:53 +00:00
moodler 73afb49262 file other.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:30:00 +0000 2005-06-07 15:44:53 +00:00
zibas 22d2a0fdc4 Applied the patch submitted with bug #3344. This fixes PHP5 issues while retaining PHP4 functionality.
Also altered the bb5.5 importer:
Respecting certain "visible" flags. Made the default course properties match the importer capabilities better.
Fixed the resource summaries.
Converting Bb "Staff Information."
2005-06-07 14:21:19 +00:00
thepurpleblob f24e18ee85 Added assert_var_set() - part of trying to deprecate required_variable (which
is used in two different ways)
2005-06-07 12:35:39 +00:00
thepurpleblob b20337b888 Converted required_variable() to required_param() 2005-06-07 09:43:45 +00:00
moodler e35720ef02 file teacher.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:47 +0000 2005-06-07 07:28:04 +00:00
martinlanghoff 472b380522 Added missing auth strings for field locks 2005-06-07 05:04:35 +00:00
martinlanghoff 094f41207b Fixes db upgrade for config_plugins failure on unquoted data - discussed at http://moodle.org/mod/forum/discuss.php?d=25122 2005-06-07 03:40:20 +00:00
moodler d1c56c3939 file category.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:59 +0000 2005-06-07 00:34:53 +00:00
moodler c156eef71e file exceptions.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:59 +0000 2005-06-07 00:34:53 +00:00
moodler 7e022f9345 file letter.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:59 +0000 2005-06-07 00:34:53 +00:00
moodler edab76787e file weight.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:59 +0000 2005-06-07 00:34:53 +00:00
moodler 815a82746b file student.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:59 +0000 2005-06-07 00:34:53 +00:00
moodler 354673e358 file teacher.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:59 +0000 2005-06-07 00:34:53 +00:00
moodler e135be2639 file preferences.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:59 +0000 2005-06-07 00:34:53 +00:00
moodler 67353f95ef file weight.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:47 +0000 2005-06-06 23:53:01 +00:00
moodler 460f06f2a5 file category.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:46 +0000 2005-06-06 23:53:01 +00:00
moodler 65b4efb096 file exceptions.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:46 +0000 2005-06-06 23:53:01 +00:00
moodler 1f93813304 file letter.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:46 +0000 2005-06-06 23:53:01 +00:00
moodler 95f0d3d486 file student.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:46 +0000 2005-06-06 23:53:01 +00:00
moodler 7ba1e94556 file preferences.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:46 +0000 2005-06-06 23:53:01 +00:00
moodler a7a97c933c file category.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:50 +0000 2005-06-06 22:45:10 +00:00
moodler e29ed82aee file category.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:49 +0000 2005-06-06 22:45:10 +00:00
michaelpenne eba970bffc BUG FIX for Bug #3059: if there is not a response to an answer, the response gets set to an empty string 2005-06-06 18:26:49 +00:00
ecastrolt 05786bc6fd *** empty log message *** 2005-06-06 18:15:37 +00:00
ecastrolt 357d789540 *** empty log message *** 2005-06-06 18:04:54 +00:00
michaelpenne 855aa8f8d6 bug fix: updated the link to the grade book 2005-06-06 17:35:02 +00:00
bobopinna 42d3772a3f Fixed a typo 2005-06-06 11:58:59 +00:00
ikawhero 3d1f6ce525 Fixed a few minor typos. 2005-06-06 10:08:27 +00:00
ikawhero 1244ed75d2 Check to see if a scale grade exists for the given grade and if not set it
to an empty string. This should never occur through normal use but just
in case ...
2005-06-06 09:45:17 +00:00
moodler ac757a9fad file category.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:50 +0000 2005-06-06 06:16:27 +00:00
moodler 194726468d file weight.html was added on branch MOODLE_15_STABLE on 2005-06-08 14:29:50 +0000 2005-06-06 06:16:27 +00:00
moodler ecbf88d217 Bumping release name 2005-06-06 06:09:07 +00:00
moodler bc9cec3cd6 Updated version for release 1.5 2005-06-06 05:21:11 +00:00
moodler f9cff66906 Merged all the changes in HEAD until now 2005-06-06 05:04:31 +00:00
ikawhero 5450baa28a Added a 'Save Changes' button to the top of the page for those of us too
lazy to scroll!
2005-06-06 03:35:28 +00:00
ikawhero 422eaecc13 Check array is initialised. Bug 3424. 2005-06-06 00:39:35 +00:00
moodler e10ed4e667 file preferences.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:48 +0000 2005-06-06 00:13:12 +00:00
moodler ecfbaad4b4 file preferences.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:28 +0000 2005-06-06 00:13:12 +00:00
ikawhero e4cedd797a Errors will now return to course page instead of site. Related to Bug 3418. 2005-06-05 23:57:19 +00:00
gustav_delius 9dadc1a89e Regrading now used the proper session mechanism. Also it now works with old-style attempts which have only a single state. 2005-06-05 20:37:52 +00:00
moodler 5b0ae9d41c file student.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:13 +0000 2005-06-05 20:33:47 +00:00
gustav_delius 2ac3cee674 Restoring of user attempts and states disabled for now, see bug 3159 2005-06-05 20:25:04 +00:00
gustav_delius f3bb54f36f Fixed typo 2005-06-05 20:19:17 +00:00
moodler e8edd40064 file exceptions.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:13 +0000 2005-06-05 19:56:09 +00:00
moodler b1120b07c9 file letter.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:13 +0000 2005-06-05 19:56:09 +00:00
moodler 00fcb704d3 file weight.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:13 +0000 2005-06-05 19:56:09 +00:00
moodler 2b1ebff73c file preferences.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:13 +0000 2005-06-05 19:56:09 +00:00
moodler 26549e7692 file category.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:13 +0000 2005-06-05 19:56:08 +00:00
moodler efd780a339 file teacher.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:13 +0000 2005-06-05 19:24:45 +00:00
urs_hunkler 0c4a965346 mainly corretion for a disply problem of the course page in MSIE plus some minor changes. 2005-06-05 16:38:01 +00:00
gustav_delius 7371dc44d0 removed some unnecessary fields 2005-06-05 15:52:18 +00:00
gustav_delius 16a8215aa1 just fixing some comments 2005-06-05 15:37:22 +00:00
gustav_delius 6d0ea08227 taken out a notice to temporarily fix bug 3130 2005-06-05 15:08:34 +00:00
gustav_delius 85a6b27786 Fixed the calculated question editing wizard temporarily for Moodle 1.5 until Julian gets his new version ready. 2005-06-05 14:14:54 +00:00
gustav_delius db7f11c3d7 fixed some typos 2005-06-05 13:59:37 +00:00
gustav_delius 98133a3eec Random questions now store both the wrapped question id and the response in the same state record, essentially going back to Julian's model. 2005-06-05 13:22:03 +00:00
moodler 52de50d2d5 Just a small fix for people tracking betas 2005-06-05 13:11:05 +00:00
gustav_delius 122299654f Improved the display of readonly form fields in questions so that they are no longer grey on grey 2005-06-05 12:03:50 +00:00
gustav_delius 52fa982eba Change to when newly created states get saved
Changes to what is printed during regrade
2005-06-05 11:49:32 +00:00
stronk7 5eab4b5c43 Removed reference to Journal (Diario in es) 2005-06-05 10:09:32 +00:00
stronk7 e68e7af8ed Merged from HEAD... 2005-06-05 09:46:33 +00:00
moodler 2e52e3c14b file gradinggrade.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:04:30 +0000 2005-06-05 08:55:11 +00:00
moodler 2be7e8b347 file grading.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:04:30 +0000 2005-06-05 08:49:33 +00:00
moodler b8187e5ae0 file grade.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:04:30 +0000 2005-06-05 08:44:38 +00:00
thepurpleblob 74be4f9a8d Removed reference to Journals. 2005-06-05 07:37:16 +00:00
moodler cb21e292fa file penalty.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:04:31 +0000 2005-06-05 07:31:24 +00:00
moodler 3a8e6b5f4b file adaptive.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:04:31 +0000 2005-06-05 07:31:24 +00:00
thepurpleblob cdd11103b7 Removed reference to Journal 2005-06-05 07:24:46 +00:00
thepurpleblob dab41ccfdc Removed reference to Journal. 2005-06-05 07:11:44 +00:00
thepurpleblob 49e8438753 Removed references to Journal. 2005-06-05 06:51:09 +00:00
thepurpleblob 12c3f08cb0 Removed reference to journals. 2005-06-05 06:47:02 +00:00
thepurpleblob 2f6b3b1966 Removed references to journals. 2005-06-05 06:44:09 +00:00
moodler 9d39272ded Added support for $CFG->allowobjectembed in the GUI 2005-06-05 05:39:25 +00:00
moodler 14bc8df569 Added $CFG->allowobjectembed in weblib.php so that these can be selected by admin 2005-06-05 05:25:02 +00:00
moodler 6dca5725ea file nextpageaction.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:49 +0000 2005-06-05 03:48:41 +00:00
moodler bf3932fc42 file nextpageaction.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:29 +0000 2005-06-05 03:48:40 +00:00
moodler 2c8a7e32db Turn off script access for autoembedded flash SC126 2005-06-05 03:31:44 +00:00
gustav_delius 3c76674f76 More graceful behaviour when there are not enough questions for the random questions. 2005-06-04 22:43:28 +00:00
ecastrolt fba559da7a *** empty log message *** 2005-06-04 21:07:57 +00:00
moodler 468f3c1cc4 file webquest.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:16 +0000 2005-06-04 20:05:32 +00:00
moodler fe0df5f546 file tex.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:16 +0000 2005-06-04 20:05:32 +00:00
moodler 370454c947 file workshop.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:16 +0000 2005-06-04 20:05:32 +00:00
moodler 3010db0e48 file wiki.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:16 +0000 2005-06-04 20:05:32 +00:00
moodler ae6a28706b file survey.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:16 +0000 2005-06-04 20:05:32 +00:00
moodler 63fd025955 file scorm.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:16 +0000 2005-06-04 20:05:32 +00:00
moodler f5e2a57092 file resource.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:16 +0000 2005-06-04 20:05:32 +00:00
moodler 1edf4fcaa6 file mediaplugin.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:32 +00:00
moodler 191ac5e692 file questionnaire.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:32 +00:00
moodler ad50e44876 file label.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:32 +00:00
moodler 1a833b187a file multilang.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:32 +00:00
moodler 5983511872 file message.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:32 +00:00
moodler df644c8811 file pix.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:32 +00:00
moodler 52183b89b1 file lesson.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:32 +00:00
moodler cfe70c4f90 file exercise.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:31 +00:00
moodler 98a68126ed file journal.php.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:31 +00:00
moodler 39538ed31a file grades.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:31 +00:00
moodler 42bdd31e68 file hotpot.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:31 +00:00
moodler d0fa39395c file install.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:31 +00:00
moodler 737d922645 file glossary.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:15 +0000 2005-06-04 20:05:31 +00:00
moodler 5e3b40221a file block_rss_client.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler fd91ea6371 file block_course_list.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler cee15d365b file countries.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler c29cc45005 file block_online_users.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler 2db4405ca0 file attendance.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler 2e3d0ff372 file editor.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler fe2c9820e8 file algebra.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler 72df247c50 file censor.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler d35f4bcabd file enrol_paypal.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler a46eb2ee08 file enrol_ldap.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler 18ac802f51 file dialogue.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler d520a0a173 file emailprotect.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler e264c29fa1 file appointment.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler 406d542d00 file block_html.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler a02176516b file block_course_summary.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler 27b0d869e6 file admin.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler 21971c4ed0 file calendar.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler e1c24a9dba file block_social_activities.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler dcb1b0cbdf file enrol_database.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler 9c94bb15aa file enrol_flatfile.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler bec8a5ca4b file error.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler cee8d7fb63 file block_quiz_results.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler 5a67edcc09 file enrol_internal.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
moodler c5f0945604 file block_section_links.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:14 +0000 2005-06-04 20:05:31 +00:00
defacer ff642e93ba Fixing all Tidy warnings in this page. This has to be A Good Thing. 2005-06-04 17:43:52 +00:00
gustav_delius 5ebe26c7d0 fixed typo 2005-06-04 17:22:00 +00:00
gustav_delius a616b09790 The versioning code will not be in Moodle 1.5 2005-06-04 17:13:26 +00:00
stronk7 e64dfa80dd Changed name of the container category a bit and avoided one notice. 2005-06-04 15:37:40 +00:00
gustav_delius 4a4d46cade slight improvement of layout 2005-06-04 11:40:57 +00:00
moodler 905746771f file quiz_analysis.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:04:05 +0000 2005-06-04 11:25:51 +00:00
moodler 82a838920f file block_search_forums.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:04:03 +0000 2005-06-04 11:25:51 +00:00
moodler d913dc4244 file enrol_authorize.php was added on branch MOODLE_15_STABLE on 2005-06-06 05:04:03 +0000 2005-06-04 11:25:51 +00:00
gustav_delius 4aa3ac1609 Print notice on preview when secure window will be used for students
Also improved some language strings
2005-06-04 11:19:48 +00:00
gustav_delius 775d4dd817 Print notice on preview when secure window will be used for students 2005-06-04 11:16:37 +00:00
gustav_delius e0b0ef395f Show link to attempts list only if student attemtps exist. 2005-06-04 11:10:36 +00:00
mindforge a21fc2b7c9 Cleaned up and documented regrading code. 2005-06-04 11:04:00 +00:00
mindforge aee2784751 Manual regrading page implemented. 2005-06-04 10:58:31 +00:00
ikawhero 3e41bf36a3 Link to add new courses only shown to course creators when there are no
courses available. Bug 3420.
2005-06-04 10:39:57 +00:00
urs_hunkler cf26a12c62 corrected width of the middle column in course view. 2005-06-04 09:16:20 +00:00
gustav_delius 90abc87934 attempts.php has moved to report/overview/report.php 2005-06-04 09:10:13 +00:00
gustav_delius 8c040068ca Removed the quiz upgrade warning. 2005-06-04 09:07:40 +00:00
gustav_delius 67a8ef4235 removing the old statistics reports 2005-06-04 08:58:16 +00:00
gustav_delius c17f91905a put back the overview report folder 2005-06-04 08:55:37 +00:00
gustav_delius 1b2457c312 added regrading page 2005-06-04 08:54:56 +00:00
gustav_delius 2fbd81b02d Fixed bug 3410. Admins are no longer shown ALL categories in drop-down menu. 2005-06-04 08:47:33 +00:00
gustav_delius e729020eda Improve alignment in table in mod.html for IE
Missing questions lead to notice rather than fatal error
Attempts report now moved to reports/overview
put in empty regrading page for Julian to complete
Moved some of the styles out of styles.php into standard style
Fixed error on reviewquestion.php
put infobox on reviewquestion.php
fixed <form> tag on item analysis report
2005-06-04 08:30:49 +00:00
defacer 6e296332ca Fix for bug 3316: Now students which have attempted the quiz but have
since been unenrolled from the course are shown with a dimmed style.
2005-06-04 00:18:57 +00:00
defacer 94640580f3 Forgot to prepend country codes to the teacher list as well when sorting. 2005-06-03 23:40:19 +00:00
defacer 113130bd32 Adding one new string: "Show $a per page" 2005-06-03 23:31:06 +00:00
defacer 1443433431 CSS styles for the revamped user/index.php 2005-06-03 23:26:31 +00:00
defacer 4fd2dff9fe A big big big patch:
Converted the students table to use the new table class

Fixed bug 3114: when sorting by country, prepend country code to the country name

Fixed behavior of autohiding teacher list; now there is a hide/show icon to be
consistent with the rest of Moodle

Fixed "show all" option so that the user can control it instead of relying on auto behavior

Fixed HTML, removed all inline styles

Improved accessibility (alt tags for images)

Updated obsolete optional_variable calls to optional_param

Several cosmetic and other improvements I 've already forgotten :P
2005-06-03 23:19:12 +00:00
defacer 680da3b4af Added function that exports current selection for first/last initial
Added extra CSS class to initial bars (can now differentiate first/last)
2005-06-03 22:46:54 +00:00
moodler dc0d77760a file maxpages.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:49 +0000 2005-06-03 21:53:41 +00:00
moodler c700b6c43b file review.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:49 +0000 2005-06-03 21:53:41 +00:00
moodler adb2f6e2fc file highscores.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:49 +0000 2005-06-03 21:53:41 +00:00
moodler def727dc7d file maxpages.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:29 +0000 2005-06-03 21:53:41 +00:00
moodler c5d16299de file review.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:29 +0000 2005-06-03 21:53:41 +00:00
moodler 93b2625047 file highscores.html was added on branch MOODLE_15_STABLE on 2005-06-06 05:03:28 +0000 2005-06-03 21:53:41 +00:00
gustav_delius b769175004 The popup window didn't always close. 2005-06-03 20:43:50 +00:00
stronk7 816f68c8aa Upgraded backup/restore TODO list. Only two points remains open:
- SCORM: restore. See bug 3404.
- QUIZ: 1.5 <=> 1.5 backup and restore. Gustav's team is polishing it.

Bump to 1.5 (Final)
2005-06-03 17:43:46 +00:00
stronk7 c3f0763f7b Added support for forum->trackingtype 2005-06-03 17:35:27 +00:00
moodler e0dcb5734f Merged many language files from HEAD 2005-06-03 17:17:15 +00:00
stronk7 321aae1d8b Small typo, preventing group events to be restored properly.
Records in backup_ids table must use the name of the table
without the prefix as name. Bug 3360. Thanks Jon.
(http://moodle.org/bugs/bug.php?op=show&bugid=3360)
2005-06-03 16:43:26 +00:00
ikawhero 9bb32eb744 Meaningful string shown in breadcrumb and heading when editing site topic.
Bug 3408.
2005-06-03 14:41:35 +00:00
mindforge 2c20f70dca Fix for bug #3357. Random questions now check properly if a question is already in use. 2005-06-03 12:56:53 +00:00
stronk7 a3247baa3a Bump!
Deletion (or move to site course) of orphan categories
executed in the upgrade process. Now we shouldn't have
such orphans anymore! B-)

Part of bug 2459
(http://moodle.org/bugs/bug.php?op=show&bugid=2459)

Important NOTE: In the upgrade code for postgreSQL I've included
                some steps that weren't up to date. They seem to
                standard SQL code but they should be tested
                properly.... hope all works!
2005-06-03 12:49:16 +00:00
stronk7 c0624b017b Deletion (or move to site course) of orphan categories
executed in the upgrade process. Now we shouldn't have
such orphans anymore! B-)

Part of bug 2459
(http://moodle.org/bugs/bug.php?op=show&bugid=2459)

Important NOTE: In the upgrade code for postgreSQL I've included
                some steps that weren't up to date. They seem to
                standard SQL code but they should be tested
                properly.... hope all works!
2005-06-03 12:47:44 +00:00
moodler 81b1951adf Labels can now have apostrophes again! :-) bug 3411 2005-06-03 12:21:16 +00:00
moodler 73c1140d6a Fix for Bug 3036. (SE) 2005-06-03 08:15:38 +00:00
moodler 20fe7276ff Merged French from HEAD 2005-06-03 05:25:09 +00:00
moodler dd8fb6e848 file autocontinue.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:10 +0000 2005-06-03 03:55:38 +00:00
moodler 1ece975598 file browsemode.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:10 +0000 2005-06-03 03:55:38 +00:00
moodler 4308feffbd file height.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:10 +0000 2005-06-03 03:55:38 +00:00
moodler 66674833f6 file maxgrade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:10 +0000 2005-06-03 03:55:38 +00:00
moodler 578462059e file width.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:10 +0000 2005-06-03 03:55:38 +00:00
moodler bd8b6c6f0e file summary.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:10 +0000 2005-06-03 03:55:38 +00:00
moodler e5e43b42ec file package.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:10 +0000 2005-06-03 03:55:38 +00:00
moodler f309507a9f file grademethod.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:10 +0000 2005-06-03 03:55:38 +00:00
moodler 5c3cf81dfb file navigation.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-06-03 03:55:38 +00:00
moodler 5bf11225c4 file analysistable.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-06-03 03:55:38 +00:00
moodler c10f0b5df7 file reportselector.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-06-03 03:55:38 +00:00
moodler abac5c2107 file mediaplayers.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-06-03 03:55:38 +00:00
moodler d6c5e20610 file forceplugins.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-06-03 03:55:38 +00:00
moodler b9b4610906 file responsestable.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-06-03 03:55:38 +00:00
moodler 03231ca0b3 file outputformat.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-06-03 03:55:38 +00:00
moodler 6d53e3b77d file shownextquiz.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-06-03 03:55:38 +00:00
martinlanghoff a0b22b3218 auth/ldap : minor html fix 2005-06-03 03:41:16 +00:00
moodler 0db7057a78 file browsemode.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-06-02 22:31:41 +00:00
moodler 7bc02fa10a file maxgrade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-06-02 22:31:41 +00:00
moodler 01737697a4 file grademethod.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-06-02 22:31:41 +00:00
moodler 2eb6412ef8 file maxgrade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:24 +0000 2005-06-02 22:31:40 +00:00
moodler 4fad751ed9 file grademethod.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:24 +0000 2005-06-02 22:31:40 +00:00
moodler e32e7ca09c file browsemode.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:24 +0000 2005-06-02 22:31:34 +00:00
moodler da7d308c32 Disable Attendance in core tables because the module has been deleted 2005-06-02 15:01:12 +00:00
moodler 4a625f17af Remove attendance from 1.5 too 2005-06-02 14:59:38 +00:00
exe-cutor 9fa1dad004 Adapted Shibboleth authentication to new field lock/update mechanism by Martin 2005-06-02 14:34:22 +00:00
moodler 651dfa878e file itemanalysis.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-06-02 13:57:26 +00:00
urs_hunkler 50da41e264 some theme optimizations: manly font-sizes and the list pages. 2005-06-02 12:31:35 +00:00
martinlanghoff 6406bef13e Fixed typo in configuration of ldap_memberattribute for RFC2307-style LDAP servers. Should fix handling of iscreator group. Thanks to Teemu Haapoja for the diagnosis and fix. 2005-06-02 09:55:06 +00:00
martinlanghoff 5a2cfa7efb Version bump triggers config_plugin migration for locks and field mapping. 2005-06-02 04:25:36 +00:00
moodler 0bb30298d0 file nelements.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-06-02 02:46:18 +00:00
moodler 37553f8493 file managing2.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-06-02 02:46:18 +00:00
moodler 1761c44531 file regrading.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-06-02 02:46:18 +00:00
moodler d1869b995e file managing.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-06-02 02:46:18 +00:00
moodler 5e01a18606 file gradingstrategy.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-06-02 02:46:18 +00:00
moodler 1ef00c891f file password.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-06-02 02:46:18 +00:00
moodler 2d910a2d08 file gradinggrade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-06-02 02:46:18 +00:00
moodler 3b61c3c5d6 file elements.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-06-02 02:46:17 +00:00
moodler 17dec907b9 file grade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-06-02 02:46:17 +00:00
moodler c90daf0b4b file comparisonofassessments.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-06-02 02:46:17 +00:00
moodler a69f876e76 file removepages.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler a960f39fbb file wikitype.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler 474ce18912 file strippages.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler 6c8f0ed5a8 file initialcontent.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler 5ace54167e file htmlmode.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler d981f1b6e3 file wikilinkoptions.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler 0810574be1 file ewikiacceptbinary.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler ee5b1788f7 file setpageflags.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler 9a6222dd38 file revertpages.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler 46cc45f293 file checklinks.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler 8e8380fb97 file revertauthorfieldpattern.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler 5aef10640e file wikiname.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler b34d0917a6 file howtowiki.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler 1067cb28f1 file wikiusage.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler f94e02f057 file studentadminoptions.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-06-02 02:46:17 +00:00
moodler fec8049d34 file leaguetable.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler a111b749fc file finalgrades.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-06-02 02:46:17 +00:00
moodler f42449f77e file nelements.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler cc13541244 file takeownership.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler d67ad45602 file submissionofdescriptions.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler 0ef063825f file moreinfo.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler 09be6630de file usemax.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler 26b9be1d7a file regrading.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler 10692d97e6 file leaguetablenames.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler f327821e4e file grade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler b9fc85815e file usepassword.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler 312f8b5410 file specimen.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler 6d163e8a59 file grading.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler 888faa0559 file managing.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler 62dec3d6b5 file gradingstrategy.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler 06979a542b file password.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler 2f4ae7848b file gradinggrade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:06 +0000 2005-06-02 02:46:17 +00:00
moodler 9199bfc986 file elements.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-06-02 02:46:17 +00:00
moodler 3fde815636 file administration.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-06-02 02:46:17 +00:00
moodler ea6787cb2f file comparisonofassessments.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-06-02 02:46:17 +00:00
moodler 4f0f9f52c6 file info.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-06-02 02:46:17 +00:00
moodler e628acf30d file dialoguetype.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-06-02 02:46:17 +00:00
moodler 97d94ab7f2 file addsubject.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-06-02 02:46:17 +00:00
moodler 675522cb1b file multiple.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-06-02 02:46:17 +00:00
moodler 69f2570655 file deleteafter.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-06-02 02:46:17 +00:00
moodler 9206c92895 file closedialogue.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-06-02 02:46:17 +00:00
moodler d3f8a394bc file maildefault.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-06-02 02:46:17 +00:00
moodler de735d30a8 file reportselector.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-06-02 00:52:14 +00:00
moodler 8afa0586cc file reportselector.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:23 +0000 2005-06-02 00:52:14 +00:00
gustav_delius 72a054b9f9 Fixed bug 3393 2005-06-01 20:07:50 +00:00
zibas 643f215f0a file xsl_emulate_xslt.inc was added on branch MOODLE_15_STABLE on 2005-06-07 14:21:19 +0000 2005-06-01 19:32:52 +00:00
moodler 6acfcce9a8 file itemanalysis.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:55 +0000 2005-06-01 19:24:17 +00:00
gustav_delius 6be3c99802 replaced some error() by redirect() 2005-06-01 18:34:24 +00:00
gustav_delius 20101a6092 Improved error messages a bit 2005-06-01 18:16:52 +00:00
moodler 4d044e6e84 SQL should not assume mdl_ prefix on tables (bug 3390) 2005-06-01 08:08:37 +00:00
martinlanghoff d08c400d31 auth fieldlocks: smarter handling of UI strings for user fields 2005-06-01 08:05:28 +00:00
martinlanghoff 770764f392 config_plugins settings migration -- this is a DB upgrade block 2005-06-01 07:47:49 +00:00
martinlanghoff 4f6af1254b get_config() now preserves CFG if DB fails or is empty 2005-06-01 06:57:09 +00:00
martinlanghoff e3cd7f35b9 config_plugin with auth/shibboleth
* config.html now uses print_auth_lock_options()
 * config.html better handling of default vars, and removed some warnings
 * lib.php uses new config_plugin vars
2005-06-01 06:23:44 +00:00
martinlanghoff 2ba609cc8c config_plugin work
* lang updates and lang-related fixes
 * auth/db uses the new convention
2005-06-01 06:01:29 +00:00
gustav_delius 3d7a1cbf2b A missing ! led to bug 3377 2005-06-01 05:56:46 +00:00
martinlanghoff b50eee807b Almost there with config_plugins work!
* More solid checking for auth GET/POST var.
 * print_auth_lock_options() now handles user field mapping options for LDAP and similar modules
 * user mapping options have moved to config_plugins table
 * LDAP module has migrated to using new field mapping vars -- simplified config.html a lot
 * strings are mostly resolved
 * a bit of work pending on CAS and DB modules
 * need an upgrade path for field-mapping config entries -- limited to LDAP only
2005-06-01 04:44:17 +00:00
martinlanghoff 6b64601101 Bumping the revision for the config_plugins table. 2005-06-01 02:28:33 +00:00
moodler 28d21ce79e file gradingstrategy.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:27 +0000 2005-06-01 01:15:06 +00:00
moodler 07387b3124 file gradingstrategy.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:24 +0000 2005-06-01 01:15:06 +00:00
moodler df699778c4 file autocontinue.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 23:34:37 +00:00
moodler 2d7915885a file browsemode.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 23:34:37 +00:00
moodler 9d24e151bc file height.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 23:34:37 +00:00
moodler 9fbed4dc26 file maxgrade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 23:34:37 +00:00
moodler 9896fa3de5 file mods.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 23:34:37 +00:00
moodler ea5cb3bbde file width.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 23:34:37 +00:00
moodler 732216d72a file summary.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 23:34:37 +00:00
moodler b08068e829 file package.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 23:34:37 +00:00
moodler 1622a2d06f file grademethod.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 23:34:37 +00:00
moodler 0d4a213943 Better handling of dates when timedue isn't set 2005-05-31 23:28:08 +00:00
moodler 98823d2ac0 Hide due date when there isn;t one 2005-05-31 23:18:54 +00:00
moodler facf76eede Added event handling from trunk 2005-05-31 23:02:44 +00:00
moodler 41591a4a17 file categories_edit.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 22:48:21 +00:00
moodler cd22423ceb file penalty.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 22:48:21 +00:00
moodler 479c8e5958 file penaltyscheme.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 22:48:21 +00:00
moodler 271228d527 file analysisoptions.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 22:48:21 +00:00
moodler d592dc462d file questionsperpage.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 22:48:21 +00:00
moodler bfaf3c876b file adaptive.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 22:48:21 +00:00
moodler 3954fbf809 file rqp.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:15 +0000 2005-05-31 22:48:21 +00:00
stronk7 c63bcbf27c Complete refactor of quiz_delete_course()
Now this function works following this:
- Iterate over every quiz category in the course (following parent-child relationships).
- If the category is being used*, move it to site level (under a container category) and
      mark it as published.
- If the category isn't being used, remove** it completely (questions, instances...) and
      re-parent its child categories.
- Feedback is shown in a table detailing all the changes performed.

* One category is being used if it has one question that is being used in any quiz,
  independently of its publish status.
** Removal of categories (and associated questions) has benn improved but, it won't
  be perfect until bug 3366 was solved.

Tested against some large courses with reused questions and multiple levels of
categories. Seems to work but

PLEASE TEST IT AND SEND ANY FEEDBACK TO BUG 2459
(http://moodle.org/bugs/bug.php?op=show&bugid=2459)

Exactly this function is going to be used in the upgrade script to solve
the orphan categories issue and it must work perfectly!
2005-05-31 22:31:22 +00:00
stronk7 0242dc70f3 Four new strings added to show the work done
against quiz_categories when a course is deleted.
Part of bug 2459
(http://moodle.org/bugs/bug.php?op=show&bugid=2459)
2005-05-31 21:26:09 +00:00
moodler 25957101a8 file responsestable.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-05-31 20:23:27 +00:00
moodler 6d079b698f file responsestable.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:23 +0000 2005-05-31 20:23:27 +00:00
stronk7 0456f1c62a Simplify the quizzes_category_used() function.
I was using the $excluded parameter to avoid
loops between categories. A->B->A. Think we can
assume such loops won't exist, so I've deleted
the $excluded use.
2005-05-31 16:30:36 +00:00
thepurpleblob 5c6c7224eb Took out dos line endings 2005-05-31 15:17:20 +00:00
thepurpleblob a40014f758 Removed spurious aligns in <input> tags for optional units - now formats
properly in Apple Safari
2005-05-31 14:45:05 +00:00
thepurpleblob 53b9b145ab Fixed incorrect !important tags in CSS 2005-05-31 14:21:28 +00:00
thepurpleblob ded3459821 'Fixed' quizzes_category_used declaration to make it work. Based on it only
being called in one place. Might need a 'proper' fix though, but this gets us
moving!
2005-05-31 13:34:15 +00:00
thepurpleblob 331b64ac3f Removed uneccessary call-time pass by reference. 2005-05-31 10:11:00 +00:00
thepurpleblob b89246267b Checks import/export class file actually exists before trying to include it. 2005-05-31 10:02:48 +00:00
martinlanghoff cdbba24134 First cut of field locks support. functional but missing strings and support for LDAP/DB modules.
- Extended set_config()
- Implemented get_config() which takes over $CFG loading in setup.php
- admin/auth.php has special handling if post vars starting in pluginconfig_
- admin/auth.php print_auth_lock_options() prints a form fragment -- being called from most plugins now
- user/edit.php follows the new convention when locking down fields, both javascript UI and on POST.
2005-05-31 05:36:41 +00:00
moodler fa84313875 file quiz_analysis.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:06 +0000 2005-05-31 05:13:33 +00:00
moodler e2d02f322e file timezones.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:06 +0000 2005-05-31 05:13:33 +00:00
moodler 2b545bff3b file block_search_forums.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:05 +0000 2005-05-31 05:13:33 +00:00
moodler ec0e8976e9 file block_glossary_random.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:05 +0000 2005-05-31 05:13:33 +00:00
moodler 24ad970192 file grades.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:05 +0000 2005-05-31 05:13:33 +00:00
moodler 83bf0c7ac3 file block_html.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:05 +0000 2005-05-31 05:13:33 +00:00
moodler 2a55ad8736 file block_quiz_results.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:05 +0000 2005-05-31 05:13:33 +00:00
moodler 25b68ad11e Fix for SC122 2005-05-31 04:36:04 +00:00
moodler d347fbefd6 file qtype.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-05-31 01:48:07 +00:00
moodler 6124af76ab file questionnaireid.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-05-31 01:48:07 +00:00
moodler 893e4ecc77 file qmanage.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-05-31 01:48:07 +00:00
moodler f5925fe29a file respondenttype.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:08 +0000 2005-05-31 01:48:07 +00:00
moodler d07e7183e6 file casesensitive.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler c82589c6b5 file editalways.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 2c0436b1a6 file importcategories.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler a1e04405ff file aliases2.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 0516af71ef file globalglossary.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 8f459f900b file usedynalink.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 866885022f file aliases.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 350ad0ef85 file entbypage.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 6b73dbaa20 file rssarticles.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 291f7bd8ba file studentcanpost.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 40fb06a8d0 file allowprintview.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler c4563fe0fb file shows.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 17c9ed588d file mainglossary.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 9480b8f1f4 file linkcategory.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 6c45d66129 file allowduplicatedentries.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler ae29b65979 file destination.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler e43dd3defa file defaultapproval.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 02c71b5a1e file filetoimport.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler b6f1f29147 file rsstype.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 6b9ab9e4fc file attachment.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler cffd20cede file usedynalinkentry.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 3372fd30ff file description.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 8353441838 file allowcomments.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 5d213075c3 file displayformat.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler 5da1448d69 file fullmatch.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-31 01:48:07 +00:00
moodler cc082cb176 file dynsection.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-31 01:48:07 +00:00
moodler 53e1d700bf file hours.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-31 01:48:07 +00:00
moodler b9441c6e63 file maxgrade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-31 01:48:07 +00:00
moodler 98aa5c1e21 file choosedays.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-31 01:48:07 +00:00
moodler fa43dc51f8 file grade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-31 01:48:07 +00:00
moodler ef405b2a1b file autoattend.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-31 01:48:07 +00:00
moodler 58c4dc24c7 file penaltyscheme.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-05-31 00:12:27 +00:00
moodler 741ee69fad file questionsperpage.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-05-31 00:12:27 +00:00
moodler 754e6ee60b file penaltyscheme.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:24 +0000 2005-05-31 00:12:27 +00:00
moodler 780d107619 file questionsperpage.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:24 +0000 2005-05-31 00:12:27 +00:00
stronk7 61842c3a01 Added the sort_categories_by_tree() function that
returns an ordered array of categories following
the parent-child relationships. It doesn't forget
any category and returns all the categories passed
although their parent were incorrect. Try to build
as much tree structure as possible.
2005-05-30 23:56:38 +00:00
mjollnir_ 8c28ed7838 Fixing up problem in generate_email_processing_address -- using sitesecret rather than siteidentifier 2005-05-30 23:25:56 +00:00
martinlanghoff 8bfac5b93d Fixed field lenght in config_plugins 2005-05-30 22:30:50 +00:00
stronk7 6d64a7091d Deleting one debug message... 2005-05-30 22:27:20 +00:00
stronk7 22ad0a2e45 Now the quizzes_category_used() function supports searching
for uses recursively plus an array of excluded categories.

Needed to solve bug 2459...in progress.
2005-05-30 22:25:52 +00:00
moodler e8eaff0171 file analysisoptions.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:55 +0000 2005-05-30 22:07:12 +00:00
moodler f3bfb270af Fixed _new with _blank 2005-05-30 18:42:41 +00:00
moodler 260d699c17 Added limit of 900 characters to subject line, to prevent overflows 2005-05-30 18:09:03 +00:00
defacer bb25fc1bca Fix for bug 3364:
The Great Global $course Hack strikes again. I had to put in another instance
of the hack for course themes to work in the "calendar" part of the course.

Hopefully some day we 'll do all that "correctly"! (search for "hack" in
weblib and despair).
2005-05-30 13:31:44 +00:00
defacer 7bc4158521 More correct handling of group events, we cannot simply omit them because
the course has "no groups" UNLESS groupmodeforce == 1 as well.

Sadly, this severely weakens the performace optimizations :(

See bug 3303 for an example of what the problem was before.
2005-05-30 12:40:44 +00:00
mudrd8mz a0028106e3 Included fix by Jaime Villate posted Sunday, 8 May 2005, 10:45 PM 2005-05-30 09:31:28 +00:00
martinlanghoff fc0ee03121 Capture the outcome of the config_plugins table creation. 2005-05-30 05:24:19 +00:00
martinlanghoff 987d846223 Created config_plugins table to manage configuration entries on a per-module/plugin. This breaks the rules a little bit, but it has been discussed with MD. 2005-05-30 05:10:22 +00:00
martinlanghoff e7c83f42ef enrol/ldap offers enrol_allowinternal config option as it should. 2005-05-30 03:51:07 +00:00
moodler c8198e1311 file summary.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-05-30 01:49:53 +00:00
moodler 17620a4193 file package.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-05-30 01:49:53 +00:00
moodler 61b7abf279 file summary.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:24 +0000 2005-05-30 01:49:52 +00:00
moodler 4be10f9c9d file package.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:24 +0000 2005-05-30 01:49:52 +00:00
watcanz 606f29ff1d styles_layout.css updated for new sideblocks code. header.html removed logo. 2005-05-30 00:02:22 +00:00
ecastrolt 6a43c2aae4 *** empty log message *** 2005-05-29 20:50:14 +00:00
ecastrolt 29a4e4e556 *** empty log message *** 2005-05-29 19:45:14 +00:00
ecastrolt c65086aab0 *** empty log message *** 2005-05-29 19:36:41 +00:00
stronk7 6d85897f87 Added the quizzes_category_used() to detect the list of
quizzes that are using questions from one category.
It relies in the quizzes_question_used() function. Will
be use in the 'orphan_categories' bug (#2459)

(http://moodle.org/bugs/bug.php?op=show&bugid=2459)
2005-05-29 18:58:14 +00:00
stronk7 83c5e8f6b1 format_string() applied once deleting courses...
Merged from HEAD
2005-05-29 17:32:18 +00:00
moodler 3d8a508910 Fix for bug 3350 where older SESSION->wantsurl was hanging around 2005-05-29 07:58:37 +00:00
moodler cb9b40a576 file book.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:14 +0000 2005-05-29 07:07:18 +00:00
moodler e21964e8b0 file timerestrict.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-05-29 06:48:37 +00:00
moodler d15938ce5f file limit.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-05-29 06:48:37 +00:00
moodler 22f52e2bf3 file options.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-05-29 06:48:37 +00:00
moodler b6f8c22bc3 file chatting.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:05 +0000 2005-05-29 06:48:36 +00:00
moodler c89d8d7636 file resubmit.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-29 06:48:36 +00:00
moodler a17794496c file commentinline.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-29 06:48:36 +00:00
moodler e545ae1876 file types.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-29 06:48:36 +00:00
moodler 236ec5b9b6 file assignmenttype.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-29 06:48:36 +00:00
moodler bae75cb826 file emailteachers.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-29 06:48:36 +00:00
moodler 89552fc789 file search.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:04 +0000 2005-05-29 06:48:36 +00:00
moodler 3684c9f4e2 file authchange.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:03 +0000 2005-05-29 06:48:36 +00:00
moodler db3a8b8a59 file advancedsettings.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:03 +0000 2005-05-29 06:48:36 +00:00
moodler 2b82654492 file cost.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:03 +0000 2005-05-29 06:48:36 +00:00
moodler bb4e105b49 FIxed a problem when stripping terms from search string for highlighting 2005-05-29 04:04:31 +00:00
defacer 1819221450 Now tablelib allows the GET variables that control sorting etc. to be
configured. Essential in order to allow two independent tables in the same
screen, which is required for /user/index.php.
2005-05-28 21:22:45 +00:00
defacer 4ac7b06a76 Revisited blocks administration page!
* Incompatible blocks which have been disabled during the upgrade
     from Moodle 1.4 can now be deleted.

   * Incompatible blocks (if any) are presented in a separate table
     and are clearly marked as such.

   * Using the new table class.

   * Improved visuals.

   * Fixed HTML and updated obsolete coding conventions all around.
2005-05-28 18:36:01 +00:00
defacer 379298d6ae NEW STRING ADDED for admin/blocks.php
One string we no longer use removed.
2005-05-28 18:28:26 +00:00
defacer 49307babf5 New styles for the revisited admin/blocks page, coming up next. 2005-05-28 18:22:28 +00:00
moodler ac6e8f1133 $CFG->ignoresesskey can override all sesskey checking 2005-05-28 14:02:53 +00:00
moodler ce34811cdd Addes mms protocol 2005-05-28 13:29:37 +00:00
moodler 51f2f92ca5 file trackingtype.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:14 +0000 2005-05-28 08:58:56 +00:00
moodler 3bcee5d4c7 Fixed a missing global 2005-05-28 06:38:10 +00:00
moodler 07a5d7cb3e file penalty.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-05-28 01:27:05 +00:00
moodler 7adc79d42c file penalty.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:24 +0000 2005-05-28 01:27:05 +00:00
moodler 069577e929 file ungradedassessments_teacher.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler cffe2e51bd file usepassword.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:13 +0000 2005-05-28 01:04:34 +00:00
moodler 317dbb6f67 file submissionofexamples.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler 0c06ed4263 file selfassessment.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler abb8d37084 file leaguetable.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler f0cffb1e49 file resubmit.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler 16b96bf3c9 file gradingsubmissions.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler e47e30a11f file overallocation.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler 4431f7188f file nattachments.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler 7f6d1637d0 file includeteachersgrade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler 7e01657166 file nassessmentsofteachersexamples.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler 51cb63459b file includeself.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler 5992f232aa file ungradedassessments_student.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler 688d2f7d5b file teacherweight.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler b5cb37d9ea file specimen.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler e892f04d05 file showinggrades.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler 01c784002a file nassessmentsofstudentsubmissions.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler 267a7811fc file ungradedassessments.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:34 +00:00
moodler 0ac29d7f60 file gradingassessments.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:33 +00:00
moodler c975e6afad file finalgrades.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:33 +00:00
moodler 80118a25eb file breakdownoffinalgrade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:33 +00:00
moodler 13bc6270d6 file calculatingfinalgrade.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:33 +00:00
moodler 85b2ee359b file editingacomment.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:33 +00:00
moodler 9cd2e8b3d4 file grading.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:12 +0000 2005-05-28 01:04:33 +00:00
moodler 2dcc168e63 file assessmentofexamples.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-05-28 01:04:33 +00:00
moodler 05f64e893d file addcommenttobank.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-05-28 01:04:33 +00:00
moodler f40c81f9b7 file analysisofassessments.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-05-28 01:04:33 +00:00
moodler fac82b6f2a file agreeassessments.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-05-28 01:04:33 +00:00
moodler d55bcca3a5 file assignmenttype.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-05-28 01:04:33 +00:00
moodler bbc338767a file addingacomment.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-05-28 01:04:33 +00:00
moodler e88d8a3aa4 file anonymous.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:11 +0000 2005-05-28 01:04:33 +00:00
urs_hunkler bb0ceba26d I removed the inlinestyle for the userentry in the sideblock "online user" and added the class "listentry" to the div. The properties of th inline style are now defined in styles_layout.css and stylews_fonts.css. 2005-05-27 17:24:27 +00:00
moodler 2b63e793a2 file analysistable.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-05-27 17:18:47 +00:00
moodler e0514c228d file analysistable.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:23 +0000 2005-05-27 17:18:47 +00:00
moodler 8f92195276 Added an extra style based on the glossary id which might allow
some nice effects.  This idea should probably be extended later,
perhaps with the ability to define the style in the glossary itself.
2005-05-27 14:56:43 +00:00
moodler 4a21ecc113 file block_search_forums.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:19 +0000 2005-05-27 12:25:38 +00:00
moodler 3217988a86 file emailprotect.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:19 +0000 2005-05-27 12:25:38 +00:00
bobopinna 65497822b9 Added AICC API to bug fix a problem with AICC package launch 2005-05-27 09:07:56 +00:00
bobopinna 5bd1036974 file aicc.js.php was added on branch MOODLE_15_STABLE on 2005-05-27 09:07:56 +0000 2005-05-27 09:05:04 +00:00
moodler 01d08c35d6 file quiz_analysis.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:00 +0000 2005-05-27 07:39:59 +00:00
moodler 8415a420df file authchange.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:14 +0000 2005-05-26 23:05:29 +00:00
moodler fa614c0451 file cost.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:14 +0000 2005-05-26 22:40:02 +00:00
moodler 532231e9e8 file retake.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-05-26 20:46:47 +00:00
moodler 98dba5cea6 file retake.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:23 +0000 2005-05-26 20:46:47 +00:00
moodler d29f2368de file slideshow.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-05-26 18:50:09 +00:00
moodler 234c4e5276 file slideshow.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:23 +0000 2005-05-26 18:50:09 +00:00
moodler f5e5206c00 file useeditor.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:26 +0000 2005-05-26 17:30:03 +00:00
moodler d19c7d4459 file useeditor.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:23 +0000 2005-05-26 17:30:03 +00:00
moodler 50e20544b7 Merged stability fix from HEAD 2005-05-26 15:25:47 +00:00
moodler a4f3ee5b1e New string for registration 2005-05-26 14:45:15 +00:00
moodler 192d6a6ea9 A little note for admins looking in the source who might be really annoyed. :-) 2005-05-26 14:44:51 +00:00
moodler 705e3a7f76 Registration is now a bit more in-your-face.
Every six months you get prompted by a slightly annoying button on
the admin page to re-register.  Once you've done so it disappears.
2005-05-26 14:43:31 +00:00
moodler d716e12ac4 More little fixes for the calendar days thing 2005-05-26 12:53:11 +00:00
moodler e8b9d71f03 Fixed Strange calls to get_string for weekdays in calendar
http://moodle.org/mod/forum/discuss.php?d=24476
2005-05-26 12:33:10 +00:00
ethem aabfe78ed5 $CFG 2005-05-26 11:22:30 +00:00
bobopinna e41e727022 Fixed some bugs. Now AICC seems to work. 2005-05-26 10:01:56 +00:00
ethem fcee2e9780 Fixing enrol_allowinternal. 2005-05-26 07:35:45 +00:00
gustav_delius 94acf297c6 Better name for the new function 2005-05-26 07:18:25 +00:00
gustav_delius b94257273c Disabled versioning and re-grading until it is fixed. 2005-05-26 07:11:20 +00:00
moodler fc071f0cfc file adaptive.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:55 +0000 2005-05-25 22:17:18 +00:00
gustav_delius 6680874953 reverted to version before Julian's attempt at fixing bug 3311 2005-05-25 21:41:39 +00:00
defacer dbf8f55057 Er, fix for bug 3334 once more.
If at first you don't succeed...
2005-05-25 17:54:58 +00:00
moodler 477647c885 Updated from HEAD 2005-05-25 16:29:16 +00:00
moodler 8fe1a6a72f file grades.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:59 +0000 2005-05-25 16:28:09 +00:00
moodler 6f1a4d5f55 file lesson.php was added on branch MOODLE_15_STABLE on 2005-06-03 17:16:59 +0000 2005-05-25 16:28:09 +00:00
moodler f96e334571 SOme cleaning up of the code 2005-05-25 16:25:43 +00:00
defacer 14b7da1527 Fixing the other half of bug 3334. 2005-05-25 14:26:28 +00:00
defacer 101415b202 Fixing one half of bug 3334 with the patch provided by the reporter.
Also fixing another unfriendly behavior in that screen.
2005-05-25 14:22:05 +00:00
gustav_delius 11e9ca5af1 updated database creation by exporting from my database that was created by updating from 1.4 2005-05-25 06:02:03 +00:00
moodler a4369a6ac4 file penaltyscheme.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:09 +0000 2005-05-25 02:24:44 +00:00
moodler f0eda67f46 file questionsperpage.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:10 +0000 2005-05-25 02:24:44 +00:00
moodler 3ea6ab6652 file rqp.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:10 +0000 2005-05-25 02:24:44 +00:00
moodler 4597517cf5 file penalty.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:09 +0000 2005-05-25 02:24:44 +00:00
moodler d7a8d13cb4 file itemanalysis.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:09 +0000 2005-05-25 02:24:44 +00:00
moodler 289d8f834b file analysisoptions.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:09 +0000 2005-05-25 02:24:44 +00:00
moodler cb219861eb file adaptive.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:09 +0000 2005-05-25 02:24:44 +00:00
moodler 206f13e19a file ratings.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-25 02:24:44 +00:00
moodler 141f2eb969 file rssarticles.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-25 02:24:44 +00:00
moodler 54c362fdaf file maxattachmentsize.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-25 02:24:44 +00:00
moodler b7f3681c1d file forumtype.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-25 02:24:44 +00:00
moodler c71b977964 file subscription2.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-25 02:24:44 +00:00
moodler f86849b8e5 file subscription.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-25 02:24:44 +00:00
moodler 0d07ff6170 file allowdiscussions.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-25 02:24:44 +00:00
moodler cf1db6bad7 file rsstype.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-25 02:24:44 +00:00
moodler 7e85d1188a file attachment.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-25 02:24:44 +00:00
moodler 76de166ee1 file trackingtype.html was added on branch MOODLE_15_STABLE on 2005-06-03 17:17:07 +0000 2005-05-25 02:24:44 +00:00
defacer 76e2cb0a9b Backporting changes from HEAD 2005-05-24 18:58:02 +00:00
moodler 1b0649d558 Moved some things from People block to Administration. Each of them
will probably be tweaked a little more still.
2005-05-24 16:55:48 +00:00
thepurpleblob 05ac097e4c Now includes missing text re. missingword format suppporting short answer questions. 2005-05-24 16:53:34 +00:00
gustav_delius 4c21136a5b fixed bug 3329 2005-05-24 16:07:10 +00:00
bobopinna d38835ab1b Fixed some typo and bugs
Added support to Moodle 1.4 backup
2005-05-24 15:29:51 +00:00
thepurpleblob b0fe38fc78 Put addslashes around question name - truncate at unlucky point could break sql. 2005-05-24 15:17:07 +00:00
julmis ce2e784b47 Adding buttons:
- nolink
- search and replace
2005-05-24 14:21:00 +00:00
gustav_delius 9114cce39b file report.php was added on branch MOODLE_15_STABLE on 2005-06-04 08:54:56 +0000 2005-05-06 06:24:04 +00:00
gustav_delius 0d00dc375f file report.php was added on branch MOODLE_15_STABLE on 2005-06-04 08:55:37 +0000 2005-05-06 06:24:04 +00:00
moodler 27437410f4 file survey.php was added on branch MOODLE_15_STABLE on 2006-03-10 07:27:54 +0000 2005-04-05 20:54:43 +00:00
15123 changed files with 676316 additions and 823366 deletions
+12256
View File
File diff suppressed because it is too large Load Diff
-339
View File
@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
+35 -36
View File
@@ -1,36 +1,35 @@
README $Id$
------
QUICK INSTALL
=============
For the impatient, here is a basic outline of the
installation process, which normally takes me only
a few minutes:
1) Move the Moodle files into your web directory.
2) Create a single database for Moodle to store all
it's tables in (or choose an existing database).
3) Visit your Moodle site with a browser, you should
be taken to the install.php script, which will lead
you through creating a config.php file and then
setting up Moodle, creating an admin account etc.
4) Set up a cron task to call the file admin/cron.php
every five minutes or so.
For more information, see the INSTALL DOCUMENTATION:
http://docs.moodle.org/en/Installing_Moodle
A local copy can also be found in
lang/en_utf8/help/install.html (or your language)
Good luck and have fun!
Martin Dougiamas, Lead Developer
README $Id$
------
QUICK INSTALL
=============
For the impatient, here is a basic outline of the
installation process, which normally takes me only
a few minutes:
1) Move the Moodle files into your web directory.
2) Create a single database for Moodle to store all
it's tables in (or choose an existing database).
3) Visit your Moodle site with a browser, you should
be taken to the install.php script, which will lead
you through creating a config.php file and then
setting up Moodle, creating an admin account etc.
4) Set up a cron task to call the file admin/cron.php
every five minutes or so.
For more information, see the INSTALL DOCUMENTATION:
http://moodle.org/doc
If you have real trouble, please visit the Moodle course
"Using Moodle" on moodle.org.
Good luck and have fun!
Martin Dougiamas, Lead Developer
+97
View File
@@ -0,0 +1,97 @@
<form name="adminform" id="adminform" method="post" action="admin.php">
<input type="hidden" name="previoussearch" value="<?php echo $previoussearch ?>">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
<table align="center" border="0" cellpadding="5" cellspacing="0">
<tr>
<td valign="top">
<?php
$a->count = count($admins);
$a->items = $strexistingadmins;
print_string('counteditems', '', $a);
?>
</td>
<td></td>
<td valign="top">
<?php
$a->count = $usercount;
$a->items = $strpotentialadmins;
print_string('counteditems', '', $a);
?>
</td>
</tr>
<tr>
<td valign="top">
<select name="removeselect[]" size="20" id="removeselect" multiple
onFocus="document.adminform.add.disabled=true;
document.adminform.remove.disabled=false;
document.adminform.addselect.selectedIndex=-1;">
<?php
if (count($admins) == 1) {
$disabled = 'disabled';
$removebuttontype = 'hidden';
} else {
$disabled = '';
$removebuttontype = 'submit';
}
foreach ($admins as $admin) {
$fullname = fullname($admin, true);
echo "<option value=\"$admin->id\" $disabled>".$fullname.", ".$admin->email."</option>\n";
}
?>
</select></td>
<td valign="top">
<br />
<input name="add" type="submit" id="add" value="&larr;" />
<br />
<input name="remove" type="<?php echo $removebuttontype ?>" id="remove" value="&rarr;" />
<br />
</td>
<td valign="top">
<select name="addselect[]" size="20" id="addselect" multiple
onFocus="document.adminform.add.disabled=false;
document.adminform.remove.disabled=true;
document.adminform.removeselect.selectedIndex=-1;">
<?php
if (!empty($searchusers)) {
echo "<optgroup label=\"$strsearchresults (" . count($searchusers) . ")\">\n";
foreach ($searchusers as $user) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
}
echo "</optgroup>\n";
}
if (!empty($users)) {
foreach ($users as $user) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
}
}
?>
</select>
<br />
<input type="text" name="searchtext" size="30" value="<?php echo $searchtext ?>"
onFocus ="document.adminform.add.disabled=true;
document.adminform.remove.disabled=true;
document.adminform.removeselect.selectedIndex=-1;
document.adminform.addselect.selectedIndex=-1;"
onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
if (keyCode == 13) {
document.adminform.previoussearch.value=1;
document.adminform.submit();
} " />
<input name="search" id="search" type="submit" value="<?php p($strsearch) ?>" />
<?php
if (!empty($searchusers)) {
echo '<input name="showall" id="showall" type="submit" value="'.$strshowall.'" />'."\n";
}
?>
</td>
</tr>
</table>
</form>
+122
View File
@@ -0,0 +1,122 @@
<?PHP // $Id$
// Admin-only script to assign administrative rights to users
require_once("../config.php");
define("MAX_USERS_PER_PAGE", 50);
optional_variable($add, "");
optional_variable($remove, "");
optional_variable($search, "");
if (! $site = get_site()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
require_login();
if (!isadmin()) {
error("You must be an administrator to use this page.");
}
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
$primaryadmin = get_admin();
/// If you want any administrator to have the ability to assign admin
/// rights, then comment out the following if statement
if ($primaryadmin->id != $USER->id) {
error("You must be the primary administrator to use this page.");
}
/// assign all of the configurable language strings
$stringstoload = array (
"assignadmins",
"administration",
"existingadmins",
"potentialadmins",
"search",
"users",
"searchresults",
"showall"
);
foreach ($stringstoload as $stringtoload){
$strstringtoload = "str" . $stringtoload;
$$strstringtoload = get_string($stringtoload);
}
print_header("$site->shortname: $strassignadmins",
"$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> <a href=\"users.php\">$strusers</a> -> $strassignadmins", "adminform.searchtext");
if (!$frm = data_submitted()) {
print_simple_box("<center>".get_string("adminhelpassignadmins")."</center>", "center", "50%");
/// A form was submitted so process the input
} else {
if (!empty($frm->add) and !empty($frm->addselect)) {
foreach ($frm->addselect as $addadmin) {
if (! add_admin($addadmin)) {
error("Could not add admin with user id $addadmin!");
}
}
} else if (!empty($frm->remove) and !empty($frm->removeselect)) {
$admins = get_admins();
if (count($admins) > count($frm->removeselect)) {
foreach ($frm->removeselect as $removeadmin) {
if (! remove_admin($removeadmin)) {
error("Could not remove admin with user id $removeadmin!");
}
}
}
} else if (!empty($frm->showall)) {
unset($frm->searchtext);
$frm->previoussearch = 0;
}
}
/// Is there a current search?
$previoussearch = (!empty($frm->search) or ($frm->previoussearch == 1)) ;
/// Get all existing admins
$admins = get_admins();
$adminarray = array();
foreach ($admins as $admin) {
$adminarray[] = $admin->id;
}
$adminlist = implode(',', $adminarray);
unset($adminarray);
/// Get search results excluding any current admins
if (!empty($frm->searchtext) and $previoussearch) {
$searchusers = get_users(true, $frm->searchtext, true, $adminlist, 'firstname ASC, lastname ASC',
'', '', 0, 99999, 'id, firstname, lastname, email');
$usercount = get_users(false, '', true, $adminlist);
}
/// If no search results then get potential users excluding current admins
if (empty($searchusers)) {
if (!$users = get_users(true, '', true, $adminlist, 'firstname ASC, lastname ASC', '', '',
0, 99999, 'id, firstname, lastname, email') ) {
$users = array();
}
$usercount = count($users);
}
$searchtext = (isset($frm->searchtext)) ? $frm->searchtext : "";
$previoussearch = ($previoussearch) ? '1' : '0';
include('./admin.html');
print_footer();
?>
+280 -90
View File
@@ -1,102 +1,292 @@
<?php
<?PHP // $Id$
// config.php - allows admin to edit all configuration variables
/**
* Allows admin to edit all auth plugin settings.
*
* JH: copied and Hax0rd from admin/enrol.php and admin/filters.php
*
*/
include("../config.php");
require_login();
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
if (!$site = get_site()) {
redirect("index.php");
}
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
if (!isadmin()) {
error("Only the admin can use this page");
}
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageauths";
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
$action = optional_param('action', '', PARAM_ACTION);
$auth = optional_param('auth', '', PARAM_SAFEDIR);
/// If data submitted, then process and store.
// get currently installed and enabled auth plugins
$authsavailable = get_list_of_plugins('auth');
if ($config = data_submitted()) {
get_enabled_auth_plugins(true); // fix the list of enabled auths
if (empty($CFG->auth)) {
$authsenabled = array();
} else {
$authsenabled = explode(',', $CFG->auth);
$config = (array)$config;
validate_form($config, $err);
// extract and sanitize the auth key explicitly
$modules = get_list_of_plugins("auth");
if (in_array($config['auth'], $modules)) {
$auth = $config['auth'];
} else {
notify("Error defining the authentication method");
}
if (count($err) == 0) {
foreach ($config as $name => $value) {
if (preg_match('/^pluginconfig_(.+?)$/', $name, $matches)) {
$plugin = "auth/$auth";
$name = $matches[1];
if (! set_config($name, $value, $plugin)) {
notify("Problem saving config $name as $value for plugin $plugin");
}
} else { // normal handling for
if (! set_config($name, $value)) {
notify("Problem saving config $name as $value");
}
}
}
redirect("auth.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
exit;
} else {
foreach ($err as $key => $value) {
$focus = "form.$key";
}
}
}
/// Otherwise fill and print the form.
if (empty($config)) {
$config = $CFG;
}
$modules = get_list_of_plugins("auth");
foreach ($modules as $module) {
$options[$module] = get_string("auth_$module"."title", "auth");
}
asort($options);
if (isset($_GET['auth']) && in_array($_GET['auth'], $modules)) {
$auth = $_GET['auth'];
} else {
$auth = $config->auth;
}
$auth = clean_filename($auth);
require_once("$CFG->dirroot/auth/$auth/lib.php"); //just to make sure that current authentication functions are loaded
if (! isset($config->guestloginbutton)) {
$config->guestloginbutton = 1;
}
if (! isset($config->alternateloginurl)) {
$config->alternateloginurl = '';
}
if (! isset($config->auth_instructions)) {
$config->auth_instructions = "";
}
if (! isset($config->changepassword)) {
$config->changepassword = "";
}
$user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "department", "address", "city", "country", "description", "idnumber", "lang");
if (empty($focus)) {
$focus = "";
}
$guestoptions[0] = get_string("hide");
$guestoptions[1] = get_string("show");
$createoptions[0] = get_string("no");
$createoptions[1] = get_string("yes");
$stradministration = get_string("administration");
$strauthentication = get_string("authentication");
$strauthenticationoptions = get_string("authenticationoptions","auth");
$strsettings = get_string("settings");
$strusers = get_string("users");
print_header("$site->shortname: $strauthenticationoptions", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> <a href=\"users.php\">$strusers</a> -> $strauthenticationoptions", "$focus");
echo "<center><b>";
echo "<form target=\"{$CFG->framename}\" name=\"authmenu\" method=\"post\" action=\"auth.php\">";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\" />";
print_string("chooseauthmethod","auth");
choose_from_menu ($options, "auth", $auth, "","document.location='auth.php?sesskey=$USER->sesskey&auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", "");
echo "</b></center>";
print_simple_box_start("center", "100%");
print_heading($options[$auth]);
print_simple_box_start("center", "60%", '', 5, 'informationbox');
print_string("auth_$auth"."description", "auth");
print_simple_box_end();
echo "<hr />";
print_heading($strsettings);
echo "<table border=\"0\" width=\"100%\" cellpadding=\"4\">";
require_once("$CFG->dirroot/auth/$auth/config.html");
echo '<tr><td colspan="3">';
print_heading(get_string('auth_common_settings', 'auth'));
echo '<td/></tr>';
if ($auth != "email" and $auth != "none" and $auth != "manual") {
echo "<tr valign=\"top\">";
echo "<td align=\"right\" nowrap=\"nowrap\">";
print_string("changepassword", "auth");
echo ":</td>";
echo "<td>";
echo "<input type=\"text\" name=\"changepassword\" size=\"40\" value=\"$config->changepassword\" />";
echo "</td>";
echo "<td>";
print_string("changepasswordhelp","auth");
echo "</td></tr>";
}
echo "<tr valign=\"top\">";
echo "<td align=\"right\" nowrap=\"nowrap\">";
print_string("guestloginbutton", "auth");
echo ":</td>";
echo "<td>";
choose_from_menu($guestoptions, "guestloginbutton", $config->guestloginbutton, "");
echo "</td>";
echo "<td>";
print_string("showguestlogin","auth");
echo "</td></tr>";
if (function_exists('auth_user_create')){
echo "<tr valign=\"top\">";
echo "<td align=\"right\" nowrap=\"nowrap\">";
print_string("auth_user_create", "auth");
echo ":</td>";
echo "<td>";
choose_from_menu($createoptions, "auth_user_create", $config->auth_user_create, "");
echo "</td>";
echo "<td>";
print_string("auth_user_creation","auth");
echo "</td></tr>";
}
/// An alternate url for the login form. It means we can use login forms that are integrated
/// into non-moodle pages
echo '<tr valign="top">';
echo '<td algin="right" nowrap="nowrap">';
print_string('alternateloginurl', 'auth');
echo '</td>';
echo '<td>';
echo '<input type="text" size="40" name="alternateloginurl" alt="'.get_string('alternateloginurl', 'auth').'" value="'.$config->alternateloginurl.'" />';
echo '</td>';
echo '<td>';
print_string('alternatelogin', 'auth', htmlspecialchars($CFG->wwwroot.'/login/index.php'));
echo '</td>';
echo '</tr>';
echo '</table>';
echo '<p align="center"><input type="submit" value="'.get_string('savechanges').'"></p>';
echo '</form>';
print_simple_box_end();
print_footer();
exit;
/// Functions /////////////////////////////////////////////////////////////////
function validate_form(&$form, &$err) {
// if (empty($form->fullname))
// $err["fullname"] = get_string("missingsitename");
return;
}
if (!empty($auth) and !exists_auth_plugin($auth)) {
print_error('pluginnotinstalled', 'auth', $url, $auth);
//
// Good enough for most auth plugins
// but some may want a custom one if they are offering
// other options
// Note: pluginconfig_ fields have special handling.
function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts, $updateopts) {
echo '<tr><td colspan="3">';
if ($retrieveopts) {
print_heading(get_string('auth_data_mapping', 'auth'));
} else {
print_heading(get_string('auth_fieldlocks', 'auth'));
}
echo '<td/></tr>';
$lockoptions = array ('unlocked' => get_string('unlocked', 'auth'),
'unlockedifempty' => get_string('unlockedifempty', 'auth'),
'locked' => get_string('locked', 'auth'));
$updatelocaloptions = array('oncreate' => get_string('update_oncreate', 'auth'),
'onlogin' => get_string('update_onlogin', 'auth'));
$updateextoptions = array('0' => get_string('update_never', 'auth'),
'1' => get_string('update_onupdate', 'auth'));
$pluginconfig = get_config("auth/$auth");
// helptext is on a field with rowspan
if (empty($helptext)) {
$helptext = '&nbsp;';
}
foreach ($user_fields as $field) {
// Define some vars we'll work with
optional_variable($pluginconfig->{"field_map_$field"}, '');
optional_variable($pluginconfig->{"field_updatelocal_$field"}, '');
optional_variable($pluginconfig->{"field_updateremote_$field"}, '');
optional_variable($pluginconfig->{"field_lock_$field"}, '');
// define the fieldname we display to the user
$fieldname = $field;
if ($fieldname === 'lang') {
$fieldname = get_string('language');
} elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) {
$fieldname = get_string($matches[1]) . ' ' . $matches[2];
} else {
$fieldname = get_string($fieldname);
}
echo '<tr valign="top"><td align="right">';
echo $fieldname;
echo '</td><td>';
if ($retrieveopts) {
$varname = 'field_map_' . $field;
echo "<input name=\"pluginconfig_{$varname}\" type=\"text\" size=\"30\" value=\"{$pluginconfig->$varname}\">";
echo '<div align="right">';
echo get_string('auth_updatelocal', 'auth') . '&nbsp;&nbsp;';
choose_from_menu($updatelocaloptions, "pluginconfig_field_updatelocal_{$field}", $pluginconfig->{"field_updatelocal_$field"}, "");
echo '<br />';
if ($updateopts) {
echo get_string('auth_updateremote', 'auth') . '&nbsp;&nbsp;';
'&nbsp;&nbsp;';
choose_from_menu($updateextoptions, "pluginconfig_field_updateremote_{$field}", $pluginconfig->{"field_updateremote_$field"}, "");
echo '<br />';
}
echo get_string('auth_fieldlock', 'auth') . '&nbsp;&nbsp;';
choose_from_menu($lockoptions, "pluginconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, "");
echo '</div>';
} else {
choose_from_menu($lockoptions, "pluginconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, "");
}
echo '</td>';
if (!empty($helptext)) {
echo '<td rowspan="' . count($user_fields) . '">' . $helptext . '</td>';
$helptext = '';
}
echo '</tr>';
}
}
////////////////////////////////////////////////////////////////////////////////
// process actions
if (!confirm_sesskey()) {
redirect($returnurl);
}
switch ($action) {
case 'disable':
// remove from enabled list
$key = array_search($auth, $authsenabled);
if ($key !== false) {
unset($authsenabled[$key]);
set_config('auth', implode(',', $authsenabled));
}
if ($auth == $CFG->registerauth) {
set_config('registerauth', '');
}
break;
case 'enable':
// add to enabled list
if (!in_array($auth, $authsenabled)) {
$authsenabled[] = $auth;
$authsenabled = array_unique($authsenabled);
set_config('auth', implode(',', $authsenabled));
}
break;
case 'down':
$key = array_search($auth, $authsenabled);
// check auth plugin is valid
if ($key === false) {
print_error('pluginnotenabled', 'auth', $url, $auth);
}
// move down the list
if ($key < (count($authsenabled) - 1)) {
$fsave = $authsenabled[$key];
$authsenabled[$key] = $authsenabled[$key + 1];
$authsenabled[$key + 1] = $fsave;
set_config('auth', implode(',', $authsenabled));
}
break;
case 'up':
$key = array_search($auth, $authsenabled);
// check auth is valid
if ($key === false) {
print_error('pluginnotenabled', 'auth', $url, $auth);
}
// move up the list
if ($key >= 1) {
$fsave = $authsenabled[$key];
$authsenabled[$key] = $authsenabled[$key - 1];
$authsenabled[$key - 1] = $fsave;
set_config('auth', implode(',', $authsenabled));
}
break;
default:
break;
}
redirect ($returnurl);
?>
-181
View File
@@ -1,181 +0,0 @@
<?php
/**
* Edit configuration for an individual auth plugin
*/
require_once '../config.php';
require_once $CFG->libdir.'/adminlib.php';
$auth = required_param('auth', PARAM_SAFEDIR);
$CFG->pagepath = 'auth/' . $auth;
admin_externalpage_setup('authsetting'.$auth);
$authplugin = get_auth_plugin($auth);
$err = array();
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageauths";
// save configuration changes
if ($frm = data_submitted() and confirm_sesskey()) {
$frm = stripslashes_recursive($frm);
$authplugin->validate_form($frm, $err);
if (count($err) == 0) {
// save plugin config
if ($authplugin->process_config($frm)) {
// save field lock configuration
foreach ($frm as $name => $value) {
if (preg_match('/^lockconfig_(.+?)$/', $name, $matches)) {
$plugin = "auth/$auth";
$name = $matches[1];
if (!set_config($name, $value, $plugin)) {
error("Problem saving config $name as $value for plugin $plugin");
}
}
}
redirect($returnurl);
exit;
}
} else {
foreach ($err as $key => $value) {
$focus = "form.$key";
}
}
} else {
$frm = get_config("auth/$auth");
}
$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();
/// Get the auth descriptions (from core or own auth lang files)
$authdescription = $authplugin->get_description();
// output configuration form
admin_externalpage_print_header();
// choose an authentication method
echo "<form $CFG->frametarget id=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
echo "<div>\n";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\" />\n";
echo "<input type=\"hidden\" name=\"auth\" value=\"".$auth."\" />\n";
// auth plugin description
print_simple_box_start('center', '80%');
print_heading($authtitle);
print_simple_box_start('center', '80%', '', 5, 'informationbox');
echo $authdescription;
print_simple_box_end();
echo "<hr />\n";
$authplugin->config_form($frm, $err, $user_fields);
print_simple_box_end();
echo '<p style="text-align: center"><input type="submit" value="' . get_string("savechanges") . "\" /></p>\n";
echo "</div>\n";
echo "</form>\n";
admin_externalpage_print_footer();
exit;
/// Functions /////////////////////////////////////////////////////////////////
// Good enough for most auth plugins
// but some may want a custom one if they are offering
// other options
// Note: lockconfig_ fields have special handling.
function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts, $updateopts) {
echo '<tr><td colspan="3">';
if ($retrieveopts) {
print_heading(get_string('auth_data_mapping', 'auth'));
} else {
print_heading(get_string('auth_fieldlocks', 'auth'));
}
echo '</td></tr>';
$lockoptions = array ('unlocked' => get_string('unlocked', 'auth'),
'unlockedifempty' => get_string('unlockedifempty', 'auth'),
'locked' => get_string('locked', 'auth'));
$updatelocaloptions = array('oncreate' => get_string('update_oncreate', 'auth'),
'onlogin' => get_string('update_onlogin', 'auth'));
$updateextoptions = array('0' => get_string('update_never', 'auth'),
'1' => get_string('update_onupdate', 'auth'));
$pluginconfig = get_config("auth/$auth");
// helptext is on a field with rowspan
if (empty($helptext)) {
$helptext = '&nbsp;';
}
foreach ($user_fields as $field) {
// Define some vars we'll work with
if (!isset($pluginconfig->{"field_map_$field"})) {
$pluginconfig->{"field_map_$field"} = '';
}
if (!isset($pluginconfig->{"field_updatelocal_$field"})) {
$pluginconfig->{"field_updatelocal_$field"} = '';
}
if (!isset($pluginconfig->{"field_updateremote_$field"})) {
$pluginconfig->{"field_updateremote_$field"} = '';
}
if (!isset($pluginconfig->{"field_lock_$field"})) {
$pluginconfig->{"field_lock_$field"} = '';
}
// define the fieldname we display to the user
$fieldname = $field;
if ($fieldname === 'lang') {
$fieldname = get_string('language');
} elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) {
$fieldname = get_string($matches[1]) . ' ' . $matches[2];
} elseif ($fieldname == 'url') {
$fieldname = get_string('webpage');
} else {
$fieldname = get_string($fieldname);
}
if ($retrieveopts) {
$varname = 'field_map_' . $field;
echo '<tr valign="top"><td align="right">';
echo '<label for="lockconfig_'.$varname.'">'.$fieldname.'</label>';
echo '</td><td>';
echo "<input id=\"lockconfig_{$varname}\" name=\"lockconfig_{$varname}\" type=\"text\" size=\"30\" value=\"{$pluginconfig->$varname}\" />";
echo '<div style="text-align: right">';
echo '<label for="menulockconfig_field_updatelocal_'.$field.'">'.get_string('auth_updatelocal', 'auth') . '</label>&nbsp;';
choose_from_menu($updatelocaloptions, "lockconfig_field_updatelocal_{$field}", $pluginconfig->{"field_updatelocal_$field"}, "");
echo '<br />';
if ($updateopts) {
echo '<label for="menulockconfig_field_updateremote_'.$field.'">'.get_string('auth_updateremote', 'auth') . '</label>&nbsp;';
choose_from_menu($updateextoptions, "lockconfig_field_updateremote_{$field}", $pluginconfig->{"field_updateremote_$field"}, "");
echo '<br />';
}
echo '<label for="menulockconfig_field_lock_'.$field.'">'.get_string('auth_fieldlock', 'auth') . '</label>&nbsp;';
choose_from_menu($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, "");
echo '</div>';
} else {
echo '<tr valign="top"><td align="right">';
echo '<label for="menulockconfig_field_lock_'.$field.'">'.$fieldname.'</label>';
echo '</td><td>';
choose_from_menu($lockoptions, "lockconfig_field_lock_{$field}", $pluginconfig->{"field_lock_$field"}, "");
}
echo '</td>';
if (!empty($helptext)) {
echo '<td rowspan="' . count($user_fields) . '">' . $helptext . '</td>';
$helptext = '';
}
echo '</tr>';
}
}
?>
+132
View File
@@ -0,0 +1,132 @@
<?PHP // $Id$
// backup.php - allows admin to edit all configuration variables for scheduled backups
require_once("../config.php");
require_once("../backup/lib.php");
require_once("../backup/backup_scheduled.php");
require_login();
if (!isadmin()) {
error("Only an admin can use this page");
}
if (!$site = get_site()) {
error("Site isn't defined!");
}
//Initialise error variables
$error = false;
$sche_destination_error = "";
/// If data submitted, then process and store.
if (($config = data_submitted()) && confirm_sesskey()) {
//First of all we check that everything is correct
//Check for trailing slash and backslash in backup_sche_destination
if (!empty($backup_sche_destination) and
(substr($backup_sche_destination,-1) == "/" or substr($backup_sche_destination,-1) == "\\")) {
$error = true;
$sche_destination_error = get_string("pathslasherror");
//Now check that backup_sche_destination dir exists
} else if (!empty($backup_sche_destination) and
!is_dir($backup_sche_destination)) {
$error = true;
$sche_destination_error = get_string("pathnotexists");
}
//We need to do some weekdays conversions prior to continue
$i = 0;
$temp = "";
$a_config = (array)$config;
while ($i<7) {
$tocheck = "dayofweek_".$i;
if (isset($a_config[$tocheck])) {
$temp .= "1";
} else {
$temp .= "0";
}
unset($a_config[$tocheck]);
$i++;
}
$a_config['backup_sche_weekdays'] = $temp;
$config = (object)$a_config;
//weekdays conversions done. Continue
foreach ($config as $name => $value) {
backup_set_config($name, $value);
}
//And now, we execute schedule_backup_next_execution() for each course in the server to have the next
//execution time updated automatically everytime it's changed.
$status = true;
//get admin
$admin = get_admin();
if (!$admin) {
$status = false;
}
//get backup config
if (! $backup_config = backup_get_config()) {
$status = false;
}
if ($status) {
//get courses
if ($courses = get_records('course', '', '', '', 'id,shortname')) {
//For each course, we check (insert, update) the backup_course table
//with needed data
foreach ($courses as $course) {
//We check if the course exists in backup_course
$backup_course = get_record("backup_courses","courseid",$course->id);
//If it doesn't exist, create
if (!$backup_course) {
$temp_backup_course->courseid = $course->id;
$newid = insert_record("backup_courses",$temp_backup_course);
//And get it from db
$backup_course = get_record("backup_courses","id",$newid);
}
//Now, calculate next execution of the course
$nextstarttime = schedule_backup_next_execution ($backup_course,$backup_config,time(),$admin->timezone);
//Save it to db
set_field("backup_courses","nextstarttime",$nextstarttime,"courseid",$backup_course->courseid);
}
}
}
if (!$error) {
redirect("$CFG->wwwroot/$CFG->admin/index.php", get_string("changessaved"), 1);
exit;
}
}
/// Otherwise print the form.
$stradmin = get_string("administration");
$strconfiguration = get_string("configuration");
$strbackup = get_string("backup");
print_header("$site->shortname: $strconfiguration: $strbackup", $site->fullname,
"<a href=\"index.php\">$stradmin</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> ".
$strbackup);
echo "<p align=\"right\"><a href=\"../backup/log.php\">".get_string("logs")."</a></p>";
print_heading($strbackup);
print_simple_box("<center>".get_string("adminhelpbackup")."</center>", "center", "50%");
echo "<br />";
print_simple_box_start("center");
//Check for required functions...
if (!function_exists('utf8_encode')) {
notify("You need to add XML support to your PHP installation");
}
include ("$CFG->dirroot/backup/config.html");
print_simple_box_end();
print_footer();
?>
+19 -8
View File
@@ -3,16 +3,22 @@
// block.php - allows admin to edit all local configuration variables for a block
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/blocklib.php');
$blockid = required_param('block', PARAM_INT);
require_login();
if(!$blockrecord = blocks_get_record($blockid)) {
error('This block does not exist');
if (!isadmin()) {
error('Only an admin can use this page');
}
if (!$site = get_site()) {
error("Site isn't defined!");
}
admin_externalpage_setup('blocksetting'.$blockrecord->name);
$blockid = required_param( 'block',PARAM_INT );
if(($blockrecord = blocks_get_record($blockid)) === false) {
error('This block does not exist');
}
$block = block_instance($blockrecord->name);
if($block === false) {
@@ -31,7 +37,7 @@
if ($config = data_submitted()) {
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', 'error');
error(get_string('confirmsesskeybad', 'error'));
}
if(!$block->has_config()) {
error('This block does not support global configuration');
@@ -47,14 +53,19 @@
/// Otherwise print the form.
$stradmin = get_string('administration');
$strconfiguration = get_string('configuration');
$strmanageblocks = get_string('manageblocks');
$strblockname = $block->get_title();
admin_externalpage_print_header();
print_header($site->shortname.': '.$strblockname.": $strconfiguration", $site->fullname,
"<a href=\"index.php\">$stradmin</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> ".
"<a href=\"blocks.php\">$strmanageblocks</a> -> ".$strblockname);
print_heading($strblockname);
print_simple_box(get_string('configwarning', 'admin'), 'center', '50%');
print_simple_box('<center>'.get_string('configwarning', 'admin').'</center>', 'center', '50%');
echo '<br />';
echo '<form method="post" action="block.php">';
+58 -73
View File
@@ -3,21 +3,30 @@
// Allows the admin to configure blocks (hide/show, delete and configure)
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->libdir.'/ddllib.php');
admin_externalpage_setup('manageblocks');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$confirm = optional_param('confirm', 0, PARAM_INT);
$hide = optional_param('hide', 0, PARAM_INT);
$show = optional_param('show', 0, PARAM_INT);
$delete = optional_param('delete', 0, PARAM_INT);
$multiple = optional_param('multiple', 0, PARAM_INT);
require_login();
if (!isadmin()) {
error("Only administrators can use this page!");
}
if (!$site = get_site()) {
error("Site isn't defined!");
}
/// Print headings
$stradministration = get_string('administration');
$strconfiguration = get_string('configuration');
$strmanageblocks = get_string('manageblocks');
$strdelete = get_string('delete');
$strversion = get_string('version');
@@ -27,7 +36,12 @@
$strcourses = get_string('blockinstances', 'admin');
$strname = get_string('name');
$strmultiple = get_string('blockmultiple', 'admin');
$strshowblockcourse = get_string('showblockcourse');
print_header("$site->shortname: $strmanageblocks", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $strmanageblocks");
print_heading($strmanageblocks);
/// If data submitted, then process and store.
@@ -36,7 +50,6 @@
error("Block doesn't exist!");
}
set_field('block', 'visible', '0', 'id', $block->id); // Hide block
admin_get_root(true, false); // settings not required - only pages
}
if (!empty($show) && confirm_sesskey() ) {
@@ -44,7 +57,6 @@
error("Block doesn't exist!");
}
set_field('block', 'visible', '1', 'id', $block->id); // Show block
admin_get_root(true, false); // settings not required - only pages
}
if (!empty($multiple) && confirm_sesskey()) {
@@ -53,12 +65,9 @@
}
$block->multiple = !$block->multiple;
update_record('block', $block);
admin_get_root(true, false); // settings not required - only pages
}
if (!empty($delete) && confirm_sesskey()) {
admin_externalpage_print_header();
print_heading($strmanageblocks);
if (!$block = blocks_get_record($delete)) {
error("Block doesn't exist!");
@@ -76,38 +85,34 @@
notice_yesno(get_string('blockdeleteconfirm', '', $strblockname),
'blocks.php?delete='.$block->id.'&amp;confirm=1&amp;sesskey='.$USER->sesskey,
'blocks.php');
admin_externalpage_print_footer();
print_footer();
exit;
} else {
// Inform block it's about to be deleted
$blockobject = block_instance($block->name);
if ($blockobject) {
$blockobject->before_delete(); //only if we can create instance, block might have been already removed
}
// First delete instances and then block
$instances = get_records('block_instance', 'blockid', $block->id);
if(!empty($instances)) {
foreach($instances as $instance) {
blocks_delete_instance($instance);
blocks_delete_instance($instance, true);
}
}
// Delete block
if (!delete_records('block', 'id', $block->id)) {
notify("Error occurred while deleting the $strblockname record from blocks table");
}
drop_plugin_tables($block->name, "$CFG->dirroot/blocks/$block->name/db/install.xml", false); // old obsoleted table names
drop_plugin_tables('block_'.$block->name, "$CFG->dirroot/blocks/$block->name/db/install.xml", false);
$instances = get_records('block_instance', 'blockid', $block->id);
if(!empty($instances)) {
foreach($instances as $instance) {
blocks_delete_instance($instance);
}
}
// Delete the capabilities that were defined by this block
capabilities_cleanup('block/'.$block->name);
// Then the tables themselves
// remove entent handlers and dequeue pending events
events_uninstall('block/'.$block->name);
if ($tables = $db->Metatables()) {
$prefix = $CFG->prefix.$block->name;
foreach ($tables as $table) {
if (strpos($table, $prefix) === 0) {
if (!execute_sql("DROP TABLE $table", false)) {
notify("ERROR: while trying to drop table $table");
}
}
}
}
$a->block = $strblockname;
$a->directory = $CFG->dirroot.'/blocks/'.$block->name;
@@ -115,9 +120,6 @@
}
}
admin_externalpage_print_header();
print_heading($strmanageblocks);
/// Main display starts here
/// Get and sort the existing blocks
@@ -130,7 +132,7 @@
foreach ($blocks as $block) {
if(!block_is_compatible($block->name)) {
notify('Block '. $block->name .' is not compatible with the current version of Moodle and needs to be updated by a programmer.');
notify('Block '. $block->name .' is not compatible with the current version of Mooodle and needs to be updated by a programmer.');
$incompatible[] = $block;
continue;
}
@@ -154,52 +156,34 @@
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'multiple', 'delete', 'settings'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strmultiple, $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->define_baseurl($CFG->wwwroot.'/admin/blocks.php');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'blocks');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->set_attribute('class', 'generaltable generalbox');
$table->setup();
foreach ($blockbyname as $blockname => $blockid) {
$blockobject = $blockobjects[$blockid];
$block = $blocks[$blockid];
$delete = '<a href="blocks.php?delete='.$blockid.'&amp;sesskey='.$USER->sesskey.'">'.$strdelete.'</a>';
$settings = ''; // By default, no configuration
if ($blockobject->has_config()) {
if (file_exists($CFG->dirroot.'/blocks/'.$block->name.'/settings.php')) {
$settings = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksetting'.$block->name.'">'.$strsettings.'</a>';
} else {
$settings = '<a href="block.php?block='.$blockid.'">'.$strsettings.'</a>';
}
if($blockobject->has_config()) {
$settings = '<a href="block.php?block='.$blockid.'">'.$strsettings.'</a>';
}
// MDL-11167, blocks can be placed on mymoodle, or the blogs page
// and it should not show up on course search page
$totalcount = count_records('block_instance', 'blockid', $blockid);
$count = count_records_sql('SELECT COUNT(*)
FROM '.$CFG->prefix.'block_instance
WHERE blockid = '.$blockid.' AND
pagetype = \'course-view\'');
if ($count>0) {
$blocklist = "<a href=\"{$CFG->wwwroot}/course/search.php?blocklist=$blockid&amp;sesskey={$USER->sesskey}\" ";
$blocklist .= "title=\"$strshowblockcourse\" >$totalcount</a>";
}
else {
$blocklist = "$totalcount";
}
$count = count_records('block_instance', 'blockid', $blockid);
$class = ''; // Nothing fancy, by default
if ($blocks[$blockid]->visible) {
$visible = '<a href="blocks.php?hide='.$blockid.'&amp;sesskey='.$USER->sesskey.'" title="'.$strhide.'">'.
'<img src="'.$CFG->pixpath.'/i/hide.gif" class="icon" alt="'.$strhide.'" /></a>';
'<img src="'.$CFG->pixpath.'/i/hide.gif" height="16" width="16" alt="" /></a>';
} else {
$visible = '<a href="blocks.php?show='.$blockid.'&amp;sesskey='.$USER->sesskey.'" title="'.$strshow.'">'.
'<img src="'.$CFG->pixpath.'/i/show.gif" class="icon" alt="'.$strshow.'" /></a>';
'<img src="'.$CFG->pixpath.'/i/show.gif" height="16" width="16" alt="" /></a>';
$class = ' class="dimmed_text"'; // Leading space required!
}
if ($blockobject->instance_allow_multiple()) {
@@ -216,8 +200,8 @@
$table->add_data(array(
'<span'.$class.'>'.$blockobject->get_title().'</span>',
$blocklist,
'<span'.$class.'>'.$blockobject->get_version().'</span>',
$count,
$blockobject->get_version(),
$visible,
$multiple,
$delete,
@@ -231,14 +215,15 @@
print_heading(get_string('incompatibleblocks', 'admin'));
$table = new flexible_table('admin-blocks-incompatible');
$table->define_columns(array('block', 'delete'));
$table->define_headers(array($strname, $strdelete));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->define_baseurl($CFG->wwwroot.'/admin/blocks.php');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'incompatible');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->set_attribute('class', 'generaltable generalbox');
$table->setup();
foreach ($incompatible as $block) {
@@ -250,6 +235,6 @@
$table->print_html();
}
admin_externalpage_print_footer();
print_footer();
?>
+68
View File
@@ -0,0 +1,68 @@
<form method="post" action="calendar.php">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
<table class="formtable">
<tr>
<th>adminseesall:</th>
<td>
<div><?php print_string('helpadminseesall', 'admin'); ?></div>
<p>
<select name="adminseesallcourses">
<option value="0" <?php if(empty($CFG->calendar_adminseesall)) echo "selected='selected'"; ?>><?php print_string('adminseesownevents', 'admin'); ?></option>
<option value="1" <?php if(!empty($CFG->calendar_adminseesall)) echo "selected='selected'"; ?>><?php print_string('adminseesallevents', 'admin'); ?></option>
</select>
</p>
</td>
</tr>
<tr>
<th>startwday:</th>
<td>
<div><?php print_string('helpstartofweek', 'admin'); ?></div>
<p><?php choose_from_menu($weekdays, 'startwday', empty($CFG->calendar_startwday) ? 0 : $CFG->calendar_startwday, ''); ?></p>
</td>
</tr>
<tr>
<th>weekenddays:</th>
<td>
<div><?php print_string('helpweekenddays', 'admin'); ?></div>
<p>
<span style="white-space: nowrap;"><input type="checkbox" name="weekend[]" value="1" id="weekend1" <?php if(CALENDAR_WEEKEND & 2) echo 'checked="checked"'; ?> /> <label for="weekend1"><?php print_string('monday', 'calendar'); ?></label></span>
<span style="white-space: nowrap;"><input type="checkbox" name="weekend[]" value="2" id="weekend2" <?php if(CALENDAR_WEEKEND & 4) echo 'checked="checked"'; ?> /> <label for="weekend2"><?php print_string('tuesday', 'calendar'); ?></label></span>
<span style="white-space: nowrap;"><input type="checkbox" name="weekend[]" value="3" id="weekend3" <?php if(CALENDAR_WEEKEND & 8) echo 'checked="checked"'; ?> /> <label for="weekend3"><?php print_string('wednesday', 'calendar'); ?></label></span>
<span style="white-space: nowrap;"><input type="checkbox" name="weekend[]" value="4" id="weekend4" <?php if(CALENDAR_WEEKEND & 16) echo 'checked="checked"'; ?> /> <label for="weekend4"><?php print_string('thursday', 'calendar'); ?></label></span>
<span style="white-space: nowrap;"><input type="checkbox" name="weekend[]" value="5" id="weekend5" <?php if(CALENDAR_WEEKEND & 32) echo 'checked="checked"'; ?> /> <label for="weekend5"><?php print_string('friday', 'calendar'); ?></label></span>
<br />
<span style="white-space: nowrap;"><input type="checkbox" name="weekend[]" value="6" id="weekend6" <?php if(CALENDAR_WEEKEND & 64) echo 'checked="checked"'; ?> /> <label for="weekend6"><?php print_string('saturday', 'calendar'); ?></label></span>
<span style="white-space: nowrap;"><input type="checkbox" name="weekend[]" value="0" id="weekend0" <?php if(CALENDAR_WEEKEND & 1) echo 'checked="checked"'; ?> /> <label for="weekend0"><?php print_string('sunday', 'calendar'); ?></label></span>
</p>
</td>
</tr>
<tr>
<th>upcoming_lookahead:</th>
<td>
<div><?php print_string('helpupcominglookahead', 'admin'); ?></div>
<p><input type="text" name="lookahead" size="3" value="<?php echo CALENDAR_UPCOMING_DAYS; ?>" /></p>
</td>
</tr>
<tr>
<th>upcoming_maxevents:</th>
<td>
<div><?php print_string('helpupcomingmaxevents', 'admin'); ?></div>
<p><input type="text" name="maxevents" size="3" value="<?php echo CALENDAR_UPCOMING_MAXEVENTS; ?>" /></p>
</td>
</tr>
<tr>
<th>timezones:</th>
<td>
<div><?php print_string('helpforcetimezone', 'admin'); ?></div>
<p><?php choose_from_menu($timezones, 'forcetimezone', $CFG->forcetimezone, get_string('timezonenotforced', 'admin'), '', '99'); ?></p>
<p><a href="timezoneimport.php"><?php print_string('importtimezones', 'admin'); ?>...</a></p>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="<?php print_string('savechanges'); ?>" />
</td>
</tr>
</table>
</form>
+99
View File
@@ -0,0 +1,99 @@
<?PHP // $Id$
// Allows the admin to configure calendar and date/time stuff
require_once('../config.php');
require_login();
if (!isadmin()) {
error('Only administrators can use this page!');
}
if (!$site = get_site()) {
error('Site isn\'t defined!');
}
/// Print headings
$stradministration = get_string('administration');
$strconfiguration = get_string('configuration');
$strcalendarsettings = get_string('calendarsettings', 'admin');
print_header("$site->shortname: $strcalendarsettings", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $strcalendarsettings");
print_heading($strcalendarsettings);
/// If data submitted, process and store
if (($form = data_submitted()) && confirm_sesskey()) {
if(isset($form->adminseesallcourses)) {
set_config('calendar_adminseesall', intval($form->adminseesallcourses) != 0);
unset($SESSION->cal_courses_shown);
}
if(isset($form->forcetimezone)) {
// To protect from SQL injections ...
$form->forcetimezone = str_replace(';', '', $form->forcetimezone);
$form->forcetimezone = str_replace('\'', '', $form->forcetimezone);
set_config('forcetimezone', $form->forcetimezone);
}
if(isset($form->startwday)) {
$startwday = intval($form->startwday);
if($startwday >= 0 && $startwday <= 6) {
set_config('calendar_startwday', $startwday);
}
}
if(isset($form->weekend)) {
if(is_array($form->weekend)) {
// Creating a packed bitfield; look at /calendar/lib.php if you can't figure it out
$bitfield = 0;
foreach($form->weekend as $day) {
$bitfield |= (1 << (intval($day) % 7));
}
if($bitfield > 0) {
set_config('calendar_weekend', $bitfield);
}
}
}
if(isset($form->lookahead)) {
$lookahead = intval($form->lookahead);
if($lookahead > 0) {
set_config('calendar_lookahead', $lookahead);
}
}
if(isset($form->maxevents)) {
$maxevents = intval($form->maxevents);
if($maxevents > 0) {
set_config('calendar_maxevents', $maxevents);
}
}
redirect('index.php');
}
// Include the calendar library AFTER modifying the data, so we read the latest values
require_once($CFG->dirroot.'/calendar/lib.php');
// Populate some variables we 're going to need in calendar.html
$timezones = get_list_of_timezones();
$weekdays = array(
0 => get_string('sunday', 'calendar'),
1 => get_string('monday', 'calendar'),
2 => get_string('tuesday', 'calendar'),
3 => get_string('wednesday', 'calendar'),
4 => get_string('thursday', 'calendar'),
5 => get_string('friday', 'calendar'),
6 => get_string('saturday', 'calendar')
);
// Main display starts here
print_simple_box_start("center", "80%");
include('./calendar.html');
print_simple_box_end();
print_footer();
?>
+180
View File
@@ -0,0 +1,180 @@
<?php // $Id$
// config.php - allows admin to edit all configuration variables
require_once('../config.php');
if ($site = get_site()) { // If false then this is a new installation
require_login();
if (!isadmin()) {
error('Only the admin can use this page');
}
}
/// This is to overcome the "insecure forms paradox"
if (isset($secureforms) and $secureforms == 0) {
$match = 'nomatch';
} else {
$match = '';
}
/// If data submitted, then process and store.
if ($config = data_submitted($match)) {
if (!empty($USER->id)) { // Additional identity check
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
}
validate_form($config, $err);
if (count($err) == 0) {
foreach ($config as $name => $value) {
if ($name == "sessioncookie") {
$value = eregi_replace("[^a-zA-Z]", "", $value);
}
unset($conf);
$conf->name = $name;
$conf->value = $value;
if ($current = get_record('config', 'name', $name)) {
$conf->id = $current->id;
if (! update_record('config', $conf)) {
notify("Could not update $name to $value");
}
} else {
if (! insert_record('config', $conf)) {
notify("Error: could not add new variable $name !");
}
}
}
redirect('index.php', get_string('changessaved'), 1);
exit;
} else {
foreach ($err as $key => $value) {
$focus = "form.$key";
}
}
}
/// Otherwise fill and print the form.
if (empty($config)) {
$config = $CFG;
if (!$config->locale = get_field('config', 'value', 'name', 'locale')) {
$config->locale = $CFG->lang;
}
}
if (empty($focus)) {
$focus = '';
}
$sesskey = !empty($USER->id) ? $USER->sesskey : '';
$stradmin = get_string('administration');
$strconfiguration = get_string('configuration');
$strconfigvariables = get_string('configvariables', 'admin');
if ($site) {
print_header("$site->shortname: $strconfigvariables", $site->fullname,
"<a href=\"index.php\">$stradmin</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $strconfigvariables", $focus);
print_heading($strconfigvariables);
} else {
print_header();
print_heading($strconfigvariables);
print_simple_box(get_string('configintro', 'admin'), 'center', "50%");
echo '<br />';
}
/// Get all the configuration fields and helptext
include('configvars.php');
/// Cycle through the sections to get the sectionnames
$linktext = '';
foreach($configvars as $sectionname=>$section) {
if ($linktext !== '') {
$linktext .= ' | ';
}
$linktext .= '<a href="#configsection'.$sectionname.'">'.get_string('configsection'.$sectionname, 'admin').'</a>';
}
echo "<center>$linktext</center>\n";
print_simple_box_start('center');
echo '<form method="post" action="config.php" name="form">';
echo '<center><input type="submit" value="'.get_string('savechanges').'" /></center>';
/// Cycle through each section of the configuration
foreach ($configvars as $sectionname=>$section) {
print_heading('<a name="configsection'.$sectionname.'"></a>'.get_string('configsection'.$sectionname, 'admin'));
$table = NULL;
$table->data = array();
foreach ($section as $configvariable=>$configobject) {
$table->data[] = array ( $configvariable.': ',
$configobject->field
);
if ($configobject->display_warning()) {
$table->data[] = array ( '&nbsp;',
'<span class="configwarning">'.$configobject->warning.'</span>'
);
}
$table->data[] = array ( '&nbsp;',
'<span class="confighelp">'.$configobject->help.'</span>'
);
$table->align = array ('right', 'left');
}
print_table($table);
}
echo '<center>';
echo '<input type="hidden" name="sesskey" value="'.$sesskey.'" />';
echo '<input type="submit" value="'.get_string('savechanges').'" />';
echo '</center>';
echo '</form>';
print_simple_box_end();
/// Lock some options
$httpsurl = str_replace('http://', 'https://', $CFG->wwwroot);
if ($httpsurl != $CFG->wwwroot) {
if (ini_get('allow_url_fopen')) {
if ((($fh = @fopen($httpsurl, 'r')) == false) and ($config->loginhttps == 0)) {
echo '<script type="text/javascript">'."\n";
echo '<!--'."\n";
echo "eval('document.form.loginhttps.disabled=true');\n";
echo '-->'."\n";
echo '</script>'."\n";
}
}
}
if ($site) {
print_footer();
}
exit;
/// Functions /////////////////////////////////////////////////////////////////
function validate_form(&$form, &$err) {
// Currently no checks are needed ...
return true;
}
?>
+56
View File
@@ -0,0 +1,56 @@
<?php // $Id$
require_once('../config.php');
require_login();
if (!isadmin()) {
error('Only admins can access this page');
}
if (!$site = get_site()) {
redirect('index.php');
}
$stradministration = get_string('administration');
$strconfiguration = get_string('configuration');
print_header("$site->shortname: $stradministration: $strconfiguration", "$site->fullname",
'<a href="index.php">'. "$stradministration</a> -> $strconfiguration");
print_heading($strconfiguration);
$table->align = array ('right', 'left');
$table->data[] = array("<strong><a href=\"config.php\">". get_string('configvariables', 'admin') .'</a></strong>',
get_string('adminhelpconfigvariables'));
$table->data[] = array("<strong><a href=\"site.php\">". get_string('sitesettings') .'</a></strong>',
get_string('adminhelpsitesettings'));
$table->data[] = array("<strong><a href=\"../theme/index.php\">". get_string('themes') .'</a></strong>',
get_string('adminhelpthemes'));
$table->data[] = array("<strong><a href=\"lang.php\">". get_string('language') .'</a></strong>',
get_string('adminhelplanguage'));
$table->data[] = array("<strong><a href=\"modules.php\">".get_string('managemodules'). ' </a></strong>',
get_string('adminhelpmanagemodules'));
$table->data[] = array("<strong><a href=\"blocks.php\">". get_string('manageblocks') .'</a></strong>',
get_string('adminhelpmanageblocks'));
$table->data[] = array("<strong><a href=\"filters.php\">". get_string('managefilters') .'</a></strong>',
get_string('adminhelpmanagefilters'));
if (!isset($CFG->disablescheduledbackups)) {
$table->data[] = array("<strong><a href=\"backup.php\">".get_string("backup")."</a></strong>",
get_string('adminhelpbackup'));
}
$table->data[]= array("<strong><a href=\"editor.php\">". get_string('editorsettings') ."</a></strong>",
get_string('adminhelpeditorsettings'));
$table->data[]= array("<strong><a href=\"calendar.php\">". get_string('calendarsettings', 'admin') ."</a></strong>",
get_string('helpcalendarsettings', 'admin'));
$table->data[]= array("<strong><a href=\"maintenance.php\">". get_string('sitemaintenancemode', 'admin') ."</a></strong>",
get_string('helpsitemaintenance', 'admin'));
print_table($table);
print_footer($site);
?>
+490
View File
@@ -0,0 +1,490 @@
<?php // $Id$
// Shane Elliott
/// Add new sitewide configuration variables to this file.
/// $configvars is parsed by config.php
/// It is an array of arrays of objects
/// $configvars[sectionname][configvariablename] = configvar object
$configvars = array();
/// no, yes strings and menu options are used in a number of places
/// so we define them here to save time on repeatedly calling
/// get_string()
$stryes = get_string('yes');
$strno = get_string('no');
$noyesoptions[0] = $strno;
$noyesoptions[1] = $stryes;
/// A class to hold the configurable information
/// $field - the html code for the form field
/// $help - help text for the field
/// $warning - optional warning text to be displayed
/// method display_warning() - a generic function that can be used in an extended class
/// e.g. enablerssfeeds
class configvar {
var $field;
var $help;
var $warning;
function configvar($help, $field, $warning='') {
$this->help = $help;
$this->field = $field;
$this->warning = $warning;
}
function display_warning() {
return false;
}
}
////////////////////////////////////////////////////////////////////
/// Miscellaneous config variables
////////////////////////////////////////////////////////////////////
$misc = array();
/// maxeditingtime
unset($options);
$options[3600] = get_string('numminutes', '', 60);
$options[2700] = get_string('numminutes', '', 45);
$options[1800] = get_string('numminutes', '', 30);
$options[900] = get_string('numminutes', '', 15);
$options[300] = get_string('numminutes', '', 5);
$options[60] = get_string('numminutes', '', 1);
$misc['maxeditingtime'] = new configvar (get_string('configmaxeditingtime', 'admin'),
choose_from_menu ($options, 'maxeditingtime', $config->maxeditingtime, '', '', '', true) );
/// debug
unset($options);
$options[7] = $strno;
$options[15] = $stryes;
$misc['debug'] = new configvar (get_string('configdebug', 'admin'),
choose_from_menu ($options, 'debug', $config->debug, '', '', '', true) );
$misc['perfdebug'] = new configvar (get_string('configperfdebug', 'admin'),
choose_from_menu ($options, 'perfdebug', $config->perfdebug, '', '', '', true) );
/// enablerssfeeds
class configvarrss extends configvar {
function display_warning() {
return (!function_exists('utf8_encode'));
}
}
$misc['enablerssfeeds'] = new configvarrss (get_string('configenablerssfeeds', 'admin'),
choose_from_menu ($noyesoptions, 'enablerssfeeds', $config->enablerssfeeds, '', '', '', true),
'<font color="red"> You need to add XML support to your PHP installation.</font>' );
////////////////////////////////////////////////////////////////////
/// OPERATING SYSTEM config variables
////////////////////////////////////////////////////////////////////
$operatingsystem = array();
/// gdversion
unset($options);
$options[0] = get_string('gdnot');
$options[1] = get_string('gd1');
$options[2] = get_string('gd2');
$installed = check_gd_version();
$operatingsystem['gdversion'] = new configvar (get_string('configgdversion', 'admin'),
choose_from_menu ($options, 'gdversion', $installed, '', '', '', true) );
/// dbsessions
$operatingsystem['dbsessions'] = new configvar (get_string('configdbsessions', 'admin'),
choose_from_menu ($noyesoptions, 'dbsessions', $config->dbsessions, '', '', '', true) );
/// sessiontimeout
unset($options);
$options[14400] = get_string('numhours', '', 4);
$options[10800] = get_string('numhours', '', 3);
$options[7200] = get_string('numhours', '', 2);
$options[5400] = get_string('numhours', '', '1.5');
$options[3600] = get_string('numminutes', '', 60);
$options[2700] = get_string('numminutes', '', 45);
$options[1800] = get_string('numminutes', '', 30);
$options[900] = get_string('numminutes', '', 15);
$options[300] = get_string('numminutes', '', 5);
$operatingsystem['sessiontimeout'] = new configvar (get_string('configsessiontimeout', 'admin'),
choose_from_menu ($options, 'sessiontimeout', $config->sessiontimeout, '', '', '', true) );
/// sessioncookie
$operatingsystem['sessioncookie'] = new configvar (get_string('configsessioncookie', 'admin'),
'<input name="sessioncookie" type="text" size="10" value="'.s($config->sessioncookie).'" alt="sessioncookie" />' );
/// zip
$operatingsystem['zip'] = new configvar (get_string('configzip', 'admin'),
'<input name="zip" type="text" size="30" value="'.s($config->zip).'" alt="zip" />' );
/// unzip
$operatingsystem['unzip'] = new configvar (get_string('configunzip', 'admin'),
'<input name="unzip" type="text" size="30" value="'.s($config->unzip).'" alt="unzip" />' );
$operatingsystem['pathtodu'] = new configvar(get_string('configpathtodu', 'admin'),
'<input name="pathtodu" type="text" size="30" value="'.s($config->pathtodu).'" alt="pathtodu" />');
/// slasharguments
unset($options);
$options[0] = "file.php?file=/pic.jpg";
$options[1] = "file.php/pic.jpg";
$operatingsystem['slasharguments'] = new configvar (get_string('configslasharguments', 'admin'),
choose_from_menu ($options, 'slasharguments', $config->slasharguments, '', '', '', true) );
/// proxyhost
$operatingsystem['proxyhost'] = new configvar (get_string('configproxyhost', 'admin'),
'<input name="proxyhost" type="text" size="30" value="'.s($config->proxyhost).'" alt="proxyhost" />' );
/// proxyport
$operatingsystem['proxyport'] = new configvar ('',
'<input name="proxyport" type="text" size="5" value="'.s($config->proxyport).'" alt="proxyport" />' );
////////////////////////////////////////////////////////////////////
/// PERMISSIONS config variables
////////////////////////////////////////////////////////////////////
$permissions = array();
/// teacherassignteachers
$permissions['teacherassignteachers'] = new configvar (get_string('configteacherassignteachers', 'admin'),
choose_from_menu ($noyesoptions, 'teacherassignteachers', $config->teacherassignteachers, '', '', '', true) );
/// allowunenroll
$permissions['allowunenroll'] = new configvar (get_string('configallowunenroll', 'admin'),
choose_from_menu ($noyesoptions, 'allowunenroll', $config->allowunenroll, '', '', '', true) );
/// allusersaresitestudents
$permissions['allusersaresitestudents'] = new configvar (get_string('configallusersaresitestudents', 'admin'),
choose_from_menu ($noyesoptions, 'allusersaresitestudents', $config->allusersaresitestudents, '', '', '', true) );
/// showsiteparticipantslist
unset($options);
$options[0] = get_string('siteteachers');
$options[1] = get_string('allteachers');
$options[2] = get_string('studentsandteachers');
$permissions['showsiteparticipantslist'] = new configvar (get_string('configshowsiteparticipantslist', 'admin'),
choose_from_menu ($options, 'showsiteparticipantslist', $config->showsiteparticipantslist, '', '', '', true) );
/// forcelogin
$permissions['forcelogin'] = new configvar (get_string('configforcelogin', 'admin'),
choose_from_menu ($noyesoptions, 'forcelogin', $config->forcelogin, '', '', '', true) );
/// forceloginforprofiles
$permissions['forceloginforprofiles'] = new configvar (get_string('configforceloginforprofiles', 'admin'),
choose_from_menu ($noyesoptions, 'forceloginforprofiles', $config->forceloginforprofiles, '', '', '', true) );
/// opentogoogle
$permissions['opentogoogle'] = new configvar (get_string('configopentogoogle', 'admin'),
choose_from_menu ($noyesoptions, 'opentogoogle', $config->opentogoogle, '', '', '', true) );
/// maxbytes
$options = get_max_upload_sizes();
$permissions['maxbytes'] = new configvar (get_string('configmaxbytes', 'admin'),
choose_from_menu ($options, 'maxbytes', $config->maxbytes, '', '', 0, true) );
/// messaging
$permissions['messaging'] = new configvar (get_string('configmessaging', 'admin'),
choose_from_menu ($noyesoptions, 'messaging', $config->messaging, '', '', '', true) );
/// allowobjectembed
$permissions['allowobjectembed'] = new configvar (get_string('configallowobjectembed', 'admin'),
choose_from_menu ($noyesoptions, 'allowobjectembed', $config->allowobjectembed, '', '', '', true) );
////////////////////////////////////////////////////////////////////
/// INTERFACE config variables
////////////////////////////////////////////////////////////////////
$interface = array();
/// language settings
$interface['lang'] = new configvar ( get_string('configlang', 'admin'),
choose_from_menu(get_list_of_languages(), 'lang', $config->lang, '', '', '', true) );
/// language menu
$interface['langmenu'] = new configvar ( get_string('configlangmenu', 'admin'),
choose_from_menu($noyesoptions, 'langmenu', $config->langmenu, '', '', '', true) );
/// language list
$interface['langlist'] = new configvar ( get_string('configlanglist', 'admin'),
'<input name="langlist" type="text" size="60" value="'.s($config->langlist).'" alt="langlist" />' );
/// language menu
$interface['langcache'] = new configvar ( get_string('configlangcache', 'admin'),
choose_from_menu($noyesoptions, 'langcache', $config->langcache, '', '', '', true) );
/// locale
$interface['locale'] = new configvar ( get_string('configlocale', 'admin'),
'<input name="locale" type="text" size="10" value="'.s($config->locale).'" alt="locale" />' );
/// timezone
$interface['timezone'] = new configvar ( get_string('configtimezone', 'admin'),
choose_from_menu (get_list_of_timezones(), 'timezone', $config->timezone, get_string('serverlocaltime'), '', '99', true ) );
/// country
$interface['country'] = new configvar ( get_string('configcountry', 'admin'),
choose_from_menu (get_list_of_countries(), 'country', $config->country, get_string('selectacountry'), '', 0, true) );
/// framename
if (empty($config->framename)) {
$config->framename = "_top";
}
$interface['framename'] = new configvar (get_string('configframename', 'admin'),
'<input name="framename" type="text" size="15" value="'.s($config->framename).'" alt="framename" />' );
/// language list
$interface['themelist'] = new configvar ( get_string('configthemelist', 'admin'),
'<input name="themelist" type="text" size="60" value="'.s($config->themelist).'" alt="themelist" />' );
/// user themes
$interface['allowuserthemes'] = new configvar (get_string('configallowuserthemes', 'admin'),
choose_from_menu ($noyesoptions, 'allowuserthemes', $config->allowuserthemes, '', '', '', true) );
/// course themes
$interface['allowcoursethemes'] = new configvar (get_string('configallowcoursethemes', 'admin'),
choose_from_menu ($noyesoptions, 'allowcoursethemes', $config->allowcoursethemes, '', '', '', true) );
/// allowuserblockhiding
$interface['allowuserblockhiding'] = new configvar (get_string('configallowuserblockhiding', 'admin'),
choose_from_menu ($noyesoptions, 'allowuserblockhiding', $config->allowuserblockhiding, '', '', '', true) );
/// showblocksonmodpages
$interface['showblocksonmodpages'] = new configvar (get_string('configshowblocksonmodpages', 'admin'),
choose_from_menu ($noyesoptions, 'showblocksonmodpages', $config->showblocksonmodpages, '', '', '', true) );
/// tabselectedtofront
$interface['tabselectedtofront'] = new configvar (get_string('tabselectedtofront', 'admin'),
choose_from_menu ($noyesoptions, 'tabselectedtofront', $config->tabselectedtofront, '', '', '', true) );
////////////////////////////////////////////////////////////////////
/// USER config variables
////////////////////////////////////////////////////////////////////
$user = array();
/// sitepolicy
$user['sitepolicy'] = new configvar (get_string('configsitepolicy', 'admin'),
'<input type="text" name="sitepolicy" size="60" value="'.$config->sitepolicy.'" alt="sitepolicy" />' );
/// fullnamedisplay
unset($options);
$options['language'] = get_string('language');
$options['firstname lastname'] = get_string('firstname') . ' + ' . get_string('lastname');
$options['lastname firstname'] = get_string('lastname') . ' + ' . get_string('firstname');
$options['firstname'] = get_string('firstname');
$user['fullnamedisplay'] = new configvar (get_string('configfullnamedisplay', 'admin'),
choose_from_menu ($options, 'fullnamedisplay', $config->fullnamedisplay, '', '', '', true) );
/// extendedusernamechars
$user['extendedusernamechars'] = new configvar (get_string('configextendedusernamechars', 'admin'),
choose_from_menu ($noyesoptions, 'extendedusernamechars', $config->extendedusernamechars, '', '', '', true) );
/// autologinguests
$user['autologinguests'] = new configvar (get_string('configautologinguests', 'admin'),
choose_from_menu ($noyesoptions, 'autologinguests', $config->autologinguests, '', '', '', true) );
////////////////////////////////////////////////////////////////////
/// SECURITY config variables
////////////////////////////////////////////////////////////////////
$security = array();
/// displayloginfailures
unset($options);
$options[''] = get_string('nobody');
$options['admin'] = get_string('administrators');
$options['teacher'] = get_string('administratorsandteachers');
$options['everybody'] = get_string('everybody');
$security['displayloginfailures'] = new configvar (get_string('configdisplayloginfailures', 'admin'),
choose_from_menu($options, 'displayloginfailures', $config->displayloginfailures, '', '', '', true) );
/// notifyloginfailures
unset($options);
$options[''] = get_string('nobody');
$options['mainadmin'] = get_string('administrator');
$options['alladmins'] = get_string('administratorsall');
$security['notifyloginfailures'] = new configvar (get_string('confignotifyloginfailures', 'admin'),
choose_from_menu($options, 'notifyloginfailures', $config->notifyloginfailures, '', '', '', true) );
/// notifyloginthreshold
unset($options);
for ($i=1; $i<=100; $i++) {
$options[$i] = "$i";
}
$security['notifyloginthreshold'] = new configvar (get_string('confignotifyloginthreshold', 'admin'),
choose_from_menu($options, 'notifyloginthreshold', $config->notifyloginthreshold, '', '', '', true) );
/// secureforms
$security['secureforms'] = new configvar (get_string('configsecureforms', 'admin'),
choose_from_menu ($noyesoptions, 'secureforms', $config->secureforms, '', '', '', true) );
/// loginhttps
$security['loginhttps'] = new configvar (get_string('configloginhttps', 'admin'),
choose_from_menu ($noyesoptions, 'loginhttps', $config->loginhttps, '', '', '', true) );
/// runclamonupload
$security['runclamonupload'] = new configvar (get_string('configrunclamonupload', 'admin'),
choose_from_menu($noyesoptions, 'runclamonupload', $config->runclamonupload, '', '', '', true) );
/// pathtoclam
$security['pathtoclam'] = new configvar (get_string('configpathtoclam', 'admin'),
'<input type="text" name="pathtoclam" size="30" value="'.$config->pathtoclam.'" alt="pathtoclam" />' );
/// quarantinedir
$security['quarantinedir'] = new configvar (get_string('configquarantinedir', 'admin'),
'<input type="text" name="quarantinedir" size="30" value="'.$config->quarantinedir.'" alt="quarantinedir" />' );
/// clamfailureonupload
unset($options);
$options['donothing'] = get_string('configclamdonothing', 'admin');
$options['actlikevirus'] = get_string('configclamactlikevirus', 'admin');
$security['clamfailureonupload'] = new configvar (get_string('configclamfailureonupload', 'admin'),
choose_from_menu($options, 'clamfailureonupload', $config->clamfailureonupload, '', '', '', true) );
////////////////////////////////////////////////////////////////////
/// MAINTENANCE config variables
////////////////////////////////////////////////////////////////////
$maintenance = array();
/// longtimenosee
unset($options);
$options[0] = get_string('never');
$options[1000] = get_string('numdays', '', 1000);
$options[365] = get_string('numdays', '', 365);
$options[180] = get_string('numdays', '', 180);
$options[150] = get_string('numdays', '', 150);
$options[120] = get_string('numdays', '', 120);
$options[90] = get_string('numdays', '', 90);
$options[60] = get_string('numdays', '', 60);
$options[30] = get_string('numdays', '', 30);
$options[21] = get_string('numdays', '', 21);
$options[14] = get_string('numdays', '', 14);
$options[7] = get_string('numdays', '', 7);
$maintenance['longtimenosee'] = new configvar (get_string('configlongtimenosee', 'admin'),
choose_from_menu ($options, 'longtimenosee', $config->longtimenosee, '', '', '', true) );
/// deleteunconfirmed
unset($options);
$options[0] = get_string('never');
$options[168] = get_string('numdays', '', 7);
$options[144] = get_string('numdays', '', 6);
$options[120] = get_string('numdays', '', 5);
$options[96] = get_string('numdays', '', 4);
$options[72] = get_string('numdays', '', 3);
$options[48] = get_string('numdays', '', 2);
$options[24] = get_string('numdays', '', 1);
$options[12] = get_string('numhours', '', 12);
$options[6] = get_string('numhours', '', 6);
$options[1] = get_string('numhours', '', 1);
$maintenance['deleteunconfirmed'] = new configvar (get_string('configdeleteunconfirmed', 'admin'),
choose_from_menu ($options, 'deleteunconfirmed', $config->deleteunconfirmed, '', '', '', true) );
/// loglifetime
unset($options);
$options[0] = get_string('neverdeletelogs');
$options[1000] = get_string('numdays', '', 1000);
$options[365] = get_string('numdays', '', 365);
$options[180] = get_string('numdays', '', 180);
$options[150] = get_string('numdays', '', 150);
$options[120] = get_string('numdays', '', 120);
$options[90] = get_string('numdays', '', 90);
$options[60] = get_string('numdays', '', 60);
$options[30] = get_string('numdays', '', 30);
$maintenance['loglifetime'] = new configvar (get_string('configloglifetime', 'admin'),
choose_from_menu ($options, 'loglifetime', $config->loglifetime, '', '', '', true) );
////////////////////////////////////////////////////////////////////
/// MAIL config variables
////////////////////////////////////////////////////////////////////
$mail = array();
/// smtphosts
$mail['smtphosts'] = new configvar (get_string('configsmtphosts', 'admin'),
'<input name="smtphosts" type="text" size="30" value="'.s($config->smtphosts).'" alt="smtphosts" />' );
/// smtpuser
$mail['smtpuser'] = new configvar (get_string('configsmtpuser', 'admin'),
'<input name="smtpuser" type="text" size="10" value="'.s($config->smtpuser).'" alt="smtpuser" />' );
/// smtppass
$mail['smtppass'] = new configvar ('',
'<input name="smtppass" type="password" size="10" value="'.s($config->smtppass).'" alt="smtppass" />' );
/// noreplyaddress
$mail['noreplyaddress'] = new configvar (get_string('confignoreplyaddress', 'admin'),
'<input name="noreplyaddress" type="text" size="30" value="'.s($config->noreplyaddress).'" alt="noreplyaddress" />' );
/// digestmailtime
$hours = array();
for ($i=0; $i<=23; $i++) {
$hours[$i] = sprintf("%02d",$i);
}
$mail['digestmailtime'] = new configvar (get_string('configdigestmailtime', 'admin'),
choose_from_menu($hours, 'digestmailtime', $config->digestmailtime, '', '', 0, true) );
/// allowemailaddresses
$mail['allowemailaddresses'] = new configvar (get_string('configallowemailaddresses', 'admin'),
'<input name="allowemailaddresses" type="text" size="60" value="'.s($config->allowemailaddresses).'" alt="allowemailaddresses" />' );
/// denyemailaddresses
$mail['denyemailaddresses'] = new configvar (get_string('configdenyemailaddresses', 'admin'),
'<input name="denyemailaddresses" type="text" size="60" value="'.s($config->denyemailaddresses).'" alt="denyemailaddresses" />' );
////////////////////////////////////////////////////////////////////
$configvars['interface'] = $interface;
$configvars['security'] = $security;
$configvars['operatingsystem'] = $operatingsystem;
$configvars['maintenance'] = $maintenance;
$configvars['mail'] = $mail;
$configvars['user'] = $user;
$configvars['permissions'] = $permissions;
$configvars['misc'] = $misc;
?>
+91
View File
@@ -0,0 +1,91 @@
<form name="creatorsform" id="creatorsform" method="post" action="creators.php">
<input type="hidden" name="previoussearch" value="<?php echo $previoussearch ?>">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
<table align="center" border="0" cellpadding="5" cellspacing="0">
<tr>
<td valign="top">
<?php
$a->count = count($creators);
$a->items = $strexistingcreators;
print_string('counteditems', '', $a);
?>
</td>
<td></td>
<td valign="top">
<?php
$a->count = $usercount;
$a->items = $strpotentialcreators;
print_string('counteditems', '', $a);
?>
</td>
</tr>
<tr>
<td valign="top">
<select name="removeselect[]" size="20" id="removeselect" multiple
onFocus="document.creatorsform.add.disabled=true;
document.creatorsform.remove.disabled=false;
document.creatorsform.addselect.selectedIndex=-1;">
<?php
foreach ($creators as $creator) {
$fullname = fullname($creator, true);
echo "<option value=\"$creator->id\">".$fullname.", ".$creator->email."</option>\n";
}
?>
</select></td>
<td valign="top">
<br />
<input name="add" type="submit" id="add" value="&larr;" />
<br />
<input name="remove" type="submit" id="remove" value="&rarr;" />
<br />
</td>
<td valign="top">
<select name="addselect[]" size="20" id="addselect" multiple
onFocus="document.creatorsform.add.disabled=false;
document.creatorsform.remove.disabled=true;
document.creatorsform.removeselect.selectedIndex=-1;">
<?php
if (!empty($searchusers)) {
echo "<optgroup label=\"$strsearchresults (" . count($searchusers) . ")\">\n";
foreach ($searchusers as $user) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
}
echo "</optgroup>\n";
}
if (!empty($users)) {
foreach ($users as $user) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
}
}
?>
</select>
<br />
<script type="text/javascript">
function
</script>
<input type="text" name="searchtext" size="30" value="<?php echo $searchtext ?>"
onFocus ="document.creatorsform.add.disabled=true;
document.creatorsform.remove.disabled=true;
document.creatorsform.removeselect.selectedIndex=-1;
document.creatorsform.addselect.selectedIndex=-1;"
onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
if (keyCode == 13) {
document.creatorsform.previoussearch.value=1;
document.creatorsform.submit();
} " />
<input name="search" id="search" type="submit" value="<?php p($strsearch) ?>"/>
<?php
if (!empty($searchusers)) {
echo '<input name="showall" id="showall" type="submit" value="'.$strshowall.'" />'."\n";
}
?>
</td>
</tr>
</table>
</form>
+116
View File
@@ -0,0 +1,116 @@
<?PHP // $Id$
// Admin only script to assign course creator rights to users
require_once("../config.php");
define("MAX_USERS_PER_PAGE", 50);
optional_variable($search, "");
optional_variable($add, "");
optional_variable($remove, "");
if (! $site = get_site()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
require_login();
if (!isadmin()) {
error("You must be an administrator to use this page.");
}
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
$primaryadmin = get_admin();
/// assign all of the configurable language strings
$stringstoload = array (
"assigncreators",
"administration",
"existingcreators",
"potentialcreators",
"search",
"users",
"searchresults",
"showall"
);
foreach ($stringstoload as $stringtoload){
$strstringtoload = "str" . $stringtoload;
$$strstringtoload = get_string($stringtoload);
}
print_header("$site->shortname: $strassigncreators",
"$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> <a href=\"users.php\">$strusers</a> ->
$strassigncreators", "creatorsform.searchtext");
if (!$frm = data_submitted()) {
print_simple_box("<center>".get_string("adminhelpassigncreators")."</center>", "center", "50%");
/// A form was submitted so process the input
} else {
if (!empty($frm->add) and !empty($frm->addselect)) {
foreach ($frm->addselect as $addcreator) {
if (! add_creator($addcreator)) {
error("Could not add course creator with user id $addcreator!");
}
}
} else if (!empty($frm->remove) and !empty($frm->removeselect)) {
foreach ($frm->removeselect as $removecreator) {
if (! remove_creator($removecreator)) {
error("Could not remove course creator with user id $removecreator!");
}
}
} else if (!empty($frm->showall)) {
unset($frm->searchtext);
$frm->previoussearch = 0;
}
}
/// Is there a current search?
$previoussearch = (!empty($frm->search) or ($frm->previoussearch == 1)) ;
/// Get all existing creators
if (! $creators = get_creators()) {
$creators = array();
}
$creatorsarray = array();
foreach ($creators as $creator) {
$creatorsarray[] = $creator->id;
}
$creatorlist = implode(',', $creatorsarray);
unset($creatorarray);
/// Get search results excluding any current admins
if (!empty($frm->searchtext) and $previoussearch) {
$searchusers = get_users(true, $frm->searchtext, true, $creatorlist, 'firstname ASC, lastname ASC',
'', '', 0, 99999, 'id, firstname, lastname, email');
$usercount = get_users(false, '', true, $creatorlist);
}
/// If no search results then get potential users excluding current creators
if (empty($searchusers)) {
if (!$users = get_users(true, '', true, $creatorlist, 'firstname ASC, lastname ASC', '', '',
0, 99999, 'id, firstname, lastname, email') ) {
$users = array();
}
$usercount = count($users);
}
$searchtext = (isset($frm->searchtext)) ? $frm->searchtext : "";
$previoussearch = ($previoussearch) ? '1' : '0';
include('./creators.html');
print_footer();
?>
+39 -396
View File
@@ -1,4 +1,4 @@
<?php // $Id$
<?PHP // $Id$
/// This script looks through all the module directories for cron.php files
/// and runs them. These files can contain cleanup functions, email functions
@@ -10,18 +10,14 @@
///
/// eg wget -q -O /dev/null 'http://moodle.somewhere.edu/admin/cron.php'
/// or php /web/moodle/admin/cron.php
set_time_limit(0);
$starttime = microtime();
/// The following is a hack necessary to allow this script to work well
/// from the command line.
define('FULLME', 'cron');
/// Do not set moodle cookie because we do not need it here, it is better to emulate session
$nomoodlecookie = true;
/// The current directory in PHP version 4.3.0 and above isn't necessarily the
/// directory of the script when run from the command line. The require_once()
/// would fail, so we'll have to chdir()
@@ -30,78 +26,30 @@
chdir(dirname($_SERVER['argv'][0]));
}
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/gradelib.php');
require_once("../config.php");
/// Extra debugging (set in config.php)
if (!empty($CFG->showcronsql)) {
$db->debug = true;
}
if (!empty($CFG->showcrondebugging)) {
$CFG->debug = DEBUG_DEVELOPER;
$CFG->debugdisplay = true;
if (!$alreadyadmin = isadmin()) {
unset($_SESSION['USER']);
unset($USER);
unset($_SESSION['SESSION']);
unset($SESSION);
$USER = get_admin(); /// Temporarily, to provide environment for this script
}
/// extra safety
@session_write_close();
/// check if execution allowed
if (isset($_SERVER['REMOTE_ADDR'])) { // if the script is accessed via the web.
if (!empty($CFG->cronclionly)) {
// This script can only be run via the cli.
print_error('cronerrorclionly', 'admin');
exit;
}
// This script is being called via the web, so check the password if there is one.
if (!empty($CFG->cronremotepassword)) {
$pass = optional_param('password', '', PARAM_RAW);
if($pass != $CFG->cronremotepassword) {
// wrong password.
print_error('cronerrorpassword', 'admin');
exit;
}
}
}
/// emulate normal session
$SESSION = new object();
$USER = get_admin(); /// Temporarily, to provide environment for this script
/// ignore admins timezone, language and locale - use site deafult instead!
$USER->timezone = $CFG->timezone;
$USER->lang = '';
$USER->theme = '';
course_setup(SITEID);
/// send mime type and encoding
if (check_browser_version('MSIE')) {
//ugly IE hack to work around downloading instead of viewing
@header('Content-Type: text/html; charset=utf-8');
echo "<xmp>"; //<pre> is not good enough for us here
} else {
//send proper plaintext header
@header('Content-Type: text/plain; charset=utf-8');
}
/// no more headers and buffers
while(@ob_end_flush());
/// increase memory limit (PHP 5.2 does different calculation, we need more memory now)
@raise_memory_limit('128M');
//unset test cookie, user must login again anyway
setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, '/');
/// Start output log
$timenow = time();
mtrace("<pre>");
mtrace("Server Time: ".date('r',$timenow)."\n\n");
/// Run all cron jobs for each module
mtrace("Starting activity modules");
get_mailer('buffer');
if ($mods = get_records_select("modules", "cron > 0 AND (($timenow - lastcron) > cron) AND visible = 1 ")) {
if ($mods = get_records_select("modules", "cron > 0 AND (($timenow - lastcron) > cron)")) {
foreach ($mods as $mod) {
$libfile = "$CFG->dirroot/mod/$mod->name/lib.php";
if (file_exists($libfile)) {
@@ -109,123 +57,23 @@
$cron_function = $mod->name."_cron";
if (function_exists($cron_function)) {
mtrace("Processing module function $cron_function ...", '');
$pre_dbqueries = null;
if (!empty($PERF->dbqueries)) {
$pre_dbqueries = $PERF->dbqueries;
$pre_time = microtime(1);
}
if ($cron_function()) {
if (! set_field("modules", "lastcron", $timenow, "id", $mod->id)) {
mtrace("Error: could not update timestamp for $mod->fullname");
}
}
if (isset($pre_dbqueries)) {
mtrace("... used " . ($PERF->dbqueries - $pre_dbqueries) . " dbqueries");
mtrace("... used " . (microtime(1) - $pre_time) . " seconds");
}
/// Reset possible changes by modules to time_limit. MDL-11597
@set_time_limit(0);
mtrace("done.");
}
}
}
}
get_mailer('close');
mtrace("Finished activity modules");
mtrace("Starting blocks");
if ($blocks = get_records_select("block", "cron > 0 AND (($timenow - lastcron) > cron) AND visible = 1")) {
// we will need the base class.
require_once($CFG->dirroot.'/blocks/moodleblock.class.php');
foreach ($blocks as $block) {
$blockfile = $CFG->dirroot.'/blocks/'.$block->name.'/block_'.$block->name.'.php';
if (file_exists($blockfile)) {
require_once($blockfile);
$classname = 'block_'.$block->name;
$blockobj = new $classname;
if (method_exists($blockobj,'cron')) {
mtrace("Processing cron function for ".$block->name.'....','');
if ($blockobj->cron()) {
if (!set_field('block','lastcron',$timenow,'id',$block->id)) {
mtrace('Error: could not update timestamp for '.$block->name);
}
}
/// Reset possible changes by blocks to time_limit. MDL-11597
@set_time_limit(0);
mtrace('done.');
}
}
}
}
mtrace('Finished blocks');
mtrace('Starting admin reports');
// Admin reports do not have a database table that lists them. Instead a
// report includes cron.php with function report_reportname_cron() if it wishes
// to be cronned. It is up to cron.php to handle e.g. if it only needs to
// actually do anything occasionally.
$reports = get_list_of_plugins($CFG->admin.'/report');
foreach($reports as $report) {
$cronfile = $CFG->dirroot.'/'.$CFG->admin.'/report/'.$report.'/cron.php';
if (file_exists($cronfile)) {
require_once($cronfile);
$cronfunction = 'report_'.$report.'_cron';
mtrace('Processing cron function for '.$report.'...', '');
$pre_dbqueries = null;
if (!empty($PERF->dbqueries)) {
$pre_dbqueries = $PERF->dbqueries;
$pre_time = microtime(true);
}
$cronfunction();
if (isset($pre_dbqueries)) {
mtrace("... used " . ($PERF->dbqueries - $pre_dbqueries) . " dbqueries");
mtrace("... used " . round(microtime(true) - $pre_time, 2) . " seconds");
}
mtrace('done.');
}
}
mtrace('Finished admin reports');
if (!empty($CFG->langcache)) {
mtrace('Updating languages cache');
get_list_of_languages(true);
get_list_of_languages();
}
mtrace('Removing expired enrolments ...', ''); // See MDL-8785
$timenow = time();
$somefound = false;
// The preferred way saves memory, dmllib.php
// find courses where limited enrolment is enabled
global $CFG;
$rs_enrol = get_recordset_sql("SELECT ra.roleid, ra.userid, ra.contextid
FROM {$CFG->prefix}course c
INNER JOIN {$CFG->prefix}context cx ON cx.instanceid = c.id
INNER JOIN {$CFG->prefix}role_assignments ra ON ra.contextid = cx.id
WHERE cx.contextlevel = '".CONTEXT_COURSE."'
AND ra.timeend > 0
AND ra.timeend < '$timenow'
AND c.enrolperiod > 0
");
while ($oldenrolment = rs_fetch_next_record($rs_enrol)) {
role_unassign($oldenrolment->roleid, $oldenrolment->userid, 0, $oldenrolment->contextid);
$somefound = true;
}
rs_close($rs_enrol);
if($somefound) {
mtrace('Done');
} else {
mtrace('none found');
}
mtrace('Starting main gradebook job ...');
grade_cron();
mtrace('done.');
mtrace('Starting processing the event queue...');
events_cron();
mtrace('done.');
/// Run all core cron jobs, but not every time since they aren't too important.
/// These don't have a timer to reduce load, so we'll use a random number
@@ -240,165 +88,60 @@
/// Unenrol users who haven't logged in for $CFG->longtimenosee
if ($CFG->longtimenosee) { // value in days
$cuttime = $timenow - ($CFG->longtimenosee * 3600 * 24);
$rs = get_recordset_sql ("SELECT id, userid, courseid
FROM {$CFG->prefix}user_lastaccess
WHERE courseid != ".SITEID."
AND timeaccess < $cuttime ");
while ($assign = rs_fetch_next_record($rs)) {
if ($context = get_context_instance(CONTEXT_COURSE, $assign->courseid)) {
if (role_unassign(0, $assign->userid, 0, $context->id)) {
mtrace("removing user $assign->userid from course $assign->courseid as they have not accessed the course for over $CFG->longtimenosee days");
$longtime = $timenow - ($CFG->longtimenosee * 3600 * 24);
if ($students = get_users_longtimenosee($longtime)) {
foreach ($students as $student) {
if (unenrol_student($student->userid, $student->course)) {
mtrace("Deleted student enrolment for user $student->userid from course $student->course");
}
}
}
rs_close($rs);
/// Execute the same query again, looking for remaining records and deleting them
/// if the user hasn't moodle/course:view in the CONTEXT_COURSE context (orphan records)
$rs = get_recordset_sql ("SELECT id, userid, courseid
FROM {$CFG->prefix}user_lastaccess
WHERE courseid != ".SITEID."
AND timeaccess < $cuttime ");
while ($assign = rs_fetch_next_record($rs)) {
if ($context = get_context_instance(CONTEXT_COURSE, $assign->courseid)) {
if (!has_capability('moodle/course:view', $context, $assign->userid)) {
delete_records('user_lastaccess', 'userid', $assign->userid, 'courseid', $assign->courseid);
mtrace("Deleted orphan user_lastaccess for user $assign->userid from course $assign->courseid");
}
}
}
rs_close($rs);
}
flush();
/// Delete users who haven't confirmed within required period
if (!empty($CFG->deleteunconfirmed)) {
$cuttime = $timenow - ($CFG->deleteunconfirmed * 3600);
$rs = get_recordset_sql ("SELECT id, firstname, lastname
FROM {$CFG->prefix}user
WHERE confirmed = 0
AND firstaccess > 0
AND firstaccess < $cuttime");
while ($user = rs_fetch_next_record($rs)) {
if (delete_records('user', 'id', $user->id)) {
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
if ($users = get_users_unconfirmed($oneweek)) {
foreach ($users as $user) {
if (delete_records("user", "id", $user->id)) {
mtrace("Deleted unconfirmed user for ".fullname($user, true)." ($user->id)");
}
}
rs_close($rs);
}
flush();
/// Delete users who haven't completed profile within required period
if (!empty($CFG->deleteincompleteusers)) {
$cuttime = $timenow - ($CFG->deleteincompleteusers * 3600);
$rs = get_recordset_sql ("SELECT id, username
FROM {$CFG->prefix}user
WHERE confirmed = 1
AND lastaccess > 0
AND lastaccess < $cuttime
AND deleted = 0
AND (lastname = '' OR firstname = '' OR email = '')");
while ($user = rs_fetch_next_record($rs)) {
if (delete_user($user)) {
mtrace("Deleted not fully setup user $user->username ($user->id)");
}
}
rs_close($rs);
}
flush();
/// Delete old logs to save space (this might need a timer to slow it down...)
if (!empty($CFG->loglifetime)) { // value in days
$loglifetime = $timenow - ($CFG->loglifetime * 3600 * 24);
if (delete_records_select("log", "time < '$loglifetime'")) {
mtrace("Deleted old log records");
}
delete_records_select("log", "time < '$loglifetime'");
}
flush();
/// Delete old cached texts
if (!empty($CFG->cachetext)) { // Defined in config.php
$cachelifetime = time() - $CFG->cachetext - 60; // Add an extra minute to allow for really heavy sites
if (delete_records_select('cache_text', "timemodified < '$cachelifetime'")) {
mtrace("Deleted old cache_text records");
}
$cachelifetime = time() - $CFG->cachetext;
delete_records_select("cache_text", "timemodified < '$cachelifetime'");
}
flush();
if (!empty($CFG->notifyloginfailures)) {
notify_login_failures();
mtrace('Notified login failured');
}
flush();
sync_metacourses();
mtrace('Synchronised metacourses');
//
// generate new password emails for users
//
mtrace('checking for create_password');
if (count_records('user_preferences', 'name', 'create_password', 'value', '1')) {
mtrace('creating passwords for new users');
$newusers = get_records_sql("SELECT u.id as id, u.email, u.firstname,
u.lastname, u.username,
p.id as prefid
FROM {$CFG->prefix}user u
JOIN {$CFG->prefix}user_preferences p ON u.id=p.userid
WHERE p.name='create_password' AND p.value='1' AND u.email !='' ");
foreach ($newusers as $newuserid => $newuser) {
$newuser->emailstop = 0; // send email regardless
// email user
if (setnew_password_and_mail($newuser)) {
// remove user pref
delete_records('user_preferences', 'id', $newuser->prefid);
} else {
trigger_error("Could not create and mail new user password!");
}
}
}
if (!empty($CFG->usetags)) {
require_once($CFG->dirroot.'/tag/lib.php');
tag_cron();
mtrace ('Executed tag cron');
}
// Accesslib stuff
cleanup_contexts();
mtrace ('Cleaned up contexts');
gc_cache_flags();
mtrace ('Cleaned cache flags');
// If you suspect that the context paths are somehow corrupt
// replace the line below with: build_context_path(true);
build_context_path();
mtrace ('Built context paths');
mtrace("Finished clean-up tasks...");
} // End of occasional clean-up tasks
if (empty($CFG->disablescheduledbackups)) { // Defined in config.php
if (!isset($CFG->disablescheduledbackups)) { // Defined in config.php
//Execute backup's cron
//Perhaps a long time and memory could help in large sites
@set_time_limit(0);
@raise_memory_limit("192M");
if (function_exists('apache_child_terminate')) {
// if we are running from Apache, give httpd a hint that
// it can recycle the process after it's done. Apache's
// memory management is truly awful but we can help it.
@apache_child_terminate();
}
@raise_memory_limit("128M");
if (file_exists("$CFG->dirroot/backup/backup_scheduled.php") and
file_exists("$CFG->dirroot/backup/backuplib.php") and
file_exists("$CFG->dirroot/backup/lib.php") and
@@ -410,7 +153,7 @@
mtrace("Running backups if required...");
if (! schedule_backup_cron()) {
mtrace("ERROR: Something went wrong while performing backup tasks!!!");
mtrace("ERORR: Something went wrong while performing backup tasks!!!");
} else {
mtrace("Backup tasks finished.");
}
@@ -428,108 +171,13 @@
}
}
/// Run the auth cron, if any
/// before enrolments because it might add users that will be needed in enrol plugins
$auths = get_enabled_auth_plugins();
mtrace("Running auth crons if required...");
foreach ($auths as $auth) {
$authplugin = get_auth_plugin($auth);
if (method_exists($authplugin, 'cron')) {
mtrace("Running cron for auth/$auth...");
$authplugin->cron();
if (!empty($authplugin->log)) {
mtrace($authplugin->log);
}
}
unset($authplugin);
}
/// Run the enrolment cron, if any
if (!($plugins = explode(',', $CFG->enrol_plugins_enabled))) {
$plugins = array($CFG->enrol);
require_once("$CFG->dirroot/enrol/$CFG->enrol/enrol.php");
$enrol = new enrolment_plugin();
$enrol->cron();
if (!empty($enrol->log)) {
mtrace($enrol->log);
}
require_once($CFG->dirroot .'/enrol/enrol.class.php');
foreach ($plugins as $p) {
$enrol = enrolment_factory::factory($p);
if (method_exists($enrol, 'cron')) {
$enrol->cron();
}
if (!empty($enrol->log)) {
mtrace($enrol->log);
}
unset($enrol);
}
if (!empty($CFG->enablestats) and empty($CFG->disablestatsprocessing)) {
require_once($CFG->dirroot.'/lib/statslib.php');
// check we're not before our runtime
$timetocheck = stats_get_base_daily() + $CFG->statsruntimestarthour*60*60 + $CFG->statsruntimestartminute*60;
if (time() > $timetocheck) {
// process configured number of days as max (defaulting to 31)
$maxdays = empty($CFG->statsruntimedays) ? 31 : abs($CFG->statsruntimedays);
if (stats_cron_daily($maxdays)) {
if (stats_cron_weekly()) {
if (stats_cron_monthly()) {
stats_clean_old();
}
}
}
@set_time_limit(0);
} else {
mtrace('Next stats run after:'. userdate($timetocheck));
}
}
// run gradebook import/export/report cron
if ($gradeimports = get_list_of_plugins('grade/import')) {
foreach ($gradeimports as $gradeimport) {
if (file_exists($CFG->dirroot.'/grade/import/'.$gradeimport.'/lib.php')) {
require_once($CFG->dirroot.'/grade/import/'.$gradeimport.'/lib.php');
$cron_function = 'grade_import_'.$gradeimport.'_cron';
if (function_exists($cron_function)) {
mtrace("Processing gradebook import function $cron_function ...", '');
$cron_function();
}
}
}
}
if ($gradeexports = get_list_of_plugins('grade/export')) {
foreach ($gradeexports as $gradeexport) {
if (file_exists($CFG->dirroot.'/grade/export/'.$gradeexport.'/lib.php')) {
require_once($CFG->dirroot.'/grade/export/'.$gradeexport.'/lib.php');
$cron_function = 'grade_export_'.$gradeexport.'_cron';
if (function_exists($cron_function)) {
mtrace("Processing gradebook export function $cron_function ...", '');
$cron_function();
}
}
}
}
if ($gradereports = get_list_of_plugins('grade/report')) {
foreach ($gradereports as $gradereport) {
if (file_exists($CFG->dirroot.'/grade/report/'.$gradereport.'/lib.php')) {
require_once($CFG->dirroot.'/grade/report/'.$gradereport.'/lib.php');
$cron_function = 'grade_report_'.$gradereport.'_cron';
if (function_exists($cron_function)) {
mtrace("Processing gradebook report function $cron_function ...", '');
$cron_function();
}
}
}
}
// run any customized cronjobs, if any
// looking for functions in lib/local/cron.php
if (file_exists($CFG->dirroot.'/local/cron.php')) {
mtrace('Processing customized cron script ...', '');
include_once($CFG->dirroot.'/local/cron.php');
mtrace('done.');
}
//Unset session variables and destroy it
@session_unset();
@@ -540,9 +188,4 @@
$difftime = microtime_diff($starttime, microtime());
mtrace("Execution took ".$difftime." seconds");
/// finish the IE hack
if (check_browser_version('MSIE')) {
echo "</xmp>";
}
?>
+8 -15
View File
@@ -1,32 +1,25 @@
<?PHP // $Id$
// dbperformance.php - shows latest ADOdb stats for the current server
require_once('../config.php');
// disable moodle specific debug messages that would be breaking the frames
disable_debugging();
$topframe = optional_param('topframe', 0, PARAM_BOOL);
$bottomframe = optional_param('bottomframe', 0, PARAM_BOOL);
$do = optional_param('do', '', PARAM_ALPHA);
require_once("../config.php");
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
if (!isadmin()) {
error("Only the admin can use this page");
}
$strdatabaseperformance = get_string("databaseperformance");
$stradministration = get_string("administration");
$site = get_site();
$navigation = build_navigation(array(
array('name'=>$stradministration, 'link'=>'index.php', 'type'=>'misc'),
array('name'=>$strdatabaseperformance, 'link'=>null, 'type'=>'misc')));
if (!empty($topframe)) {
print_header("$site->shortname: $strdatabaseperformance", "$site->fullname", $navigation);
if (isset($topframe)) {
print_header("$site->shortname: $strdatabaseperformance", "$site->fullname",
"<a target=\"$CFG->framename\" href=\"index.php\">$stradministration</a> -> Database performance");
exit;
}
if (!empty($bottomframe) or !empty($do)) {
if (isset($bottomframe) or isset($_GET['do'])) {
$perf =&NewPerfMonitor($db);
$perf->UI($pollsecs=5);
exit;
+10 -21
View File
@@ -4,35 +4,25 @@
// BE VERY CAREFUL USING THIS!
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('purgemoodledata');
require_login();
$sure = optional_param('sure', 0, PARAM_BOOL);
$reallysure = optional_param('reallysure', 0, PARAM_BOOL);
$sure = optional_param('sure', '');
$reallysure = optional_param('reallysure', '');
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
if (!isadmin()) {
error('You must be admin to use this script!');
}
$deletedir = $CFG->dataroot; // The directory to delete!
admin_externalpage_print_header();
print_heading('Purge moodledata');
if (empty($sure)) {
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey());
notice_yesno ('Are you completely sure you want to delete everything inside the directory '. $deletedir .' ?',
'delete.php', 'index.php', $optionsyes, NULL, 'post', 'get');
admin_externalpage_print_footer();
notice_yesno ('Are you completely sure you want to delete everything inside the directory '. $deletedir .' ?', 'delete.php?sure=yes&amp;sesskey='.sesskey(), 'index.php');
exit;
}
if (!data_submitted() or empty($reallysure)) {
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey(), 'reallysure'=>'yes');
notice_yesno ('Are you REALLY REALLY completely sure you want to delete everything inside the directory '. $deletedir .' (this includes all user images, and any other course files that have been created) ?',
'delete.php', 'index.php', $optionsyes, NULL, 'post', 'get');
admin_externalpage_print_footer();
if (empty($reallysure)) {
notice_yesno ('Are you REALLY REALLY completely sure you want to delete everything inside the directory '. $deletedir .' (this includes all user images, and any other course files that have been created) ?', 'delete.php?sure=yes&amp;reallysure=yes&amp;sesskey='.sesskey(), 'index.php');
exit;
}
@@ -46,7 +36,6 @@
echo '<h1 align="center">Done!</h1>';
print_continue($CFG->wwwroot);
admin_externalpage_print_footer();
exit;
@@ -54,7 +43,7 @@ function delete_subdirectories($rootdir) {
$dir = opendir($rootdir);
while (false !== ($file = readdir($dir))) {
while ($file = readdir($dir)) {
if ($file != '.' and $file != '..') {
$fullfile = $rootdir .'/'. $file;
if (filetype($fullfile) == 'dir') {
@@ -77,5 +66,5 @@ function delete_subdirectories($rootdir) {
}
closedir($dir);
}
?>
+265
View File
@@ -0,0 +1,265 @@
<form method="post" action="editor.php">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<table border="0" cellpadding="4" cellspacing="2">
<tr>
<td align="right" valign="top">htmleditor:</td>
<td valign="top">
<?php
unset($options);
$options[0] = get_string("allownot");
$options[1] = get_string("allow");
choose_from_menu ($options, "htmleditor", $CFG->htmleditor, "", "", "");
?>
</td>
<td>
<?php print_string('confightmleditor', 'admin') ?>
</td>
</tr>
<tr>
<td align="right" valign="top">editorbackgroundcolor:</td>
<td valign="top"><input type="text" name="backgroundcolor" size="10" value="<?php print($CFG->editorbackgroundcolor);?>" /></td>
<td valign="top"><?php print_string("edhelpbgcolor");?></td>
</tr>
<tr>
<td align="right" valign="top">editorfontfamily:</td>
<td valign="top"><input type="text" name="fontfamily" size="30" value="<?php print($CFG->editorfontfamily);?>" /></td>
<td valign="top"><?php print_string("edhelpfontfamily");?></td>
</tr>
<tr>
<td align="right" valign="top">editorfontsize:</td>
<td valign="top"><input type="text" name="fontsize" size="10" value="<?php print($CFG->editorfontsize);?>" /></td>
<td valign="top"><?php print_string("edhelpfontsize");?></td>
</tr>
<tr>
<td align="right" valign="top">editorkillword:</td>
<td valign="top"><select name="killword">
<option value="1"<?php print(!$CFG->editorkillword)?"":" selected=\"selected\"";?>><?php print_string("yes");?></option>
<option value="0"<?php print(!$CFG->editorkillword)?" selected=\"selected\"":"";?>><?php print_string("no");?></option>
</select></td>
<td valign="top"><?php print_string("edhelpcleanword");?></td>
</tr>
<tr>
<td align="right" valign="top">aspellpath:</td>
<td valign="top"><input onchange="change_state()" id="aspellpath" type="text" name="aspellpath" size="25" value="<?php print($CFG->aspellpath);?>" /></td>
<td valign="top"><?php print_string("edhelpaspellpath");?></td>
</tr>
<tr>
<td align="right" valign="top">editorspelling:</td>
<td valign="top"><select onchange="change_state()" id="spelling" name="spelling"<?php
if (empty($CFG->aspellpath)) {
echo " disabled=\"disabled\"";
$CFG->editorspelling = false;
}
?>>
<option value="1"<?php print(!$CFG->editorspelling)?"":" selected=\"selected\"";?>><?php print_string("yes");?></option>
<option value="0"<?php print(!$CFG->editorspelling)?" selected=\"selected\"":"";?>><?php print_string("no");?></option>
</select>
<select id="dictionary" name="dictionary"<?php
if (empty($CFG->aspellpath)) {
echo " disabled=\"disabled\"";
$CFG->editordictionary = false;
}
?>>
<?php
if (is_array($dicts)) {
foreach ($dicts as $dict) {
echo "<option value=\"$dict\"";
if (!empty($CFG->editordictionary)) {
print ($CFG->editordictionary != $dict) ? "" : " selected=\"selected\"";
}
echo ">$dict</option>\n";
}
} else if (is_string($dicts)) {
echo '<option value="">'. $dicts .'</option>' . "\n";
}
?>
</select>
</td>
<td valign="top"><?php print_string("edhelpenablespelling");?></td>
</tr>
<tr><td colspan="3"><br /><?php print_string("edhelpfontlist");?></td></tr>
<?php
if(is_array($fontlist)) {
foreach($fontlist as $fontkey => $fontvalue) {
?>
<tr>
<td>&nbsp;</td>
<td colspan="2"><input type="text" name="fontname[]" size="15" value="<?php print($fontkey);?>">
<input type="text" name="fontnamevalue[]" size="30" value="<?php print($fontvalue);?>" /></td>
</tr>
<?php
}
}
?>
<tr>
<td>&nbsp;</td>
<td colspan="2"><input type="text" name="fontname[]" size="15" value="" />
<input type="text" name="fontnamevalue[]" size="30" value="" /></td>
</tr>
<tr>
<td valign="top" align="right">editorhidebuttons:</td>
<td colspan="2">
<?php
$buttons = array();
if (!empty($CFG->editorhidebuttons)) {
$buttons = explode(chr(32), $CFG->editorhidebuttons);
}
?>
<table border="0" cellpadding="2" cellspacing="1">
<tr>
<td colspan="12"><input type="checkbox" name="buttons[fontname]"<?php print(in_array("fontname", $buttons)) ? " checked=\"checked\"": "";?> /> <?php print_string("fontname","editor");?>
<input type="checkbox" name="buttons[fontsize]"<?php print(in_array("fontsize", $buttons)) ? " checked=\"checked\"": "";?> /> <?php print_string("fontsize","editor");?>
<input type="checkbox" name="buttons[formatblock]"<?php print(in_array("formatblock", $buttons)) ? " checked=\"checked\"": "";?> /> <?php print_string("formatblock","editor");?></td>
</tr>
<tr>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_bold.gif" width="18" height="18" alt="<?php print_string("bold","editor");?>" title="<?php print_string("bold","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_italic.gif" width="18" height="18" alt="<?php print_string("italic","editor");?>" title="<?php print_string("italic","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_underline.gif" width="18" height="18" alt="<?php print_string("underline","editor");?>" title="<?php print_string("underline","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_strike.gif" width="18" height="18" alt="<?php print_string("strikethrough","editor");?>" title="<?php print_string("strikethrough","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_sub.gif" width="18" height="18" alt="<?php print_string("subscript","editor");?>" title="<?php print_string("subscript","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_format_sup.gif" width="18" height="18" alt="<?php print_string("superscript","editor");?>" title="<?php print_string("superscript","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_copy.gif" width="18" height="18" alt="<?php print_string("copy","editor");?>" title="<?php print_string("copy","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_cut.gif" width="18" height="18" alt="<?php print_string("cut","editor");?>" title="<?php print_string("cut","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_paste.gif" width="18" height="18" alt="<?php print_string("paste","editor");?>" title="<?php print_string("paste","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_wordclean.gif" width="18" height="18" alt="<?php print_string("wordclean","editor");?>" title="<?php print_string("wordclean","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_undo.gif" width="18" height="18" alt="<?php print_string("undo","editor");?>" title="<?php print_string("undo","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_redo.gif" width="18" height="18" alt="<?php print_string("redo","editor");?>" title="<?php print_string("redo","editor");?>" /></td>
</tr>
<tr>
<td><input type="checkbox" name="buttons[bold]"<?php print(in_array("bold", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[italic]"<?php print(in_array("italic", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[underline]"<?php print(in_array("underline", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[strikethrough]"<?php print(in_array("strikethrough", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[subscript]"<?php print(in_array("subscript", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[superscript]"<?php print(in_array("superscript", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[copy]"<?php print(in_array("copy", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[cut]"<?php print(in_array("cut", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[paste]"<?php print(in_array("paste", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[clean]"<?php print(in_array("clean", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[undo]"<?php print(in_array("undo", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[redo]"<?php print(in_array("redo", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
</tr>
<tr>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_align_left.gif" width="18" height="18" alt="<?php print_string("justifyleft","editor");?>" title="<?php print_string("justifyleft","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_align_center.gif" width="18" height="18" alt="<?php print_string("justifycenter","editor");?>" title="<?php print_string("justifycenter","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_align_right.gif" width="18" height="18" alt="<?php print_string("justifyright","editor");?>" title="<?php print_string("justifyright","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_align_justify.gif" width="18" height="18" alt="<?php print_string("justifyfull","editor");?>" title="<?php print_string("justifyfull","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_left_to_right.gif" width="18" height="18" alt="<?php print_string("lefttoright","editor");?>" title="<?php print_string("lefttoright","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_right_to_left.gif" width="18" height="18" alt="<?php print_string("righttoleft","editor");?>" title="<?php print_string("righttoleft","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_list_num.gif" width="18" height="18" alt="<?php print_string("orderedlist","editor");?>" title="<?php print_string("orderedlist","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_list_bullet.gif" width="18" height="18" alt="<?php print_string("unorderedlist","editor");?>" title="<?php print_string("unorderedlist","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_indent_less.gif" width="18" height="18" alt="<?php print_string("outdent","editor");?>" title="<?php print_string("outdent","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_indent_more.gif" width="18" height="18" alt="<?php print_string("indent","editor");?>" title="<?php print_string("indent","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_color_fg.gif" width="18" height="18" alt="<?php print_string("forecolor","editor");?>" title="<?php print_string("forecolor","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_color_bg.gif" width="18" height="18" alt="<?php print_string("hilitecolor","editor");?>" title="<?php print_string("hilitecolor","editor");?>" /></td>
</tr>
<tr>
<td><input type="checkbox" name="buttons[justifyleft]"<?php print(in_array("justifyleft", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[justifycenter]"<?php print(in_array("justifycenter", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[justifyright]"<?php print(in_array("justifyright", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[justifyfull]"<?php print(in_array("justifyfull", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[lefttoright]"<?php print(in_array("lefttoright", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[righttoleft]"<?php print(in_array("righttoleft", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[insertorderedlist]"<?php print(in_array("insertorderedlist", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[insertunorderedlist]"<?php print(in_array("insertunorderedlist", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[outdent]"<?php print(in_array("outdent", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[indent]"<?php print(in_array("indent", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[forecolor]"<?php print(in_array("forecolor", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[hilitecolor]"<?php print(in_array("hilitecolor", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
</tr>
<tr>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_hr.gif" width="18" height="18" alt="<?php print_string("horizontalrule","editor");?>" title="<?php print_string("horizontalrule","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_anchor.gif" width="18" height="18" alt="<?php print_string("createanchor","editor");?>" title="<?php print_string("createanchor","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_link.gif" width="18" height="18" alt="<?php print_string("insertlink","editor");?>" title="<?php print_string("insertlink","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_unlink.gif" width="18" height="18" alt="<?php print_string("removelink","editor");?>" title="<?php print_string("removelink","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_image.gif" width="18" height="18" alt="<?php print_string("insertimage","editor");?>" title="<?php print_string("insertimage","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/insert_table.gif" width="18" height="18" alt="<?php print_string("inserttable","editor");?>" title="<?php print_string("inserttable","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/em.icon.smile.gif" width="18" height="18" alt="<?php print_string("insertsmile","editor");?>" title="<?php print_string("insertsmile","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/icon_ins_char.gif" width="18" height="18" alt="<?php print_string("insertchar","editor");?>" title="<?php print_string("insertchar","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/spell-check.gif" width="18" height="18" alt="<?php print_string("spellcheck","editor");?>" title="<?php print_string("spellcheck","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_html.gif" width="18" height="18" alt="<?php print_string("htmlmode","editor");?>" title="<?php print_string("htmlmode","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/fullscreen_maximize.gif" width="18" height="18" alt="<?php print_string("popupeditor","editor");?>" title="<?php print_string("popupeditor","editor");?>" /></td>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_replace.gif" width="18" height="18" alt="<?php print_string("popupeditor","editor");?>" title="<?php print_string("searchandreplace","editor");?>" /></td>
</tr>
<tr>
<td><input type="checkbox" name="buttons[inserthorizontalrule]"<?php print(in_array("inserthorizontalrule", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[createanchor]"<?php print(in_array("createanchor", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[createlink]"<?php print(in_array("createlink", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[unlink]"<?php print(in_array("unlink", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[insertimage]"<?php print(in_array("insertimage", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[inserttable]"<?php print(in_array("inserttable", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[insertsmile]"<?php print(in_array("insertsmile", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[insertchar]"<?php print(in_array("insertchar", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[spellcheck]"<?php print(in_array("spellcheck", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[htmlmode]"<?php print(in_array("htmlmode", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[popupeditor]"<?php print(in_array("popupeditor", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td><input type="checkbox" name="buttons[search_replace]"<?php print(in_array("search_replace", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
</tr>
<tr>
<td><img src="<?php echo $CFG->wwwroot ?>/lib/editor/images/ed_nolink.gif" width="18" height="18" alt="<?php print_string("horizontalrule","editor");?>" title="<?php print_string("nolink","editor");?>" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><input type="checkbox" name="buttons[nolink]"<?php print(in_array("nolink", $buttons)) ? " checked=\"checked\"" : "" ;?> /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" align="center"><input type="submit" value="<?php print_string("savechanges");?>" /></td>
</tr>
</table>
</form>
<form method="post" action="<?php print($GLOBALS['ME']);?>">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<center>
<input type="submit" name="resettodefaults" value="<?php print_string('editorresettodefaults') ?>" />
</center>
</form>
<script language="javascript" type="text/javascript">
<!--
function change_state () {
var choice = document.forms[0].spelling;
var speller = choice.options[choice.selectedIndex].value;
var spellpath = document.forms[0].aspellpath.value;
if (spellpath == '') {
document.forms[0].spelling.disabled = true;
} else {
document.forms[0].spelling.disabled = false;
}
if (speller != 1) {
document.forms[0].dictionary.disabled = true;
} else {
document.forms[0].dictionary.disabled = false;
}
}
document.onload = change_state();
-->
</script>
+214
View File
@@ -0,0 +1,214 @@
<?php // $Id$
/// configuration routines for HTMLArea editor
require_once("../config.php");
require_login();
if (!isadmin()) {
error("Only admins can access this page");
}
if (($data = data_submitted()) && confirm_sesskey()) {
// do we want default values?
if (isset($data->resettodefaults)) {
if (!(reset_to_defaults())) {
error("Editor settings could not be restored!");
}
} else {
if (!(editor_update_config($data))) {
error("Editor settings could not be updated!");
}
}
redirect("$CFG->wwwroot/$CFG->admin/editor.php", get_string("changessaved"), 1);
} else {
// Generate edit form
$fontlist = editor_convert_to_array($CFG->editorfontlist);
$dicts = editor_get_dictionaries();
$stradmin = get_string("administration");
$strconfiguration = get_string("configuration");
$streditorsettings = get_string("editorsettings");
$streditorsettingshelp = get_string("adminhelpeditorsettings");
print_header("Editor settings","Editor settings",
"<a href=\"index.php\">$stradmin</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $streditorsettings");
print_heading($streditorsettings);
print_simple_box("<center>$streditorsettingshelp</center>","center","50%");
print("<br />\n");
print_simple_box_start("center");
include("editor.html");
print_simple_box_end();
print_footer();
}
/// FUNCTIONS
function editor_convert_to_array ($string) {
/// Converts $CFG->editorfontlist to array
if (empty($string) || !is_string($string)) {
return false;
}
$fonts = array();
$lines = explode(";", $string);
foreach ($lines as $line) {
if (!empty($line)) {
list($fontkey, $fontvalue) = explode(":", $line);
$fonts[$fontkey] = $fontvalue;
}
}
return $fonts;
}
function editor_update_config ($data) {
/// Updates the editor config values.
if (!is_object($data)) {
return false;
}
// Make array for unwanted characters.
$nochars = array(chr(33),chr(34),chr(35),chr(36),chr(37),
chr(38),chr(39),chr(40),chr(41),chr(42),
chr(43),chr(46),chr(47),chr(58),chr(59),
chr(60),chr(61),chr(62),chr(63),chr(64),
chr(91),chr(92),chr(93),chr(94),chr(95),
chr(96),chr(123),chr(124),chr(125),chr(126));
$fontlist = '';
// make font string
$cnt = count($data->fontname);
for ($i = 0; $i < $cnt; $i++) {
if (!empty($data->fontname[$i])) {
$fontlist .= str_replace($nochars, "", $data->fontname[$i]) .":";
$fontlist .= str_replace($nochars, "", $data->fontnamevalue[$i]) .";";
}
}
// strip last semicolon
$fontlist = substr($fontlist, 0, strlen($fontlist) - 1);
// make array of values to update
$updatedata = array();
$updatedata['htmleditor'] = !empty($data->htmleditor) ? $data->htmleditor : 0;
$updatedata['editorbackgroundcolor'] = !empty($data->backgroundcolor) ? $data->backgroundcolor : "#ffffff";
$updatedata['editorfontfamily'] = !empty($data->fontfamily) ? str_replace($nochars,"",$data->fontfamily) : "Times New Roman, Times";
$updatedata['editorfontsize'] = !empty($data->fontsize) ? $data->fontsize : "";
$updatedata['editorkillword'] = !empty($data->killword) ? $data->killword : 0;
$updatedata['editorspelling'] = !empty($data->spelling) ? $data->spelling : 0;
$updatedata['editorfontlist'] = $fontlist;
$updatedata['editordictionary'] = !empty($data->dictionary) ? $data->dictionary : '';
$updatedata['aspellpath'] = !empty($data->aspellpath) ? $data->aspellpath : '';
$hidebuttons = '';
if (!empty($data->buttons) && is_array($data->buttons)) {
foreach ($data->buttons as $key => $value) {
$hidebuttons .= $key . " ";
}
}
$updatedata['editorhidebuttons'] = trim($hidebuttons);
foreach ($updatedata as $name => $value) {
if (!(set_config($name, $value))) {
return false;
}
}
return true;
}
function reset_to_defaults () {
/// Reset the values to default
global $CFG;
include_once($CFG->dirroot .'/lib/defaults.php');
$updatedata = array();
$updatedata['editorbackgroundcolor'] = $defaults['editorbackgroundcolor'];
$updatedata['editorfontfamily'] = $defaults['editorfontfamily'];
$updatedata['editorfontsize'] = $defaults['editorfontsize'];
$updatedata['editorkillword'] = $defaults['editorkillword'];
$updatedata['editorspelling'] = $defaults['editorspelling'];
$updatedata['editorfontlist'] = $defaults['editorfontlist'];
$updatedata['editorhidebuttons'] = $defaults['editorhidebuttons'];
$updatedata['editordictionary'] = '';
foreach ($updatedata as $name => $value) {
if (!(set_config($name, $value))) {
return false;
}
}
return true;
}
function editor_get_dictionaries () {
/// Get all installed dictionaries in the system
global $CFG;
error_reporting(E_ALL); // for debug, final version shouldn't have this...
clearstatcache();
$strerror = '';
// If aspellpath isn't set don't even bother ;-)
if (empty($CFG->aspellpath)) {
return $strerror = 'Empty aspell path!';
}
// Do we have access to popen function?
if (!function_exists('popen')) {
return $strerror = "Popen function disabled!";
exit;
}
global $CFG;
$cmd = $CFG->aspellpath;
$output = '';
$dictionaries = array();
$dicts = array();
if(!($handle = @popen(escapeshellarg($cmd) .' dump dicts', 'r'))) {
return $strerror = "Couldn't create handle!";
exit;
}
while(!feof($handle)) {
$output .= fread($handle, 1024);
}
@pclose($handle);
$dictionaries = explode(chr(10), $output);
// Get rid of possible empty values
if (is_array($dictionaries)) {
$cnt = count($dictionaries);
for ($i = 0; $i < $cnt; $i++) {
if (!empty($dictionaries[$i])) {
$dicts[] = $dictionaries[$i];
}
}
}
if (count($dicts) >= 1) {
return $dicts;
}
$strerror = "Error! Check your aspell installation!";
return $strerror;
}
?>
+56 -112
View File
@@ -2,143 +2,87 @@
// enrol.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
include("../config.php");
$enrol = optional_param('enrol', $CFG->enrol, PARAM_SAFEDIR);
$savesettings = optional_param('savesettings', 0, PARAM_BOOL);
$enrol = optional_param('enrol', $CFG->enrol, PARAM_ALPHA);
$CFG->pagepath = 'enrol';
require_login();
admin_externalpage_setup('enrolment');
if (!isset($CFG->sendcoursewelcomemessage)) {
set_config('sendcoursewelcomemessage', 1);
if (!$site = get_site()) {
redirect("index.php");
}
require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
/// Save settings
if ($frm = data_submitted() and !$savesettings) {
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', 'error');
}
if (empty($frm->enable)) {
$frm->enable = array();
}
if (empty($frm->default)) {
$frm->default = '';
}
if ($frm->default && $frm->default != 'manual' && !in_array($frm->default, $frm->enable)) {
$frm->enable[] = $frm->default;
}
asort($frm->enable);
$frm->enable = array_merge(array('manual'), $frm->enable); // make sure manual plugin is called first
set_config('enrol_plugins_enabled', implode(',', $frm->enable));
set_config('enrol', $frm->default);
redirect("enrol.php", get_string("changessaved"), 1);
} else if ($frm = data_submitted() and $savesettings) {
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', 'error');
}
set_config('sendcoursewelcomemessage', required_param('sendcoursewelcomemessage', PARAM_BOOL));
if (!isadmin()) {
error("Only the admin can use this page");
}
/// Print the form
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
$str = get_strings(array('enrolmentplugins', 'users', 'administration', 'settings', 'edit'));
require_once("$CFG->dirroot/enrol/$enrol/enrol.php"); /// Open the class
$enrolment = new enrolment_plugin();
/// If data submitted, then process and store.
if ($frm = data_submitted()) {
if ($enrolment->process_config($frm)) {
set_config('enrol', $frm->enrol);
redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
}
} else {
$frm = $CFG;
}
/// Otherwise fill and print the form.
/// get language strings
$str = get_strings(array('enrolments', 'users', 'administration', 'settings'));
admin_externalpage_print_header();
$modules = get_list_of_plugins("enrol");
$options = array();
foreach ($modules as $module) {
$options[$module] = get_string("enrolname", "enrol_$module");
}
asort($options);
print_simple_box(get_string('configenrolmentplugins', 'admin'), 'center', '700');
print_header("$site->shortname: $str->enrolments", "$site->fullname",
"<a href=\"index.php\">$str->administration</a> ->
<a href=\"users.php\">$str->users</a> -> $str->enrolments");
echo "<form $CFG->frametarget id=\"enrolmenu\" method=\"post\" action=\"enrol.php\">";
echo "<div>";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\" />";
echo "<form target=\"{$CFG->framename}\" name=\"enrolmenu\" method=\"post\" action=\"enrol.php\">";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\">";
echo "<div align=\"center\"><p><b>";
$table = new stdClass();
$table->head = array(get_string('name'), get_string('enable'), get_string('default'), $str->settings);
$table->align = array('left', 'center', 'center', 'center');
$table->size = array('60%', '', '', '15%');
$table->width = '700';
$table->data = array();
$modules = get_list_of_plugins("enrol");
$enabledplugins = explode(',', $CFG->enrol_plugins_enabled);
foreach ($modules as $module) {
/// Choose an enrolment method
echo get_string('chooseenrolmethod').': ';
choose_from_menu ($options, "enrol", $enrol, "",
"document.location='enrol.php?sesskey=$USER->sesskey&enrol='+document.enrolmenu.enrol.options[document.enrolmenu.enrol.selectedIndex].value", "");
// skip if directory is empty
if (!file_exists("$CFG->dirroot/enrol/$module/enrol.php")) {
continue;
}
echo "</b></p></div>";
/// Print current enrolment type description
print_simple_box_start("center", "80%");
print_heading($options[$enrol]);
$name = get_string("enrolname", "enrol_$module");
$plugin = enrolment_factory::factory($module);
$enable = '<input type="checkbox" name="enable[]" value="'.$module.'"';
if (in_array($module, $enabledplugins)) {
$enable .= ' checked="checked"';
}
if ($module == 'manual') {
$enable .= ' disabled="disabled"';
}
$enable .= ' />';
if (method_exists($plugin, 'print_entry')) {
$default = '<input type="radio" name="default" value="'.$module.'"';
if ($CFG->enrol == $module) {
$default .= ' checked="checked"';
}
$default .= ' />';
} else {
$default = '';
}
$table->data[$name] = array($name, $enable, $default,
'<a href="enrol_config.php?enrol='.$module.'">'.$str->edit.'</a>');
}
asort($table->data);
print_simple_box_start("center", "60%", '', 5, 'informationbox');
print_string("description", "enrol_$enrol");
print_simple_box_end();
print_table($table);
echo "<hr />";
// print_heading($str->settings);
$enrolment->config_form($frm);
echo "<div style=\"text-align:center\"><input type=\"submit\" value=\"".get_string("savechanges")."\" /></div>\n";
echo "</div>";
echo "<center><p><input type=\"submit\" value=\"".get_string("savechanges")."\"></p></center>\n";
echo "</form>";
echo '<hr />';
print_simple_box_end();
$yesnooptions = array(0=>get_string('no'), 1=>get_string('yes'));
echo '<form '.$CFG->frametarget.' id="adminsettings" method="post" action="enrol.php">';
echo '<div class="settingsform clearfix">';
print_heading(get_string('commonsettings', 'admin'));
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="savesettings" value="1" />';
echo '<fieldset>';
echo '<div class="form-item clearfix" id="admin-sendcoursewelcomemessage">';
echo '<div class="form-label"><label for = "menusendcoursewelcomemessage">' . get_string('sendcoursewelcomemessage', 'admin');
echo '<span class="form-shortname">sendcoursewelcomemessage</span>';
echo '</label></div>';
echo '<div class="form-setting"><div class="form-checkbox defaultsnext">';
choose_from_menu($yesnooptions, 'sendcoursewelcomemessage', $CFG->sendcoursewelcomemessage, '');
echo '</div><div class="form-defaultinfo">'.get_string('defaultsettinginfo', 'admin', get_string('yes')).'</div></div>';
echo '<div class="form-description">' . get_string('configsendcoursewelcomemessage', 'admin') . '</div>';
echo '</div>';
echo '</fieldset>';
echo '<div class="form-buttons"><input class="form-submit" type="submit" value="'.get_string('savechanges', 'admin').'" /></div>';
echo '</div>';
echo '</form>';
admin_externalpage_print_footer();
print_footer();
exit;
?>
-71
View File
@@ -1,71 +0,0 @@
<?PHP // $Id$
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
require_once("../config.php");
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('enrolment');
$enrol = required_param('enrol', PARAM_ALPHA);
$CFG->pagepath = 'enrol/' . $enrol;
require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
$enrolment = enrolment_factory::factory($enrol);
/// If data submitted, then process and store.
if ($frm = data_submitted()) {
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', 'error');
}
if ($enrolment->process_config($frm)) {
redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
}
} else {
$frm = $CFG;
}
/// Otherwise fill and print the form.
/// get language strings
$str = get_strings(array('enrolmentplugins', 'configuration', 'users', 'administration'));
unset($options);
$modules = get_list_of_plugins("enrol");
foreach ($modules as $module) {
$options[$module] = get_string("enrolname", "enrol_$module");
}
asort($options);
admin_externalpage_print_header();
echo "<form $CFG->frametarget id=\"enrolmenu\" method=\"post\" action=\"enrol_config.php\">";
echo "<div>";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\" />";
echo "<input type=\"hidden\" name=\"enrol\" value=\"".$enrol."\" />";
/// Print current enrolment type description
print_simple_box_start("center", "80%");
print_heading($options[$enrol]);
print_simple_box_start("center", "60%", '', 5, 'informationbox');
print_string("description", "enrol_$enrol");
print_simple_box_end();
echo "<hr />";
$enrolment->config_form($frm);
echo "<p class=\"centerpara\"><input type=\"submit\" value=\"".get_string("savechanges")."\" /></p>\n";
print_simple_box_end();
echo "</div>";
echo "</form>";
admin_externalpage_print_footer();
exit;
?>
+23 -47
View File
@@ -7,7 +7,7 @@
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
// Copyright (C) 2001-3001 Martin Dougiamas http://dougiamas.com //
// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com //
// //
// This program is free software; you can redistribute it and/or modify //
@@ -30,16 +30,24 @@
// from moodle.org be able to check more and more versions.
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/environmentlib.php');
require_once($CFG->libdir.'/componentlib.class.php');
admin_externalpage_setup('environment');
/// Parameters
$action = optional_param('action', '', PARAM_ACTION);
$version = optional_param('version', '', PARAM_FILE); //
$action = optional_param('action', '', PARAM_ALPHA);
$sesskey = optional_param('sesskey');
$version = optional_param('version');
/// Security checks
require_login();
if (!isadmin()) {
error('You need to be admin to use this page');
}
if (!$site = get_site()) {
error("Site isn't defined!");
}
/// Get some strings
$stradmin = get_string('administration');
@@ -47,50 +55,18 @@
$strenvironment = get_string('environment', 'admin');
$strerror = get_string('error');
$strmoodleversion = get_string('moodleversion');
$strupdate = get_string('updatecomponent', 'admin');
$strupwards = get_string('upwards', 'admin');
$strmisc = get_string('miscellaneous');
/// Print the header stuff
admin_externalpage_print_header();
/// Print the component download link
echo '<div class="reportlink"><a href="environment.php?action=updatecomponent&amp;sesskey='.$USER->sesskey.'">'.$strupdate.'</a></div>';
print_header("$SITE->shortname: $strenvironment", $SITE->fullname,
"<a href=\"index.php\">$stradmin</a> -> ".$strenvironment);
print_heading($strenvironment);
/// Handle the 'updatecomponent' action
if ($action == 'updatecomponent' && confirm_sesskey()) {
/// Create component installer and execute it
if ($cd = new component_installer('http://download.moodle.org',
'environment',
'environment.zip')) {
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
switch ($status) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/environment/environment.zip';
$a->dest= $CFG->dataroot.'/';
print_simple_box(get_string($cd->get_error(), 'error', $a), 'center', '', '', 5, 'errorbox');
} else {
print_simple_box(get_string($cd->get_error(), 'error'), 'center', '', '', 5, 'errorbox');
}
break;
case COMPONENT_UPTODATE:
print_simple_box(get_string($cd->get_error(), 'error'), 'center');
break;
case COMPONENT_INSTALLED:
print_simple_box(get_string('componentinstalled', 'admin'), 'center');
break;
}
}
}
/// Start of main box
print_simple_box_start('center');
echo "<div style=\"text-align:center\">".$stradminhelpenvironment."</div><br />";
echo "<center>".$stradminhelpenvironment."</center><br />";
/// Get current Moodle version
$current_version = $CFG->release;
@@ -120,11 +96,11 @@
}
/// Print form and popup menu
echo '<div style="text-align:center">'.$strmoodleversion.' ';
popup_form("$CFG->wwwroot/$CFG->admin/environment.php?version=",
$versions, 'selectversion', $version, '');
echo '</div>';
echo '<center><form method="post" action="environment.php">';
echo $strmoodleversion.' ';
choose_from_menu ($versions, 'version', $version, null, 'this.form.submit();' );
echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
echo '</form></center>';
/// End of main box
print_simple_box_end();
@@ -132,5 +108,5 @@
$status = check_moodle_environment($version, $environment_results);
/// Print footer
admin_externalpage_print_footer();
print_footer();
?>
-269
View File
@@ -34,273 +34,4 @@
</PHP_EXTENSION>
</PHP_EXTENSIONS>
</MOODLE>
<MOODLE version="1.7">
<UNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="unicoderecommended" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="4.1.16">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
<BYPASS function="bypass_mysql416_reqs" message="mysql416bypassed" />
</VENDOR>
<VENDOR name="postgres" version="7.4" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="9.0" />
</DATABASE>
<PHP version="4.3.0" level="required">
<RESTRICT function="restrict_php50_version" message="php50restricted" />
</PHP>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="optional">
<FEEDBACK>
<ON_CHECK message="iconvrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
</PHP_EXTENSIONS>
</MOODLE>
<MOODLE version="1.8">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="4.1.16">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
</VENDOR>
<VENDOR name="postgres" version="7.4" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="9.0" />
</DATABASE>
<PHP version="4.3.0" level="required">
<RESTRICT function="restrict_php50_version" message="php50restricted" />
</PHP>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="optional">
<FEEDBACK>
<ON_CHECK message="iconvrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="optional">
<FEEDBACK>
<ON_CHECK message="curlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="optional">
<FEEDBACK>
<ON_CHECK message="ctyperecommended" />
</FEEDBACK>
</PHP_EXTENSION>
</PHP_EXTENSIONS>
</MOODLE>
<MOODLE version="1.9">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="4.1.16">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
</VENDOR>
<VENDOR name="postgres" version="8.0" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="9.0" />
</DATABASE>
<PHP version="4.3.0" level="required">
<RESTRICT function="restrict_php50_version" message="php50restricted" />
</PHP>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="optional">
<FEEDBACK>
<ON_CHECK message="iconvrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="optional">
<FEEDBACK>
<ON_CHECK message="curlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="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">
<FEEDBACK>
<ON_CHECK message="qtyperqpwillberemovedanyway" />
<ON_OK message="qtyperqpwillberemoved" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/upgrade.php" function="question_random_check" level="optional">
<FEEDBACK>
<ON_OK message="questioncwqpfsok" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/customcheckslib.php" function="php_check_register_globals" level="required">
<FEEDBACK>
<ON_CHECK message="globalswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="2.0" requires="1.9">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.0.25">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
</VENDOR>
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="10.2" />
<VENDOR name="sqlite" version="2.0" />
</DATABASE>
<PHP version="5.2.8" level="required">
</PHP>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_CHECK message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_CHECK message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="optional">
<FEEDBACK>
<ON_CHECK message="gdrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_CHECK message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="40M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="safe_mode" value="0" level="optional">
<FEEDBACK>
<ON_CHECK message="settingsafemode" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
-90
View File
@@ -1,90 +0,0 @@
<?php // $Id$
// filter.php
// Edit text filter settings
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
$filterfull = required_param('filter', PARAM_PATH);
$forcereset = optional_param('reset', 0, PARAM_BOOL);
$filtername = substr($filterfull, strpos( $filterfull, '/' )+1 ) ;
admin_externalpage_setup('filtersetting'.str_replace('/', '', $filterfull));
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=managefilters";
// get translated strings for use on page
$txt = new Object;
$txt->managefilters = get_string( 'managefilters' );
$txt->administration = get_string( 'administration' );
$txt->configuration = get_string( 'configuration' );
//======================
// Process Actions
//======================
// if reset pressed let filter config page handle it
if ($config = data_submitted() and !$forcereset) {
// check session key
if (!confirm_sesskey()) {
error( get_string('confirmsesskeybad', 'error' ) );
}
$configpath = $CFG->dirroot.'/filter/'.$filtername.'/filterconfig.php';
if (file_exists($configpath)) {
require_once($configpath);
$functionname = $filtername.'_process_config';
if (function_exists($functionname)) {
$functionname($config);
$saved = true;
}
}
if (empty($saved)) {
// run through submitted data
// reject if does not start with filter_
foreach ($config as $name => $value) {
set_config($name, stripslashes($value));
}
}
reset_text_filters_cache();
redirect($returnurl);
exit;
}
//==============================
// Display logic
//==============================
$filtername = ucfirst($filtername);
admin_externalpage_print_header();
print_heading( $filtername );
print_simple_box(get_string("configwarning", "admin"), "center", "50%");
echo "<br />";
print_simple_box_start("center",'');
?>
<form action="filter.php?filter=<?php echo urlencode($filterfull); ?>" method="post">
<div style="text-align: center">
<input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
<?php include "$CFG->dirroot/$filterfull/filterconfig.html"; ?>
<input type="submit" name="submit" value="<?php print_string('savechanges'); ?>" />
<input type="submit" name="reset" value="<?php echo print_string('resettodefaults'); ?>" />
</div>
</form>
<?php
print_simple_box_end();
admin_externalpage_print_footer();
?>
+159
View File
@@ -0,0 +1,159 @@
<?php print_simple_box_start("center"); ?>
<form name="filters" id="filters" method="post" action="filters.php">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
<table align="center" border="0" cellpadding="5" cellspacing="0">
<tr>
<td valign="top"><div align="right">
<br />
<input name="up" type="submit" id="up" value="&uarr;" />
<br />
<input name="down" type="submit" id="down" value="&darr;" />
<br />
</div></td>
<td valign="top">
<?php p($stractive) ?>
<br />
<select name="iselect" size="20" id="iselect"
onclick="document.filters.add.disabled=true;
document.filters.remove.disabled=false;
document.filters.uselect.selectedIndex=-1;">
<?php
$runscript = "";
foreach ($installedfilters as $filter) {
if ($selectedfilter == $filter) {
$selected = " selected ";
$runscript = "eval(\"document.filters.add.disabled=true\");
eval(\"document.filters.remove.disabled=false\");
eval(\"document.filters.uselect.selectedIndex=-1\");";
} else {
$selected = "";
}
echo "<option value=\"$filter\" $selected>".$allfilters[$filter]."</option>";
}
?>
</select></td>
<td valign="top">
<br />
<input name="add" type="submit" id="add" value="&larr;" />
<br />
<input name="remove" type="submit" id="remove" value="&rarr;" />
<br />
</td>
<td valign="top">
<?php p($strinactive) ?>
<br />
<select name="uselect" size="20" id="select"
onclick="document.filters.add.disabled=false;
document.filters.remove.disabled=true;
document.filters.iselect.selectedIndex=-1;">
<?php
foreach ($uninstalledfilters as $filter) {
if ($selectedfilter == $filter) {
$selected = " selected ";
$runscript = "eval(\"document.filters.add.disabled=false\");
eval(\"document.filters.remove.disabled=true\");
eval(\"document.filters.iselect.selectedIndex=-1\");";
} else {
$selected = "";
}
echo "<option value=\"$filter\" $selected>".$allfilters[$filter]."</option>";
}
?>
</select></td>
</tr>
</table>
</form>
<script language="Javascript">
<!--
<?php echo $runscript ?>
-->
</script>
<?php print_simple_box_end(); ?>
<br />
<br />
<?php print_simple_box_start("center"); ?>
<form name="options" id="options" method="post" action="filters.php">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
<input type="hidden" name="options" value="1">
<table cellpadding="20">
<tr valign="top">
<td nowrap="nowrap" align="right"><?php p($strcachetext) ?>:</td>
<td>
<?php
unset($options);
$options[604800] = get_string('numdays', '', 7);
$options[86400] = get_string('numdays', '', 1);
$options[43200] = get_string('numhours', '', 12);
$options[10800] = get_string('numhours', '', 3);
$options[7200] = get_string('numhours', '', 2);
$options[3600] = get_string('numhours', '', 1);
$options[2700] = get_string('numminutes', '', 45);
$options[1800] = get_string('numminutes', '', 30);
$options[900] = get_string('numminutes', '', 15);
$options[600] = get_string('numminutes', '', 10);
$options[540] = get_string('numminutes', '', 9);
$options[480] = get_string('numminutes', '', 8);
$options[420] = get_string('numminutes', '', 7);
$options[360] = get_string('numminutes', '', 6);
$options[300] = get_string('numminutes', '', 5);
$options[240] = get_string('numminutes', '', 4);
$options[180] = get_string('numminutes', '', 3);
$options[120] = get_string('numminutes', '', 2);
$options[60] = get_string('numminutes', '', 1);
$options[30] = get_string('numseconds', '', 30);
$options[0] = get_string('no');
choose_from_menu ($options, "cachetext", $CFG->cachetext, "", "", "");
?>
</td>
<td>
<?php p($strconfigcachetext) ?>
</td>
</tr>
<tr valign="top">
<td nowrap="nowrap" align="right"><?php p($strfilteruploadedfiles) ?>:</td>
<td>
<?php
unset($options);
$options[0] = get_string('no');
$options[1] = get_string('yes');
choose_from_menu ($options, "filteruploadedfiles", $CFG->filteruploadedfiles, "", "", "");
?>
</td>
<td>
<?php p($strconfigfilteruploadedfiles) ?>
</td>
</tr>
<tr valign="top">
<td nowrap="nowrap" align="right"><?php p($strfilterall) ?>:</td>
<td>
<?php
unset($options);
$options[0] = get_string('no');
$options[1] = get_string('yes');
choose_from_menu ($options, "filterall", $CFG->filterall, "", "", "");
?>
</td>
<td>
<?php p($strconfigfilterall) ?>
</td>
</tr>
<tr valign="top">
<td>&nbsp;</td>
<td><input type="submit" value="<?php print_string("savechanges") ?>"></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
<?php print_simple_box_end(); ?>
+150 -79
View File
@@ -1,102 +1,173 @@
<?php // $Id$
<?PHP // $Id$
// Allows the admin to create, delete and rename course categories
require_once('../config.php');
require_once("../config.php");
$action = optional_param('action', '', PARAM_ACTION);
$filterpath = optional_param('filterpath', '', PARAM_PATH);
optional_variable($iselect);
optional_variable($uselect);
optional_variable($add);
optional_variable($remove);
optional_variable($up);
optional_variable($down);
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=managefilters";
if (!confirm_sesskey()) {
redirect($returnurl);
if (!isadmin()) {
error("Only administrators can use this page!");
}
// get a list of installed filters
$installedfilters = array();
$filterlocations = array('mod','filter');
if (!$site = get_site()) {
error("Site isn't defined!");
}
/// Print headings
$stradministration = get_string("administration");
$strconfiguration = get_string("configuration");
$strmanagefilters = get_string("managefilters");
$strversion = get_string("version");
$strsettings = get_string("settings");
$strup = get_string("up");
$strdown = get_string("down");
$stractive = get_string("active");
$strinactive = get_string("inactive");
$strcachetext = get_string("cachetext", "admin");
$strconfigcachetext = get_string("configcachetext", 'admin');
$strfilteruploadedfiles = get_string("filteruploadedfiles", "admin");
$strfilterall = get_string("filterall", "admin");
$strconfigfilteruploadedfiles = get_string("configfilteruploadedfiles", 'admin');
$strconfigfilterall = get_string("configfilterall", "admin");
print_header("$site->shortname: $strmanagefilters", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $strmanagefilters");
print_heading($strmanagefilters);
/// Make a list of all available filters and the best names for them we can find
$allfilters = array();
$filterlocations = array("mod", "filter");
foreach ($filterlocations as $filterlocation) {
$plugins = get_list_of_plugins($filterlocation);
foreach ($plugins as $plugin) {
$pluginpath = "$CFG->dirroot/$filterlocation/$plugin/filter.php";
if (is_readable($pluginpath)) {
$installedfilters["$filterlocation/$plugin"] = "$filterlocation/$plugin";
foreach ($plugins as $key => $plugin) {
if (is_readable("$CFG->dirroot/$filterlocation/$plugin/filter.php")) {
$name = trim(get_string("filtername", $plugin));
if (empty($name) or $name == "[[filtername]]") {
$name = $plugin;
}
$allfilters["$filterlocation/$plugin"] = $name;
}
}
}
// get all the currently selected filters
/// Make an array of all the currently installed filters
$installedfilters = array();
if (!empty($CFG->textfilters)) {
$activefilters = explode(',', $CFG->textfilters);
} else {
$activefilters = array();
$installedfilters = explode(',',$CFG->textfilters);
// Do a little cleanup for robustness
foreach ($installedfilters as $key => $installedfilter) {
if (empty($installedfilter)) {
unset($installedfilters[$key]);
set_config("textfilters", implode(',', $installedfilters));
}
}
}
//======================
// Process Actions
//======================
$selectedfilter = "none";
switch ($action) {
/// If data submitted, then process and store.
case 'hide':
$key=array_search($filterpath, $activefilters);
// check filterpath is valid
if ($key===false) {
break;
if (!empty($options)) {
if (($config = data_submitted()) && confirm_sesskey()) {
unset($config->options);
unset($config->sesskey);
foreach ($config as $name => $value) {
set_config($name, $value);
}
}
// just delete it
unset($activefilters[$key]);
break;
case 'show':
// check filterpath is valid
if (!array_key_exists($filterpath, $installedfilters)) {
error("Filter $filterpath is not currently installed", $url);
} elseif (array_search($filterpath,$activefilters)) {
// filterpath is already active - doubleclick??
} else {
// add it to installed filters
$activefilters[] = $filterpath;
$activefilters = array_unique($activefilters);
}
break;
case 'down':
$key=array_search($filterpath, $activefilters);
// check filterpath is valid
if ($key===false) {
error("Filter $filterpath is not currently active", $url);
} elseif ($key>=(count($activefilters)-1)) {
// cannot be moved any further down - doubleclick??
} else {
// swap with $key+1
$fsave = $activefilters[$key];
$activefilters[$key] = $activefilters[$key+1];
$activefilters[$key+1] = $fsave;
}
break;
case 'up':
$key=array_search($filterpath, $activefilters);
// check filterpath is valid
if ($key===false) {
error("Filter $filterpath is not currently active", $url);
} elseif ($key<1) {
//cannot be moved any further up - doubleclick??
} else {
// swap with $key-1
$fsave = $activefilters[$key];
$activefilters[$key] = $activefilters[$key-1];
$activefilters[$key-1] = $fsave;
}
break;
}
// save, reset cache and return
set_config('textfilters', implode(',', $activefilters));
reset_text_filters_cache();
redirect($returnurl);
if (!empty($add) and !empty($uselect) and confirm_sesskey()) {
$selectedfilter = $uselect;
if (!in_array($selectedfilter, $installedfilters)) {
$installedfilters[] = $selectedfilter;
set_config("textfilters", implode(',', $installedfilters));
}
} else if (!empty($remove) and !empty($iselect) and confirm_sesskey()) {
$selectedfilter = $iselect;
foreach ($installedfilters as $key => $installedfilter) {
if ($installedfilter == $selectedfilter) {
unset($installedfilters[$key]);
}
}
set_config("textfilters", implode(',', $installedfilters));
} else if ((!empty($up) or !empty($down)) and !empty($iselect) and confirm_sesskey()) {
if (!empty($up)) {
if ($allfilters[$iselect]) {
foreach ($installedfilters as $key => $installedfilter) {
if ($installedfilter == $iselect) {
$movefilter = $key;
break;
}
$swapfilter = $key;
}
}
}
if (!empty($down)) {
if ($allfilters[$iselect]) {
$choosenext = false;
foreach ($installedfilters as $key => $installedfilter) {
if ($choosenext) {
$swapfilter = $key;
break;
}
if ($installedfilter == $iselect) {
$movefilter = $key;
$choosenext = true;
}
}
}
}
if (isset($swapfilter) and isset($movefilter)) {
$tempfilter = $installedfilters[$swapfilter];
$installedfilters[$swapfilter] = $installedfilters[$movefilter];
$installedfilters[$movefilter] = $tempfilter;
set_config("textfilters", implode(',', $installedfilters));
}
$selectedfilter = $iselect;
}
/// Make an array of all the currently uninstalled filters
$uninstalledfilters = array();
foreach ($allfilters as $filter => $name) {
$installed = false;
foreach ($installedfilters as $installedfilter) {
if ($installedfilter == $filter) {
$installed = true;
}
}
if (!$installed) {
$uninstalledfilters[] = $filter;
}
}
/// Print the current form
include("filters.html");
print_footer();
?>
-275
View File
@@ -1,275 +0,0 @@
<?php
require_once('../config.php');
/**
* SCRIPT CONFIGURATION
*/
$starttimer = time()+microtime();
$settings = array();
$settings['verbose'] = false;
$settings['username'] = null;
$settings['password'] = null;
$settings['eolchar'] = '<br />'; // Character used to break lines
// Argument arrays: 0=>short name, 1=>long name
$arguments = array(
array('short'=>'u', 'long'=>'username', 'help' => 'Your moodle username', 'type'=>'STRING', 'default' => ''),
array('short'=>'pw', 'long'=>'password', 'help' => 'Your moodle password', 'type'=>'STRING', 'default' => ''),
array('short'=>'v', 'long' => 'verbose', 'help' => 'Display extra information about the process')
);
// Building the USAGE output of the command line version
if (isset($argv) && isset($argc)) {
$help = "Moodle User Pix Fix. Restores user profile images that were not properly moved during 1.8.2 upgrade to newer versions.\n\n"
. "Usage: {$argv[0]}; [OPTION] ...\n"
. "Options:\n"
. " -h, -?, -help, --help This output\n";
foreach ($arguments as $arg_array) {
$equal = '';
if (!empty($arg_array['type'])) {
$equal = "={$arg_array['type']}";
}
$padding1 = 5 - strlen($arg_array['short']);
$padding2 = 30 - (strlen($arg_array['long']) + strlen($equal));
$paddingstr1 = '';
for ($i = 0; $i < $padding1; $i++) {
$paddingstr1 .= ' ';
}
$paddingstr2 = '';
for ($i = 0; $i < $padding2; $i++) {
$paddingstr2 .= ' ';
}
$help .= " -{$arg_array['short']},$paddingstr1--{$arg_array['long']}$equal$paddingstr2{$arg_array['help']}\n";
}
$help .= "\nEmail nicolasconnault@gmail.com for any suggestions or bug reports.\n";
if ($argc == 1 || in_array($argv[1], array('--help', '-help', '-h', '-?'))) {
echo $help;
die();
} else {
$settings['eolchar'] = "\n";
$argv = arguments($argv);
$argscount = 0;
foreach ($arguments as $arg_array) {
$value = null;
if (in_array($arg_array['short'], array_keys($argv))) {
$value = $argv[$arg_array['short']];
unset($argv[$arg_array['short']]);
} elseif (in_array($arg_array['long'], array_keys($argv))) {
$value = $argv[$arg_array['long']];
unset($argv[$arg_array['long']]);
}
if (!is_null($value)) {
$settings[$arg_array['long']] = $value;
$argscount++;
}
}
// If some params are left in argv, it means they are not supported
if ($argscount == 0 || count($argv) > 0) {
echo $help;
die();
}
}
}
/**
* SCRIPT SETUP
*/
require_once($CFG->libdir . '/formslib.php');
require_once($CFG->dirroot .'/course/lib.php');
verbose("Loading libraries...");
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
/**
* WEB INTERFACE FORM
*/
class pixfix_form extends moodleform {
function definition() {
global $arguments;
$mform =& $this->_form;
foreach ($arguments as $arg_array) {
$type = 'advcheckbox';
$label = ucfirst(str_replace('-', ' ', $arg_array['long']));
if (!empty($arg_array['type'])) {
$type = 'text';
}
if ($arg_array['long'] == 'password' || $arg_array['long'] == 'username') {
continue;
}
$mform->addElement($type, $arg_array['long'], $label);
if (isset($arg_array['default'])) {
$mform->setDefault($arg_array['long'], $arg_array['default']);
}
}
$this->add_action_buttons(false, 'Restore Images');
}
function definition_after_data() {
}
}
$run_script = true;
$web_interface = false;
// If eolchar is still <br />, load the web interface
if ($settings['eolchar'] == '<br />') {
print_header("User Pix-Fix");
print_heading("User Pix-Fix");
$mform = new pixfix_form();
if ($data = $mform->get_data(false)) {
foreach ($arguments as $arg_array) {
if (!empty($data->{$arg_array['long']})) {
$settings[$arg_array['long']] = $data->{$arg_array['long']};
}
}
} else {
$run_script = false;
}
if (!has_capability('moodle/site:doanything', $systemcontext)) {
// If not logged in, give link to login page for current site
notify("You must be logged in as administrator before using this script.");
require_login();
} else {
$mform->display();
}
$web_interface = true;
}
if ($run_script) {
// User authentication
if (!$web_interface) {
if (empty($settings['username'])) {
echo "You must enter a valid username for a moodle administrator account on this site.{$settings['eolchar']}";
die();
} elseif (empty($settings['password'])) {
echo "You must enter a valid password for a moodle administrator account on this site.{$settings['eolchar']}";
die();
} else {
if (!$user = authenticate_user_login($settings['username'], $settings['password'])) {
echo "Invalid username or password!{$settings['eolchar']}";
die();
}
$USER = complete_user_login($user);
if (!has_capability('moodle/site:doanything', $systemcontext)) {
echo "You do not have administration privileges on this Moodle site. These are required for running the restore script.{$settings['eolchar']}";
die();
}
}
}
// Script code here
// Look for old moodledata/users directory
$oldusersdir = $CFG->dataroot . '/users';
if (!file_exists($oldusersdir)) {
notify('The old directory for user profile images ('.$oldusersdir.') does not exist. Pictures cannot be restored!');
} else {
// Find user profile images that are not yet in the new directory
$folders = get_directory_list($oldusersdir, '', false, true, false);
$restored_count = 0;
foreach ($folders as $userid) {
$olddir = $oldusersdir . '/' . $userid;
$files = get_directory_list($olddir);
if (empty($files)) {
continue;
}
// Create new user directory
if (!$newdir = make_user_directory($userid)) {
// some weird directory - do not stop the upgrade, just ignore it
continue;
}
// Move contents of old directory to new one
if (file_exists($olddir) && file_exists($newdir)) {
$restored = false;
foreach ($files as $file) {
if (!file_exists($newdir . '/' . $file)) {
copy($olddir . '/' . $file, $newdir . '/' . $file);
verbose("Moved $olddir/$file into $newdir/$file");
$restored = true;
}
}
if ($restored) {
$restored_count++;
}
} else {
notify("Could not move the contents of $olddir into $newdir!");
$result = false;
break;
}
}
if ($settings['eolchar'] == '<br />') {
print_box_start('generalbox centerpara');
}
if ($restored_count > 0) {
echo "Successfully restored profile images for $restored_count users!" . $settings['eolchar'];
} else {
echo "Did not find any user profile images in need of restoring." . $settings['eolchar'];
}
if ($settings['eolchar'] == '<br />') {
print_box_end();
}
}
}
if ($settings['eolchar'] == '<br />') {
print_footer();
}
/**
* Converts the standard $argv into an associative array taking var=val arguments into account
* @param array $argv
* @return array $_ARG
*/
function arguments($argv) {
$_ARG = array();
foreach ($argv as $arg) {
if (ereg('--?([^=]+)=(.*)',$arg,$reg)) {
$_ARG[$reg[1]] = $reg[2];
} elseif(ereg('-([a-zA-Z0-9]+)',$arg,$reg)) {
$_ARG[$reg[1]] = 'true';
}
}
return $_ARG;
}
/**
* If verbose is switched on, prints a string terminated by the global eolchar string.
* @param string $string The string to STDOUT
*/
function verbose($string) {
global $settings;
if ($settings['verbose'] && !$settings['quiet']) {
echo $string . $settings['eolchar'];
}
}
?>
+2 -2
View File
@@ -40,7 +40,7 @@ while(!feof($fd)) {
$user = get_record("user","id",$log->userid);
$course = get_record("course","id",$log->course);
$subject = get_string('virusfoundsubject','moodle',format_string($site->fullname));
$subject = get_string('virusfoundsubject','moodle',$site->fullname);
$a->date = userdate($log->time);
$a->action = $action;
@@ -78,7 +78,7 @@ function notify_admins_unknown($file,$a) {
global $site;
$admins = get_admins();
$subject = get_string('virusfoundsubject','moodle',format_string($site->fullname));
$subject = get_string('virusfoundsubject','moodle',$site->fullname);
$body = get_string('virusfoundlateradminnolog','moodle',$a);
foreach ($admins as $admin) {
email_to_user($admin,$admin,$subject,$body);
+45 -360
View File
@@ -1,34 +1,23 @@
<?php // $Id$
ob_start(); //for whitespace test
require_once('../config.php');
// extra whitespace test - intentionally breaks cookieless mode
$extraws = '';
while (true) {
$extraws .= ob_get_contents();
if (!@ob_end_clean()) {
break;
}
}
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('healthcenter');
define('SEVERITY_NOTICE', 'notice');
define('SEVERITY_ANNOYANCE', 'annoyance');
define('SEVERITY_SIGNIFICANT', 'significant');
define('SEVERITY_CRITICAL', 'critical');
$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));
if (!isadmin()) {
error('Only the admin can use this page');
}
$site = get_site();
$stradmin = get_string('administration');
$strhealthcenter = get_string('healthcenter');
admin_externalpage_print_header();
print_header($site->shortname.': '.$strhealthcenter, $site->fullname,
'<a href="index.php">'.$stradmin.'</a> -> '.$strhealthcenter);
echo <<<STYLES
<style type="text/css">
@@ -92,7 +81,9 @@ dd.solution li {
</style>
STYLES;
if(strpos($solution, 'problem_') === 0 && class_exists($solution)) {
$solution = optional_param('solution', NULL);
if(!empty($solution) && class_exists($solution)) {
health_print_solution($solution);
}
else {
@@ -100,7 +91,7 @@ STYLES;
}
admin_externalpage_print_footer();
print_footer();
function health_find_problems() {
@@ -224,13 +215,18 @@ class problem_000001 extends problem_base {
class problem_000002 extends problem_base {
function title() {
return 'Extra characters at the end of config.php or other library function';
return 'Extra characters at the end of config.php';
}
function exists() {
global $extraws;
if($extraws === '') {
return false;
// [pj] When the requirements are raised to PHP 4.3.0 this will be file_get_contents()
if($fp = @fopen('../config.php', 'r')) {
$contents = fread($fp, 16384); // 16K should be enough
$ending = substr($contents, -2);
unset($contents);
if($ending == '?>') {
return false;
}
fclose($fp);
}
return true;
}
@@ -238,11 +234,11 @@ class problem_000002 extends problem_base {
return SEVERITY_SIGNIFICANT;
}
function description() {
return 'Your Moodle configuration file config.php or another library file, contains some characters after the closing PHP tag (?>). This causes Moodle to exhibit several kinds of problems (such as broken downloaded files) and must be fixed.';
return 'Your Moodle configuration file, config.php, contains some characters after the closing PHP tag (?>). This could cause Moodle to exhibit several kinds of problems and should be fixed.';
}
function solution() {
global $CFG;
return 'You need to edit <strong>'.$CFG->dirroot.'/config.php</strong> and remove all characters (including spaces and returns) after the ending ?> tag. These two characters should be the very last in that file. The extra trailing whitespace may be also present in other PHP files that are included from lib/setup.php.';
return 'You need to edit <strong>'.$CFG->dirroot.'/config.php</strong> and remove all characters (including spaces and returns) after the ending ?> tag. These two characters should be the very last in that file.';
}
}
@@ -353,45 +349,24 @@ class problem_000008 extends problem_base {
return 'PHP: memory_limit cannot be controlled by Moodle';
}
function exists() {
$oldmemlimit = @ini_get('memory_limit');
if(empty($oldmemlimit)) {
$memlimit = @ini_get('memory_limit');
if(empty($memlimit)) {
// PHP not compiled with memory limits, this means that it's
// probably limited to 8M or in case of Windows not at all.
// We can ignore it for now - there is not much to test anyway
// TODO: add manual test that fills memory??
return false;
// probably limited to 8M so we have a problem...
return true;
}
$oldmemlimit = get_real_size($oldmemlimit);
//now lets change the memory limit to something unique below 128M==134217728
if (empty($CFG->extramemorylimit)) {
raise_memory_limit('128M');
} else {
raise_memory_limit($CFG->extramemorylimit);
}
$testmemlimit = get_real_size(@ini_get('memory_limit'));
//verify the change had any effect at all
if ($oldmemlimit == $testmemlimit) {
//memory limit can not be changed - is it big enough then?
if ($oldmemlimit < get_real_size('128M')) {
return true;
} else {
return false;
}
}
reduce_memory_limit($oldmemlimit);
// Otherwise, raise_memory_limit in setup.php will do the trick
return false;
}
function severity() {
return SEVERITY_NOTICE;
return SEVERITY_ANNOYANCE;
}
function description() {
return 'The settings for PHP on your server do not allow a script to request more memory during its execution. '.
'This means that there is a hard limit of '.@ini_get('memory_limit').' for each script. '.
'It is possible that certain operations within Moodle will require more than this amount in order '.
'to complete successfully, especially if there are lots of data to be processed.';
return 'The settings for PHP on your server do not allow a script to request more memory during its execution. This means that most likely there is a hard limit of 8MB for each script. It is possible that certain operations within Moodle will require more than this amount in order to complete successfully, especially if there are lots of data to be processed. Therefore, it is recommended that you contact your server administrator to address this issue.';
}
function solution() {
return 'It is recommended that you contact your web server administrator to address this issue.';
global $CFG;
return 'We need a good solution here. Enabling memory limit control means recompiling PHP... maybe this should be SEVERITY_NOTICE instead of SEVERITY_ANNOYANCE?';
}
}
@@ -422,7 +397,7 @@ class problem_000010 extends problem_base {
}
function exists() {
if (!$this->is_enabled()) {
return true;
return true;
}
if ($this->status() < 1) {
return true;
@@ -432,7 +407,7 @@ class problem_000010 extends problem_base {
function severity() {
if ($this->is_enabled() and $this->status() == 0) {
return SEVERITY_SIGNIFICANT;
} else {
} else {
return SEVERITY_ANNOYANCE;
}
}
@@ -440,12 +415,12 @@ class problem_000010 extends problem_base {
global $CFG;
$desc = 'Slasharguments are needed for relative linking in uploaded resources:<ul>';
if (!$this->is_enabled()) {
$desc .= '<li>slasharguments are <strong>disabled</strong> in Moodle configuration</li>';
$desc .= '<li>slasharguments are <strong>disabled</strong> in Moodle configuration</li>';
} else {
$desc .= '<li>slasharguments are enabled in Moodle configuration</li>';
$desc .= '<li>slasharguments are enabled in Moodle configuration</li>';
}
if ($this->status() == -1) {
$desc .= '<li>can not run automatic test, you can verify it <a href="'.$CFG->wwwroot.'/file.php/testslasharguments" target="_blank">here</a> manually</li>';
$desc .= '<li>can not run automatic test, you can verify it <a href="'.$CFG->wwwroot.'/file.php/testslasharguments" target="_blank">here</a></li>';
} else if ($this->status() == 0) {
$desc .= '<li>slashargument test <strong>failed</strong>, please check server configuration</li>';
} else {
@@ -473,9 +448,9 @@ class problem_000010 extends problem_base {
$solution .= 'Congratulations - everything seems OK now :-D';
}
if ($status < 1) {
$solution .= '<p>IIS:<ul><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li><li>do NOT enable AllowPathInfoForScriptMappings !!!</li><li>slasharguments may not work when using ISAPI and PHP 4.3.10 and older</li></ul></p>';
$solution .= '<p>Apache 1:<ul><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li></ul></p>';
$solution .= '<p>Apache 2:<ul><li>you must add <code>AcceptPathInfo on</code> to php.ini or .htaccess</li><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li></ul></p>';
$solution .= '<p>IIS:<ul><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li><li>do NOT enable AllowPathInfoForScriptMappings !!!</li><li>slasharguments may not work when using ISAPI and PHP 4.3.10 and older</li></ul></p>';
$solution .= '<p>Apache 1:<ul><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li></ul></p>';
$solution .= '<p>Apache 2:<ul><li>you must add <code>AcceptPathInfo on</code> to php.ini or .htaccess</li><li>try to add <code>cgi.fix_pathinfo=1</code> to php.ini</li></ul></p>';
}
return $solution;
}
@@ -486,13 +461,13 @@ class problem_000010 extends problem_base {
function status() {
global $CFG;
$handle = @fopen($CFG->wwwroot.'/file.php?file=/testslasharguments', "r");
$contents = @trim(fread($handle, 10));
$contents = trim(@fread($handle, 7));
@fclose($handle);
if ($contents != 'test -1') {
return -1;
}
$handle = @fopen($CFG->wwwroot.'/file.php/testslasharguments', "r");
$contents = trim(@fread($handle, 10));
$contents = trim(@fread($handle, 6));
@fclose($handle);
switch ($contents) {
case 'test 1': return 1;
@@ -523,306 +498,17 @@ class problem_000011 extends problem_base {
}
function solution() {
global $CFG;
if (optional_param('resetsesserrorcounter', 0, PARAM_BOOL)) {
if (isset($_GET['resetsesserrorcounter'])) {
if (get_field('config', 'name', 'name', 'session_error_counter')) {
delete_records('config', 'name', 'session_error_counter');
}
return 'Error counter was cleared.';
} else {
return '<p>Session errors can be caused by:</p><ul>' .
'<li>unresolved problem in server software (aka random switching of users),</li>' .
'<li>blocked or modified cookies,</li>' .
'<li>deleting of active session files.</li>' .
'</ul><p><a href="'.me().'&amp;resetsesserrorcounter=1">Reset counter</a></p>';
return '<p>Session errors can be caused by:<ul><li>unresolved problem in server software (aka random switching of users),</li><li>blocked or modified cookies,</li><li>deleting of active session files.</li></ul></p><p><a href="'.me().'&resetsesserrorcounter=1">Reset counter.</a></p>';
}
}
}
class problem_000012 extends problem_base {
function title() {
return 'Random questions data consistency';
}
function exists() {
return record_exists_select('question', "qtype = 'random' AND parent <> id");
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
return '<p>For random questions, question.parent should equal question.id. ' .
'There are some questions in your database for which this is not true. ' .
'One way that this could have happened is for random questions restored from backup before ' .
'<a href="http://tracker.moodle.org/browse/MDL-5482">MDL-5482</a> was fixed.</p>';
}
function solution() {
global $CFG;
return '<p>Upgrade to Moodle 1.9.1 or later, or manually execute the SQL</p>' .
'<pre>UPDATE ' . $CFG->prefix . 'question SET parent = id WHERE qtype = \'random\' and parent &lt;> id;</pre>';
}
}
class problem_000013 extends problem_base {
function title() {
return 'Multi-answer questions data consistency';
}
function exists() {
global $CFG;
$positionexpr = sql_position(sql_concat("','", "q.id", "','"),
sql_concat("','", "qma.sequence", "','"));
return record_exists_sql("
SELECT * FROM {$CFG->prefix}question q
JOIN {$CFG->prefix}question_multianswer qma ON $positionexpr > 0
WHERE qma.question <> q.parent") ||
record_exists_sql("
SELECT * FROM {$CFG->prefix}question q
JOIN {$CFG->prefix}question parent_q ON parent_q.id = q.parent
WHERE q.category <> parent_q.category");
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
return '<p>For each sub-question whose id is listed in ' .
'question_multianswer.sequence, its question.parent field should equal ' .
'question_multianswer.question; and each sub-question should be in the same ' .
'category as its parent. There are questions in your database for ' .
'which this is not the case. One way that this could have happened is ' .
'for multi-answer questions restored from backup before ' .
'<a href="http://tracker.moodle.org/browse/MDL-14750">MDL-14750</a> was fixed.</p>';
}
function solution() {
return '<p>Upgrade to Moodle 1.9.1 or later, or manually execute the ' .
'code in question_multianswer_fix_subquestion_parents_and_categories in ' .
'<a href="http://cvs.moodle.org/moodle/question/type/multianswer/db/upgrade.php?revision=1.1.10.2&amp;view=markup">/question/type/multianswer/db/upgrade.php' .
'from the 1.9 stable branch</a>.</p>';
}
}
class problem_000014 extends problem_base {
function title() {
return 'Only multianswer and random questions should be the parent of another question';
}
function exists() {
global $CFG;
return record_exists_sql("
SELECT * FROM {$CFG->prefix}question q
JOIN {$CFG->prefix}question parent_q ON parent_q.id = q.parent
WHERE parent_q.qtype NOT IN ('random', 'multianswer')");
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
return '<p>You have questions that violate this in your databse. ' .
'You will need to investigate to determine how this happened.</p>';
}
function solution() {
return '<p>It is impossible to give a solution without knowing more about ' .
' how the problem was caused. You may be able to get help from the ' .
'<a href="http://moodle.org/mod/forum/view.php?f=121">Quiz forum</a>.</p>';
}
}
class problem_000015 extends problem_base {
function title() {
return 'Question categories should belong to a valid context';
}
function exists() {
global $CFG;
return record_exists_sql("
SELECT qc.*, (SELECT COUNT(1) FROM {$CFG->prefix}question q WHERE q.category = qc.id) AS numquestions
FROM {$CFG->prefix}question_categories qc
LEFT JOIN {$CFG->prefix}context con ON qc.contextid = con.id
WHERE con.id IS NULL");
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
global $CFG;
$problemcategories = get_records_sql("
SELECT qc.id, qc.name, qc.contextid, (SELECT COUNT(1) FROM {$CFG->prefix}question q WHERE q.category = qc.id) AS numquestions
FROM {$CFG->prefix}question_categories qc
LEFT JOIN {$CFG->prefix}context con ON qc.contextid = con.id
WHERE con.id IS NULL
ORDER BY numquestions DESC, qc.name");
$table = '<table><thead><tr><th>Cat id</th><th>Category name</th>' .
"<th>Context id</th><th>Num Questions</th></tr></thead><tbody>\n";
if ($problemcategories) {
foreach ($problemcategories as $cat) {
$table .= "<tr><td>$cat->id</td><td>" . s($cat->name) . "</td><td>" .
$cat->contextid ."</td><td>$cat->numquestions</td></tr>\n";
}
}
$table .= '</tbody></table>';
return '<p>All question categories are linked to a context id, and, ' .
'the context they are linked to must exist. The following categories ' .
'belong to a non-existant category:</p>' . $table . '<p>Any of these ' .
'categories that contain no questions can just be deleted form the database. ' .
'Other categories will require more thought.</p>';
}
function solution() {
global $CFG;
return '<p>You can delete the empty categories by executing the following SQL:</p><pre>
DELETE FROM ' . $CFG->prefix . 'question_categories
WHERE
NOT EXISTS (SELECT * FROM ' . $CFG->prefix . 'question q WHERE q.category = ' . $CFG->prefix . 'question_categories.id)
AND NOT EXISTS (SELECT * FROM ' . $CFG->prefix . 'context con WHERE contextid = con.id)
</pre><p>Any remaining categories that contain questions will require more thought. ' .
'People in the <a href="http://moodle.org/mod/forum/view.php?f=121">Quiz forum</a> may be able to help.</p>';
}
}
class problem_000016 extends problem_base {
function title() {
return 'Question categories should belong to the same context as their parent';
}
function exists() {
global $CFG;
return record_exists_sql("
SELECT parent_qc.id AS parent, child_qc.id AS child, child_qc.contextid
FROM {$CFG->prefix}question_categories child_qc
JOIN {$CFG->prefix}question_categories parent_qc ON child_qc.parent = parent_qc.id
WHERE child_qc.contextid <> parent_qc.contextid");
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
global $CFG;
$problemcategories = get_records_sql("
SELECT
parent_qc.id AS parentid, parent_qc.name AS parentname, parent_qc.contextid AS parentcon,
child_qc.id AS childid, child_qc.name AS childname, child_qc.contextid AS childcon
FROM {$CFG->prefix}question_categories child_qc
JOIN {$CFG->prefix}question_categories parent_qc ON child_qc.parent = parent_qc.id
WHERE child_qc.contextid <> parent_qc.contextid");
$table = '<table><thead><tr><th colspan="3">Child category</th><th colspan="3">Parent category</th></tr><tr>' .
'<th>Id</th><th>Name</th><th>Context id</th>' .
'<th>Id</th><th>Name</th><th>Context id</th>' .
"</tr></thead><tbody>\n";
if ($problemcategories) {
foreach ($problemcategories as $cat) {
$table .= "<tr><td>$cat->childid</td><td>" . s($cat->childname) .
"</td><td>$cat->childcon</td><td>$cat->parentid</td><td>" . s($cat->parentname) .
"</td><td>$cat->parentcon</td></tr>\n";
}
}
$table .= '</tbody></table>';
return '<p>When one question category is the parent of another, then they ' .
'should both belong to the same context. This is not true for the following categories:</p>' .
$table;
}
function solution() {
return '<p>An automated solution is difficult. It depends whether the ' .
'parent or child category is in the wrong pace.' .
'People in the <a href="http://moodle.org/mod/forum/view.php?f=121">Quiz forum</a> may be able to help.</p>';
}
}
class problem_000017 extends problem_base {
function title() {
return 'Question categories tree structure';
}
function find_problems() {
static $answer = null;
if (is_null($answer)) {
$categories = get_records('question_categories', '', '', 'id');
// Look for missing parents.
$missingparent = array();
foreach ($categories as $category) {
if ($category->parent != 0 && !array_key_exists($category->parent, $categories)) {
$missingparent[$category->id] = $category;
}
}
// Look for loops.
$loops = array();
while (!empty($categories)) {
$current = array_pop($categories);
$thisloop = array($current->id => $current);
while (true) {
if (isset($thisloop[$current->parent])) {
// Loop detected
$loops[$current->id] = $thisloop;
break;
} else if (!isset($categories[$current->parent])) {
// Got to the top level, or a category we already know is OK.
break;
} else {
// Continue following the path.
$current = $categories[$current->parent];
$thisloop[$current->id] = $current;
unset($categories[$current->id]);
}
}
}
$answer = array($missingparent, $loops);
}
return $answer;
}
function exists() {
list($missingparent, $loops) = $this->find_problems();
return !empty($missingparent) || !empty($loops);
}
function severity() {
return SEVERITY_ANNOYANCE;
}
function description() {
list($missingparent, $loops) = $this->find_problems();
$description = '<p>The question categories should be arranged into tree ' .
' structures by the question_categories.parent field. Sometimes ' .
' this tree structure gets messed up.</p>';
if (!empty($missingparent)) {
$description .= '<p>The following categories are missing their parents:</p><ul>';
foreach ($missingparent as $cat) {
$description .= "<li>Category $cat->id: " . s($cat->name) . "</li>\n";
}
$description .= "</ul>\n";
}
if (!empty($loops)) {
$description .= '<p>The following categories form a loop of parents:</p><ul>';
foreach ($loops as $loop) {
$description .= "<li><ul>\n";
foreach ($loop as $cat) {
$description .= "<li>Category $cat->id: " . s($cat->name) . " has parent $cat->parent</li>\n";
}
$description .= "</ul></li>\n";
}
$description .= "</ul>\n";
}
return $description;
}
function solution() {
global $CFG;
list($missingparent, $loops) = $this->find_problems();
$solution = '<p>Consider executing the following SQL queries. These fix ' .
'the problem by moving some categories to the top level.</p>';
if (!empty($missingparent)) {
$solution .= "<pre>UPDATE " . $CFG->prefix . "question_categories\n" .
" SET parent = 0\n" .
" WHERE id IN (" . implode(',', array_keys($missingparent)) . ");</pre>\n";
}
if (!empty($loops)) {
$solution .= "<pre>UPDATE " . $CFG->prefix . "question_categories\n" .
" SET parent = 0\n" .
" WHERE id IN (" . implode(',', array_keys($loops)) . ");</pre>\n";
}
return $solution;
}
}
class problem_00000x extends problem_base {
function title() {
@@ -848,8 +534,7 @@ class problem_00000x extends problem_base {
TODO:
session.save_path -- it doesn't really matter because we are already IN a session, right?
detect unsupported characters in $CFG->wwwroot - see bug Bug #6091 - relative vs absolute path during backup/restore process
*/
?>
?>
+258 -497
View File
@@ -1,53 +1,34 @@
<?php // $Id$
/// Check that config.php exists, if not then call the install script
if (!file_exists('../config.php')) {
if (!file_exists("../config.php")) {
header('Location: ../install.php');
die;
}
require_once("../config.php");
include_once("$CFG->dirroot/lib/adminlib.php"); // Contains various admin-only functions
/// Check that PHP is of a sufficient version
/// Moved here because older versions do not allow while(@ob_end_clean());
if (version_compare(phpversion(), "4.3.0") < 0) {
$phpversion = phpversion();
echo "Sorry, Moodle requires PHP 4.3.0 or later (currently using version $phpversion)";
if (!check_php_version("4.1.0")) {
$version = phpversion();
print_heading("Sorry, Moodle requires PHP 4.1.0 or later (currently using version $version)");
die;
}
/// Turn off time limits and try to flush everything all the time, sometimes upgrades can be slow.
@set_time_limit(0);
@ob_implicit_flush(true);
while(@ob_end_clean()); // ob_end_flush prevents sending of headers
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php'); // Contains various admin-only functions
require_once($CFG->libdir.'/ddllib.php'); // Install/upgrade related db functions
require_once($CFG->libdir.'/db/upgradelib.php'); // Upgrade-related functions
$id = optional_param('id', '', PARAM_TEXT);
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
$confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL);
$agreelicense = optional_param('agreelicense', 0, PARAM_BOOL);
$autopilot = optional_param('autopilot', 0, PARAM_BOOL);
$ignoreupgradewarning = optional_param('ignoreupgradewarning', 0, PARAM_BOOL);
$confirmplugincheck = optional_param('confirmplugincheck', 0, PARAM_BOOL);
/// check upgrade status first
if ($ignoreupgradewarning and !empty($_SESSION['upgraderunning'])) {
$_SESSION['upgraderunning'] = 0;
/// This is a Moodle 1.5 hack ONLY to fix accidental bad versions from version.php
/// Do not copy this code into HEAD
if ($CFG->version == '2005072100') {
set_config('version', 2005060221);
}
upgrade_check_running("Upgrade already running in this session, please wait!<br />Click on the exclamation marks to ignore this warning (<a href=\"index.php?ignoreupgradewarning=1\">!!!</a>).", 10);
/// set install/upgrade autocontinue session flag
if ($autopilot) {
$_SESSION['installautopilot'] = $autopilot;
}
/// Check some PHP server settings
$documentationlink = '<a href="http://docs.moodle.org/en/Installation">Installation docs</a>';
$documentationlink = "please read the <a href=\"../doc/?frame=install.html&amp;sub=webserver\">install documentation</a>";
if (ini_get_bool('session.auto_start')) {
error("The PHP server variable 'session.auto_start' should be Off - $documentationlink");
@@ -61,17 +42,6 @@
error("The PHP server variable 'file_uploads' is not turned On - $documentationlink");
}
if (is_float_problem()) {
print_error('phpfloatproblem', 'admin', '', $documentationlink);
}
if (empty($CFG->prefix) && $CFG->dbfamily != 'mysql') { //Enforce prefixes for everybody but mysql
error('$CFG->prefix can\'t be empty for your target DB (' . $CFG->dbtype . ')');
}
if ($CFG->dbfamily == 'oracle' && strlen($CFG->prefix) > 2) { //Max prefix length for Oracle is 2cc
error('$CFG->prefix maximum allowed length for Oracle DBs is 2cc.');
}
/// Check that config.php has been edited
@@ -103,13 +73,12 @@
$CFG->version = "";
}
if (is_readable("$CFG->dirroot/version.php")) {
include_once("$CFG->dirroot/version.php"); # defines $version
}
/// Turn off time limits and try to flush everything all the time, sometimes upgrades can be slow.
@set_time_limit(0);
@ob_implicit_flush(true);
@ob_end_flush();
if (!$version or !$release) {
error('Main version.php was not readable or specified');# without version, stop
}
/// Check if the main tables have been installed yet or not.
@@ -120,7 +89,7 @@
$maintables = true;
$mtables = array("config", "course", "course_categories", "course_modules",
"course_sections", "log", "log_display", "modules",
"user");
"user", "user_admins", "user_students", "user_teachers");
foreach ($mtables as $mtable) {
if (!in_array($CFG->prefix.$mtable, $tables)) {
$maintables = false;
@@ -128,110 +97,38 @@
}
}
}
if (! $maintables) {
/// hide errors from headers in case debug enabled in config.php
$origdebug = $CFG->debug;
$CFG->debug = DEBUG_MINIMAL;
error_reporting($CFG->debug);
if (empty($agreelicense)) {
$strlicense = get_string('license');
$navigation = build_navigation(array(array('name'=>$strlicense, 'link'=>null, 'type'=>'misc')));
print_header($strlicense, $strlicense, $navigation, "", "", false, "&nbsp;", "&nbsp;");
if (empty($agreelicence)) {
$strlicense = get_string("license");
print_header($strlicense, $strlicense, $strlicense, "", "", false, "&nbsp;", "&nbsp;");
print_heading("<a href=\"http://moodle.org\">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment");
print_heading(get_string('copyrightnotice'));
print_box(text_to_html(get_string('gpl')), 'copyrightnotice');
print_heading(get_string("copyrightnotice"));
print_simple_box_start("center");
echo text_to_html(get_string("gpl"));
print_simple_box_end();
echo "<br />";
notice_yesno(get_string('doyouagree'), "index.php?agreelicense=1",
"http://docs.moodle.org/en/License");
print_footer('none');
notice_yesno(get_string("doyouagree"), "index.php?agreelicence=true",
"http://moodle.org/doc/?frame=licence.html");
exit;
}
if (empty($confirmrelease)) {
$strcurrentrelease = get_string("currentrelease");
$navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc')));
print_header($strcurrentrelease, $strcurrentrelease, $navigation, "", "", false, "&nbsp;", "&nbsp;");
print_heading("Moodle $release");
print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'generalbox boxaligncenter boxwidthwide');
echo '<form action="index.php"><div>';
echo '<input type="hidden" name="agreelicense" value="1" />';
echo '<input type="hidden" name="confirmrelease" value="1" />';
echo '</div>';
echo '<div class="continuebutton"><input name="autopilot" id="autopilot" type="checkbox" value="1" /><label for="autopilot">'.get_string('unattendedoperation', 'admin').'</label>';
echo '<br /><br /><input type="submit" value="'.get_string('continue').'" /></div>';
echo '</form>';
print_footer('none');
die;
}
$strdatabasesetup = get_string("databasesetup");
$strdatabasesuccess = get_string("databasesuccess");
$navigation = build_navigation(array(array('name'=>$strdatabasesetup, 'link'=>null, 'type'=>'misc')));
print_header($strdatabasesetup, $strdatabasesetup, $navigation,
"", upgrade_get_javascript(), false, "&nbsp;", "&nbsp;");
/// return to original debugging level
$CFG->debug = $origdebug;
error_reporting($CFG->debug);
upgrade_log_start();
$db->debug = true;
/// Both old .sql files and new install.xml are supported
/// But we prioritise install.xml (XMLDB) if present
change_db_encoding(); // first try to change db encoding to utf8
if (!setup_is_unicodedb()) {
// If could not convert successfully, throw error, and prevent installation
print_error('unicoderequired', 'admin');
}
$status = false;
if (file_exists("$CFG->libdir/db/install.xml")) {
$status = install_from_xmldb_file("$CFG->libdir/db/install.xml"); //New method
} else if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
$status = modify_database("$CFG->libdir/db/$CFG->dbtype.sql"); //Old method
print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup, "", "", false, "&nbsp;", "&nbsp;");
if (file_exists("$CFG->libdir/db/$CFG->dbtype.sql")) {
$db->debug = true;
if (modify_database("$CFG->libdir/db/$CFG->dbtype.sql")) {
$db->debug = false;
notify($strdatabasesuccess, "green");
} else {
$db->debug = false;
error("Error: Main databases NOT set up successfully");
}
} else {
error("Error: Your database ($CFG->dbtype) is not yet fully supported by Moodle or install.xml is not present. See the lib/db directory.");
error("Error: Your database ($CFG->dbtype) is not yet fully supported by Moodle. See the lib/db directory.");
}
// all new installs are in unicode - keep for backwards compatibility and 1.8 upgrade checks
set_config('unicodedb', 1);
/// Continue with the instalation
$db->debug = false;
if ($status) {
/// Groups install is now in core above.
// Install the roles system.
moodle_install_roles();
set_config('statsrolesupgraded',time());
// install core event handlers
events_update_definition();
/// This is used to handle any settings that must exist in $CFG but which do not exist in
/// admin_get_root()/$ADMIN as admin_setting objects (there are some exceptions).
apply_default_exception_settings(array('auth' => 'email',
'auth_pop3mailbox' => 'INBOX',
'enrol' => 'manual',
'enrol_plugins_enabled' => 'manual',
'style' => 'default',
'template' => 'default',
'theme' => 'standardwhite',
'filter_multilang_converted' => 1));
// Write default settings unconditionally (i.e. even if a setting is already set, overwrite it)
// (this should only have any effect during initial install).
admin_apply_default_settings(NULL, true);
notify($strdatabasesuccess, "green");
require_once $CFG->dirroot.'/mnet/lib.php';
} else {
error("Error: Main databases NOT set up successfully");
}
print_continue('index.php');
print_footer('none');
print_continue("index.php");
die;
}
@@ -239,461 +136,325 @@
/// Check version of Moodle code on disk compared with database
/// and upgrade if possible.
if (file_exists("$CFG->dirroot/lib/db/$CFG->dbtype.php")) {
include_once("$CFG->dirroot/lib/db/$CFG->dbtype.php"); # defines old upgrades
}
if (file_exists("$CFG->dirroot/lib/db/upgrade.php")) {
include_once("$CFG->dirroot/lib/db/upgrade.php"); # defines new upgrades
}
include_once("$CFG->dirroot/version.php"); # defines $version
include_once("$CFG->dirroot/lib/db/$CFG->dbtype.php"); # defines upgrades
$stradministration = get_string("administration");
if ($CFG->version) {
if ($version > $CFG->version) { // upgrade
/// If the database is not already Unicode then we do not allow upgrading!
/// Instead, we print an error telling them to upgrade to 1.7 first. MDL-6857
if (empty($CFG->unicodedb)) {
print_error('unicodeupgradeerror', 'error', '', $version);
}
$a->oldversion = "$CFG->release ($CFG->version)";
$a->newversion = "$release ($version)";
$strdatabasechecking = get_string("databasechecking", "", $a);
// hide errors from headers in case debug is enabled
$origdebug = $CFG->debug;
$CFG->debug = DEBUG_MINIMAL;
error_reporting($CFG->debug);
// logo ut in case we are upgrading from pre 1.9 version in order to prevent
// weird session/role problems caused by incorrect data in USER and SESSION
if ($CFG->version < 2007101500) {
require_logout();
}
if (empty($confirmupgrade)) {
$navigation = build_navigation(array(array('name'=>$strdatabasechecking, 'link'=>null, 'type'=>'misc')));
print_header($strdatabasechecking, $stradministration, $navigation,
if (empty($_GET['confirmupgrade'])) {
print_header($strdatabasechecking, $stradministration, $strdatabasechecking,
"", "", false, "&nbsp;", "&nbsp;");
notice_yesno(get_string('upgradesure', 'admin', $a->newversion), 'index.php?confirmupgrade=1', 'index.php');
print_footer('none');
notice_yesno(get_string('upgradesure', 'admin', $a->newversion), 'index.php?confirmupgrade=yes', 'index.php');
exit;
} else if (empty($confirmrelease)){
$strcurrentrelease = get_string("currentrelease");
$navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc')));
print_header($strcurrentrelease, $strcurrentrelease, $navigation, "", "", false, "&nbsp;", "&nbsp;");
print_heading("Moodle $release");
print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'));
require_once($CFG->libdir.'/environmentlib.php');
print_heading(get_string('environment', 'admin'));
remove_dir($CFG->dataroot . '/environment'); /// Always delete downloaded env. info to force use of the released one. MDL-9796
if (!check_moodle_environment($release, $environment_results, true)) {
if (empty($CFG->skiplangupgrade)) {
print_box_start('generalbox', 'notice'); // MDL-8330
print_string('langpackwillbeupdated', 'admin');
print_box_end();
}
notice_yesno(get_string('environmenterrorupgrade', 'admin'),
'index.php?confirmupgrade=1&amp;confirmrelease=1', 'index.php');
} else {
notify(get_string('environmentok', 'admin'), 'notifysuccess');
if (empty($CFG->skiplangupgrade)) {
print_box_start('generalbox', 'notice'); // MDL-8330
print_string('langpackwillbeupdated', 'admin');
print_box_end();
}
echo '<form action="index.php"><div>';
echo '<input type="hidden" name="confirmupgrade" value="1" />';
echo '<input type="hidden" name="confirmrelease" value="1" />';
echo '</div>';
echo '<div class="continuebutton">';
echo '<br /><br /><input type="submit" value="'.get_string('continue').'" /></div>';
echo '</form>';
}
print_footer('none');
die;
} elseif (empty($confirmplugincheck)) {
$strplugincheck = get_string('plugincheck');
$navigation = build_navigation(array(array('name'=>$strplugincheck, 'link'=>null, 'type'=>'misc')));
print_header($strplugincheck, $strplugincheck, $navigation, "", "", false, "&nbsp;", "&nbsp;");
print_heading($strplugincheck);
print_box_start('generalbox', 'notice'); // MDL-8330
print_string('pluginchecknotice');
print_box_end();
print_plugin_tables();
echo "<br />";
echo '<div class="continuebutton">';
echo '<a href="index.php?confirmupgrade=1&amp;confirmrelease=1" title="'.get_string('reload').'" ><img src="'.$CFG->pixpath.'/i/reload.gif" alt="" /> '.get_string('reload').'</a>';
echo '</div><br />';
echo '<form action="index.php"><div>';
echo '<input type="hidden" name="confirmupgrade" value="1" />';
echo '<input type="hidden" name="confirmrelease" value="1" />';
echo '<input type="hidden" name="confirmplugincheck" value="1" />';
echo '</div>';
echo '<div class="continuebutton"><input name="autopilot" id="autopilot" type="checkbox" value="1" /><label for="autopilot">'.get_string('unattendedoperation', 'admin').'</label>';
echo '<br /><br /><input type="submit" value="'.get_string('continue').'" /></div>';
echo '</form>';
print_footer('none');
die();
} else {
$strdatabasesuccess = get_string("databasesuccess");
$navigation = build_navigation(array(array('name'=>$strdatabasesuccess, 'link'=>null, 'type'=>'misc')));
print_header($strdatabasechecking, $stradministration, $navigation,
"", upgrade_get_javascript(), false, "&nbsp;", "&nbsp;");
/// return to original debugging level
$CFG->debug = $origdebug;
error_reporting($CFG->debug);
upgrade_log_start();
/// Upgrade current language pack if we can
if (empty($CFG->skiplangupgrade)) {
upgrade_language_pack();
}
print_header($strdatabasechecking, $stradministration, $strdatabasechecking,
"", "", false, "&nbsp;", "&nbsp;");
print_heading($strdatabasechecking);
$db->debug=true;
/// Launch the old main upgrade (if exists)
$status = true;
if (function_exists('main_upgrade')) {
$status = main_upgrade($CFG->version);
}
/// If succesful and exists launch the new main upgrade (XMLDB), called xmldb_main_upgrade
if ($status && function_exists('xmldb_main_upgrade')) {
$status = xmldb_main_upgrade($CFG->version);
}
$db->debug=false;
/// If successful, continue upgrading roles and setting everything properly
if ($status) {
if (empty($CFG->rolesactive)) {
/// Groups upgrade is now in core above.
// Upgrade to the roles system.
moodle_install_roles();
set_config('rolesactive', 1);
} else if (!update_capabilities()) {
error('Had trouble upgrading the core capabilities for the Roles System');
}
// update core events
events_update_definition();
require_once($CFG->libdir.'/statslib.php');
if (!stats_upgrade_for_roles_wrapper()) {
notify('Couldn\'t upgrade the stats tables to use the new roles system');
}
if (main_upgrade($CFG->version)) {
$db->debug=false;
if (set_config("version", $version)) {
remove_dir($CFG->dataroot . '/cache', true); // flush cache
notify($strdatabasesuccess, "green");
print_continue("upgradesettings.php");
print_footer('none');
print_continue("index.php");
exit;
} else {
error('Upgrade failed! (Could not update version in config table)');
notify("Upgrade failed! (Could not update version in config table)");
}
/// Main upgrade not success
} else {
notify('Main Upgrade failed! See lib/db/upgrade.php');
print_continue('index.php?confirmupgrade=1&amp;confirmrelease=1&amp;confirmplugincheck=1');
print_footer('none');
die;
$db->debug=false;
notify("Upgrade failed! See /version.php");
}
upgrade_log_finish();
}
} else if ($version < $CFG->version) {
upgrade_log_start();
notify("WARNING!!! The code you are using is OLDER than the version that made these databases!");
upgrade_log_finish();
}
} else {
if (!set_config("version", $version)) {
error("A problem occurred inserting current version into databases");
$strcurrentversion = get_string("currentversion");
print_header($strcurrentversion, $stradministration, $strcurrentversion,
"", "", false, "&nbsp;", "&nbsp;");
if (set_config("version", $version)) {
print_heading("Moodle $release ($version)");
print_continue("index.php");
die;
} else {
$db->debug=true;
if (main_upgrade(0)) {
print_continue("index.php");
} else {
error("A problem occurred inserting current version into databases");
}
$db->debug=false;
}
}
/// Updated human-readable release version if necessary
if ($release <> $CFG->release) { // Update the release version
$strcurrentrelease = get_string("currentrelease");
print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, "&nbsp;", "&nbsp;");
print_heading("Moodle $release");
if (!set_config("release", $release)) {
error("ERROR: Could not update release version in database!!");
notify("ERROR: Could not update release version in database!!");
}
print_continue("index.php");
print_simple_box_start("CENTER");
include("$CFG->dirroot/lang/en/docs/release.html");
print_simple_box_end();
print_continue("index.php");
exit;
}
/// Insert default values for any important configuration variables
include_once("$CFG->dirroot/lib/defaults.php");
foreach ($defaults as $name => $value) {
if (!isset($CFG->$name)) {
$CFG->$name = $value;
set_config($name, $value);
$configchange = true;
}
}
/// Groups install/upgrade is now in core above.
/// If any new configurations were found then send to the config page to check
if (!empty($configchange)) {
redirect("config.php");
}
/// Find and check all main modules and load them up or upgrade them if necessary
/// first old *.php update and then the new upgrade.php script
upgrade_activity_modules("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Check all questiontype plugins and upgrade if necessary
/// first old *.php update and then the new upgrade.php script
/// It is important that this is done AFTER the quiz module has been upgraded
upgrade_plugins('qtype', 'question/type', "$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Upgrade backup/restore system if necessary
/// first old *.php update and then the new upgrade.php script
require_once("$CFG->dirroot/backup/lib.php");
upgrade_backup_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Upgrade blocks system if necessary
/// first old *.php update and then the new upgrade.php script
require_once("$CFG->dirroot/lib/blocklib.php");
upgrade_blocks_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Check all blocks and load (or upgrade them if necessary)
/// first old *.php update and then the new upgrade.php script
upgrade_blocks_plugins("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Check all enrolment plugins and upgrade if necessary
/// first old *.php update and then the new upgrade.php script
upgrade_plugins('enrol', 'enrol', "$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Check all auth plugins and upgrade if necessary
upgrade_plugins('auth','auth',"$CFG->wwwroot/$CFG->admin/index.php");
/// Check all course formats and upgrade if necessary
upgrade_plugins('format','course/format',"$CFG->wwwroot/$CFG->admin/index.php");
/// Check for local database customisations
/// first old *.php update and then the new upgrade.php script
require_once("$CFG->dirroot/lib/locallib.php");
upgrade_local_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Check for changes to RPC functions
require_once("$CFG->dirroot/$CFG->admin/mnet/adminlib.php");
upgrade_RPC_functions("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// Upgrade all plugins for gradebook
upgrade_plugins('gradeexport', 'grade/export', "$CFG->wwwroot/$CFG->admin/index.php");
upgrade_plugins('gradeimport', 'grade/import', "$CFG->wwwroot/$CFG->admin/index.php");
upgrade_plugins('gradereport', 'grade/report', "$CFG->wwwroot/$CFG->admin/index.php");
/// Check all message output plugins and upgrade if necessary
upgrade_plugins('message','message/output',"$CFG->wwwroot/$CFG->admin/index.php");
/// Check all course report plugins and upgrade if necessary
upgrade_plugins('coursereport', 'course/report', "$CFG->wwwroot/$CFG->admin/index.php");
/// Check all admin report plugins and upgrade if necessary
upgrade_plugins('report', $CFG->admin.'/report', "$CFG->wwwroot/$CFG->admin/index.php");
upgrade_enrol_plugins("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
/// just make sure upgrade logging is properly terminated
upgrade_log_finish();
unset($_SESSION['installautopilot']);
/// Set up the blank site - to be customized later at the end of install.
/// Set up the overall site name etc.
if (! $site = get_site()) {
// We are about to create the site "course"
require_once($CFG->libdir.'/blocklib.php');
$newsite = new object();
$newsite->fullname = "";
$newsite->shortname = "";
$newsite->summary = NULL;
$newsite->newsitems = 3;
$newsite->numsections = 0;
$newsite->category = 0;
$newsite->format = 'site'; // Only for this course
$newsite->teacher = get_string("defaultcourseteacher");
$newsite->teachers = get_string("defaultcourseteachers");
$newsite->student = get_string("defaultcoursestudent");
$newsite->students = get_string("defaultcoursestudents");
$newsite->timemodified = time();
if (!$newid = insert_record('course', $newsite)) {
error("Serious Error! Could not set up the site!");
}
// make sure course context exists
get_context_instance(CONTEXT_COURSE, $newid);
// Site created, add blocks for it
$page = page_create_object(PAGE_COURSE_VIEW, $newid);
blocks_repopulate_page($page); // Return value not checked because you can always edit later
$cat = new object();
$cat->name = get_string('miscellaneous');
$cat->depth = 1;
if (!$catid = insert_record('course_categories', $cat)) {
error("Serious Error! Could not set up a default course category!");
}
// make sure category context exists
get_context_instance(CONTEXT_COURSECAT, $catid);
mark_context_dirty('/'.SYSCONTEXTID);
redirect('index.php');
redirect("site.php");
}
// initialise default blocks on admin and site page if needed
if (empty($CFG->adminblocks_initialised)) {
require_once("$CFG->dirroot/$CFG->admin/pagelib.php");
require_once($CFG->libdir.'/blocklib.php');
page_map_class(PAGE_ADMIN, 'page_admin');
$page = page_create_object(PAGE_ADMIN, 0); // there must be some id number
blocks_repopulate_page($page);
//add admin_tree block to site if not already present
if ($admintree = get_record('block', 'name', 'admin_tree')) {
$page = page_create_object(PAGE_COURSE_VIEW, SITEID);
$pageblocks=blocks_get_by_page($page);
blocks_execute_action($page, $pageblocks, 'add', (int)$admintree->id, false, false);
if ($admintreeinstance = get_record('block_instance', 'pagetype', $page->type, 'pageid', SITEID, 'blockid', $admintree->id)) {
$pageblocks=blocks_get_by_page($page); // Needs to be re-got, since has just changed
blocks_execute_action($page, $pageblocks, 'moveleft', $admintreeinstance, false, false);
}
}
set_config('adminblocks_initialised', 1);
/// Define the unique site ID code if it isn't already
if (empty($CFG->siteidentifier)) { // Unique site identification code
set_config('siteidentifier', random_string(32));
}
/// Define the unique site ID code if it isn't already set. This getter does that as a side-effect.
get_site_identifier();
/// Check if the guest user exists. If not, create one.
if (! record_exists("user", "username", "guest")) {
if (! $guest = create_guest_record()) {
$guest->auth = "manual";
$guest->username = "guest";
$guest->password = md5("guest");
$guest->firstname = addslashes(get_string("guestuser"));
$guest->lastname = " ";
$guest->email = "root@localhost";
$guest->description = addslashes(get_string("guestuserinfo"));
$guest->confirmed = 1;
$guest->lang = $CFG->lang;
$guest->timemodified= time();
if (! $guest->id = insert_record("user", $guest)) {
notify("Could not create guest user record !!!");
}
}
/// Set up the admin user
if (empty($CFG->rolesactive)) {
build_context_path(); // just in case - should not be needed
create_admin_user();
if (! record_exists("user_admins")) { // No admin user yet
redirect("user.php");
}
/// Check for valid admin user - no guest autologin
require_login(0, false);
/// Check for valid admin user
require_login();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context);
/// check that site is properly customized
if (empty($site->shortname)) {
// probably new installation - lets return to frontpage after this step
// remove settings that we want uninitialised
unset_config('registerauth');
redirect('upgradesettings.php?return=site');
if (!isadmin()) {
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
/// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders
if (!empty($id)) {
if ($id == $CFG->siteidentifier) {
if (!empty($_GET['id'])) {
if ($_GET['id'] == $CFG->siteidentifier) {
set_config('registered', time());
}
}
/// setup critical warnings before printing admin tree block
$insecuredataroot = is_dataroot_insecure(true);
$register_globals_enabled = ini_get_bool('register_globals');
/// At this point everything is set up and the user is an admin, so print menu
$SESSION->admin_critical_warning = ($register_globals_enabled || $insecuredataroot==INSECURE_DATAROOT_ERROR);
$stradministration = get_string("administration");
print_header("$site->shortname: $stradministration","$site->fullname", "$stradministration");
print_simple_box_start('center', '100%', '', 20);
print_heading($stradministration);
$adminroot =& admin_get_root();
/// Check if there are any new admin settings which have still yet to be set
if (any_new_admin_settings($adminroot)){
redirect('upgradesettings.php');
if (!empty($CFG->upgrade)) { // Print notice about extra upgrading that needs to be done
print_simple_box(get_string("upgrade$CFG->upgrade", "admin",
"$CFG->wwwroot/$CFG->admin/upgrade$CFG->upgrade.php"), "center");
print_spacer(10,10);
}
/// Everything should now be set up, and the user is an admin
/// Print default admin page with notifications.
admin_externalpage_setup('adminnotifications');
admin_externalpage_print_header();
/// Deprecated database! Warning!!
if (!empty($CFG->migrated_to_new_db)) {
print_box(print_string('dbmigrationdeprecateddb', 'admin'), 'generalbox adminwarning');
if (ini_get_bool('register_globals') && !ini_get_bool('magic_quotes_gpc')) {
print_simple_box(get_string('globalsquoteswarning', 'admin'), 'center');
}
/// Check for any special upgrades that might need to be run
if (!empty($CFG->upgrade)) {
print_box(get_string("upgrade$CFG->upgrade", "admin", "$CFG->wwwroot/$CFG->admin/upgrade$CFG->upgrade.php"));
}
if ($register_globals_enabled) {
print_box(get_string('globalswarning', 'admin'), 'generalbox adminerror');
}
if ($insecuredataroot == INSECURE_DATAROOT_WARNING) {
print_box(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot), 'generalbox adminwarning');
} else if ($insecuredataroot == INSECURE_DATAROOT_ERROR) {
print_box(get_string('datarootsecurityerror', 'admin', $CFG->dataroot), 'generalbox adminerror');
}
if (empty($CFG->passwordsaltmain)) {
$path = $CFG->docroot.'/'.str_replace('_utf8', '', current_language()).'/report/security/report_security_check_passwordsaltmain';
print_box(get_string('upgrade197notice', 'admin')."\n".get_string('upgrade197salt', 'admin', $path));
}
if (defined('WARN_DISPLAY_ERRORS_ENABLED')) {
print_box(get_string('displayerrorswarning', 'admin'), 'generalbox adminwarning');
}
if (substr($CFG->wwwroot, -1) == '/') {
print_box(get_string('cfgwwwrootslashwarning', 'admin'), 'generalbox adminwarning');
}
if (strpos($ME, $CFG->httpswwwroot.'/') === false) {
print_box(get_string('cfgwwwrootwarning', 'admin'), 'generalbox adminwarning');
}
/// If no recently cron run
$lastcron = get_field_sql('SELECT max(lastcron) FROM ' . $CFG->prefix . 'modules');
if (time() - $lastcron > 3600 * 24) {
$strinstallation = get_string('installation', 'install');
$helpbutton = helpbutton('install', $strinstallation, 'moodle', true, false, '', true);
print_box(get_string('cronwarning', 'admin')."&nbsp;".$helpbutton, 'generalbox adminwarning');
}
/// Print multilang upgrade notice if needed
if (empty($CFG->filter_multilang_converted)) {
print_box(get_string('multilangupgradenotice', 'admin'), 'generalbox adminwarning');
print_simple_box(get_string('cronwarning', 'admin') , 'center');
}
/// Alert if we are currently in maintenance mode
if (file_exists($CFG->dataroot.'/1/maintenance.html')) {
print_box(get_string('sitemaintenancewarning', 'admin'), 'generalbox adminwarning');
print_simple_box(get_string('sitemaintenancewarning', 'admin') , 'center');
}
/// Print slightly annoying registration button every six months ;-)
/// You can set the "registered" variable to something far in the future
/// if you really want to prevent this. eg 9999999999
if (!isset($CFG->registered) || $CFG->registered < (time() - 3600*24*30*6)) {
$options = array();
$options['sesskey'] = $USER->sesskey;
print_simple_box_start('center');
echo '<div align="center">';
print_string('pleaseregister', 'admin');
print_single_button('register.php', $options, get_string('registration'));
echo '</div>';
print_simple_box_end();
}
/// Print slightly annoying registration button
$table->tablealign = "right";
$table->align = array ("right", "left");
$table->wrap = array ("nowrap", "nowrap");
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = "40%";
$configdata = "<font size=\"+1\">&nbsp;</font><a href=\"config.php\">".get_string("configvariables", 'admin')."</a> - <font size=\"1\">".
get_string("adminhelpconfigvariables")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"site.php\">".get_string("sitesettings")."</a> - <font size=\"1\">".
get_string("adminhelpsitesettings")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"../theme/index.php\">".get_string("themes")."</a> - <font size=\"1\">".
get_string("adminhelpthemes")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"lang.php\">".get_string("language")."</a> - <font size=\"1\">".
get_string("adminhelplanguage")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"modules.php\">".get_string("managemodules")."</a> - <font size=\"1\">".
get_string("adminhelpmanagemodules")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"blocks.php\">".get_string("manageblocks")."</a> - <font size=\"1\">".
get_string("adminhelpmanageblocks")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"filters.php\">".get_string("managefilters")."</a> - <font size=\"1\">".
get_string("adminhelpmanagefilters")."</font><br />";
if (!isset($CFG->disablescheduledbackups)) {
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"backup.php\">".get_string("backup")."</a> - <font size=\"1\">".
get_string("adminhelpbackup")."</font><br />";
}
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"editor.php\">". get_string("editorsettings") ."</a> - <font size=\"1\">".
get_string("adminhelpeditorsettings")."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"calendar.php\">". get_string('calendarsettings', 'admin') ."</a> - <font size=\"1\">".
get_string('helpcalendarsettings', 'admin')."</font><br />";
$configdata .= "<font size=\"+1\">&nbsp;</font><a href=\"maintenance.php\">". get_string('sitemaintenancemode', 'admin') ."</a> - <font size=\"1\">".
get_string('helpsitemaintenance', 'admin')."</font><br />";
$table->data[] = array("<font size=\"+1\"><b><a href=\"configure.php\">".get_string("configuration")."</a></b></font>",
$configdata);
$userdata = "<font size=\"+1\">&nbsp;</font><a href=\"auth.php?sesskey=$USER->sesskey\">".get_string("authentication")."</a> - <font size=\"1\">".
get_string("adminhelpauthentication")."</font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"user.php\">".get_string("edituser")."</a> - <font size=\"1\">".
get_string("adminhelpedituser")."</font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"$CFG->wwwroot/$CFG->admin/user.php?newuser=true&amp;sesskey=$USER->sesskey\">".
get_string("addnewuser")."</a> - <font size=\"1\">".
get_string("adminhelpaddnewuser")."</font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"$CFG->wwwroot/$CFG->admin/uploaduser.php?sesskey=$USER->sesskey\">".
get_string("uploadusers")."</a> - <font size=\"1\">".
get_string("adminhelpuploadusers")."</font><br />";
$userdata .= "<hr /><font size=\"+1\">&nbsp;</font><a href=\"enrol.php?sesskey=$USER->sesskey\">".get_string("enrolments")."</a> - <font size=\"1\">".
get_string("adminhelpenrolments")."</font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"../course/index.php?edit=off&amp;sesskey=$USER->sesskey\">".get_string("assignstudents")."</a> - <font size=\"1\">".
get_string("adminhelpassignstudents")."</font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"../course/index.php?edit=on&amp;sesskey=$USER->sesskey\">".get_string("assignteachers")."</a> - <font size=\"1\">".
get_string("adminhelpassignteachers").
" <img src=\"../pix/t/user.gif\" height=\"11\" width=\"11\" alt=\"\" /></font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"creators.php?sesskey=$USER->sesskey\">".get_string("assigncreators")."</a> - <font size=\"1\">".
get_string("adminhelpassigncreators")."</font><br />";
$userdata .= "<font size=\"+1\">&nbsp;</font><a href=\"admin.php?sesskey=$USER->sesskey\">".get_string("assignadmins")."</a> - <font size=\"1\">".
get_string("adminhelpassignadmins")."</font><br />";
$table->data[] = array("<font size=\"+1\"><b><a href=\"users.php\">".get_string("users")."</a></b></font>", $userdata);
$table->data[] = array("<font size=\"+1\"><b><a href=\"../course/index.php?edit=on&amp;sesskey=$USER->sesskey\">".get_string("courses")."</a></b></font>",
"<font size=\"+1\">&nbsp;</font>".get_string("adminhelpcourses"));
$table->data[] = array("<font size=\"+1\"><b><a href=\"../course/log.php?id=$site->id\">".get_string("logs")."</a></b></font>",
"<font size=\"+1\">&nbsp;</font>".get_string("adminhelplogs"));
$table->data[] = array("<font size=\"+1\"><b><a href=\"../files/index.php?id=$site->id\">".get_string("sitefiles")."</a></b></font>",
"<font size=\"+1\">&nbsp;</font>".get_string("adminhelpsitefiles"));
$table->data[] = array('<font size="+1"><b><a href="environment.php">'.get_string('environment','admin').'</a></b></font>',
"<font size=\"+1\">&nbsp;</font>".get_string('adminhelpenvironment'));
if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) {
$table->data[] = array("<font size=\"+1\"><b><a href=\"$CFG->dbtype/frame.php\">".get_string("managedatabase")."</a></b></font>",
"<font size=\"+1\">&nbsp;</font>".get_string("adminhelpmanagedatabase"));
}
print_table($table);
//////////////////////////////////////////////////////////////////////////////////////////////////
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO REMOVE OR MODIFY THE COPYRIGHT NOTICE BELOW ////
$copyrighttext = "<a href=\"http://moodle.org/\">Moodle</a> ".
"<a href=\"../doc/?frame=release.html\">$CFG->release</a> ($CFG->version)<br />".
"Copyright &copy; 1999 onwards by Martin Dougiamas<br />".
"<a href=\"../doc/?frame=licence.html\">GNU Public License</a>";
echo "<center><p><font size=\"1\">$copyrighttext</font></p></center>";
//////////////////////////////////////////////////////////////////////////////////////////////////
echo '<table width="100%" cellspacing="0"><tr>';
echo '<td align="center" width="33%">';
print_single_button($CFG->wwwroot.'/doc/', NULL, get_string('documentation'));
echo '</td>';
echo '<td align="center" width="33%">';
print_single_button('phpinfo.php', NULL, get_string('phpinfo'));
echo '</td>';
echo '<td align="center" width="33%">';
$options = array();
$options['sesskey'] = $USER->sesskey;
print_box_start('generalbox adminwarning');
if(!isset($CFG->registered)) {
print_string('pleaseregister', 'admin');
}
else { /* if (isset($CFG->registered) && $CFG->registered < (time() - 3600*24*30*6)) { */
print_string('pleaserefreshregistration', 'admin', userdate($CFG->registered));
}
print_single_button('register.php', $options, get_string('registration'));
print_box_end();
echo '</td></tr></table>';
print_simple_box_end();
//////////////////////////////////////////////////////////////////////////////////////////////////
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
$copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
'<a href="http://docs.moodle.org/en/Release" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
'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>';
print_box($copyrighttext, 'copyright');
//////////////////////////////////////////////////////////////////////////////////////////////////
admin_externalpage_print_footer();
print_footer($site);
?>
+11 -24
View File
@@ -1,43 +1,30 @@
<?php
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('toinodb');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
include('../config.php');
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
admin_externalpage_print_header();
print_heading('Convert all MySQL tables from MYISAM to InnoDB');
if ($CFG->dbfamily != 'mysql') {
notice('This function is for MySQL databases only!', 'index.php');
if (!isadmin()) {
error('Admin only');
}
if (data_submitted() and $confirm and confirm_sesskey()) {
print_header("Convert all tables from MYISAM to InnoDB", "Convert all tables from MYISAM to InnoDB",
"Convert all tables from MYISAM to InnoDB");
notify('Please be patient and wait for this to complete...', 'notifysuccess');
if (!empty($confirm) and confirm_sesskey()) {
print_heading("Please be patient and wait for this to complete...");
if ($tables = $db->MetaTables()) {
$db->debug = true;
foreach ($tables as $table) {
execute_sql("ALTER TABLE $table TYPE=INNODB; ");
}
$db->debug = false;
}
notify('... done.', 'notifysuccess');
print_continue('index.php');
admin_externalpage_print_footer();
} else {
$optionsyes = array('confirm'=>'1', 'sesskey'=>sesskey());
notice_yesno('Are you sure you want convert all your tables to the InnoDB format?',
'innodb.php', 'index.php', $optionsyes, NULL, 'post', 'get');
admin_externalpage_print_footer();
notice_yesno("Are you sure you want convert all your tables to the InnoDB format?",
"innodb.php?confirm=yes&sesskey=".sesskey(), "index.php");
}
?>
+189 -1246
View File
File diff suppressed because it is too large Load Diff
+51 -74
View File
@@ -1,17 +1,14 @@
<?php // $Id$
/**
* This script enables Moodle translators to edit /docs and /help language
* files directly via WWW interface.
*
* Author: mudrd8mz@uxit.pedf.cuni.cz (http://moodle.cz)
* Based on: lang.php in 1.4.3+ release
* Thanks: Jaime Villate for important bug fixing, koen roggemans for his job and all moodlers
* for intensive testing of this my first contribution
*/
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('langedit');
This script enables Moodle translators to edit /docs and /help language
files directly via WWW interface.
Author: mudrd8mz@uxit.pedf.cuni.cz (http://moodle.cz)
Based on: lang.php in 1.4.3+ release
Thanks: Jaime Villate for important bug fixing, koen roggemans for his job and all moodlers
for intensive testing of this my first contribution
*/
//
// Some local configuration
@@ -24,26 +21,37 @@
// or to filenames with filesize() == 0
$filetemplate = ''; // template for new files, i.e. '$Id$';
require_once("../config.php");
$currentfile = optional_param('currentfile', 'docs/README.txt', PARAM_PATH);
require_login();
if (!isadmin()) {
error("You need to be admin to edit this page");
}
if (! $site = get_site()) {
error("Site not defined!");
}
$stradministration = get_string("administration");
$strconfiguration = get_string("configuration");
$strlanguage = get_string("language");
$strcurrentlanguage = get_string("currentlanguage");
$strthislanguage = get_string("thislanguage");
$stredithelpdocs = get_string('edithelpdocs', 'admin');
admin_externalpage_print_header();
notify('NOTICE: This interface is obsolete now and will be removed. You should use
improved <a href="lang.php?mode=helpfiles">lang.php</a> interface.');
print_header("$site->shortname: $stredithelpdocs: $currentfile", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> ->
<a href=\"lang.php\">$strlanguage</a> -> $stredithelpdocs",
'choosefile.popup', '', true);
$currentlang = current_language();
$langdir = "$CFG->dataroot/lang/$currentlang";
$enlangdir = "$CFG->dirroot/lang/en_utf8";
$langdir = "$CFG->dirroot/lang/$currentlang";
$enlangdir = "$CFG->dirroot/lang/en";
if (!file_exists($langdir)) {
error ('to edit this language pack, you need to put it in '.$CFG->dataroot.'/lang');
}
// Shall I save POSTed data?
if (isset($_POST['currentfile'])) {
@@ -62,7 +70,7 @@
// Get all files from /docs directory
if (! $files = get_directory_list("$CFG->dirroot/lang/en_utf8/docs", "CVS")) {
if (! $files = get_directory_list("$CFG->dirroot/lang/en/docs", "CVS")) {
error("Could not find English language docs files!");
}
@@ -74,7 +82,7 @@
if (( !file_exists("$langdir/docs/$file")) || (filesize("$langdir/docs/$file") == 0)) {
$options["docs/$file"] .= "$filemissingmark";
} else {
if (filemtime("$langdir/docs/$file") < filemtime("$CFG->dirroot/lang/en_utf8/docs/$file")) {
if (filemtime("$langdir/docs/$file") < filemtime("$CFG->dirroot/lang/en/docs/$file")) {
$options["docs/$file"] .= "$fileoldmark";
}
}
@@ -82,13 +90,13 @@
// Get all files from /help directory
if (! $files = get_directory_list("$CFG->dirroot/lang/en_utf8/help", "CVS")) {
if (! $files = get_directory_list("$CFG->dirroot/lang/en/help", "CVS")) {
error("Could not find English language help files!");
}
foreach ($files as $filekey => $file) { // check all the help files.
$options["help/$file"] = "help/$file";
if (( !file_exists("$langdir/help/$file")) || (filesize("$CFG->dirroot/lang/en_utf8/help/$file") == 0)) {
if (( !file_exists("$langdir/help/$file")) || (filesize("$CFG->dirroot/lang/en/help/$file") == 0)) {
$options["help/$file"] .= "$filemissingmark";
} else {
if (filemtime("$langdir/help/$file") < filemtime("$langdir/help/$file")) {
@@ -112,7 +120,7 @@
for ($a=0; $a < count($pathparts)-1 ; $a++) {
$checkpath .= "/".$pathparts[$a];
if(!file_exists($checkpath)){
if(!mkdir($checkpath, $CFG->directorypermissions)){
if(!mkdir($checkpath)){
echo ("Cannot create directory: $checkpath");
}
}
@@ -150,20 +158,11 @@ $langdir/$currentfile")."</font></p>";
."</font></p>";
}
//en_utf8 in dataroot is not editable
if ($currentlang == 'en_utf8') {
$editable = false;
}
echo "<table align=\"center\"><tr valign=\"center\"><td align=\"center\">\n";
echo "<textarea rows=\"$fileeditorrows\" cols=\"$fileeditorcols\" name=\"\">\n";
echo htmlspecialchars(file_get_contents("$enlangdir/$currentfile"));
echo "</textarea>\n";
//link_to_popup_window("/lang/en_utf8/$currentfile", "popup", get_string("preview"));
$preview_url = langdoc_preview_url($currentfile);
if ($preview_url) {
link_to_popup_window($preview_url.'&amp;forcelang=en_utf8', 'popup', get_string('preview'));
}
link_to_popup_window("/lang/en/$currentfile", "popup", get_string("preview"));
echo "</td>\n";
if ($fileeditorinline == 1) {
echo "</tr>\n<tr valign=\"center\">\n";
@@ -171,32 +170,32 @@ $langdir/$currentfile")."</font></p>";
echo "<td align=\"center\">\n";
if ($editable) {
echo "<form id=\"$currentfile\" action=\"langdoc.php\" method=\"post\">";
echo "<form name=\"$currentfile\" action=\"langdoc.php\" method=\"post\">";
echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
echo '<input type="hidden" name="currentfile" value="'.$currentfile.'" />';
echo "<textarea rows=\"$fileeditorrows\" cols=\"$fileeditorcols\" name=\"filedata\">\n";
if (file_exists("$langdir/$currentfile")) {
echo htmlspecialchars(file_get_contents("$langdir/$currentfile"));
} else {
echo ($filetemplate);
}
echo "</textarea>\n";
$preview_url = langdoc_preview_url($currentfile);
if ($preview_url) {
link_to_popup_window($preview_url, 'popup', get_string('preview'));
}
echo '<div class="mdl-align"><input type="submit" value="'.get_string('savechanges').': lang/'.$currentlang.'/'.$currentfile.'" /></div>';
echo '</form>';
}
echo "<textarea rows=\"$fileeditorrows\" cols=\"$fileeditorcols\" name=\"filedata\">\n";
if (file_exists("$langdir/$currentfile")) {
echo htmlspecialchars(file_get_contents("$langdir/$currentfile"));
} else {
echo ($filetemplate);
}
echo "</textarea>\n";
link_to_popup_window("/lang/$currentlang/$currentfile", "popup", get_string("preview"));
echo "</td>\n</tr>\n</table>";
if ($editable) {
echo '<div align="center"><input type="submit" value="'.get_string('savechanges').': lang/'.$currentlang.'/'.$currentfile.'" /></div>';
echo '</form>';
}
error_reporting($CFG->debug);
}
admin_externalpage_print_footer();
print_footer();
//////////////////////////////////////////////////////////////////////
@@ -234,26 +233,4 @@ function langdoc_save_file($path, $file, $content) {
return true;
}
/**
* Return a preview URL for the file, if available.
*
* Documentation will be moved into moodle.org wiki and current version 1.6 does not
* seem to be able to display local documentation. Thus, return empty URL for doc files.
* See lib/moodlelib.php document_file() - it still relies on old pre-UTF8 lang/ location.
*/
function langdoc_preview_url($currentfile) {
if (substr($currentfile, 0, 5) == 'help/') {
$currentfile = substr($currentfile, 5);
$currentpathexp = explode('/', $currentfile);
if (count($currentpathexp) > 1) {
$url = '/help.php?module='.implode('/',array_slice($currentpathexp,0,count($currentpathexp)-1)).'&amp;file='.end($currentpathexp);
} else {
$url = '/help.php?module=moodle&amp;file='.$currentfile;
}
} else {
$url = '';
}
return $url;
}
?>
-446
View File
@@ -1,446 +0,0 @@
<?php //$Id$
///This file only manages the installation of 1.6 lang packs.
///in downloads.moodle.org, they are store in separate directory /lang16
///in local server, they are stored in $CFG->dataroot/lang
///This helps to avoid confusion.
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/filelib.php');
require_once($CFG->libdir.'/componentlib.class.php');
admin_externalpage_setup('langimport');
if (!empty($CFG->skiplangupgrade)) {
admin_externalpage_print_header();
print_box(get_string('langimportdisabled', 'admin'));
print_footer();
die;
}
$mode = optional_param('mode', 0, PARAM_INT); //phase
$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);
$sitelang = optional_param('sitelangconfig', '', PARAM_FILE);
define('INSTALLATION_OF_SELECTED_LANG', 2);
define('DELETION_OF_SELECTED_LANG', 4);
define('UPDATE_ALL_LANG', 5);
$strlang = get_string('langimport','admin');
$strlanguage = get_string('language');
$strthislanguage = get_string('thislanguage');
$title = $strlang;
//reset and diagnose lang cache permissions
@unlink($CFG->dataroot.'/cache/languages');
if (file_exists($CFG->dataroot.'/cache/languages')) {
error('Language cache can not be deleted, please fix permissions in dataroot/cache/languages!');
}
get_list_of_languages(true); //refresh lang cache
$notice_ok = array();
$notice_error = array();
switch ($mode){
case INSTALLATION_OF_SELECTED_LANG: ///installation of selected language pack
if (confirm_sesskey() and !empty($pack)) {
set_time_limit(0);
@mkdir ($CFG->dataroot.'/temp/', $CFG->directorypermissions); //make it in case it's a fresh install, it might not be there
@mkdir ($CFG->dataroot.'/lang/', $CFG->directorypermissions);
if (is_array($pack)) {
$packs = $pack;
} else {
$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;
case DELETION_OF_SELECTED_LANG: //delete a directory(ies) containing a lang pack completely
if ($uninstalllang == 'en_utf8') {
$notice_error[] = 'en_utf8 can not be uninstalled!';
} else if (!$confirm && confirm_sesskey()) {
admin_externalpage_print_header();
notice_yesno(get_string('uninstallconfirm', 'admin', $uninstalllang),
'langimport.php?mode='.DELETION_OF_SELECTED_LANG.'&amp;uninstalllang='.$uninstalllang.'&amp;confirm=1&amp;sesskey='.sesskey(),
'langimport.php');
print_footer();
die;
} else if (confirm_sesskey()) {
$dest1 = $CFG->dataroot.'/lang/'.$uninstalllang;
$dest2 = $CFG->dirroot.'/lang/'.$uninstalllang;
$rm1 = false;
$rm2 = false;
if (file_exists($dest1)){
$rm1 = remove_dir($dest1);
}
if (file_exists($dest2)){
$rm2 = remove_dir($dest2);
}
get_list_of_languages(true); //refresh lang cache
//delete the direcotries
if ($rm1 or $rm2) {
$notice_ok[] = get_string('langpackremoved','admin');
} else { //nothing deleted, possibly due to permission error
$notice_error[] = 'An error has occurred, language pack is not completely uninstalled, please check file permissions';
}
}
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
$md5array = array();
$updated = 0; //any packs updated?
$alllangs = array_keys(get_list_of_languages(false, true)); //get all available langs
$lang16 = array(); //all the Moodle 1.6 unicode lang packs (updated and not updated)
$packs = array(); //all the packs that needs updating
if (!$availablelangs = get_remote_list_of_languages()) {
print_error('cannotdownloadlanguageupdatelist');
}
//and build an associative array
foreach ($availablelangs as $alang) {
$md5array[$alang[0]] = $alang[1];
}
//filtering out non-16 and unofficial packs
foreach ($alllangs as $clang) {
if (!array_key_exists($clang, $md5array)) {
$notice_ok[] = get_string('langpackupdateskipped', 'admin', $clang);
continue;
}
$dest1 = $CFG->dataroot.'/lang/'.$clang;
$dest2 = $CFG->dirroot.'/lang/'.$clang;
if (file_exists($dest1.'/langconfig.php') || file_exists($dest2.'/langconfig.php')){
$lang16[] = $clang;
}
}
//then filter out packs that have the same md5 key
foreach ($lang16 as $clang) {
if (!is_installed_lang($clang, $md5array[$clang])){
$packs[] = $clang;
}
}
@mkdir ($CFG->dataroot.'/temp/', $CFG->directorypermissions);
@mkdir ($CFG->dataroot.'/lang/', $CFG->directorypermissions);
foreach ($packs as $pack){ //for each of the remaining in the list, we
if ($pack == 'en_utf8') { // no update for en_utf8
continue;
}
//1. delete old director(ies)
$dest1 = $CFG->dataroot.'/lang/'.$pack;
$dest2 = $CFG->dirroot.'/lang/'.$pack;
$rm1 = false;
$rm2 = false;
if (file_exists($dest1)) {
if (!remove_dir($dest1)) {
$notice_error[] = 'Could not delete old directory '.$dest1.', update of '.$pack.' failed, please check permissions.';
continue;
}
}
if (file_exists($dest2)) {
if (!remove_dir($dest2)) {
$notice_error[] = 'Could not delete old directory '.$dest2.', update of '.$pack.' failed, please check permissions.';
continue;
}
}
//2. copy & unzip into new
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 stdClass();
$a->url = 'http://download.moodle.org/lang16/'.$pack.'.zip';
$a->dest= $CFG->dataroot.'/lang';
print_error($cd->get_error(), 'error', "", $a); // not probable
} else {
print_error($cd->get_error(), 'error'); // not probable
}
break;
case COMPONENT_UPTODATE:
//Print error string or whatever you want to do
break;
case COMPONENT_INSTALLED:
$notice_ok[] = get_string('langpackupdated', 'admin', $pack);
$updated = true;
//Print/do whatever you want
break;
default:
}
} else {
}
}
if ($updated) {
$notice_ok[] = get_string('langupdatecomplete','admin');
} else {
$notice_ok[] = get_string('nolangupdateneeded','admin');
}
break;
} //close of main switch
admin_externalpage_print_header();
$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 {
$remote = 0; //flag for reading from remote or local
$availablelangs = get_local_list_of_languages();
}
if (!$remote) {
print_box_start();
print_string('remotelangnotavailable', 'admin', $CFG->dataroot.'/lang/');
print_box_end();
}
if ($notice_ok) {
$info = implode('<br />', $notice_ok);
notify($info, 'notifysuccess');
}
if ($notice_error) {
$info = implode('<br />', $notice_error);
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">';
echo '<form id="uninstallform" action="langimport.php?mode='.DELETION_OF_SELECTED_LANG.'" method="post">';
echo '<fieldset class="invisiblefieldset">';
echo '<input name="sesskey" type="hidden" value="'.sesskey().'" />';
/// display installed langs here
echo '<label for="uninstalllang">'.get_string('installedlangs','admin')."</label><br />\n";
echo '<select name="uninstalllang" id="uninstalllang" size="15">';
foreach ($installedlangs as $clang =>$ilang){
echo '<option value="'.$clang.'">'.$ilang.'</option>';
}
echo '</select>';
echo '<br /><input type="submit" value="'.get_string('uninstall','admin').'" />';
echo '</fieldset>';
echo '</form>';
if ($remote) {
echo '<form id="updateform" action="langimport.php?mode='.UPDATE_ALL_LANG.'" method="post">';
echo '<div>';
echo '<br /><input type="submit" value="'.get_string('updatelangs','admin').'" />';
echo '</div>';
echo '</form>';
}
/// Display option to change site language
/// display to be installed langs here
echo '</td><td align="center" valign="top">';
//availabe langs table
$empty = 1; //something to pring
/// if this language pack is not already installed, then we allow installation
echo '<form id="installform" method="post" action="langimport.php?mode='.INSTALLATION_OF_SELECTED_LANG.'">';
echo '<fieldset class="invisiblefieldset">';
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" multiple="multiple">';
}
foreach ($availablelangs as $alang) {
if ($alang[0] == '') {
continue;
}
if (trim($alang[0]) != "en_utf8") {
if ($remote) {
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];
}
if (!is_installed_lang($alang[0], $alang[1])){ //if not already installed
echo '<option value="'.$alang[0].'">'.$alang[2].' ('.$shortlang.')</option>';
}
} else { //print list in local format, and instruction to install
echo '<tr><td>'.$alang[2].'</td><td><a href="http://download.moodle.org/lang16/'.$alang[0].'.zip">'.get_string('download','admin').'</a></td></tr>';
}
$empty = 0;
}
}
if ($remote) {
echo '</select>';
echo '<br /><input type="submit" value="'.$THEME->larrow.' '.get_string('install','admin').'" />';
}
echo '</fieldset>';
echo '</form>';
if ($empty) {
echo '<br />';
print_string('nolanguagetodownload','admin');
}
//close available langs table
echo '</td></tr></table>';
print_box_end();
admin_externalpage_print_footer();
/**
* Returns a list of available language packs from a
* local copy shipped with standard moodle distro
* this is for site that can't download components.
* @return array
*/
function get_local_list_of_languages() {
global $CFG;
$source = $CFG->dirroot.'/lib/languages.md5';
$availablelangs = array();
if ($fp = fopen($source, 'r')) {
while(!feof ($fp)) {
$availablelangs[] = split(',', fgets($fp,1024));
}
}
return $availablelangs;
}
/**
* checks the md5 of the zip file, grabbed from download.moodle.org,
* against the md5 of the local language file from last update
* @param string $lang
* @param string $md5check
* @return bool
*/
function is_installed_lang($lang, $md5check) {
global $CFG;
$md5file = $CFG->dataroot.'/lang/'.$lang.'/'.$lang.'.md5';
if (file_exists($md5file)){
return (file_get_contents($md5file) == $md5check);
}
return false;
}
/**
* Returns the latest list of available language packs from
* moodle.org
* @return array or false if can not download
*/
function get_remote_list_of_languages() {
$source = 'http://download.moodle.org/lang16/languages.md5';
$availablelangs = array();
if ($content = download_file_content($source)) {
$alllines = split("\n", $content);
foreach($alllines as $line) {
if (!empty($line)){
$availablelangs[] = split(',', $line);
}
}
return $availablelangs;
} else {
return false;
}
}
?>
-77
View File
@@ -1,77 +0,0 @@
#!/usr/bin/php
<?php
/*
* Utility to debug mailouts - will save the content of emails to a
* logfile instead of sending them out. Use it as a sendmail
* "stand-in" when testing mailouts.
*
* It is not Moodle specific - use it anywhere by setting the php
* "sendmail_path" setting to this file with a logfile parameter.
*
* - Set in php.ini (not settable in config.php):
* sendmail_path=/path-to-moodle/admin/mailout-debugger.php');
* Or from the commandline
* php -d sendmail_path='/path-to-moodle/admin/mailout-debugger.php' /path/to/cron.php
*
* - Create a file in admin called mailout-debugger.enable
* (this is a security check to prevent execution in prod environments)
* touch /path/to/moodle/admin/mailout-debugger.enable
*
* - Mark as executable: chmod ugo+rx mailout-debugger.php
*
* - Run your admin/cron.php
*
* - Read /tmp/moodle-mailout.log
*
*
* This script will create logfiles in /tmp/ or in $TMPDIR if set.
* On windows, use php -r 'print sys_get_temp_dir()' to see where the file is saved.
*/
// Security check.
if (!file_exists(dirname(__FILE__).'/mailout-debugger.enable')) {
mdie("Disabled.");
}
$tmpdir=sys_get_temp_dir(); // default
if (isset($_SERVER['REMOTE_ADDR'])) {
mdie("should not be called from web server!");
}
if (isset($_ENV['TMPDIR']) && is_dir($_ENV['TMPDIR'])) {
$tmpdir = $_ENV['TMPDIR'];
}
$tmpfile = $tmpdir . '/moodle-mailout.log';
$fh = fopen($tmpfile, 'a+', false)
or mdie("Error openning $tmpfile on append\n");
fwrite($fh, "==== ".strftime("%a %b %e %H:%M:%S %Y", time())." ====\n");
fwrite($fh, "==== Commandline: " . implode(' ',$argv) . "\n");
$stdin = fopen('php://stdin', 'r');
while ($line = fgets($stdin)) {
fwrite($fh, $line);
}
fwrite($fh, "\n");
fclose($fh);
fclose($stdin);
/**
* Print an error to STDOUT and exit with a non-zero code. For commandline scripts.
* Default errorcode is 1.
*
* Very useful for perl-like error-handling:
*
* do_somethting() or mdie("Something went wrong");
*
* @param string $msg Error message
* @param integer $errorcode Error code to emit
*
*/
function mdie($msg='', $errorcode=1) {
trigger_error($msg);
exit($errorcode);
}
?>
+28 -27
View File
@@ -2,11 +2,15 @@
// Enables/disables maintenance mode
require('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$action = optional_param('action', '', PARAM_ALPHA);
$sesskey = optional_param('sesskey');
admin_externalpage_setup('maintenancemode');
require_login();
if (!isadmin()) {
error('You need to be admin to use this page');
}
//Check folder exists
if (! make_upload_directory(SITEID)) { // Site folder
@@ -19,60 +23,57 @@
if (confirm_sesskey()) {
if ($form->action == "disable") {
unlink($filename);
redirect('maintenance.php', get_string('sitemaintenanceoff','admin'));
redirect('index.php', get_string('sitemaintenanceoff','admin'));
} else {
$file = fopen($filename, 'w');
fwrite($file, stripslashes($form->text));
fclose($file);
redirect('maintenance.php', get_string('sitemaintenanceon', 'admin'));
redirect('index.php', get_string('sitemaintenanceon', 'admin'));
}
}
}
/// Print the header stuff
admin_externalpage_print_header();
$strmaintenance = get_string('sitemaintenancemode', 'admin');
$stradmin = get_string('administration');
$strconfiguration = get_string('configuration');
print_heading(get_string('sitemaintenancemode', 'admin'));
print_header("$SITE->shortname: $strmaintenance", $SITE->fullname,
"<a href=\"index.php\">$stradmin</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $strmaintenance");
print_box_start();
print_heading($strmaintenance);
/// Print the appropriate form
if (file_exists($filename)) { // We are in maintenance mode
echo '<div class="buttons">';
echo '<p>'.get_string('sitemaintenanceon', 'admin').'</p>';
echo '<center>';
echo '<form action="maintenance.php" method="post">';
echo '<div>';
echo '<input type="hidden" name="action" value="disable" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<p><input type="submit" value="'.get_string('disable').'" /></p>';
echo '</div>';
echo '<input type="hidden" name="action" value="disable">';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'">';
echo '<p><input type="submit" value="'.get_string('disable').'"></p>';
echo '</form>';
echo '</div>';
echo '</center>';
} else { // We are not in maintenance mode
$usehtmleditor = can_use_html_editor();
echo '<div class="buttons">';
echo '<center>';
echo '<form action="maintenance.php" method="post">';
echo '<div>';
echo '<input type="hidden" name="action" value="enable" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<p><input type="submit" value="'.get_string('enable').'" /></p>';
echo '<input type="hidden" name="action" value="enable">';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'">';
echo '<p><input type="submit" value="'.get_string('enable').'"></p>';
echo '<p>'.get_string('optionalmaintenancemessage', 'admin').':</p>';
echo '<div class="editor" style="width:600px;">'; // contains the editor
echo '<table><tr><td>';
print_textarea($usehtmleditor, 20, 50, 600, 400, "text");
echo '</div>';
echo '</div>';
echo '</td></tr></table>';
echo '</form>';
echo '</div>';
echo '</center>';
if ($usehtmleditor) {
use_html_editor();
}
}
print_box_end();
admin_externalpage_print_footer();
print_footer();
?>
-583
View File
@@ -1,583 +0,0 @@
<?php
/**
* Adapted for Moodle from the AMFPHP Project at http://www.amfphp.org/
* Creates the methodTable for a service class.
*
* @usage $this->methodTable = MethodTable::create($this);
* @author Christophe Herreman
* @since 05/01/2005
* @version $id$
*
* Special contributions by Allessandro Crugnola and Ted Milker
*/
if (!defined('T_ML_COMMENT')) {
define('T_ML_COMMENT', T_COMMENT);
} else {
define('T_DOC_COMMENT', T_ML_COMMENT);
}
/**
* Return string from start of haystack to first occurance of needle, or whole
* haystack, if needle does not occur
*
* @access public
* @param $haystack(String) Haystack to search in
* @param $needle(String) Needle to look for
*/
function strrstr($haystack, $needle)
{
return substr($haystack, 0, strpos($haystack.$needle,$needle));
}
/**
* Return substring of haystack from end of needle onwards, or FALSE
*
* @access public
* @param $haystack(String) Haystack to search in
* @param $needle(String) Needle to look for
*/
function strstrafter($haystack, $needle)
{
return substr(strstr($haystack, $needle), strlen($needle));
}
class MethodTable
{
/**
* Constructor.
*
* Since this class should only be accessed through the static create() method
* this constructor should be made private. Unfortunately, this is not possible
* in PHP4.
*
* @access private
*/
function MethodTable(){
}
/**
* Creates the methodTable for a passed class.
*
* @static
* @access public
* @param $sourcePath(String) The path to the file you want to parse
* @param $containsClass(Bool) True if the file is a class definition (optional)
*/
function create($sourcePath, $containsClass = false){
$methodTable = array();
if(!file_exists($sourcePath))
{
return false;
}
$source = file_get_contents($sourcePath);
$tokens = (array)token_get_all($source);
$waitingForOpenParenthesis = false;
$waitingForFunction = false;
$waitingForClassName = false;
$bufferingArgs = false;
$argBuffer = "";
$lastFunction = "";
$lastFunctionComment = "";
$lastComment = "";
$classMethods = array();
$realClassName = "";
if($containsClass) {
$openBraces = -10000;
}
else
{
$openBraces = 1;
}
$waitingForEndEncapsedString = false;
foreach($tokens as $token)
{
if (is_string($token)) {
if($token == '{')
{
$openBraces++;
}
if($token == '}')
{
if($waitingForEndEncapsedString)
{
$waitingForEndEncapsedString = false;
}
else
{
$lastComment = '';
$openBraces--;
if($openBraces == 0)
{
break;
}
}
}
elseif($waitingForOpenParenthesis && $token == '(')
{
$bufferingArgs = true;
$argBuffer = "";
$waitingForOpenParenthesis = false;
}
elseif($bufferingArgs)
{
if($token != ')')
{
$argBuffer .= $token;
}
else
{
if($lastFunction != $realClassName)
{
$classMethods[] = array("name" => $lastFunction,
"comment" => $lastFunctionComment,
"args" => $argBuffer);
$bufferingArgs = false;
$argBuffer = "";
$lastFunction = "";
$lastFunctionComment = "";
}
}
}
} else {
// token array
list($id, $text) = $token;
if($bufferingArgs)
{
$argBuffer .= $text;
}
switch ($id)
{
case T_COMMENT:
case T_ML_COMMENT: // we've defined this
case T_DOC_COMMENT: // and this
// no action on comments
$lastComment = $text;
break;
case T_FUNCTION:
if($openBraces >= 1)
{
$waitingForFunction = true;
}
break;
case T_STRING:
if($waitingForFunction)
{
$waitingForFunction = false;
$waitingForOpenParenthesis = true;
$lastFunction = $text;
$lastFunctionComment = $lastComment;
$lastComment = "";
}
if($waitingForClassName)
{
$waitingForClassName = false;
$realClassName = $text;
}
break;
case T_CLASS:
$openBraces = 0;
$waitingForClassName = true;
break;
case T_CURLY_OPEN:
case T_DOLLAR_OPEN_CURLY_BRACES:
$waitingForEndEncapsedString = true;
break;
}
}
}
foreach ($classMethods as $key => $value) {
$methodSignature = $value['args'];
$methodName = $value['name'];
$methodComment = $value['comment'];
$description = MethodTable::getMethodDescription($methodComment) . " " . MethodTable::getMethodCommentAttribute($methodComment, "desc");
$description = trim($description);
$access = MethodTable::getMethodCommentAttributeFirstWord($methodComment, "access");
$roles = MethodTable::getMethodCommentAttributeFirstWord($methodComment, "roles");
$instance = MethodTable::getMethodCommentAttributeFirstWord($methodComment, "instance");
$returns = MethodTable::getMethodReturnValue($methodComment);
$pagesize = MethodTable::getMethodCommentAttributeFirstWord($methodComment, "pagesize");
$params = MethodTable::getMethodCommentArguments($methodComment);
//description, arguments, access, [roles, [instance, [returns, [pagesize]]]]
$methodTable[$methodName] = array();
//$methodTable[$methodName]["signature"] = $methodSignature; //debug purposes
$methodTable[$methodName]["description"] = ($description == "") ? "No description given." : $description;
$methodTable[$methodName]["arguments"] = MethodTable::getMethodArguments($methodSignature, $params);
$methodTable[$methodName]["access"] = ($access == "") ? "private" : $access;
if($roles != "") $methodTable[$methodName]["roles"] = $roles;
if($instance != "") $methodTable[$methodName]["instance"] = $instance;
if($returns != "") $methodTable[$methodName]["returns"] = $returns;
if($pagesize != "") $methodTable[$methodName]["pagesize"] = $pagesize;
}
return $methodTable;
}
/**
*
*/
function getMethodCommentServices($comment)
{
$pieces = explode('@service', $comment);
$args = array();
if(is_array($pieces) && count($pieces) > 1)
{
for($i = 0; $i < count($pieces) - 1; $i++)
{
$ps = strrstr($pieces[$i + 1], '@');
$ps = strrstr($ps, '*/');
$args[] = MethodTable::cleanComment($ps);
}
}
return $args;
}
/**
*
*/
function getMethodCommentArguments($comment)
{
$pieces = explode('@param', $comment);
$args = array();
if(is_array($pieces) && count($pieces) > 1)
{
for($i = 0; $i < count($pieces) - 1; $i++)
{
$ps = strrstr($pieces[$i + 1], '@');
$ps = strrstr($ps, '*/');
$args[] = MethodTable::cleanComment($ps);
}
}
return $args;
}
/**
* Returns the description from the comment.
* The description is(are) the first line(s) in the comment.
*
* @static
* @private
* @param $comment(String) The method's comment.
*/
function getMethodDescription($comment){
$comment = MethodTable::cleanComment(strrstr($comment, "@"));
return trim($comment);
}
/**
* Returns the value of a comment attribute.
*
* @static
* @private
* @param $comment(String) The method's comment.
* @param $attribute(String) The name of the attribute to get its value from.
*/
function getMethodCommentAttribute($comment, $attribute){
$pieces = strstrafter($comment, '@' . $attribute);
if($pieces !== FALSE)
{
$pieces = strrstr($pieces, '@');
$pieces = strrstr($pieces, '*/');
return MethodTable::cleanComment($pieces);
}
return "";
}
/**
* Returns the value of a comment attribute.
*
* @static
* @private
* @param $comment(String) The method's comment.
* @param $attribute(String) The name of the attribute to get its value from.
*/
function getMethodCommentAttributeFirstLine($comment, $attribute){
$pieces = strstrafter($comment, '@' . $attribute);
if($pieces !== FALSE)
{
$pieces = strrstr($pieces, '@');
$pieces = strrstr($pieces, "*");
$pieces = strrstr($pieces, "/");
$pieces = strrstr($pieces, "-");
$pieces = strrstr($pieces, "\n");
$pieces = strrstr($pieces, "\r");
$pieces = strrstr($pieces, '*/');
return MethodTable::cleanComment($pieces);
}
return "";
}
/**
* Returns the value of a comment attribute.
*
* @static
* @private
* @param $comment(String) The method's comment.
* @param $attribute(String) The name of the attribute to get its value from.
*/
function getMethodReturnValue($comment){
$result = array('type' => 'void', 'description' => '');
$pieces = strstrafter($comment, '@returns');
if(FALSE == $pieces) $pieces = strstrafter($comment, '@return');
if($pieces !== FALSE)
{
$pieces = strrstr($pieces, '@');
$pieces = strrstr($pieces, "*");
$pieces = strrstr($pieces, "/");
$pieces = strrstr($pieces, "-");
$pieces = strrstr($pieces, "\n");
$pieces = strrstr($pieces, "\r");
$pieces = strrstr($pieces, '*/');
$pieces = trim(MethodTable::cleanComment($pieces));
@list($result['type'], $result['description']) = explode(' ', $pieces, 2);
$result['type'] = MethodTable::standardizeType($result['type']);
}
return $result;
}
function getMethodCommentAttributeFirstWord($comment, $attribute){
$pieces = strstrafter($comment, '@' . $attribute);
if($pieces !== FALSE)
{
$val = MethodTable::cleanComment($pieces);
return trim(strrstr($val, ' '));
}
return "";
}
/**
* Returns an array with the arguments of a method.
*
* @static
* @access private
* @param $methodSignature(String) The method's signature;
*/
function getMethodArguments($methodSignature, $commentParams){
if(strlen($methodSignature) == 0){
//no arguments, return an empty array
$result = array();
}else{
//clean the arguments before returning them
$result = MethodTable::cleanArguments(explode(",", $methodSignature), $commentParams);
}
return $result;
}
/**
* Cleans the function or method's return value.
*
* @static
* @access private
* @param $value(String) The "dirty" value.
*/
function cleanReturnValue($value){
$result = array();
$value = trim($value);
list($result['type'], $result['description']) = explode(' ', $value, 2);
$result['type'] = MethodTable::standardizeType($result['type']);
return $result;
}
/**
* Takes a string and returns the XMLRPC type that most closely matches it.
*
* @static
* @access private
* @param $type(String) The given type string.
*/
function standardizeType($type) {
$type = strtolower($type);
if('str' == $type || 'string' == $type) return 'string';
if('int' == $type || 'integer' == $type) return 'int';
if('bool' == $type || 'boolean' == $type) return 'boolean';
// Note that object is not a valid XMLRPC type
if('object' == $type || 'class' == $type) return 'object';
if('float' == $type || 'dbl' == $type || 'double' == $type || 'flt' == $type) return 'double';
// Note that null is not a valid XMLRPC type. The null type can have
// only one value - null.
if('null' == $type) return 'null';
// Note that mixed is not a valid XMLRPC type
if('mixed' == $type) return 'mixed';
if('array' == $type || 'arr' == $type) return 'array';
if('assoc' == $type || 'struct' == $type) return 'struct';
// Note that this is not a valid XMLRPC type. As references cannot be
// serialized or exported, there is no way this could be XML-RPCed.
if('reference' == $type || 'ref' == $type) return 'reference';
return 'string';
}
/**
* Cleans the arguments array.
* This method removes all whitespaces and the leading "$" sign from each argument
* in the array.
*
* @static
* @access private
* @param $args(Array) The "dirty" array with arguments.
*/
function cleanArguments($args, $commentParams){
$result = array();
if(!is_array($args)) return array();
foreach($args as $index => $arg){
$arg = strrstr(str_replace(array('$','&$'), array('','&'), $arg), '=');
if(!isset($commentParams[$index]))
{
$result[] = trim($arg);
}
else
{
$start = trim($arg);
$end = trim(str_replace('$', '', $commentParams[$index]));
// Suppress Notice of 'Undefined offset' with @
@list($word0, $word1, $tail) = preg_split("/[\s]+/", $end, 3);
$word0 = strtolower($word0);
$word1 = strtolower($word1);
$wordBase0 = ereg_replace('^[&$]+','',$word0);
$wordBase1 = ereg_replace('^[&$]+','',$word1);
$startBase = strtolower(ereg_replace('^[&$]+','',$start));
if ($wordBase0 == $startBase) {
$type = str_replace(array('(',')'),'', $word1);
} elseif($wordBase1 == $startBase) {
$type = str_replace(array('(',')'),'', $word0);
} elseif( ereg('(^[&$]+)|(\()([a-z0-9]+)(\)$)', $word0, $regs) ) {
$tail = str_ireplace($word0, '', $end);
$type = $regs[3];
} else {
// default to string
$type = 'string';
}
$type = MethodTable::standardizeType($type);
/*
if($type == 'str') {
$type = 'string';
} elseif($type == 'int' || $type == 'integer') {
$type = 'int';
} elseif($type == 'bool' || $type == 'boolean') {
$type = 'boolean';
} elseif($type == 'object' || $type == 'class') {
// Note that this is not a valid XMLRPC type
$type = 'object';
} elseif($type == 'float' || $type == 'dbl' || $type == 'double' || $type == 'flt') {
$type = 'double';
} elseif($type == 'null') {
// Note that this is not a valid XMLRPC type
// The null type can have only one value - null. Why would
// that be an argument to a function? Just in case:
$type = 'null';
} elseif($type == 'mixed') {
// Note that this is not a valid XMLRPC type
$type = 'mixed';
} elseif($type == 'array' || $type == 'arr') {
$type = 'array';
} elseif($type == 'assoc') {
$type = 'struct';
} elseif($type == 'reference' || $type == 'ref') {
// Note that this is not a valid XMLRPC type
// As references cannot be serialized or exported, there is
// no way this could be XML-RPCed.
$type = 'reference';
} else {
$type = 'string';
}
*/
$result[] = array('type' => $type, 'description' => $start . ' - ' . $tail);
}
}
return $result;
}
/**
* Cleans the comment string by removing all comment start and end characters.
*
* @static
* @private
* @param $comment(String) The method's comment.
*/
function cleanComment($comment){
$comment = str_replace("/**", "", $comment);
$comment = str_replace("*/", "", $comment);
$comment = str_replace("*", "", $comment);
$comment = str_replace("\n", "\\n", trim($comment));
$comment = eregi_replace("[\r\t\n ]+", " ", trim($comment));
$comment = str_replace("\"", "\\\"", $comment);
return $comment;
}
/**
*
*/
function showCode($methodTable){
if(!is_array($methodTable)) $methodTable = array();
foreach($methodTable as $methodName=>$methodProps){
$result .= "\n\t\"" . $methodName . "\" => array(";
foreach($methodProps as $key=>$value){
$result .= "\n\t\t\"" . $key . "\" => ";
if($key=="arguments"){
$result .= "array(";
for($i=0; $i<count($value); $i++){
$result .= "\"" . addslashes($value[$i]) . "\"";
if($i<count($value)-1){
$result .= ", ";
}
}
$result .= ")";
}else{
$result .= "\"" . $value . "\"";
}
$result .= ",";
}
$result = substr($result, 0, -1);
$result .= "\n\t),";
}
$result = substr($result, 0, -1);
$result = "\$this->methodTable = array(" . $result;
$result .= "\n);";
return $result;
}
}
?>
-237
View File
@@ -1,237 +0,0 @@
<?php // $Id$
// Allows the admin to control user logins from remote moodles.
require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
$sort = optional_param('sort', 'username', PARAM_ALPHA);
$dir = optional_param('dir', 'ASC', PARAM_ALPHA);
$page = optional_param('page', 0, PARAM_INT);
$perpage = optional_param('perpage', 30, PARAM_INT);
$action = trim(strtolower(optional_param('action', '', PARAM_ALPHA)));
require_login();
admin_externalpage_setup('ssoaccesscontrol');
admin_externalpage_print_header();
if (!extension_loaded('openssl')) {
print_error('requiresopenssl', 'mnet');
}
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$sesskey = sesskey();
$formerror = array();
// grab the mnet hosts and remove the localhost
$mnethosts = get_records_menu('mnet_host', '', '', 'name', 'id, name');
if (array_key_exists($CFG->mnet_localhost_id, $mnethosts)) {
unset($mnethosts[$CFG->mnet_localhost_id]);
}
// process actions
if (!empty($action) and confirm_sesskey()) {
// boot if insufficient permission
if (!has_capability('moodle/user:delete', $sitecontext)) {
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)) {
print_error('recordnoexists','mnet', "$CFG->wwwroot/$CFG->admin/mnet/access_control.php");
}
switch ($action) {
case "delete":
delete_records('mnet_sso_access_control', 'id', $id);
redirect('access_control.php', get_string('deleteuserrecord', 'mnet', array($idrec->username, $mnethosts[$idrec->mnet_host_id])));
break;
case "acl":
// 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') {
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)) {
if ($accessctrl == 'allow') {
redirect('access_control.php', get_string('ssl_acl_allow','mnet', array($idrec->username, $mnethosts[$idrec->mnet_host_id])));
} elseif ($accessctrl == 'deny') {
redirect('access_control.php', get_string('ssl_acl_deny','mnet', array($idrec->username, $mnethosts[$idrec->mnet_host_id])));
}
}
break;
default:
print_error('invalidactionparam', 'mnet', "$CFG->wwwroot/$CFG->admin/mnet/access_control.php");
}
}
// process the form results
if ($form = data_submitted() and confirm_sesskey()) {
// check permissions and verify form input
if (!has_capability('moodle/user:delete', $sitecontext)) {
print_error('nomodifyacl','mnet', "$CFG->wwwroot/$CFG->admin/mnet/access_control.php");
}
if (empty($form->username)) {
$formerror['username'] = get_string('enterausername','mnet');
}
if (empty($form->mnet_host_id)) {
$formerror['mnet_host_id'] = get_string('selectahost','mnet');
}
if (empty($form->accessctrl)) {
$formerror['accessctrl'] = get_string('selectaccesslevel','mnet'); ;
}
// process if there are no errors
if (count($formerror) == 0) {
// username can be a comma separated list
$usernames = explode(',', $form->username);
foreach ($usernames as $username) {
$username = trim(moodle_strtolower($username));
if (!empty($username)) {
if (mnet_update_sso_access_control($username, $form->mnet_host_id, $form->accessctrl)) {
if ($form->accessctrl == 'allow') {
redirect('access_control.php', get_string('ssl_acl_allow','mnet', array($username, $mnethosts[$form->mnet_host_id])));
} elseif ($form->accessctrl == 'deny') {
redirect('access_control.php', get_string('ssl_acl_deny','mnet', array($username, $mnethosts[$form->mnet_host_id])));
}
}
}
}
}
exit;
}
// Explain
print_box(get_string('ssoacldescr','mnet'));
// Are the needed bits enabled?
$warn = '';
if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict') {
$warn = '<p>' . get_string('mnetdisabled','mnet') .'</p>';
}
if (!is_enabled_auth('mnet')) {
$warn .= '<p>' . get_string('authmnetdisabled','mnet').'</p>';
}
if (get_config('auth/mnet', 'auto_add_remote_users') != true) {
$warn .= '<p>' . get_string('authmnetautoadddisabled','mnet').'</p>';
}
if (!empty($warn)) {
$warn = '<p>' . get_string('ssoaclneeds','mnet').'</p>' . $warn;
print_box($warn);
}
// output the ACL table
$columns = array("username", "mnet_host_id", "access", "delete");
$headings = array();
$string = array('username' => get_string('username'),
'mnet_host_id' => get_string('remotehost', 'mnet'),
'access' => get_string('accesslevel', 'mnet'),
'delete' => get_string('delete'));
foreach ($columns as $column) {
if ($sort != $column) {
$columnicon = "";
$columndir = "ASC";
} else {
$columndir = $dir == "ASC" ? "DESC" : "ASC";
$columnicon = $dir == "ASC" ? "down" : "up";
$columnicon = " <img src=\"$CFG->pixpath/t/$columnicon.gif\" alt=\"\" />";
}
$headings[$column] = "<a href=\"?sort=$column&amp;dir=$columndir&amp;\">".$string[$column]."</a>$columnicon";
}
$headings['delete'] = '';
$acl = get_records('mnet_sso_access_control', '', '', "$sort $dir", '*'); //, $page * $perpage, $perpage);
$aclcount = count_records('mnet_sso_access_control');
if (!$acl) {
print_heading(get_string('noaclentries','mnet'));
$table = NULL;
} else {
$table->head = $headings;
$table->align = array('left', 'left', 'center');
$table->width = "95%";
foreach ($acl as $aclrecord) {
if ($aclrecord->accessctrl == 'allow') {
$accesscolumn = get_string('allow', 'mnet')
. " (<a href=\"?id={$aclrecord->id}&amp;action=acl&amp;accessctrl=deny&amp;sesskey={$USER->sesskey}\">"
. get_string('deny', 'mnet') . "</a>)";
} else {
$accesscolumn = get_string('deny', 'mnet')
. " (<a href=\"?id={$aclrecord->id}&amp;action=acl&amp;accessctrl=allow&amp;sesskey={$USER->sesskey}\">"
. get_string('allow', 'mnet') . "</a>)";
}
$deletecolumn = "<a href=\"?id={$aclrecord->id}&amp;action=delete&amp;sesskey={$USER->sesskey}\">"
. get_string('delete') . "</a>";
$table->data[] = array ($aclrecord->username, $aclrecord->mnet_host_id, $accesscolumn, $deletecolumn);
}
}
if (!empty($table)) {
print_table($table);
echo '<p>&nbsp;</p>';
print_paging_bar($aclcount, $page, $perpage, "?sort=$sort&amp;dir=$dir&amp;perpage=$perpage&amp;");
}
// output the add form
print_simple_box_start('center','90%','','20');
?>
<div class="mnetaddtoaclform">
<form id="mnetaddtoacl" method="post">
<input type="hidden" name="sesskey" value="<?php echo $sesskey; ?>" />
<?php
// enter a username
echo get_string('username') . ":\n";
if (!empty($formerror['username'])) {
echo '<span class="error"> * </span>';
}
echo '<input type="text" name="username" size="20" maxlength="100" />';
// choose a remote host
echo " " . get_string('remotehost', 'mnet') . ":\n";
if (!empty($formerror['mnet_host_id'])) {
echo '<span class="error"> * </span>';
}
choose_from_menu($mnethosts, 'mnet_host_id');
// choose an access level
echo " " . get_string('accesslevel', 'mnet') . ":\n";
if (!empty($formerror['accessctrl'])) {
echo '<span class="error"> * </span>';
}
$accessmenu['allow'] = get_string('allow', 'mnet');
$accessmenu['deny'] = get_string('deny', 'mnet');
choose_from_menu($accessmenu, 'accessctrl');
// submit button
echo '<input type="submit" value="' . get_string('addtoacl', 'mnet') . '" />';
echo "</form></div>\n";
// print errors
foreach ($formerror as $error) {
echo "<br><span class=\"error\">$error<span>";
}
print_simple_box_end();
admin_externalpage_print_footer();
?>
-182
View File
@@ -1,182 +0,0 @@
<?php
/**
* Library functions for mnet
*
* @author Donal McMullan donal@catalyst.net.nz
* @version 0.0.1
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package mnet
*/
/**
* Parse a file to find out what functions/methods exist in it, and add entries
* for the remote-call-enabled functions to the database.
*
* The path to a file, e.g. auth/mnet/auth.php can be thought of as
* type/parentname/docname
*
* @param string $type mod, auth or enrol
* @param string $parentname Implementation of type, e.g. 'mnet' in the
* case of auth/mnet/auth.php
* @return bool True on success, else false
*/
function mnet_get_functions($type, $parentname) {
global $CFG;
$dataobject = new stdClass();
$docname = $type.'.php';
$publishes = array();
if ('mod' == $type) {
$docname = 'rpclib.php';
$relname = '/mod/'.$parentname.'/'.$docname;
$filename = $CFG->dirroot.$relname;
if (file_exists($filename)) include_once $filename;
$mnet_publishes = $parentname.'_mnet_publishes';
if (function_exists($mnet_publishes)) {
(array)$publishes = $mnet_publishes();
}
} else {
// auth or enrol
$relname = '/'.$type.'/'.$parentname.'/'.$docname;
$filename = $CFG->dirroot.$relname;
if (file_exists($filename)) include_once $filename;
$class = $type.($type=='enrol'? 'ment':'').'_plugin_'.$parentname;
if (class_exists($class)) {
$object = new $class();
if (method_exists($object, 'mnet_publishes')) {
(array)$publishes = $object->mnet_publishes();
}
}
}
$methodServiceArray = array();
foreach($publishes as $service) {
if (is_array($service['methods'])) {
foreach($service['methods'] as $methodname) {
$methodServiceArray[$methodname][] = $service;
}
}
}
// Disable functions that don't exist (any more) in the source
// Should these be deleted? What about their permissions records?
$rpcrecords = get_records_select('mnet_rpc', ' parent=\''.$parentname.'\' AND parent_type=\''.$type.'\' ', 'function_name ASC ');
if (!empty($rpcrecords)) {
foreach($rpcrecords as $rpc) {
if (!array_key_exists($rpc->function_name, $methodServiceArray)) {
$rpc->enabled = 0;
update_record('mnet_rpc', addslashes_recursive($rpc));
}
}
}
if (!file_exists($filename)) return false;
if (extension_loaded('tokenizer')) {
include_once "$CFG->dirroot/$CFG->admin/mnet/MethodTable.php";
$functions = (array)MethodTable::create($filename,false);
}
foreach($methodServiceArray as $method => $servicearray) {
if (!empty($functions[$method])) {
$details = $functions[$method];
$profile = $details['arguments'];
if (!isset($details['returns'])) {
array_unshift($profile, array('type' => 'void', 'description' => 'No return value'));
} else {
array_unshift($profile, $details['returns']);
}
$dataobject->profile = addslashes(serialize($profile));
$dataobject->help = addslashes($details['description']);
} else {
$dataobject->profile = serialize(array(array('type' => 'void', 'description' => 'No return value')));
$dataobject->help = '';
}
$dataobject->function_name = $method;
$dataobject->xmlrpc_path = $type.'/'.$parentname.'/'.$docname.'/'.$method;
$dataobject->parent_type = $type;
$dataobject->parent = $parentname;
$dataobject->enabled = '0';
if ($record_exists = get_record('mnet_rpc', 'xmlrpc_path', $dataobject->xmlrpc_path)) {
$dataobject->id = $record_exists->id;
$dataobject->enabled = $record_exists->enabled;
update_record('mnet_rpc', $dataobject);
} else {
$dataobject->id = insert_record('mnet_rpc', $dataobject, true);
}
foreach($servicearray as $service) {
$serviceobj = get_record('mnet_service', 'name', $service['name']);
if (false == $serviceobj) {
$serviceobj = new stdClass();
$serviceobj->name = $service['name'];
$serviceobj->apiversion = $service['apiversion'];
$serviceobj->offer = 1;
$serviceobj->id = insert_record('mnet_service', $serviceobj, true);
}
if (false == get_record('mnet_service2rpc', 'rpcid', $dataobject->id, 'serviceid', $serviceobj->id)) {
$obj = new stdClass();
$obj->rpcid = $dataobject->id;
$obj->serviceid = $serviceobj->id;
insert_record('mnet_service2rpc', $obj, true);
}
}
}
return true;
}
function upgrade_RPC_functions($returnurl) {
global $CFG;
$basedir = $CFG->dirroot.'/mod';
if (file_exists($basedir) && filetype($basedir) == 'dir') {
$dirhandle = opendir($basedir);
while (false !== ($dir = readdir($dirhandle))) {
$firstchar = substr($dir, 0, 1);
if ($firstchar == '.' or $dir == 'CVS' or $dir == '_vti_cnf') {
continue;
}
if (filetype($basedir .'/'. $dir) != 'dir') {
continue;
}
mnet_get_functions('mod', $dir);
}
}
$basedir = $CFG->dirroot.'/auth';
if (file_exists($basedir) && filetype($basedir) == 'dir') {
$dirhandle = opendir($basedir);
while (false !== ($dir = readdir($dirhandle))) {
$firstchar = substr($dir, 0, 1);
if ($firstchar == '.' or $dir == 'CVS' or $dir == '_vti_cnf') {
continue;
}
if (filetype($basedir .'/'. $dir) != 'dir') {
continue;
}
mnet_get_functions('auth', $dir);
}
}
$basedir = $CFG->dirroot.'/enrol';
if (file_exists($basedir) && filetype($basedir) == 'dir') {
$dirhandle = opendir($basedir);
while (false !== ($dir = readdir($dirhandle))) {
$firstchar = substr($dir, 0, 1);
if ($firstchar == '.' or $dir == 'CVS' or $dir == '_vti_cnf') {
continue;
}
if (filetype($basedir .'/'. $dir) != 'dir') {
continue;
}
mnet_get_functions('enrol', $dir);
}
}
}
?>
-55
View File
@@ -1,55 +0,0 @@
<?php
$navlinks = array();
$navlinks[] = array('name' => $stradministration, 'link' => "$CFG->wwwroot/$CFG->admin/index.php", 'type' => 'misc');
$navlinks[] = array('name' => get_string('mnetsettings', 'mnet'), 'link' => "$CFG->wwwroot/$CFG->admin/mnet/index.php", 'type' => 'misc');
$navlinks[] = array('name' => get_string('deletehost', 'mnet'), 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$site->shortname: $strmnetsettings", "$site->fullname", $navigation);
print_heading(get_string('mnetsettings', 'mnet'));
?>
<div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->
<table class="generalbox standard" border="0" cellpadding="5" cellspacing="0">
<tr>
<td class="generalboxcontent">
<table cellpadding="9" cellspacing="0" >
<tr valign="top">
<td colspan="2" class="header" cellpadding="0"><span><?php print_string('deleteaserver', 'mnet'); ?>Deleting a Server</span></td>
</tr>
<?php
if (count($warn) > 0){
?>
<tr valign="top">
<td align="right" colspan="2"><?php print_string('receivedwarnings','mnet'); ?>:<br />
<?php foreach($warn as $warning) echo $warning .'<br />'; ?>
</td>
</tr>
<?php
}
?>
<tr valign="top">
<td colspan="2"><?php print_string('reallydeleteserver','mnet'); ?>: "<?php echo $mnet_peer->name; ?>"?</td>
</tr>
<tr valign="top">
<td width="80">
<form method="post" action="delete.php">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<input type="hidden" name="hostid" value="<?php echo $mnet_peer->id; ?>" />
<input type="hidden" name="step" value="delete" />
<input type="submit" name="submit" value="<?php print_string('delete'); ?>"/>
</form>
</td>
<td>
<form method="get" action="index.php">
<input type="submit" name="ignore" value="<?php print_string('cancel'); ?>"/>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<?php
print_footer();
?>
-50
View File
@@ -1,50 +0,0 @@
<?PHP // $Id$
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
include_once($CFG->dirroot.'/mnet/lib.php');
$stradministration = get_string('administration');
$strconfiguration = get_string('configuration');
$strmnetsettings = get_string('mnetsettings', 'mnet');
$strmnetservices = get_string('mnetservices', 'mnet');
$strmnetlog = get_string('mnetlog', 'mnet');
$strmnetedithost = get_string('reviewhostdetails', 'mnet');
require_login();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
if (!$site = get_site()) {
print_error('nosite', '', '', NULL, true);
}
/// Initialize variables.
// Step must be one of:
// input Parse the details of a new host and fetch its public key
// commit Save our changes (to a new OR existing host)
$step = optional_param('step', 'verify', PARAM_ALPHA);
$hostid = required_param('hostid', PARAM_INT);
$warn = array();
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
redirect('index.php', get_string('postrequired','mnet') ,7);
}
require_sesskey();
if ('verify' == $step) {
$mnet_peer = new mnet_peer();
$mnet_peer->set_id($hostid);
$live_users = $mnet_peer->count_live_sessions();
if ($live_users > 0) {
$warn[] = get_string('usersareonline', 'mnet', $live_users);
}
include('delete.html');
} elseif ('delete' == $step) {
$mnet_peer = new mnet_peer();
$mnet_peer->set_id($hostid);
$mnet_peer->delete();
redirect('peers.php', get_string('hostdeleted', 'mnet'), 5);
}
?>
-104
View File
@@ -1,104 +0,0 @@
<form id="assignform" method="post" action="">
<div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->
<input type="hidden" name="previoussearch" value="<?php p($previoussearch) ?>" />
<input type="hidden" name="courseid" value="<?php p($courseid) ?>" />
<input type="hidden" name="host" value="<?php p($mnet_peer->id) ?>" />
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
<table class="generaltable" border="0" cellpadding="5" cellspacing="0">
<tr>
<td valign="top">
<?php print_string('existingusers', 'role', count($mnetenrolledusers)); ?>
</td>
<td></td>
<td valign="top">
<?php print_string('potentialusers', 'role', $availableusers->_numOfRows); ?>
</td>
</tr>
<tr>
<td valign="top">
<select name="removeselect[]" size="20" id="removeselect" multiple="multiple"
onfocus="getElementById('assignform').add.disabled=true;
getElementById('assignform').remove.disabled=false;
getElementById('assignform').addselect.selectedIndex=-1;">
<?php
foreach ($mnetenrolledusers as $enrolleduser) {
$fullname = fullname($enrolleduser, true);
echo "<option value=\"$enrolleduser->id\">".s($fullname)." (".s($enrolleduser->rolename).")</option>\n";
}
?>
</select></td>
<td valign="top">
<br />
<input name="add" type="submit" id="add" value="&larr;" />
<br />
<input name="remove" type="submit" id="remove" value="&rarr;" />
<br />
</td>
<td valign="top">
<select name="addselect[]" size="20" id="addselect" multiple="multiple"
onfocus="getElementById('assignform').add.disabled=false;
getElementById('assignform').remove.disabled=true;
getElementById('assignform').removeselect.selectedIndex=-1;">
<?php
if (!empty($searchtext)) {
echo "<optgroup label=\"$strsearchresults (" . $availableusers->_numOfRows . ")\">\n";
while ($user = rs_fetch_next_record($availableusers)) {
if (!isset($enrolledusers[$user->id])) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
}
}
echo "</optgroup>\n";
} else {
if ($availableusers->_numOfRows > MAX_USERS_PER_PAGE) {
echo '<optgroup label="'.get_string('toomanytoshow').'"><option></option></optgroup>'."\n"
.'<optgroup label="'.get_string('trysearching').'"><option></option></optgroup>'."\n";
} else {
while ($user = rs_fetch_next_record($availableusers)) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
}
}
}
?>
</select>
<br />
<input type="text" name="searchtext" size="30" value="<?php p($searchtext, true) ?>"
onfocus ="getElementById('assignform').add.disabled=true;
getElementById('assignform').remove.disabled=true;
getElementById('assignform').removeselect.selectedIndex=-1;
getElementById('assignform').addselect.selectedIndex=-1;"
onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
if (keyCode == 13) {
getElementById('assignform').previoussearch.value=1;
getElementById('assignform').submit();
} " />
<input name="search" id="search" type="submit" value="<?php p($strsearch) ?>" />
<?php
if (!empty($searchusers)) {
echo '<input name="showall" id="showall" type="submit" value="'.$strshowall.'" />'."\n";
}
?>
</td>
</tr>
<tr>
<td valign="top"><?php print_string('otherenrolledusers', 'mnet'); ?>:<br />
<ul>
<?php
foreach ($remtenrolledusers as $enrolleduser) {
$fullname = fullname($enrolleduser, true);
print '<li>'
. s($fullname) . ' (' . s($enrolleduser->rolename) . ') '
. s($enrolleduser->enroltype)."</li>\n";
}
?></ul></td>
<td valign="top"></td>
<td valign="top"></td>
</tr>
</table>
</div>
</form>
-291
View File
@@ -1,291 +0,0 @@
<?PHP // $Id$
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
require_once(dirname(__FILE__) . "/../../config.php");
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/xmlrpc/client.php');
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', 'error');
}
admin_externalpage_setup('mnetenrol');
$CFG->pagepath = 'admin/mnet';
require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
$enrolment = enrolment_factory::factory('mnet');
$mnethostid = required_param('host', PARAM_INT);
$courseid = required_param('courseid', PARAM_INT);
$mnet_peer = new mnet_peer();
if (!$mnet_peer->set_id($mnethostid)) {
print_error('hostcoursenotfound','mnet');
}
$course = get_record('mnet_enrol_course', 'id', $courseid, 'hostid', $mnet_peer->id);
if (empty($course)) {
print_error('hostcoursenotfound','mnet');
}
define("MAX_USERS_PER_PAGE", 5000);
$add = optional_param('add', 0, PARAM_BOOL);
$remove = optional_param('remove', 0, PARAM_BOOL);
$showall = optional_param('showall', 0, PARAM_BOOL);
$searchtext = optional_param('searchtext', '', PARAM_RAW); // search string
$previoussearch = optional_param('previoussearch', 0, PARAM_BOOL);
$userid = optional_param('userid', 0, PARAM_INT); // needed for user tabs
$errors = array();
$previoussearch = ($searchtext != '') or ($previoussearch) ? 1:0;
$baseurl = "remote_enrolment.php?courseid={$course->id}&amp;host={$mnet_peer->id}";
if (!empty($userid)) {
$baseurl .= '&amp;userid='.$userid;
}
/// Process incoming role assignment
if ($frm = data_submitted()) {
if ($add and !empty($frm->addselect) and confirm_sesskey()) {
$timemodified = time();
foreach ($frm->addselect as $adduser) {
if (!$adduser = clean_param($adduser, PARAM_INT)) {
continue;
}
if (! $enrolment->req_enrol_user($adduser, $course->id)) {
$errors[] = "Could not add user with id $adduser to course {$course->id}!";
}
}
} else if ($remove and !empty($frm->removeselect) and confirm_sesskey()) {
foreach ($frm->removeselect as $removeuser) {
$removeuser = clean_param($removeuser, PARAM_INT);
if (! $enrolment->req_unenrol_user($removeuser, $course->id)) {
$errors[] = "Could not remove user with id $removeuser from course {$course->id}!";
}
}
} else if ($showall) {
$searchtext = '';
$previoussearch = 0;
}
}
/// Prepare data for users / enrolled users panes
/// Create a new request object
$mnet_request = new mnet_xmlrpc_client();
/// Pass it the path to the method that we want to execute
$mnet_request->set_method('enrol/mnet/enrol.php/course_enrolments');
$mnet_request->add_param($course->remoteid, 'int');
$mnet_request->send($mnet_peer);
$raw_all_enrolled_users = $mnet_request->response;
unset($mnet_request);
$all_enrolled_users = array();
if (!empty($raw_all_enrolled_users)) {
// Try to repair keying of remote users array, numeric usernames get lost in the fracas
foreach ($raw_all_enrolled_users as $username => $userdetails) {
if (empty($userdetails['username']) || !is_numeric($username)) {
//Not able to repair, or no need to repair
$all_enrolled_users[$username] = $userdetails;
} else {
$all_enrolled_users[$userdetails['username']] = $userdetails;
}
}
}
$select = '';
$all_enrolled_usernames = '';
$timemodified = array();
/// List all the users (homed on this server) who are enrolled on the course
/// This will include mnet-enrolled users, and those who have enrolled
/// themselves, etc.
if (is_array($all_enrolled_users) && count($all_enrolled_users)) {
foreach($all_enrolled_users as $username => $data) {
$all_enrolled_usernames .= "'$username', ";
}
$select = ' u.username IN (' .substr($all_enrolled_usernames, 0, -2) .') AND ';
} else {
$all_enrolled_users = array();
}
/// Synch our mnet_enrol_assignments with remote server
$sql = "
SELECT
u.id,
u.firstname,
u.lastname,
u.username,
u.email,
a.enroltype,
a.id as enrolid,
COALESCE(a.hostid, 0) as wehaverecord,
a.courseid
FROM
{$CFG->prefix}user u
LEFT JOIN
{$CFG->prefix}mnet_enrol_assignments a
ON
a.userid = u.id AND a.courseid={$courseid}
WHERE
$select
u.deleted = 0 AND
u.confirmed = 1 AND
u.mnethostid = {$CFG->mnet_localhost_id}
ORDER BY
u.firstname ASC,
u.lastname ASC";
if (!$enrolledusers = get_records_sql($sql)) {
$enrolledusers = array();
}
foreach($enrolledusers as $user) {
$dataobj = new stdClass();
$dataobj->userid = $user->id;
$dataobj->hostid = $mnet_peer->id;
$dataobj->courseid = $courseid;
$dataobj->rolename = $all_enrolled_users[$user->username]['name'];
$dataobj->enroltype = $all_enrolled_users[$user->username]['enrol'];
if ($user->wehaverecord == 0) {
$dataobj->enroltime = $all_enrolled_users[$user->username]['timemodified'];
$dataobj->id = insert_record('mnet_enrol_assignments', $dataobj);
} elseif (array_key_exists($user->username, $all_enrolled_users)) {
$dataobj->id = $user->enrolid;
update_record('mnet_enrol_assignments', $dataobj);
} elseif (is_array($all_enrolled_users) && count($all_enrolled_users)) {
delete_record('mnet_enrol_assignments', 'id', $user->enrolid);
}
}
unset($enrolledusers);
// Read about our remote enrolments in 2 sets
// first, get the remote enrolments done via enrol/mnet $mnetenrolledusers
// second, get the remote enrolments done with other plugins $remtenrolledusers
// NOTE: both arrays are keyed on the userid!
$sql = "
SELECT
u.id,
u.firstname,
u.lastname,
a.rolename,
a.enroltype,
a.courseid
FROM
{$CFG->prefix}user u,
{$CFG->prefix}mnet_enrol_assignments a
WHERE
a.userid = u.id AND
a.courseid={$courseid} AND
a.enroltype = 'mnet' AND
u.deleted = 0 AND
u.confirmed = 1 AND
u.mnethostid = {$CFG->mnet_localhost_id}
ORDER BY
u.firstname ASC,
u.lastname ASC";
if (!$mnetenrolledusers = get_records_sql($sql)) {
$mnetenrolledusers = array();
}
$sql = "
SELECT
u.id,
u.firstname,
u.lastname,
a.rolename,
a.enroltype,
a.courseid
FROM
{$CFG->prefix}user u,
{$CFG->prefix}mnet_enrol_assignments a
WHERE
a.userid = u.id AND
a.courseid={$courseid} AND
a.enroltype != 'mnet' AND
u.deleted = 0 AND
u.confirmed = 1 AND
u.mnethostid = {$CFG->mnet_localhost_id}
ORDER BY
u.firstname ASC,
u.lastname ASC";
if (!$remtenrolledusers = get_records_sql($sql)) {
$remtenrolledusers = array();
}
$select = '';
$exclude = array_merge(array_keys($mnetenrolledusers), array_keys($remtenrolledusers));
$exclude[] = 0;
$select = 'AND u.username!=\'guest\' AND u.id NOT IN ('. join(',',$exclude) .') ';
unset($exclude);
$searchtext = trim($searchtext);
if ($searchtext !== '') { // Search for a subset of remaining users
$LIKE = sql_ilike();
$FULLNAME = sql_fullname();
$select .= " AND ($FULLNAME $LIKE '%$searchtext%' OR email $LIKE '%$searchtext%') ";
}
$sql = ('SELECT id, firstname, lastname, email
FROM '.$CFG->prefix.'user u
WHERE deleted = 0 AND confirmed = 1
AND mnethostid = '.$CFG->mnet_localhost_id.' '
.$select
.'ORDER BY lastname ASC, firstname ASC');
$availableusers = get_recordset_sql($sql, 0, MAX_USERS_PER_PAGE);
/// Print the page
/// get language strings
$str = get_strings(array('enrolmentplugins', 'configuration', 'users', 'administration'));
/// Get some language strings
$strpotentialusers = get_string('potentialusers', 'role');
$strexistingusers = get_string('existingusers', 'role');
$straction = get_string('assignroles', 'role');
$strroletoassign = get_string('roletoassign', 'role');
$strcurrentcontext = get_string('currentcontext', 'role');
$strsearch = get_string('search');
$strshowall = get_string('showall');
$strparticipants = get_string('participants');
$strsearchresults = get_string('searchresults');
admin_externalpage_print_header();
print_box('<strong>' . s($mnet_peer->name) . ' : '
. format_string($course->shortname) .' '. format_string($course->fullname)
. '</strong><br />'
. get_string("enrolcourseenrol_desc", "mnet"));
echo "<hr />";
include(dirname(__FILE__).'/enr_course_enrol.html');
if (!empty($errors)) {
$msg = '<p>';
foreach ($errors as $e) {
$msg .= $e.'<br />';
}
$msg .= '</p>';
notify($msg);
}
admin_externalpage_print_footer();
?>
-57
View File
@@ -1,57 +0,0 @@
<?PHP // $Id$
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
require_once(dirname(__FILE__) . "/../../config.php");
require_once($CFG->libdir.'/adminlib.php');
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', 'error');
}
admin_externalpage_setup('mnetenrol');
$CFG->pagepath = 'admin/mnet';
require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
$enrolment = enrolment_factory::factory('mnet');
$mnethost = required_param('host', PARAM_INT);
$host = get_record('mnet_host', 'id', $mnethost);
$courses = $enrolment->fetch_remote_courses($mnethost);
/// Print the page
admin_externalpage_print_header();
print_box('<strong>' . s($host->name) . ' </strong><br />'
. get_string("enrolcourses_desc", "mnet"));
echo '<hr />';
echo '<div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->'
. '<table class="generaltable">';
$icon = "<img src=\"$CFG->pixpath/i/course.gif\"".
" class=\"icon\" alt=\"".get_string("course")."\" />";
foreach ($courses as $course) {
$link = "$CFG->wwwroot/$CFG->admin/mnet/enr_course_enrol.php?"
. "host={$mnethost}&amp;courseid={$course->id}&amp;sesskey={$USER->sesskey}";
echo '<tr>'
. "<td>$icon</td>"
. "<td><a href=\"$link\">".format_string($course->fullname). "</a></td>"
. '</tr><tr>'
. '<td></td>'
. '<td>'.format_string($course->shortname). ' - ' .format_string($course->cat_name).'</td>'
. '</tr><tr>'
. '<td></td>'
. "<td align=\"left\" >{$course->summary}</td>"
. '</tr>';
}
echo '</table></div>';
admin_externalpage_print_footer();
?>
-61
View File
@@ -1,61 +0,0 @@
<?PHP // $Id$
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
require_once(dirname(__FILE__) . "/../../config.php");
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('mnetenrol');
$CFG->pagepath = 'admin/mnet';
require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
$enrolment = enrolment_factory::factory('mnet');
/// Otherwise fill and print the form.
/// get language strings
admin_externalpage_print_header();
print_box(get_string("remoteenrolhosts_desc", "mnet"));
echo '<hr />';
if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict') {
print_box(get_string('mnetdisabled','mnet'));
}
echo '<div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->'
. '<table cellspacing="0" cellpadding="5" id="hosts" class="generaltable generalbox" >'
. '<tr>'
. '<th class="header c0"> '.get_string('host', 'mnet').' </th>'
. '<th class="header c1"> '.get_string('enrolments', 'mnet').' </th>'
. '<th class="header c2"> '.get_string('courses', 'mnet').' </th>'
// . '<th class="header c3"> &nbsp; </th>'
. '</tr>';
$hosts = $enrolment->list_remote_servers();
foreach ($hosts as $host) {
$coursesurl = "$CFG->wwwroot/$CFG->admin/mnet/enr_courses.php?host={$host->id}&amp;sesskey={$USER->sesskey}";
$coursecount = get_field_sql("SELECT count(id) FROM {$CFG->prefix}mnet_enrol_course WHERE hostid={$host->id}");
if (empty($coursecount)) {
$coursecount = '?';
}
$enrolcount = get_field_sql("SELECT count(id) FROM {$CFG->prefix}mnet_enrol_assignments WHERE hostid={$host->id}");
echo '<tr>'
. "<td><a href=\"{$coursesurl}\">{$host->name}</a></td>"
. "<td align=\"center\" >$enrolcount</td>"
. "<td align=\"center\" >$coursecount - <a href=\"{$coursesurl}\">".get_string('editenrolments', 'mnet')."</a></td>"
// TODO: teach report/log/index.php to show per-host-logs
// . '<td align="center" ><a href="$CFG->wwwroot/$CFG->admin/report/log/index.php?course_host={$host->id}">'
// . get_string('logs', 'mnet').'</a> </td>'
. '</tr>';
}
echo '</table>'
. '</div>';
admin_externalpage_print_footer();
?>
-151
View File
@@ -1,151 +0,0 @@
<?PHP // $Id$
// Allows the admin to configure mnet stuff
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
require_login();
admin_externalpage_setup('net');
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
if (!extension_loaded('openssl')) {
admin_externalpage_print_header();
set_config('mnet_dispatcher_mode', 'off');
print_error('requiresopenssl', 'mnet', '', NULL, true);
}
if (!$site = get_site()) {
admin_externalpage_print_header();
set_config('mnet_dispatcher_mode', 'off');
print_error('nosite', '', '', NULL, true);
}
if (!function_exists('curl_init') ) {
admin_externalpage_print_header();
set_config('mnet_dispatcher_mode', 'off');
print_error('nocurl', 'mnet', '', NULL, true);
}
if (!isset($CFG->mnet_dispatcher_mode)) {
set_config('mnet_dispatcher_mode', 'off');
}
/// If data submitted, process and store
if (($form = data_submitted()) && confirm_sesskey()) {
if (!empty($form->submit) && $form->submit == get_string('savechanges')) {
if (in_array($form->mode, array("off", "strict", "dangerous"))) {
if (set_config('mnet_dispatcher_mode', $form->mode)) {
redirect('index.php', get_string('changessaved'));
} else {
error('Invalid action parameter.', 'index.php');
}
}
} elseif (!empty($form->submit) && $form->submit == get_string('delete')) {
$MNET->get_private_key();
$_SESSION['mnet_confirm_delete_key'] = md5(sha1($MNET->keypair['keypair_PEM'])).':'.time();
notice_yesno(get_string("deletekeycheck", "mnet"),
"index.php?sesskey=$USER->sesskey&amp;confirm=".md5($MNET->public_key),
"index.php",
array('sesskey' => $USER->sesskey),
NULL,
'post',
'get');
exit;
} else {
// We're deleting
if (!isset($_SESSION['mnet_confirm_delete_key'])) {
// fail - you're being attacked?
}
$key = '';
$time = '';
@list($key, $time) = explode(':',$_SESSION['mnet_confirm_delete_key']);
$MNET->get_private_key();
if($time < time() - 60) {
// fail - you're out of time.
print_error ('deleteoutoftime', 'mnet', 'index.php');
exit;
}
if ($key != md5(sha1($MNET->keypair['keypair_PEM']))) {
// fail - you're being attacked?
print_error ('deletewrongkeyvalue', 'mnet', 'index.php');
exit;
}
$MNET->replace_keys();
redirect('index.php', get_string('keydeleted','mnet'));
exit;
}
}
$hosts = get_records_select('mnet_host', " id != '{$CFG->mnet_localhost_id}' AND deleted = '0' ",'wwwroot ASC' );
admin_externalpage_print_header();
?>
<center>
<form method="post" action="index.php">
<table align="center" width="635" class="generalbox" border="0" cellpadding="5" cellspacing="0">
<tr>
<td class="generalboxcontent">
<table cellpadding="9" cellspacing="0" >
<tr valign="top">
<td colspan="2" class="header" cellpadding="0"><?php print_string('aboutyourhost', 'mnet'); ?></td>
</tr>
<tr valign="top">
<td align="right"><?php print_string('publickey', 'mnet'); ?>:</td>
<td><pre><?php echo $MNET->public_key; ?></pre></td>
</tr>
<tr valign="top">
<td align="right"><?php print_string('expires', 'mnet'); ?>:</td>
<td><?php echo userdate($MNET->public_key_expires); ?></td>
</tr>
<tr valign="top">
<td align="right"><?php print_string('net', 'mnet'); ?>:</td>
<td><input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<input type="radio" name="mode" value="off" <?php echo ("off" == $CFG->mnet_dispatcher_mode)? 'checked="checked"' : '' ?> /> <?php print_string('off', 'mnet'); ?> <br />
<input type="radio" name="mode" value="strict" <?php echo ("strict" == $CFG->mnet_dispatcher_mode)? 'checked="checked"' : '' ?> /> <?php print_string('on', 'mnet'); ?><br />
<input type="submit" name="submit" value="<?php print_string('savechanges'); ?>" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<form method="post" action="index.php">
<table align="center" width="635" class="generalbox" border="0" cellpadding="5" cellspacing="0">
<tr>
<td class="generalboxcontent">
<table cellpadding="9" cellspacing="0" >
<tr valign="top">
<td colspan="2" class="header" cellpadding="0"><?php print_string('expireyourkey', 'mnet'); ?></td>
</tr>
<tr valign="top">
<td colspan="2" cellpadding="0"><?php print_string('expireyourkeyexplain', 'mnet'); ?></td>
</tr>
<tr valign="top">
<td align="left" width="10" nowrap="nowrap"><?php print_string('expireyourkey', 'mnet'); ?></td>
<td align="left"><input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<input type="hidden" name="deleteKey" value="" />
<input type="submit" name="submit" value="<?php print_string('delete'); ?>" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</center>
<?php
admin_externalpage_print_footer();
?>
-126
View File
@@ -1,126 +0,0 @@
<?php
admin_externalpage_print_header();
$currenttab = 'mnetdetails';
require_once($CFG->dirroot .'/admin/mnet/tabs.php');
print_simple_box_start("center", "");
?>
<form method="post" action="peers.php">
<div>
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<input type="hidden" name="step" value="commit" />
<input type="hidden" name="last_connect_time" value="<?php echo $mnet_peer->last_connect_time; ?>" />
<input type="hidden" name="id" value="<?php echo isset($mnet_peer->id)? $mnet_peer->id : '0' ; ?>" />
<input type="hidden" name="applicationid" value="<?php echo isset($mnet_peer->applicationid)? $mnet_peer->applicationid : '0' ; ?>" />
<input type="hidden" name="applicationname" value="<?php echo isset($mnet_peer->application->name)? $mnet_peer->application->name : '' ; ?>" />
<table cellpadding="9" cellspacing="0" width="635">
<tr>
<td align="right" valign="top"><?php print_string('site'); ?>:</td>
<td valign="top"><input type="text" name="name" size="30" value="<?php echo $mnet_peer->name; ?>" /></td>
</tr>
<tr>
<td align="right" valign="top"><?php print_string('hostname', 'mnet'); ?>:</td>
<td valign="top"><input type="text" name="wwwroot" size="30" value="<?php echo $mnet_peer->wwwroot; ?>" /></td>
</tr>
<?php
if (empty($mnet_peer->public_key)) $mnet_peer->public_key = '';
?>
<tr>
<td align="right" valign="top"><?php
print_string('publickey', 'mnet');
echo ': <br />';
helpbutton("publickey", get_string('publickey', 'mnet'), "mnet", true, true);
?></td>
<?php
if (isset($mnet_peer->deleted) && $mnet_peer->deleted > 0) {
$key = mnet_get_public_key($mnet_peer->wwwroot, $mnet_peer->application->xmlrpc_server_url);
$mnet_peer->public_key = clean_param($key, PARAM_PEM);
}
?>
<td valign="top">
<?php
if (empty($mnet_peer->public_key)) {
print_string('nopubkey', 'mnet');
}
?><br />
<textarea rows="17" cols="65" name="public_key" style="font-size: 8px;"><?php echo $mnet_peer->public_key; ?></textarea>
</td>
</tr>
<tr>
<td align="right" valign="top"><?php print_string('expires', 'mnet'); ?>:</td>
<td valign="top">
<?php
if($mnet_peer->public_key_expires < time()) {
print_string('expired', 'mnet');
echo ' ';
}
echo userdate($mnet_peer->public_key_expires);
?>
</td>
</tr>
<?php
if(!empty($currentkey)) {
?>
<tr>
<td align="right" valign="top"></td>
<td valign="top"><?php print_string('keymismatch', 'mnet'); ?></td>
</tr>
<tr>
<td align="right" valign="top"><?php print_string('currentkey', 'mnet'); ?>:</td>
<td valign="top"><pre style="font-size: 8px;"><?php echo $currentkey;?></pre></td>
</tr>
<?php
}
if (isset($mnet_peer->id) && $mnet_peer->id > 0) {
?>
<tr>
<td align="right" valign="top"><?php print_string('last_connect_time', 'mnet'); ?>:</td>
<td valign="top"><?php echo ($mnet_peer->last_connect_time == 0)? get_string('never','mnet') : date('H:i:s d/m/Y',$mnet_peer->last_connect_time);?></td>
</tr>
<?php
}
if (isset($mnet_peer->deleted) && $mnet_peer->deleted > 0){
?>
<tr>
<td align="right" valign="top"><?php print_string('deleted'); ?>:</td>
<td valign="top">
<input type="radio" name="deleted" value="0" checked="checked" /> <?php print_string('reenableserver','mnet'); ?><br />
<input type="radio" name="deleted" value="1" /> <?php print_string('yes'); ?><br />
</td>
</tr>
<?php
}
if (isset($mnet_peer->ip_address) && '' != $mnet_peer->ip_address){
?>
<tr>
<td align="right" valign="top"><?php print_string('ipaddress', 'mnet');
echo ': <br />';
helpbutton("ipaddress", get_string('ipaddress', 'mnet'), "mnet", true, true);
?>:</td>
<td valign="top"><?php echo $mnet_peer->ip_address; ?></td>
</tr>
<?php
}
?>
<tr>
<td></td>
<td><input type="submit" value="<?php print_string("savechanges"); ?>" /></td>
</tr>
</table>
</div>
</form>
<?php
print_simple_box_end();
admin_externalpage_print_footer();
?>
-21
View File
@@ -1,21 +0,0 @@
<?php
admin_externalpage_print_header();
$currenttab = 'mnetdetails';
require_once($CFG->dirroot .'/admin/mnet/tabs.php');
print_simple_box_start("center", "");
?>
<table cellpadding="9" cellspacing="0" >
<tr>
<td align="right" valign="top"><?php print_string('site'); ?>:</td>
<td valign="top"><?php echo $mnet_peer->name; ?></td>
</tr>
<tr>
<td align="right" valign="top" colspan="2"><?php print_string('allhosts_no_options','mnet'); ?></td>
</tr>
</table>
<?php
print_simple_box_end();
admin_externalpage_print_footer();
?>
-94
View File
@@ -1,94 +0,0 @@
<?php
admin_externalpage_print_header();
$currenttab = 'mnetservices';
require_once($CFG->dirroot .'/admin/mnet/tabs.php');
print_simple_box_start("center", "");
?>
<form method="post" action="mnet_services.php">
<div>
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<input type="hidden" name="step" value="<?php echo $mnet_peer->nextstep; ?>" />
<input type="hidden" name="hostid" value="<?php echo ($mnet_peer->id)? $mnet_peer->id : '0' ; ?>" />
<table cellpadding="9" cellspacing="0" >
<?php
foreach($myservices as $name => $versions) {
$version = current($versions);
$langmodule = ($version['parent_type'] == 'mod' ? '' : ($version['parent_type'] . '_')) . $version['parent'];
?>
<tr>
<td align="left" valign="top" colspan="2">
<h3><?php echo get_string($name.'_name', $langmodule , $mnet_peer->name); ?></h3>
<?php echo get_string($name.'_description', $langmodule, $mnet_peer->name); ?>
<?php
$breakstring = '';
foreach($versions as $version){
if (count($versions) > 1) {
$versionstring = '('.get_string('version','mnet') .' '.$version['apiversion'].')';
} else {
$versionstring = '';
}
echo $breakstring;
?>
<input type="hidden" name="exists[<?php echo $version['serviceid']; ?>]" value="1" />
<input type="checkbox" name="publish[<?php echo $version['serviceid']; ?>]" <?php echo (!empty($version['I_publish']))? 'checked="checked" ': '' ; ?>/>
<?php
print_string('publish','mnet');
echo $versionstring;
if (!empty($version['hostsubscribes'])) {
echo '<a href="#" title="'.get_string('issubscribed','mnet', $mnet_peer->name).'">&radic;</a> ';
}
if (!empty($version['allhosts_publish'])) {
print_string("enabled_for_all",'mnet',!empty($version['I_publish']));
}
echo '<br />';
?>
<input type="checkbox" name="subscribe[<?php echo $version['serviceid']; ?>]" <?php echo (!empty($version['I_subscribe']))? 'checked="checked" ': '' ; ?>/>
<?php
print_string('subscribe','mnet');
echo $versionstring;
if (!empty($version['hostpublishes'])) {
echo '<a href="#" title="'.get_string('ispublished','mnet', $mnet_peer->name).'">&radic;</a> ';
}
if (!empty($version['allhosts_subscribe'])) {
print_string("enabled_for_all",'mnet',!empty($version['I_subscribe']));
}
echo '<br />';
$breakstring = '. . . . . . . . . . . . . . . . . . . . . . . . <br>';
} // end foreach
?>
</td>
</tr>
<?php
} // end foreach
?>
<tr>
<td align="left" valign="top" colspan="2">
<div id="pubTreeLoc"></div>
</td>
</tr>
<tr>
<td align="left" valign="top" colspan="2">
<div id="subTreeLoc"></div>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="<?php print_string("savechanges") ?>" /></td>
</tr>
<tr>
<td align="left" valign="top" colspan="2">
<div id="formElements"><input type="hidden" name="outer" value="4" /></div>
</td>
</tr>
</table>
</div>
</form>
<?php
print_simple_box_end();
admin_externalpage_print_footer();
?>
-187
View File
@@ -1,187 +0,0 @@
<?php
// Allows the admin to configure services for remote hosts
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
require_login();
admin_externalpage_setup('mnetpeers');
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
if (!$site = get_site()) {
print_error('nosite', '', '', NULL, true);
}
/// Initialize variables.
// Step must be one of:
// input Parse the details of a new host and fetch its public key
// commit Save our changes (to a new OR existing host)
// force Go ahead with something we've been warned is strange
$step = optional_param('step', NULL, PARAM_ALPHA);
$hostid = optional_param('hostid', NULL, PARAM_INT);
$publishes = optional_param('publish', null, PARAM_BOOL); // optional_param cleans arrays too
$subscribes = optional_param('subscribe', null, PARAM_BOOL); // optional_param cleans arrays too
$exists = optional_param('exists', null, PARAM_BOOL); // optional_param cleans arrays too
$nocertstring = '';
$nocertmatch = '';
$badcert = '';
$certerror = '';
$noipmatch = '';
$stradministration = get_string('administration');
$strconfiguration = get_string('configuration');
$strmnetsettings = get_string('mnetsettings', 'mnet');
$strmnetservices = get_string('mnetservices', 'mnet');
$strmnetthemes = get_string('mnetthemes', 'mnet');
$strmnetlog = get_string('mnetlog', 'mnet');
$strmnetedithost = get_string('reviewhostdetails', 'mnet');
$strmneteditservices = get_string('reviewhostservices', 'mnet');
$mnet_peer = new mnet_peer();
if (($form = data_submitted()) && confirm_sesskey()) {
$mnet_peer->set_id($hostid);
$treevals = array();
foreach($exists as $key => $value) {
$host2service = get_record('mnet_host2service', 'hostid', $hostid, 'serviceid', $key);
$publish = array_key_exists($key, $publishes) ? $publishes[$key] : 0;
$subscribe = array_key_exists($key, $subscribes) ? $subscribes[$key] : 0;
if ($publish != 1 && $subscribe != 1) {
if (false == $host2service) {
// We don't have or need a record - do nothing!
} else {
// We don't need the record - delete it
delete_records('mnet_host2service', 'hostid', $hostid, 'serviceid', $key);
}
} elseif (false == $host2service && ($publish == 1 || $subscribe == 1)) {
$host2service = new stdClass();
$host2service->hostid = $hostid;
$host2service->serviceid = $key;
$host2service->publish = $publish;
$host2service->subscribe = $subscribe;
$host2service->id = insert_record('mnet_host2service', $host2service);
} elseif ($host2service->publish != $publish || $host2service->subscribe != $subscribe) {
$host2service->publish = $publish;
$host2service->subscribe = $subscribe;
$tf = update_record('mnet_host2service', $host2service);
}
}
}
if (is_int($hostid)) {
if (0 == $mnet_peer->id) $mnet_peer->set_id($hostid);
$mnet_peer->nextstep = 'verify';
$id_list = $mnet_peer->id;
if (!empty($CFG->mnet_all_hosts_id)) {
$id_list .= ', '.$CFG->mnet_all_hosts_id;
}
$concat = sql_concat('COALESCE(h2s.id,0) ', ' \'-\' ', ' svc.id', '\'-\'', 'r.parent_type', '\'-\'', 'r.parent');
$query = "
SELECT DISTINCT
$concat as id,
svc.id as serviceid,
svc.name,
svc.offer,
svc.apiversion,
r.parent_type,
r.parent,
h2s.hostid,
h2s.publish,
h2s.subscribe
FROM
{$CFG->prefix}mnet_service2rpc s2r,
{$CFG->prefix}mnet_rpc r,
{$CFG->prefix}mnet_service svc
LEFT JOIN
{$CFG->prefix}mnet_host2service h2s
ON
h2s.hostid in ($id_list) AND
h2s.serviceid = svc.id
WHERE
svc.offer = '1' AND
s2r.serviceid = svc.id AND
s2r.rpcid = r.id
ORDER BY
svc.name ASC";
$resultset = get_records_sql($query);
if (is_array($resultset)) {
$resultset = array_values($resultset);
} else {
$resultset = array();
}
require_once $CFG->dirroot.'/mnet/xmlrpc/client.php';
$remoteservices = array();
if ($hostid != $CFG->mnet_all_hosts_id) {
// Create a new request object
$mnet_request = new mnet_xmlrpc_client();
// Tell it the path to the method that we want to execute
$mnet_request->set_method('system/listServices');
$mnet_request->send($mnet_peer);
if (is_array($mnet_request->response)) {
foreach($mnet_request->response as $service) {
$remoteservices[$service['name']][$service['apiversion']] = $service;
}
}
}
$myservices = array();
foreach($resultset as $result) {
$result->hostpublishes = false;
$result->hostsubscribes = false;
if (isset($remoteservices[$result->name][$result->apiversion])) {
if ($remoteservices[$result->name][$result->apiversion]['publish'] == 1) {
$result->hostpublishes = true;
}
if ($remoteservices[$result->name][$result->apiversion]['subscribe'] == 1) {
$result->hostsubscribes = true;
}
}
if (empty($myservices[$result->name][$result->apiversion])) {
$myservices[$result->name][$result->apiversion] = array('serviceid' => $result->serviceid,
'name' => $result->name,
'offer' => $result->offer,
'apiversion' => $result->apiversion,
'parent_type' => $result->parent_type,
'parent' => $result->parent,
'hostsubscribes' => $result->hostsubscribes,
'hostpublishes' => $result->hostpublishes
);
}
// allhosts_publish allows us to tell the admin that even though he
// is disabling a service, it's still available to the host because
// he's also publishing it to 'all hosts'
if ($result->hostid == $CFG->mnet_all_hosts_id && $CFG->mnet_all_hosts_id != $mnet_peer->id) {
$myservices[$result->name][$result->apiversion]['allhosts_publish'] = $result->publish;
$myservices[$result->name][$result->apiversion]['allhosts_subscribe'] = $result->subscribe;
} elseif (!empty($result->hostid)) {
$myservices[$result->name][$result->apiversion]['I_publish'] = $result->publish;
$myservices[$result->name][$result->apiversion]['I_subscribe'] = $result->subscribe;
}
}
} else {
redirect('peers.php', get_string('nohostid','mnet'), '5');
exit;
}
include('./mnet_services.html');
?>
-116
View File
@@ -1,116 +0,0 @@
<?php
admin_externalpage_print_header();
print_heading(get_string('themes'));
$original_theme = fullclone($THEME);
$currenttab = 'mnetthemes';
require_once($CFG->dirroot .'/admin/mnet/tabs.php');
$themes = get_list_of_plugins("theme");
$sesskey = !empty($USER->id) ? $USER->sesskey : '';
echo "<table style=\"margin-left:auto;margin-right:auto;\" cellpadding=\"7\" cellspacing=\"5\">";
if (count($report)) {
echo '<tr>';
echo '<td align="center" colspan="2">';
echo '<span class="'.$report[1].'">'.$report[0].'</span>';
echo '</td>';
echo '</tr>';
}
if (!$USER->screenreader) {
echo "<tr class=\"generaltableheader\"><th scope=\"col\">$strtheme</th>";
echo "<th scope=\"col\">$strinfo</th></tr>";
}
echo "<tr>";
echo '<td align="center"><span class="informationbox">Choose this option to use your site\'s default theme: <strong>'.$CFG->theme.'</strong>.</span></td>';
if ($mnet_peer->theme == '') {
echo '<td valign="top" style="border-style:solid; border-width:1px; border-color=#555555">';
} else {
echo '<td valign="top">';
}
echo '<p style="font-size:1.5em;font-style:bold;">Site Theme</p>';
$options = null;
$options['choose'] = $unlikely_name;// Something unlikely to ever be a theme name... initially $unlikely_name = 'ZoqZoqZ';
$options['sesskey'] = $sesskey;
$options['hostid'] = $mnet_peer->id;
print_single_button('mnet_themes.php', $options, $strchoose);
echo '</td>';
echo "</tr>";
foreach ($themes as $theme) {
unset($THEME);
if (!file_exists($CFG->themedir.'/'.$theme.'/config.php')) { // bad folder
continue;
}
include($CFG->themedir.'/'.$theme.'/config.php');
$readme = '';
$screenshot = '';
$screenshotpath = '';
if (file_exists($CFG->themedir.'/'.$theme.'/README.html')) {
$readme = '<li>'.
link_to_popup_window($CFG->themewww .'/'. $theme .'/README.html', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
} else if (file_exists($CFG->themedir.'/'.$theme.'/README.txt')) {
$readme = '<li>'.
link_to_popup_window($CFG->themewww .'/'. $theme .'/README.txt', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
}
if (file_exists("$theme/screenshot.png")) {
$screenshotpath = "$theme/screenshot.png";
} else if (file_exists("$theme/screenshot.jpg")) {
$screenshotpath = "$theme/screenshot.jpg";
}
echo "<tr>";
// no point showing this if user is using screen reader
if (!$USER->screenreader) {
echo "<td align=\"center\">";
if ($screenshotpath) {
$screenshot = '<li><a href='.$CFG->wwwroot .'/theme/'. $theme.'/screenshot.jpg">'.$strscreenshot.'</a></li>';
echo "<object type=\"text/html\" data=\"$screenshotpath\" height=\"200\" width=\"400\">$theme</object></td>";
} else {
echo '<object type="text/html" data="'.$CFG->wwwroot.'/theme/preview.php?preview='.$theme.'" height="200" width="400">'.$theme.'</object></td>';
}
}
if ($mnet_peer->theme == $theme) {
echo '<td valign="top" style="border-style:solid; border-width:1px; border-color=#555555">';
} else {
echo '<td valign="top">';
}
if (isset($THEME->sheets)) {
echo '<p style="font-size:1.5em;font-style:bold;">'.$theme.'</p>';
} else {
echo '<p style="font-size:1.5em;font-style:bold;color:red;">'.$theme.' (Moodle 1.4)</p>';
}
if ($screenshot or $readme) {
echo '<ul>';
if (!$USER->screenreader) {
echo '<li><a href="'.$CFG->wwwroot.'/theme/preview.php?preview='.$theme.'">'.$strpreview.'</a></li>';
}
echo $screenshot.$readme;
echo '</ul>';
}
$options = null;
$options['choose'] = $theme;
$options['sesskey'] = $sesskey;
$options['hostid'] = $mnet_peer->id;
print_single_button('mnet_themes.php', $options, $strchoose);
echo '</td>';
echo "</tr>";
}
echo "</table>";
$THEME = $original_theme;
admin_externalpage_print_footer();
?>
-81
View File
@@ -1,81 +0,0 @@
<?php
// Allows the admin to configure services for remote hosts
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
require_login();
admin_externalpage_setup('mnetpeers');
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
if (!$site = get_site()) {
print_error('nosite', '', '', NULL, true);
}
/// Initialize variables.
$hostid = required_param('hostid', PARAM_INT);
$stradministration = get_string('administration');
$strconfiguration = get_string('configuration');
$strmnetedithost = get_string('reviewhostdetails', 'mnet');
$strmnetsettings = get_string('mnetsettings', 'mnet');
$strmnetservices = get_string('mnetservices', 'mnet');
$strmnetthemes = get_string('mnetthemes', 'mnet');
$strmnetlog = get_string('mnetlog', 'mnet');
$mnet_peer = new mnet_peer();
if (is_int($hostid)) {
$mnet_peer->set_id($hostid);
}
$choose = optional_param("choose",'',PARAM_FILE); // set this theme as default
$stradministration = get_string("administration");
$strconfiguration = get_string("configuration");
$strthemes = get_string("themes");
$strpreview = get_string("preview");
$strchoose = get_string("choose");
$strinfo = get_string("info");
$strtheme = get_string("theme");
$strthemesaved = get_string("themesaved");
$strscreenshot = get_string("screenshot");
$stroldtheme = get_string("oldtheme");
$report = array();
$unlikely_name = 'ZoqZoqZ'; // Something unlikely to ever be a theme name
if ($choose) {
if (confirm_sesskey()) {
if ($choose == $unlikely_name) {
$mnet_peer->force_theme = 1;
$mnet_peer->updateparams->force_theme = 1;
$mnet_peer->theme = '';
$mnet_peer->updateparams->theme = '';
if ($mnet_peer->commit()) {
$report = array(get_string('themesaved'), 'informationbox');
} else {
$report = array(get_string('themesavederror', 'mnet'), 'errorbox');
}
} elseif (!is_dir($CFG->themedir .'/'. $choose) || !file_exists($CFG->themedir .'/'. $choose .'/config.php')) {
echo 'CHOOSE -'.$choose.' '. $CFG->themedir .'/'. $choose .'/config.php' ;
$report = array('This theme is not installed!'.'3', 'errorbox');
} else {
$mnet_peer->force_theme = 1;
$mnet_peer->theme = $choose;
$mnet_peer->updateparams->theme = addslashes($choose);
if ($mnet_peer->commit()) {
$report = array(get_string('themesaved').'1', 'informationbox');
} else {
$report = array(get_string('themesavederror', 'mnet').'2', 'errorbox');
}
}
}
}
$adminroot = admin_get_root();
require('./mnet_themes.html');
?>
-102
View File
@@ -1,102 +0,0 @@
<?php
admin_externalpage_print_header();
if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict') {
print_box(get_string('mnetdisabled','mnet'));
}
?>
<div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->
<form method="post" action="peers.php">
<div>
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<input type="hidden" name="updateregisterall" value="1" />
<table cellspacing="0" cellpadding="5" class="generaltable generalbox" >
<tr>
<th class="header c0" colspan="2"><?php print_string('registerallhosts', 'mnet'); ?></th>
</tr>
<tr>
<td class="cell c1" colspan="2"><?php print_string('registerallhostsexplain', 'mnet'); ?></td>
</tr>
<tr>
<td class="cell c1"><input type="checkbox" name="registerallhosts" <?php if (!empty($CFG->mnet_register_allhosts)) echo 'checked="checked" '; ?>/></td>
<td class="cell c1"> <?php print_string('registerallhosts', 'mnet'); ?> </td>
</tr>
<tr>
<td align="right" colspan="2"><input type="submit" name="submit" value="<?php print_string('savechanges'); ?>" /></td>
</tr>
</table>
</div>
</form>
<table cellspacing="0" cellpadding="5" class="generaltable generalbox standard" >
<tr>
<th class="header c0"><?php print_string('site'); ?></th>
<th class="header c1"><?php print_string('system','mnet'); ?></th>
<th class="header c2"><?php print_string('last_connect_time', 'mnet'); ?></th>
<th class="header c3"></th>
</tr>
<?php
foreach($hosts as $host) {
if ($host->last_connect_time == 0) {
$last_connect = get_string('never');
} else {
$last_connect = date('H:i:s d/m/Y', $host->last_connect_time);
}
?>
<tr>
<td class="cell c0"><a href="peers.php?step=update&amp;hostid=<?php echo $host->id; ?>"><?php echo $host->name; ?></a></td>
<td class="cell c1"><a href="peers.php?step=update&amp;hostid=<?php echo $host->id; ?>"><?php echo $host->wwwroot; ?></a></td>
<td class="cell c2"><?php if ($host->id != $CFG->mnet_all_hosts_id) echo $last_connect; ?></td>
<td class="cell c3">
<?php if ($host->id != $CFG->mnet_all_hosts_id){ ?>
<form method="post" action="delete.php">
<div>
<input type="hidden" name="hostid" value="<?php echo $host->id; ?>" />
<input type="hidden" name="step" value="verify" />
<input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
<input type="submit" name="submit" value="<?php print_string('delete'); ?>"/>
</div>
</form>
<?php } ?>
</td>
</tr>
<?php
}
?>
</table>
<form method="post" action="peers.php">
<table cellspacing="0" cellpadding="5" class="generaltable generalbox standard" >
<tr>
<th class="header c4" colspan="4">
<?php print_string('addnewhost', 'mnet'); ?>
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<input type="hidden" name="step" value="input" />
</th>
</tr>
<tr>
<td class="cell c0">wwwroot:</td>
<td class="cell c1"><input type="text" name="wwwroot" value="" /></td>
<td class="cell c2">
<select name="applicationid">
<?php
foreach($applications as $application) {
echo ' <option value="'.$application->id.'">'.$application->display_name."</option>\n";
}
?>
</select>
</td>
<td class="cell c3"></td>
</tr>
<tr>
<td class="cell c4" align="right" colspan="4"><input type="submit" value="<?php print_string('addhost','mnet'); ?>" /></td>
</tr>
</table>
</form>
</div>
<?php
admin_externalpage_print_footer();
?>
-184
View File
@@ -1,184 +0,0 @@
<?PHP // $Id$
// Allows the admin to configure other Moodle hosts info
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
require_login();
admin_externalpage_setup('mnetpeers');
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
if (!extension_loaded('openssl')) {
admin_externalpage_print_header();
print_error('requiresopenssl', 'mnet');
}
if (!$site = get_site()) {
admin_externalpage_print_header();
print_error('nosite', '');
}
if (!function_exists('curl_init') ) {
admin_externalpage_print_header();
print_error('nocurl', 'mnet');
}
/// Initialize variables.
// Step must be one of:
// input Parse the details of a new host and fetch its public key
// commit Save our changes (to a new OR existing host)
$step = optional_param('step', NULL, PARAM_ALPHA);
$hostid = optional_param('hostid', NULL, PARAM_INT);
// Fetch some strings for the HTML templates
$strmnetservices = get_string('mnetservices', 'mnet');
$strmnetlog = get_string('mnetlog', 'mnet');
$strmnetedithost = get_string('reviewhostdetails', 'mnet');
$strmnetthemes = get_string('mnetthemes', 'mnet');
if (!isset($CFG->mnet_dispatcher_mode)) set_config('mnet_dispatcher_mode', 'off');
/// If data submitted, process and store
if (($form = data_submitted()) && confirm_sesskey()) {
if (!empty($form->wwwroot)) {
// ensure we remove trailing slashes
$form->wwwroot = preg_replace(':/$:', '', $form->wwwroot);
// ensure the wwwroot starts with a http or https prefix
if (strtolower(substr($form->wwwroot, 0, 4)) != 'http') {
$form->wwwroot = 'http://'.$form->wwwroot;
}
}
if(!function_exists('xmlrpc_encode_request')) {
trigger_error("You must have xml-rpc enabled in your PHP build to use this feature.");
print_error('xmlrpc-missing', 'mnet','peers.php');
exit;
}
if (!empty($form->updateregisterall)) {
if (!empty($form->registerallhosts)) {
set_config('mnet_register_allhosts',1);
} else {
set_config('mnet_register_allhosts',0);
}
redirect('peers.php', get_string('changessaved'));
} else {
$mnet_peer = new mnet_peer();
if (!empty($form->id)) {
$form->id = clean_param($form->id, PARAM_INT);
$mnet_peer->set_id($form->id);
} else {
// PARAM_URL requires a genuine TLD (I think) This breaks my testing
$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.");
print_error("invalidurl", 'mnet','peers.php');
exit;
}
unset($temp_wwwroot);
$mnet_peer->set_applicationid($form->applicationid);
$application = get_field('mnet_application', 'name', 'id', $form->applicationid);
$mnet_peer->bootstrap($form->wwwroot, null, $application);
}
if (isset($form->name) && $form->name != $mnet_peer->name) {
$form->name = clean_param($form->name, PARAM_NOTAGS);
$mnet_peer->set_name($form->name);
}
if (isset($form->deleted) && ($form->deleted == '0' || $form->deleted == '1')) {
$mnet_peer->updateparams->deleted = $form->deleted;
$mnet_peer->deleted = $form->deleted;
}
if (isset($form->public_key)) {
$form->public_key = clean_param($form->public_key, PARAM_PEM);
if (empty($form->public_key)) {
print_error("invalidpubkey", 'mnet', 'peers.php?step=update&amp;hostid='.$mnet_peer->id);
exit;
} else {
$oldkey = $mnet_peer->public_key;
$mnet_peer->public_key = $form->public_key;
$mnet_peer->updateparams->public_key = addslashes($form->public_key);
$mnet_peer->public_key_expires = $mnet_peer->check_common_name($form->public_key);
$mnet_peer->updateparams->public_key_expires = $mnet_peer->check_common_name($form->public_key);
if ($mnet_peer->public_key_expires == false) {
$errmsg = '<br />';
foreach ($mnet_peer->error as $err) {
$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;
}
}
}
// PREVENT DUPLICATE RECORDS ///////////////////////////////////////////
if ('input' == $form->step) {
if ( isset($mnet_peer->id) && $mnet_peer->id > 0 ) {
print_error("hostexists", 'mnet', 'peers.php?step=update&amp;hostid='.$mnet_peer->id, $mnet_peer->id);
}
}
if ('input' == $form->step) {
include('./mnet_review.html');
} elseif ('commit' == $form->step) {
$bool = $mnet_peer->commit();
if ($bool) {
redirect('peers.php?step=update&amp;hostid='.$mnet_peer->id, get_string('changessaved'));
} else {
error('Invalid action parameter.', 'index.php');
}
}
}
} elseif (is_int($hostid)) {
$mnet_peer = new mnet_peer();
$mnet_peer->set_id($hostid);
$currentkey = mnet_get_public_key($mnet_peer->wwwroot, $mnet_peer->application);
if($currentkey == $mnet_peer->public_key) unset($currentkey);
$form = new stdClass();
if ($hostid != $CFG->mnet_all_hosts_id) {
include('./mnet_review.html');
} else {
include('./mnet_review_allhosts.html');
}
} else {
$hosts = get_records_sql(' SELECT
h.id,
h.wwwroot,
h.ip_address,
h.name,
h.public_key,
h.public_key_expires,
h.transport,
h.portno,
h.last_connect_time,
h.last_log_id,
h.applicationid,
a.name as app_name,
a.display_name as app_display_name,
a.xmlrpc_server_url
FROM
'.$CFG->prefix.'mnet_host h,
'.$CFG->prefix.'mnet_application a
WHERE
h.id != \''.$CFG->mnet_localhost_id.'\' AND
h.deleted = \'0\' AND
h.applicationid=a.id');
if (empty($hosts)) $hosts = array();
$applications = get_records('mnet_application');
include('./peers.html');
}
?>
-27
View File
@@ -1,27 +0,0 @@
<?php
/**
* Handles tabs for the mnet pages.
* We assume that $currenttab is defined
*
*/
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); // It must be included from a Moodle page
}
$logurl = $CFG->wwwroot.
'/course/report/log/index.php?chooselog=1&amp;showusers=1&amp;showcourses=1&amp;host_course='.$mnet_peer->id.
'%2F1&amp;user='.'0'.
'&amp;date=0'.
'&amp;modid=&amp;modaction=0&amp;logformat=showashtml';
$tabs = array();
if (isset($mnet_peer->id) && $mnet_peer->id > 0) {
$tabs[] = new tabobject('mnetdetails', 'peers.php?step=update&amp;hostid='.$mnet_peer->id, $strmnetedithost, $strmnetedithost, false);
$tabs[] = new tabobject('mnetservices', 'mnet_services.php?step=list&amp;hostid='.$mnet_peer->id, $strmnetservices, $strmnetservices, false);
$tabs[] = new tabobject('mnetthemes', 'mnet_themes.php?step=list&amp;hostid='.$mnet_peer->id, $strmnetthemes, $strmnetthemes, false);
if ($mnet_peer->application->name == 'moodle' && $mnet_peer->id != $CFG->mnet_all_hosts_id) {
$tabs[] = new tabobject('mnetlog', $logurl, $strmnetlog, $strmnetlog, false);
}
} else {
$tabs[] = new tabobject('mnetdetails', '#', $strmnetedithost, $strmnetedithost, false);
}
print_tabs(array($tabs), $currenttab);
-68
View File
@@ -1,68 +0,0 @@
<?php
admin_externalpage_print_header();
?>
<div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->
<table cellspacing="0" cellpadding="5" class="generaltable generalbox" >
<tr>
<th class="header c0" colspan="2"><?php print_string('trustedhosts', 'mnet'); ?></th>
</tr>
<tr>
<td class="cell c1" colspan="2"><?php print_string('trustedhostsexplain', 'mnet'); ?></td>
</tr>
<tr>
<td class="cell c1" colspan="2">
<form method="post" action="trustedhosts.php">
<div>
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<textarea name="hostlist" cols="40" rows="20"><?php echo $trusted_hosts; ?></textarea><br />
<input type="submit" value="<?php print_string('savechanges'); ?>" />
</div>
</form>
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="5" class="generaltable generalbox" >
<tr>
<th class="header c0" colspan="2"><?php print_string('testtrustedhosts', 'mnet'); ?></th>
</tr>
<?php
if (!empty($test_ip_address)){
?>
<tr>
<td class="cell c1" colspan="2">
<?php
if ($in_range) {
print_string('is_in_range', 'mnet', $test_ip_address);
echo '<br />';
print_string('validated_by', 'mnet', $validated_by);
} else {
print_string('not_in_range', 'mnet', $test_ip_address);
}
?>
</td>
</tr>
<?php
} else {
?>
<tr>
<td class="cell c1" colspan="2"><?php print_string('testtrustedhostsexplain', 'mnet'); ?></td>
</tr>
<?php
}
?>
<tr>
<td class="cell c1" colspan="2">
<form method="get" action="trustedhosts.php">
<div>
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<input type="text" name="testipaddress" value="<?php echo $test_ip_address; ?>" />
<input type="submit" value="<?php print_string('go'); ?>" />
</div>
</form>
</td>
</tr>
</table>
</div>
<?php
admin_externalpage_print_footer();
?>
-71
View File
@@ -1,71 +0,0 @@
<?php
// Allows the admin to configure services for remote hosts
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
require_login();
admin_externalpage_setup('trustedhosts');
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
if (!extension_loaded('openssl')) {
admin_externalpage_print_header();
print_error('requiresopenssl', 'mnet', '', NULL, true);
}
if (!$site = get_site()) {
admin_externalpage_print_header();
print_error('nosite', '', '', NULL, true);
}
$trusted_hosts = '';//array();
$old_trusted_hosts = get_config('mnet', 'mnet_trusted_hosts');
if (!empty($old_trusted_hosts)) {
$old_trusted_hosts = explode(',', $old_trusted_hosts);
} else {
$old_trusted_hosts = array();
}
$test_ip_address = optional_param('testipaddress', NULL, PARAM_HOST);
$in_range = false;
if (!empty($test_ip_address)) {
foreach($old_trusted_hosts as $host) {
list($network, $mask) = explode('/', $host.'/');
if (empty($network)) continue;
if (strlen($mask) == 0) $mask = 32;
if (ip_in_range($test_ip_address, $network, $mask)) {
$in_range = true;
$validated_by = $network.'/'.$mask;
break;
}
}
}
/// If data submitted, process and store
if (($form = data_submitted()) && confirm_sesskey()) {
$hostlist = preg_split("/[\s,]+/", $form->hostlist);
foreach($hostlist as $host) {
list($address, $mask) = explode('/', $host.'/');
if (empty($address)) continue;
if (strlen($mask) == 0) $mask = 32;
$trusted_hosts .= trim($address).'/'.trim($mask)."\n";
unset($address, $mask);
}
set_config('mnet_trusted_hosts', str_replace("\n", ',', $trusted_hosts), 'mnet');
} elseif (!empty($old_trusted_hosts)) {
foreach($old_trusted_hosts as $host) {
list($address, $mask) = explode('/', $host.'/');
if (empty($address)) continue;
if (strlen($mask) == 0) $mask = 32;
$trusted_hosts .= trim($address).'/'.trim($mask)."\n";
unset($address, $mask);
}
}
include('./trustedhosts.html');
?>
+27 -23
View File
@@ -1,40 +1,42 @@
<?PHP // $Id$
// module.php - allows admin to edit all local configuration variables for a module
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once("../config.php");
require_login();
if (!isadmin()) {
error("Only an admin can use this page");
}
if (!$site = get_site()) {
error("Site isn't defined!");
}
/// If data submitted, then process and store.
if ($config = data_submitted()) {
$module = optional_param('module', '', PARAM_SAFEDIR);
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', 'error');
error(get_string('confirmsesskeybad', 'error'));
}
if ($module != '') {
include_once("$CFG->dirroot/mod/$module/lib.php");
admin_externalpage_setup('modsetting'.$module);
if ($module = optional_param('module', '', PARAM_CLEANFILE)) {
// if the config.html contains a hidden form field giving
// the module name then the form does not have to prefix all
// its variable names, we will do it here.
$moduleprefix = $module.'_';
// let the module process the form data if it has to,
// $config is passed to this function by reference
require_once("$CFG->dirroot/mod/$module/lib.php");
$moduleconfig = $module.'_process_options';
if (function_exists($moduleconfig)) {
$moduleconfig($config);
}
} else {
admin_externalpage_setup('managemodules');
$moduleprefix = '';
}
unset($config->sesskey);
unset($config->module);
foreach ($config as $name => $value) {
set_config($moduleprefix.$name, $value);
}
@@ -43,27 +45,29 @@
}
/// Otherwise print the form.
$module = required_param('module', PARAM_SAFEDIR);
include_once("$CFG->dirroot/mod/$module/lib.php");
admin_externalpage_setup('modsetting'.$module);
$module = required_param('module', '', PARAM_CLEANFILE);
require_once("$CFG->dirroot/mod/$module/lib.php");
$stradmin = get_string("administration");
$strconfiguration = get_string("configuration");
$strmanagemodules = get_string("managemodules");
$strmodulename = get_string("modulename", $module);
// $CFG->pagepath is used to generate the body and id attributes for the body tag
// of the page. It is also used to generate the link to the Moodle Docs for this view.
$CFG->pagepath = 'mod/' . $module . '/config';
admin_externalpage_print_header();
print_header("$site->shortname: $strmodulename: $strconfiguration", $site->fullname,
"<a href=\"index.php\">$stradmin</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> ".
"<a href=\"modules.php\">$strmanagemodules</a> -> $strmodulename");
print_heading($strmodulename);
print_simple_box(get_string("configwarning", 'admin'), "center", "60%");
print_simple_box("<center>".get_string("configwarning", 'admin')."</center>", "center", "50%");
echo "<br />";
print_simple_box_start("center", "");
include("$CFG->dirroot/mod/$module/config.html");
print_simple_box_end();
admin_externalpage_print_footer();
print_footer();
?>
+63 -145
View File
@@ -1,26 +1,30 @@
<?PHP // $Id$
// Allows the admin to manage activity modules
// Allows the admin to create, delete and rename course categories
require_once('../config.php');
require_once('../course/lib.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->libdir.'/ddllib.php');
require_once("../config.php");
require_once("../course/lib.php");
// defines
define('MODULE_TABLE','module_administration_table');
optional_variable($disable);
optional_variable($enable);
optional_variable($delete);
optional_variable($confirm);
admin_externalpage_setup('managemodules');
require_login();
$show = optional_param('show', '', PARAM_SAFEDIR);
$hide = optional_param('hide', '', PARAM_SAFEDIR);
$delete = optional_param('delete', '', PARAM_SAFEDIR);
$confirm = optional_param('confirm', '', PARAM_BOOL);
if (!isadmin()) {
error("Only administrators can use this page!");
}
if (!$site = get_site()) {
error("Site isn't defined!");
}
/// Print headings
$stractivities = get_string("activities");
$stradministration = get_string("administration");
$strconfiguration = get_string("configuration");
$strmanagemodules = get_string("managemodules");
$strdelete = get_string("delete");
$strversion = get_string("version");
$strhide = get_string("hide");
@@ -28,7 +32,13 @@
$strsettings = get_string("settings");
$stractivities = get_string("activities");
$stractivitymodule = get_string("activitymodule");
$strshowmodulecourse = get_string('showmodulecourse');
print_header("$site->shortname: $strmanagemodules", "$site->fullname",
"<a href=\"index.php\">$stradministration</a> -> ".
"<a href=\"configure.php\">$strconfiguration</a> -> $strmanagemodules");
print_heading($strmanagemodules);
/// If data submitted, then process and store.
@@ -36,54 +46,27 @@
if (!$module = get_record("modules", "name", $hide)) {
error("Module doesn't exist!");
}
set_field("modules", "visible", "0", "id", $module->id); // Hide main module
// Remember the visibility status in visibleold
// and hide...
$sql = "UPDATE {$CFG->prefix}course_modules
SET visibleold=visible,
visible=0
WHERE module={$module->id}";
execute_sql($sql, false);
// clear the course modinfo cache for courses
// where we just deleted something
$sql = "UPDATE {$CFG->prefix}course
SET modinfo=''
WHERE id IN (SELECT DISTINCT course
FROM {$CFG->prefix}course_modules
WHERE visibleold=1 AND module={$module->id})";
execute_sql($sql, false);
admin_get_root(true, false); // settings not required - only pages
set_field("modules", "visible", "0", "id", $module->id); // Hide main module
set_field("course_modules", "visible", "0", "module", $module->id); // Hide all related activity modules
}
if (!empty($show) and confirm_sesskey()) {
if (!$module = get_record("modules", "name", $show)) {
error("Module doesn't exist!");
}
set_field("modules", "visible", "1", "id", $module->id); // Show main module
set_field('course_modules', 'visible', '1', 'visibleold',
'1', 'module', $module->id); // Get the previous saved visible state for the course module.
// clear the course modinfo cache for courses
// where we just made something visible
$sql = "UPDATE {$CFG->prefix}course
SET modinfo=''
WHERE id IN (SELECT DISTINCT course
FROM {$CFG->prefix}course_modules
WHERE visible=1 AND module={$module->id})";
execute_sql($sql, false);
admin_get_root(true, false); // settings not required - only pages
set_field("modules", "visible", "1", "id", $module->id); // Show main module
set_field("course_modules", "visible", "1", "module", $module->id); // Show all related activity modules
}
if (!empty($delete) and confirm_sesskey()) {
admin_externalpage_print_header();
print_heading($stractivities);
$strmodulename = get_string("modulename", "$delete");
if (!$confirm) {
notice_yesno(get_string("moduledeleteconfirm", "", $strmodulename),
"modules.php?delete=$delete&amp;confirm=1&amp;sesskey=$USER->sesskey",
if (empty($confirm)) {
notice_yesno(get_string("moduledeleteconfirm", "", $strmodulename),
"modules.php?delete=$delete&amp;confirm=$delete&amp;sesskey=$USER->sesskey",
"modules.php");
admin_externalpage_print_footer();
print_footer();
exit;
} else { // Delete everything!!
@@ -105,33 +88,12 @@
}
}
// delete calendar events
if (!delete_records("event", "modulename", $delete)) {
notify("Error occurred while deleting all $strmodulename records in calendar event table");
}
// clear course.modinfo for courses
// that used this module...
$sql = "UPDATE {$CFG->prefix}course
SET modinfo=''
WHERE id IN (SELECT DISTINCT course
FROM {$CFG->prefix}course_modules
WHERE module={$module->id})";
execute_sql($sql, false);
// Now delete all the course module records
if (!delete_records("course_modules", "module", $module->id)) {
notify("Error occurred while deleting all $strmodulename records in course_modules table");
}
if ($coursemods) {
foreach ($coursemods as $coursemod) {
if (!delete_context(CONTEXT_MODULE, $coursemod->id)) {
notify("Could not delete the context for $strmodulename with id = $coursemod->id");
}
}
}
// Then delete all the logs
// Then delete all the logs
if (!delete_records("log", "module", $module->name)) {
notify("Error occurred while deleting all $strmodulename records in log table");
}
@@ -146,34 +108,21 @@
notify("Error occurred while deleting the $strmodulename record from modules table");
}
// And the module configuration records
if (!execute_sql("DELETE FROM {$CFG->prefix}config WHERE name LIKE '{$module->name}_%'")) {
notify("Error occurred while deleting the $strmodulename records from the config table");
}
// cleanup the gradebook
require_once($CFG->libdir.'/gradelib.php');
grade_uninstalled_module($module->name);
// Then the tables themselves
drop_plugin_tables($module->name, "$CFG->dirroot/mod/$module->name/db/install.xml", false);
// Delete the capabilities that were defined by this module
capabilities_cleanup('mod/'.$module->name);
// remove entent handlers and dequeue pending events
events_uninstall('mod/'.$module->name);
// Perform any custom uninstall tasks
if (file_exists($CFG->dirroot . '/mod/' . $module->name . '/lib.php')) {
require_once($CFG->dirroot . '/mod/' . $module->name . '/lib.php');
$uninstallfunction = $module->name . '_uninstall';
if (function_exists($uninstallfunction)) {
if (! $uninstallfunction() ) {
notify('Encountered a problem running uninstall function for '. $module->name.'!');
if ($tables = $db->Metatables()) {
$prefix = $CFG->prefix.$module->name;
foreach ($tables as $table) {
if (strpos($table, $prefix) === 0) {
if (!execute_sql("DROP TABLE $table", false)) {
notify("ERROR: while trying to drop table $table");
}
}
}
}
}
rebuild_course_cache(); // Because things have changed
$a->module = $strmodulename;
$a->directory = "$CFG->dirroot/mod/$delete";
@@ -181,9 +130,6 @@
}
}
admin_externalpage_print_header();
print_heading($stractivities);
/// Get and sort the existing modules
if (!$modules = get_records("modules")) {
@@ -192,80 +138,52 @@
foreach ($modules as $module) {
$strmodulename = get_string("modulename", "$module->name");
// Deal with modules which are lacking the language string
if ($strmodulename == '[[modulename]]') {
$strmodulename = $module->name;
}
$modulebyname[$strmodulename] = $module;
}
ksort($modulebyname, SORT_LOCALE_STRING);
ksort($modulebyname);
/// Print the table of all modules
// construct the flexible table ready to display
$table = new flexible_table(MODULE_TABLE);
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'delete', 'settings'));
$table->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/modules.php');
$table->set_attribute('id', 'modules');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->setup();
$table->head = array ($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strdelete, $strsettings);
$table->align = array ("left", "right", "left", "center", "center", "center");
$table->wrap = array ("nowrap", "", "", "", "","");
$table->size = array ("100%", "10", "10", "10", "10","12");
$table->width = "100";
foreach ($modulebyname as $modulename => $module) {
// took out hspace="\10\", because it does not validate. don't know what to replace with.
$icon = "<img src=\"$CFG->modpixpath/$module->name/icon.gif\" class=\"icon\" alt=\"\" />";
$icon = "<img src=\"$CFG->modpixpath/$module->name/icon.gif\" hspace=\"10\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" />";
$delete = "<a href=\"modules.php?delete=$module->name&amp;sesskey=$USER->sesskey\">$strdelete</a>";
if (file_exists("$CFG->dirroot/mod/$module->name/settings.php")) {
$settings = "<a href=\"settings.php?section=modsetting$module->name\">$strsettings</a>";
} else if (file_exists("$CFG->dirroot/mod/$module->name/config.html")) {
if (file_exists("$CFG->dirroot/mod/$module->name/config.html")) {
$settings = "<a href=\"module.php?module=$module->name\">$strsettings</a>";
} else {
$settings = "";
}
$count = count_records_select("$module->name",'course<>0');
if ($count>0) {
$countlink = "<a href=\"{$CFG->wwwroot}/course/search.php?modulelist=$module->name" .
"&amp;sesskey={$USER->sesskey}\" title=\"$strshowmodulecourse\">$count</a>";
}
else {
$countlink = "$count";
}
$count = count_records("$module->name");
if ($module->visible) {
$visible = "<a href=\"modules.php?hide=$module->name&amp;sesskey=$USER->sesskey\" title=\"$strhide\">".
"<img src=\"$CFG->pixpath/i/hide.gif\" class=\"icon\" alt=\"$strhide\" /></a>";
"<img src=\"$CFG->pixpath/i/hide.gif\" align=\"middle\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" /></a>";
$class = "";
} else {
$visible = "<a href=\"modules.php?show=$module->name&amp;sesskey=$USER->sesskey\" title=\"$strshow\">".
"<img src=\"$CFG->pixpath/i/show.gif\" class=\"icon\" alt=\"$strshow\" /></a>";
$class = " class=\"dimmed_text\"";
"<img src=\"$CFG->pixpath/i/show.gif\" align=\"middle\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" /></a>";
$class = "class=\"dimmed_text\"";
}
if ($module->name == "forum") {
$delete = "";
$visible = "";
$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.$extra.'</span>',
$countlink,
'<span'.$class.'>'.$module->version.'</span>',
$visible,
$delete,
$settings
));
$table->data[] = array ("<span $class>$icon $modulename</span>", $count, $module->version, $visible, $delete, $settings);
}
print_table($table);
$table->print_html();
echo "<br /><br />";
admin_externalpage_print_footer();
print_footer();
?>
-121
View File
@@ -1,121 +0,0 @@
<?php /// $Id$
/// Search and replace strings throughout all texts in the whole database
require_once('../config.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('multilangupgrade');
$go = optional_param('go', 0, PARAM_BOOL);
###################################################################
admin_externalpage_print_header();
print_heading(get_string('multilangupgrade', 'admin'));
$strmultilangupgrade = get_String('multilangupgradeinfo', 'admin');
if (!$go or !data_submitted() or !confirm_sesskey()) { /// Print a form
$optionsyes = array('go'=>1, 'sesskey'=>sesskey());
notice_yesno($strmultilangupgrade, 'multilangupgrade.php', 'index.php', $optionsyes, null, 'post', 'get');
admin_externalpage_print_footer();
die;
}
if (!$tables = $db->Metatables() ) { // No tables yet at all.
error("no tables");
}
print_simple_box_start('center');
/// Turn off time limits, sometimes upgrades can be slow.
@set_time_limit(0);
@ob_implicit_flush(true);
while(@ob_end_flush());
echo '<strong>Progress:</strong>';
$i = 0;
$skiptables = array($CFG->prefix.'config', $CFG->prefix.'user_students', $CFG->prefix.'user_teachers');//, $CFG->prefix.'sessions2');
foreach ($tables as $table) {
if (($CFG->prefix && strpos($table, $CFG->prefix) !== 0)
or strpos($table, $CFG->prefix.'pma') === 0) { // Not our tables
continue;
}
if (in_array($table, $skiptables)) { // Don't process these
continue;
}
if ($columns = $db->MetaColumns($table, false)) {
if (!array_key_exists('id', $columns) and !array_key_exists('ID', $columns)) {
continue; // moodle tables have id
}
foreach ($columns as $column => $data) {
if (in_array($data->type, array('text','mediumtext','longtext','varchar'))) { // Text stuff only
// first find candidate records
$rs = get_recordset_sql("SELECT id, $column FROM $table WHERE $column LIKE '%</lang>%' OR $column LIKE '%<span lang=%'");
if ($rs) {
while (!$rs->EOF) {
$text = $rs->fields[$column];
$id = $rs->fields['id'];
if ($i % 600 == 0) {
echo '<br />';
}
if ($i % 10 == 0) {
echo '.';
}
$i++;
$rs->MoveNext();
if (empty($text) or is_numeric($text)) {
continue; // nothing to do
}
$search = '/(<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.+?<\/(?:lang|span)>)(\s*<(?:lang|span) lang="[a-zA-Z0-9_-]*".*?>.+?<\/(?:lang|span)>)+/is';
$newtext = preg_replace_callback($search, 'multilangupgrade_impl', $text);
if (is_null($newtext)) {
continue; // regex error
}
if ($newtext != $text) {
$newtext = addslashes($newtext);
execute_sql("UPDATE $table SET $column='$newtext' WHERE id=$id", false);
}
}
rs_close($rs);
}
}
}
}
}
// set conversion flag - switches to new plugin automatically
set_config('filter_multilang_converted', 1);
print_simple_box_end();
/// Rebuild course cache which might be incorrect now
notify('Rebuilding course cache...', 'notifysuccess');
rebuild_course_cache();
notify('...finished', 'notifysuccess');
print_continue('index.php');
admin_externalpage_print_footer();
die;
function multilangupgrade_impl($langblock) {
$searchtosplit = '/<(?:lang|span) lang="([a-zA-Z0-9_-]*)".*?>(.+?)<\/(?:lang|span)>/is';
preg_match_all($searchtosplit, $langblock[0], $rawlanglist);
$return = '';
foreach ($rawlanglist[1] as $index=>$lang) {
$return .= '<span lang="'.$lang.'" class="multilang">'.$rawlanglist[2][$index].'</span>';
}
return $return;
}
?>
+15 -9
View File
@@ -1,15 +1,21 @@
<?php // $Id$
<?php
if (!isset($CFG)) {
require('../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('oacleanup');
require_login();
if (!isadmin()) {
error('You must be an admin to use this script');
exit;
}
print_header_simple('Online Assignment Cleanup','Online Assignment Cleanup', 'Admin');
admin_externalpage_print_header();
online_assignment_cleanup(true);
admin_externalpage_print_footer();
print_footer();
}
@@ -42,7 +48,7 @@ function online_assignment_cleanup($output=false) {
/// get a list of all courses on this site
$courses = get_records('course');
$courses = get_courses();
/// cycle through each course
foreach ($courses as $course) {
@@ -69,7 +75,7 @@ function online_assignment_cleanup($output=false) {
/// cycle through the instances
foreach ($instances as $instance) {
/// is this an instance of an online assignment
$sql = "SELECT a.id
$sql = "SELECT a.id
FROM {$CFG->prefix}course_modules cm,
{$CFG->prefix}assignment a
WHERE cm.id = '$instance' AND
@@ -95,7 +101,7 @@ function online_assignment_cleanup($output=false) {
/// grab the section record
if (!($section = get_record('course_sections', 'id', $newsection))) {
if ($output) echo 'Serious error: Cannot retrieve section: '.$newsection.' for course: '. format_string($course->fullname) .'<br />';
if ($output) echo 'Serious error: Cannot retrieve section: '.$newsection.' for course: '.$course->fullname.'<br />';
continue;
}
@@ -134,7 +140,7 @@ function online_assignment_cleanup($output=false) {
set_field('course_sections', 'sequence', $section->sequence, 'id', $section->id);
if ($output) echo 'Online Assignment (instance '.$instance.') moved from section '.$section->id.': to section '.$newsection.'<br />';
}
-165
View File
@@ -1,165 +0,0 @@
<?php // $Id$
require_once($CFG->libdir.'/pagelib.php');
define('PAGE_ADMIN', 'admin');
// Bounds for block widths
// more flexible for theme designers taken from theme config.php
$lmin = (empty($THEME->block_l_min_width)) ? 0 : $THEME->block_l_min_width;
$lmax = (empty($THEME->block_l_max_width)) ? 210 : $THEME->block_l_max_width;
$rmin = (empty($THEME->block_r_min_width)) ? 0 : $THEME->block_r_min_width;
$rmax = (empty($THEME->block_r_max_width)) ? 210 : $THEME->block_r_max_width;
define('BLOCK_L_MIN_WIDTH', $lmin);
define('BLOCK_L_MAX_WIDTH', $lmax);
define('BLOCK_R_MIN_WIDTH', $rmin);
define('BLOCK_R_MAX_WIDTH', $rmax);
page_map_class(PAGE_ADMIN, 'page_admin');
class page_admin extends page_base {
var $section = '';
var $visiblepathtosection;
var $extraurlparams = array();
var $extrabutton = '';
var $url = '';
// hack alert!
// this function works around the inability to store the section name
// in default block, maybe we should "improve" the blocks a bit?
function init_extra($section) {
global $CFG;
if($this->full_init_done) {
return;
}
$adminroot =& admin_get_root(false, false); //settings not required - only pages
// fetch the path parameter
$this->section = $section;
$current =& $adminroot->locate($section, true);
$this->visiblepathtosection = array_reverse($current->visiblepath);
// all done
$this->full_init_done = true;
}
function blocks_get_default() {
return 'admin_tree,admin_bookmarks';
}
// 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));
}
// has to be fixed. i know there's a "proper" way to do this
function user_is_editing() {
global $USER;
return $USER->adminediting;
}
function url_get_path() {
global $CFG;
if (!empty($this->url)) {
return $this->url;
}
$adminroot =& admin_get_root(false, false); //settings not required - only pages
$root =& $adminroot->locate($this->section);
if (is_a($root, 'admin_externalpage')) {
return $root->url;
} else {
return ($CFG->wwwroot . '/' . $CFG->admin . '/settings.php');
}
}
/**
* Use this to pass extra HTML that is added after the turn blocks editing on/off button.
*
* @param string $extrabutton HTML code.
*/
function set_extra_button($extrabutton) {
$this->extrabutton = $extrabutton;
}
/**
* Use this to pass extra URL parameters that, for example, the blocks editing controls need to reload the current page accurately.
*
* @param array $extraurlparams paramname => value array.
*/
function set_extra_url_params($extraurlparams, $actualurl = '') {
$this->extraurlparams = $extraurlparams;
if (!empty($actualurl)) {
$this->url = $actualurl;
}
}
function url_get_parameters() { // only handles parameters relevant to the admin pagetype
return array_merge($this->extraurlparams, array('section' => $this->section));
}
function blocks_get_positions() {
return array(BLOCK_POS_LEFT, BLOCK_POS_RIGHT);
}
function blocks_default_position() {
return BLOCK_POS_LEFT;
}
function blocks_move_position(&$instance, $move) {
if($instance->position == BLOCK_POS_LEFT && $move == BLOCK_MOVE_RIGHT) {
return BLOCK_POS_RIGHT;
} else if ($instance->position == BLOCK_POS_RIGHT && $move == BLOCK_MOVE_LEFT) {
return BLOCK_POS_LEFT;
}
return $instance->position;
}
// does anything need to be done here?
function init_quick($data) {
parent::init_quick($data);
}
function print_header($section = '', $focus='') {
global $USER, $CFG, $SITE;
$this->init_full($section); // we're trusting that init_full() has already been called by now; it should have.
// if not, print_header() has to be called with a $section parameter
// The search page currently doesn't handle block editing
if ($this->section != 'search' and $this->user_allowed_editing()) {
$options = $this->url_get_parameters();
if ($this->user_is_editing()) {
$caption = get_string('blockseditoff');
$options['adminedit'] = 'off';
} else {
$caption = get_string('blocksediton');
$options['adminedit'] = 'on';
}
$buttons = print_single_button($this->url_get_path(), $options, $caption, 'get', '', true);
} else {
$buttons = '&nbsp;';
}
$buttons .= $this->extrabutton;
$navlinks = array();
foreach ($this->visiblepathtosection as $element) {
$navlinks[] = array('name' => $element, 'link' => null, 'type' => 'misc');
}
$navigation = build_navigation($navlinks);
print_header("$SITE->shortname: " . implode(": ",$this->visiblepathtosection), $SITE->fullname, $navigation, $focus, '', true, $buttons, '');
}
function get_type() {
return PAGE_ADMIN;
}
}
?>
+26 -20
View File
@@ -2,32 +2,38 @@
// phpinfo.php - shows phpinfo for the current server
require_once("../config.php");
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('phpinfo');
$topframe = optional_param('topframe', false, PARAM_BOOL);
$bottomframe = optional_param('bottomframe', false, PARAM_BOOL);
admin_externalpage_print_header();
require_login();
echo '<div class="phpinfo">';
if (!isadmin()) {
error("Only the admin can use this page");
}
ob_start();
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES);
$html = ob_get_contents();
ob_end_clean();
if (!$topframe && !$bottomframe) {
?>
/// Delete styles from output
$html = preg_replace('#(\n?<style[^>]*?>.*?</style[^>]*?>)|(\n?<style[^>]*?/>)#is', '', $html);
$html = preg_replace('#(\n?<head[^>]*?>.*?</head[^>]*?>)|(\n?<head[^>]*?/>)#is', '', $html);
/// Delete DOCTYPE from output
$html = preg_replace('/<!DOCTYPE html PUBLIC.*?>/is', '', $html);
/// Delete body and html tags
$html = preg_replace('/<html.*?>.*?<body.*?>/is', '', $html);
$html = preg_replace('/<\/body><\/html>/is', '', $html);
<head>
<title>PHP info</title>
</head>
echo $html;
<frameset rows="80,*">
<frame src="phpinfo.php?topframe=true&amp;sesskey=<?php echo $USER->sesskey ?>">
<frame src="phpinfo.php?bottomframe=true&amp;sesskey=<?php echo $USER->sesskey ?>">
</frameset>
echo '</div>';
admin_externalpage_print_footer();
<?php
} else if ($topframe && confirm_sesskey()) {
$stradministration = get_string("administration");
$site = get_site();
print_header("$site->shortname: phpinfo", "$site->fullname",
"<a target=\"$CFG->framename\" href=\"index.php\">$stradministration</a> -> PHP info");
exit;
} else if ($bottomframe && confirm_sesskey()) {
phpinfo();
exit;
}
?>
+4 -4
View File
@@ -16,8 +16,8 @@ if ($_ENV['RECIPIENT'] == $CFG->noreplyaddress) {
}
$site = get_site();
$subject = get_string('noreplybouncesubject','moodle',format_string($site->fullname));
$body = get_string('noreplybouncemessage','moodle',format_string($site->fullname))."\n\n";
$subject = get_string('noreplybouncesubject','moodle',$site->fullname);
$body = get_string('noreplybouncemessage','moodle',$site->fullname)."\n\n";
$fd = fopen('php://stdin','r');
if ($fd) {
@@ -54,7 +54,7 @@ if ($modid == '0') { // special
}
else {
$modname = get_field("modules","name","id",$modid);
include_once('mod/'.$modname.'/lib.php');
require_once('mod/'.$modname.'/lib.php');
}
$function = $modname.'_process_email';
@@ -72,7 +72,7 @@ while(!feof($fd)) {
$function($modargs,$body);
fclose($fd);
fclose($handle);
+103 -95
View File
@@ -1,18 +1,20 @@
<?php // $Id$
// register.php - allows admin to register their site on moodle.org
require_once('../config.php');
include("../config.php");
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
if (!isadmin()) {
error("Only the admin can use this page");
}
if (!$site = get_site()) {
redirect("index.php");
}
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', 'error');
error(get_string('confirmsesskeybad', 'error'));
}
if (!$admin = get_admin()) {
@@ -23,164 +25,170 @@
$admin->country = $CFG->country;
}
if (empty($CFG->siteidentifier)) { // Unique site identification code
set_config('siteidentifier', random_string(32));
}
/// Print headings
$stradministration = get_string("administration");
$strregistration = get_string("registration");
$strregistrationinfo = get_string("registrationinfo");
$navlinks = array();
$navlinks[] = array('name' => $stradministration, 'link' => "../$CFG->admin/index.php", 'type' => 'misc');
$navlinks[] = array('name' => $strregistration, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$site->shortname: $strregistration", $site->fullname, $navigation);
print_header("$site->shortname: $strregistration", "$site->fullname",
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strregistration");
print_heading($strregistration);
print_simple_box($strregistrationinfo, "center", "70%");
echo "<br />";
/// Print the form
echo "<form id=\"mform1\" class=\"mform\" action=\"http://moodle.org/register/\" method=\"post\">\n";
echo '<fieldset id="registration">';
echo '<legend>'.get_string("registrationinfotitle").'</legend>';
print_simple_box_start("center", "");
echo "<form name=\"form\" action=\"http://moodle.org/register/\" method=\"post\">\n";
echo "<table cellpadding=\"9\" border=\"0\">\n";
echo "<tr valign=\"top\">\n";
echo "<td align=\"center\" colspan=\"2\">".get_string("location")."</td>\n";
echo "</tr>\n";
echo "<tr valign=\"top\">\n";
echo "<td align=\"right\">Moodle URL:</td>\n";
echo "<td>$CFG->wwwroot</td>\n";
echo "<!-- The following hidden variables are to help prevent fake entries being sent. -->\n";
echo "<!-- Together they form a key. If any of these change between updates then the entry -->\n";
echo "<!-- is flagged as a new entry and will be manually checked by the list maintainer -->\n";
echo "<input type=\"hidden\" name=\"url\" value=\"$CFG->wwwroot\" />\n";
echo "<input type=\"hidden\" name=\"secret\" value=\"" . get_site_identifier() . "\" />\n";
echo "<input type=\"hidden\" name=\"host\" value=\"".$_SERVER["HTTP_HOST"]."\" />\n";
echo "<input type=\"hidden\" name=\"lang\" value=\"".current_language()."\" />\n";
echo "<input type=\"hidden\" name=\"url\" value=\"$CFG->wwwroot\">\n";
echo "<input type=\"hidden\" name=\"secret\" value=\"$CFG->siteidentifier\">\n";
echo "<input type=\"hidden\" name=\"host\" value=\"".$_SERVER["HTTP_HOST"]."\">\n";
echo "<input type=\"hidden\" name=\"lang\" value=\"".current_language()."\">\n";
echo "</td></tr>\n";
echo "<input type=\"hidden\" name=\"version\" value=\"$CFG->version\" />\n";
echo "<input type=\"hidden\" name=\"release\" value=\"$CFG->release\" />\n";
echo "<tr valign=\"top\">\n";
echo "<td align=\"right\">".get_string("currentversion").":</td>\n";
echo "<td>$CFG->release ($CFG->version)</td>\n";
echo "<input type=\"hidden\" name=\"version\" value=\"$CFG->version\">\n";
echo "<input type=\"hidden\" name=\"release\" value=\"$CFG->release\">\n";
echo "</td></tr>\n";
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label>URL</label></div>';
echo '<div class="felement ftext">'.$CFG->wwwroot.'</div>';
echo '</div>';
echo "<tr valign=\"top\">\n";
echo "<td align=\"right\">".get_string("fullsitename").":</td>\n";
echo "<td><input size=\"50\" type=\"text\" name=\"sitename\" value=\"$site->fullname\"></td>\n";
echo "</tr>\n";
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label>'.get_string("currentversion").'</label></div>';
echo '<div class="felement ftext">'."$CFG->release ($CFG->version)".'</div>';
echo '</div>';
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="sitename">'.get_string("fullsitename").'</label></div>';
echo '<div class="felement ftext">';
echo '<input size="50" id="sitename" type="text" name="sitename" value="'.format_string($site->fullname).'" />';
echo '</div>';
echo '</div>';
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="menucountry">'.get_string("country").'</label></div>';
echo '<div class="felement ftext">';
echo "<tr valign=\"top\">\n";
echo "<td align=\"right\">".get_string("country").":</td>\n";
echo "<td>";
choose_from_menu (get_list_of_countries(), "country", $admin->country, get_string("selectacountry")."...", "", "");
echo '</div>';
echo '</div>';
echo "</td>\n";
echo "</tr>\n";
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="menupublic">'."<a href=\"http://moodle.org/sites/?country=$admin->country\" title=\"".get_string("publicdirectorytitle")."\">".get_string("publicdirectory")."</a>".'</label></div>';
echo '<div class="felement ftext">';
echo "<tr valign=\"top\">\n";
echo "<td align=\"right\"><a href=\"http://moodle.org/sites/?country=$admin->country\" title=\"See the current list of sites\" target=_blank>".get_string("publicdirectory")."</a>:</td>\n";
echo "<td>";
$options[0] = get_string("publicdirectory0");
$options[1] = get_string("publicdirectory1");
$options[2] = get_string("publicdirectory2");
choose_from_menu ($options, "public", "2", "", "", "");
unset($options);
echo '</div>';
echo '</div>';
echo "</td>\n";
echo "</tr>\n";
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="menucontact">'.get_string("registrationcontact").'</label></div>';
echo '<div class="felement ftext">';
echo "<tr valign=\"top\">\n";
echo "<td align=\"right\">".get_string("registrationcontact")."</a>:</td>\n";
echo "<td>\n";
$options[0] = get_string("registrationcontactno");
$options[1] = get_string("registrationcontactyes");
choose_from_menu ($options, "contact", "1", "", "", "");
unset($options);
echo '</div>';
echo '</div>';
echo "</td>\n";
echo "</tr>\n";
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label>'.get_string("statistics")."<br />(".get_string("notpublic").')'.'</label></div>';
echo '<div class="felement ftext">';
echo "<tr valign=\"top\">\n";
echo "<td align=\"right\">".get_string("statistics").":";
echo "<br />(".get_string("notpublic").')';
echo "</td>\n";
echo "<td>";
$count = count_records('course')-1;
echo get_string("courses").": ".$count;
echo "<input type=\"hidden\" name=\"courses\" value=\"$count\" />\n";
echo "<input type=\"hidden\" name=\"courses\" value=\"$count\">\n";
echo '<br />';
$count = count_records('user', 'deleted', 0);
$count = count_records('user')-1;
echo get_string("users").": ".$count;
echo "<input type=\"hidden\" name=\"users\" value=\"$count\" />\n";
echo "<input type=\"hidden\" name=\"users\" value=\"$count\">\n";
echo '<br />';
// total number of role assignments
$count = count_records('role_assignments');
echo get_string('roleassignments', 'role').": ".$count;
echo "<input type=\"hidden\" name=\"roleassignments\" value=\"$count\" />\n";
$count = count_records('user_students');
echo get_string("enrolments").": ".$count;
echo "<input type=\"hidden\" name=\"enrolments\" value=\"$count\">\n";
echo '<br />';
// first find all distinct roles with mod/course:update
// please change the name and strings to something appropriate to reflect the new data collected
$sql = "SELECT COUNT(DISTINCT u.id)
FROM {$CFG->prefix}role_capabilities rc,
{$CFG->prefix}role_assignments ra,
{$CFG->prefix}user u
WHERE (rc.capability = 'moodle/course:update' or rc.capability='moodle/site:doanything')
AND rc.roleid = ra.roleid
AND u.id = ra.userid";
$count = count_records_sql($sql);
$count = count_records('user_teachers');
echo get_string("teachers").": ".$count;
echo "<input type=\"hidden\" name=\"courseupdaters\" value=\"$count\" />\n";
echo "<input type=\"hidden\" name=\"teachers\" value=\"$count\">\n";
echo '<br />';
$count = count_records('forum_posts');
echo get_string("posts", 'forum').": ".$count;
echo "<input type=\"hidden\" name=\"posts\" value=\"$count\" />\n";
echo "<input type=\"hidden\" name=\"posts\" value=\"$count\">\n";
echo '<br />';
$count = count_records('question');
$count = count_records('quiz_questions');
echo get_string("questions", 'quiz').": ".$count;
echo "<input type=\"hidden\" name=\"questions\" value=\"$count\" />\n";
echo "<input type=\"hidden\" name=\"questions\" value=\"$count\">\n";
echo '<br />';
$count = count_records('resource');
echo get_string("modulenameplural", "resource").": ".$count;
echo "<input type=\"hidden\" name=\"resources\" value=\"$count\" />\n";
echo '</div>';
echo '</div>';
echo "<input type=\"hidden\" name=\"resources\" value=\"$count\">\n";
echo '<br />';
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="adminname">'.get_string("administrator").'</label></div>';
echo '<div class="felement ftext">';
echo "<input size=\"50\" type=\"text\" id=\"adminname\" name=\"adminname\" value=\"".fullname($admin, true)."\" />";
echo '</div>';
echo '</div>';
echo "</td>\n";
echo "</tr>\n";
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="adminemail">'.get_string("email").'</label></div>';
echo '<div class="felement ftext">';
echo "<input size=\"50\" type=\"text\" id=\"adminemail\" name=\"adminemail\" value=\"$admin->email\" />";
echo '</div>';
echo '</div>';
echo "<tr valign=\"top\">\n";
echo "<td align=\"center\" colspan=\"2\"><hr size=\"1\" noshade>".get_string("administrator")."</td>\n";
echo "</tr>\n";
echo '<div class="fitem">';
echo '<div class="fitemtitle"><label for="menumailme">'.get_string("registrationemail").'</label></div>';
echo '<div class="felement ftext">';
echo "<tr valign=\"top\">\n";
echo "<td align=\"right\">".get_string("administrator").":</td>\n";
echo "<td><input size=\"50\" type=\"text\" name=\"adminname\" value=\"".fullname($admin, true)."\"></td>\n";
echo "</tr>\n";
echo "<tr valign=\"top\">\n";
echo "<td align=\"right\">".get_string("email").":</td>\n";
echo "<td><input size=\"50\" type=\"text\" name=\"adminemail\" value=\"$admin->email\"></td>\n";
echo "</tr>\n";
echo "<tr valign=\"top\">\n";
echo "<td align=\"right\">".get_string("registrationemail")."</a>:</td>\n";
echo "<td>\n";
$options[0] = get_string("registrationno");
$options[1] = get_string("registrationyes");
choose_from_menu ($options, "mailme", "1", "", "", "");
unset($options);
echo '</div>';
echo '</div>';
echo "</td>\n";
echo "</tr>\n";
echo '<div class="felement fsubmit"><input name="submitbutton" value="'.get_string('registrationsend').'" type="submit" id="id_submitbutton" /></div>';
echo "<tr valign=\"top\">\n";
echo "<td align=\"right\">&nbsp;</td>\n";
echo "<td><input type=\"submit\" value=\"".get_string("registrationsend")."\"></td>\n";
echo "</tr>\n";
echo "</fieldset>\n";
echo "</table>\n";
echo "</form>\n";
print_simple_box_end();
echo "<br />\n";
print_footer();
?>
+32 -45
View File
@@ -1,71 +1,58 @@
<?php /// $Id$
/// Search and replace strings throughout all texts in the whole database
require_once('../config.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->libdir.'/adminlib.php');
require('../config.php');
// workaround for problems with compression
if (ini_get('zlib.output_compression')) {
@ini_set('zlib.output_compression', 'Off');
$search = optional_param('search', '');
$replace = optional_param('replace', '');
require_login();
if (!isadmin()) {
error("Admins only");
}
admin_externalpage_setup('replace');
$search = optional_param('search', '', PARAM_RAW);
$replace = optional_param('replace', '', PARAM_RAW);
###################################################################
admin_externalpage_print_header();
print_heading('Search and replace text throughout the whole database');
print_header('Search and replace throughout the whole database', 'Replace text within the whole database');
if (!data_submitted() or !$search or !$replace or !confirm_sesskey()) { /// Print a form
if (!$search or !$replace or !confirm_sesskey()) { /// Print a form
print_simple_box_start('center');
echo '<div class="mdl-align">';
echo '<form action="replace.php" method="post">';
echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
echo 'Search whole database for: <input type="text" name="search" /><br />';
echo 'Replace with this string: <input type="text" name="replace" /><br />';
echo '<input type="submit" value="Yes, do it now" /><br />';
echo '<div align="center">';
echo '<form action="replace.php">';
echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'">';
echo 'Search whole database for: <input type="text" name="search"><br />';
echo 'Replace with this string: <input type="text" name="replace"><br /></br />';
echo '<input type="submit" value="Yes, do it now"><br />';
echo '</form>';
echo '</div>';
print_simple_box_end();
admin_externalpage_print_footer();
die;
}
print_simple_box_start('center');
if (!db_replace($search, $replace)) {
error('An error has occured during this process');
if (!$tables = $db->Metatables() ) { // No tables yet at all.
error("no tables");
}
print_simple_box_end();
/// Try to replace some well-known serialised contents (html blocks)
notify('Replacing in html blocks...');
$sql = "SELECT bi.*
FROM {$CFG->prefix}block_instance bi
JOIN {$CFG->prefix}block b ON b.id = bi.blockid
WHERE b.name = 'html'";
if ($instances = get_records_sql($sql)) {
foreach ($instances as $instance) {
$blockobject = block_instance('html', $instance);
$blockobject->config->text = str_replace($search, $replace, $blockobject->config->text);
$blockobject->instance_config_commit($blockobject->pinned);
print_simple_box_start('center');
foreach ($tables as $table) {
if (in_array($table, array($CFG->prefix.'config'))) { // Don't process these
continue;
}
if ($columns = $db->MetaColumns($table, false)) {
foreach ($columns as $column => $data) {
if (in_array($data->type, array('text','mediumtext','longtext','varchar'))) { // Text stuff only
$db->debug = true;
execute_sql("UPDATE {$CFG->prefix}$table SET $column = REPLACE($column, '$search', '$replace');");
$db->debug = false;
}
}
}
}
/// Rebuild course cache which might be incorrect now
notify('Rebuilding course cache...');
rebuild_course_cache();
notify('...finished');
print_simple_box_end();
print_continue('index.php');
admin_externalpage_print_footer();
?>
-135
View File
@@ -1,135 +0,0 @@
<?php // $Id$
// index.php - scheduled backup logs
require_once('../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot.'/backup/lib.php');
$courseid = optional_param('courseid', 0, PARAM_INT);
admin_externalpage_setup('reportbackups');
admin_externalpage_print_header();
/// Scheduled backups are disabled by the server admin
if (!empty($CFG->disablescheduledbackups)) {
print_error('scheduledbackupsdisabled', '', '', NULL, true);
}
/// Scheduled backups aren't active by the site admin
$backup_config = backup_get_config();
if (empty($backup_config->backup_sche_active)) {
notify(get_string('scheduledbackupsinactive'));
}
/// Get needed strings
$backuploglaststatus = get_string("backuploglaststatus");
$backuplogdetailed = get_string("backuplogdetailed");
$stradmin = get_string("administration");
$strconfiguration = get_string("configuration");
$strbackup = get_string("backup");
$strbackupdetails = get_string("backupdetails");
$strlogs = get_string("logs");
$strftimedatetime = get_string("strftimerecent");
$strftimetime = get_string("strftimetime").":%S";
$strerror = get_string("error");
$strok = get_string("ok");
$strunfinished = get_string("unfinished");
$strskipped = get_string("skipped");
$strcourse = get_string("course");
$strtimetaken = get_string("timetaken","quiz");
$strstatus = get_string("status");
$strnext = get_string("backupnext");
/// Decide when to show last execution logs or detailed logs
/// Lastlog view
if (!$courseid) {
print_heading($backuploglaststatus);
print_simple_box_start('center');
/// Now, get every record from backup_courses
$courses = get_records("backup_courses");
if (!$courses) {
notify(get_string('nologsfound'));
} else {
echo "<table border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"3\">";
//Print table header
echo "<tr>";
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"3\">$strcourse</font></td>";
echo "<td nowrap=\"nowrap\" align=\"center\" colspan=\"3\"><font size=\"3\">$strtimetaken</font></td>";
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"3\">$strstatus</font></td>";
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"3\">$strnext</font></td></tr>";
foreach ($courses as $course) {
/// Get the course shortname
$coursename = get_field ("course","fullname","id",$course->courseid);
if ($coursename) {
echo "<tr>";
echo "<td nowrap=\"nowrap\"><font size=\"2\"><a href=\"index.php?courseid=$course->courseid\">".$coursename."</a></font></td>";
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($course->laststarttime,$strftimedatetime)."</font></td>";
echo "<td nowrap=\"nowrap\"><font size=\"2\"> - </font></td>";
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($course->lastendtime,$strftimedatetime)."</font></td>";
if ($course->laststatus == 1) {
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"green\">".$strok."</font></td>";
} else if ($course->laststatus == 2) {
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"red\">".$strunfinished."</font></td>";
} else if ($course->laststatus == 3) {
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"green\">".$strskipped."</font></td>";
} else {
echo "<td nowrap=\"nowrap\" align=\"center\"><font size=\"2\" color=\"red\">".$strerror."</font></td>";
}
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($course->nextstarttime,$strftimedatetime)."</font></td>";
echo "</tr>";
}
}
echo "</table>";
}
print_simple_box_end();
/// Detailed View !!
} else {
print_heading($backuplogdetailed);
$coursename = get_field("course","fullname","id","$courseid");
print_heading("$strcourse: $coursename");
print_simple_box_start('center');
/// First, me get all the distinct backups for that course in backup_log
$executions = get_records_sql("SELECT DISTINCT laststarttime,laststarttime
FROM {$CFG->prefix}backup_log
WHERE courseid = '$courseid'
ORDER BY laststarttime DESC");
/// Iterate over backup executions
if (!$executions) {
notify(get_string('nologsfound'));
} else {
echo "<table border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"3\">";
foreach($executions as $execution) {
echo "<tr>";
echo "<td nowrap=\"nowrap\" align=\"center\" colspan=\"3\">";
print_simple_box("<center>".userdate($execution->laststarttime)."</center>", "center");
echo "</td>";
echo "</tr>";
$logs = get_records_sql("SELECT *
FROM {$CFG->prefix}backup_log
WHERE courseid = '$courseid' AND
laststarttime = '$execution->laststarttime'
ORDER BY id");
if ($logs) {
foreach ($logs as $log) {
echo "<tr>";
echo "<td nowrap=\"nowrap\"><font size=\"2\">".userdate($log->time,$strftimetime)."</font></td>";
$log->info = str_replace("- ERROR!!","- <font color=\"red\">ERROR!!</font>",$log->info);
$log->info = str_replace("- OK","- <font color=\"green\">OK</font>",$log->info);
echo "<td nowrap=\"nowrap\"><font size=\"2\">".str_replace(" ","&nbsp;&nbsp;&nbsp;&nbsp;",$log->info)."</font></td>";
echo "</tr>";
}
}
}
echo "</table>";
}
print_simple_box_end();
}
print_footer();
?>
-3
View File
@@ -1,3 +0,0 @@
<?php // $Id$
$ADMIN->add('reports', new admin_externalpage('reportbackups', get_string('backups', 'admin'), "$CFG->wwwroot/$CFG->admin/report/backups/index.php",'moodle/site:backup'));
?>
-42
View File
@@ -1,42 +0,0 @@
<?php // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
$report_courseoverview_capabilities = array(
'report/courseoverview:view' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:viewreports',
)
);
?>
-120
View File
@@ -1,120 +0,0 @@
<?php
require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/statslib.php');
require_once($CFG->libdir.'/adminlib.php');
$report = optional_param('report', STATS_REPORT_ACTIVE_COURSES, PARAM_INT);
$time = optional_param('time', 0, PARAM_INT);
$numcourses = optional_param('numcourses', 20, PARAM_INT);
admin_externalpage_setup('reportcourseoverview');
admin_externalpage_print_header();
if (empty($CFG->enablestats)) {
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3);
} else {
error("Stats is not enabled.");
}
}
$course = get_site();
stats_check_uptodate($course->id);
$strreports = get_string('reports');
$strcourseoverview = get_string('courseoverview');
$reportoptions = stats_get_report_options($course->id,STATS_MODE_RANKED);
$tableprefix = $CFG->prefix.'stats_';
$earliestday = get_field_sql('SELECT timeend FROM '.$tableprefix.'daily ORDER BY timeend');
$earliestweek = get_field_sql('SELECT timeend FROM '.$tableprefix.'weekly ORDER BY timeend');
$earliestmonth = get_field_sql('SELECT timeend FROM '.$tableprefix.'monthly ORDER BY timeend');
if (empty($earliestday)) $earliestday = time();
if (empty($earliestweek)) $earliestweek = time();
if (empty($earliestmonth)) $earliestmonth = time();
$now = stats_get_base_daily();
$lastweekend = stats_get_base_weekly();
$lastmonthend = stats_get_base_monthly();
$timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth);
if (empty($timeoptions)) {
print_error('nostatstodisplay', "", $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
echo '<form action="index.php" method="post">'."\n";
echo '<div>';
$table->width = '*';
$table->align = array('left','left','left','left','left','left');
$table->data[] = array(get_string('statsreporttype'),choose_from_menu($reportoptions,'report',$report,'','','',true),
get_string('statstimeperiod'),choose_from_menu($timeoptions,'time',$time,'','','',true),
'<input type="text" name="numcourses" size="3" maxlength="2" value="'.$numcourses.'" />',
'<input type="submit" value="'.get_string('view').'" />') ;
print_table($table);
echo '</div>';
echo '</form>';
print_heading($reportoptions[$report]);
if (!empty($report) && !empty($time)) {
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
if (!empty($param->sql)) {
$sql = $param->sql;
} else {
$sql = "SELECT courseid,".$param->fields." FROM ".$CFG->prefix.'stats_'.$param->table
." WHERE timeend >= $param->timeafter AND stattype = 'activity' AND roleid = 0"
." GROUP BY courseid "
.$param->extras
." ORDER BY ".$param->orderby;
}
error_log($sql);
$courses = get_records_sql($sql, 0, $numcourses);
if (empty($courses)) {
notify(get_string('statsnodata'));echo '</td></tr></table>';echo '<p>after notify</p>';
} else {
if (empty($CFG->gdversion)) {
echo '<div class="graph">(' . get_string("gdneed") .')</div>';
} else {
echo '<div class="graph"><img alt="'.get_string('courseoverviewgraph').'" src="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></div>';
}
$table = new StdClass;
$table->align = array('left','center','center','center');
$table->head = array(get_string('course'),$param->line1);
if (!empty($param->line2)) {
$table->head[] = $param->line2;
}
if (!empty($param->line3)) {
$table->head[] = $param->line3;
}
foreach ($courses as $c) {
$a = array();
$a[] = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$c->courseid.'">'.get_field('course','shortname','id',$c->courseid).'</a>';
$a[] = $c->line1;
if (isset($c->line2)) {
$a[] = $c->line2;
}
if (isset($c->line3)) {
$a[] = round($c->line3,2);
}
$table->data[] = $a;
}
print_table($table);
}
}
admin_externalpage_print_footer();
?>
@@ -1,57 +0,0 @@
<?php // $Id$
require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/statslib.php');
require_once($CFG->dirroot.'/lib/graphlib.php');
$report = required_param('report', PARAM_INT);
$time = required_param('time', PARAM_INT);
$numcourses = required_param('numcourses', PARAM_INT);
require_login();
require_capability('report/courseoverview:view', get_context_instance(CONTEXT_SYSTEM));
stats_check_uptodate();
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
if (!empty($param->sql)) {
$sql = $param->sql;
} else {
$sql = "SELECT courseid,".$param->fields." FROM ".$CFG->prefix.'stats_'.$param->table
." WHERE timeend >= $param->timeafter AND stattype = 'activity' AND roleid = 0"
." GROUP BY courseid "
.$param->extras
." ORDER BY ".$param->orderby;
}
$courses = get_records_sql($sql, 0, $numcourses);
if (empty($courses)) {
print_error('statsnodata', "", $CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/index.php');
}
$graph = new graph(750,400);
$graph->parameter['legend'] = 'outside-right';
$graph->parameter['legend_size'] = 10;
$graph->parameter['x_axis_angle'] = 90;
$graph->parameter['title'] = false; // moodle will do a nicer job.
$graph->y_tick_labels = null;
$graph->offset_relation = null;
if ($report != STATS_REPORT_ACTIVE_COURSES) {
$graph->parameter['y_decimal_left'] = 2;
}
foreach ($courses as $c) {
$graph->x_data[] = get_field('course','shortname','id',$c->courseid);
$graph->y_data['bar1'][] = $c->{$param->graphline};
}
$graph->y_order = array('bar1');
$graph->y_format['bar1'] = array('colour' => 'blue','bar' => 'fill','legend' => $param->{$param->graphline});
$graph->draw_stack();
?>
-3
View File
@@ -1,3 +0,0 @@
<?php // $Id$
$ADMIN->add('reports', new admin_externalpage('reportcourseoverview', get_string('courseoverview', 'admin'), "$CFG->wwwroot/$CFG->admin/report/courseoverview/index.php",'report/courseoverview:view'));
?>
-29
View File
@@ -1,29 +0,0 @@
<?PHP // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
$plugin->version = 2007101503;
$plugin->requires = 2007101532;
?>
-5
View File
@@ -1,5 +0,0 @@
<?php // $Id$
// just a link to course report
$ADMIN->add('reports', new admin_externalpage('reportlog', get_string('log', 'admin'), "$CFG->wwwroot/course/report/log/index.php?id=".SITEID, 'coursereport/log:view'));
$ADMIN->add('reports', new admin_externalpage('reportloglive', get_string('loglive', 'coursereport_log'), "$CFG->wwwroot/course/report/log/indexlive.php?id=".SITEID, 'coursereport/log:viewlive'));
?>
-73
View File
@@ -1,73 +0,0 @@
<?php // $Id$
require_once('../../../config.php');
require_once($CFG->dirroot.'/question/upgrade.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('reportquestion');
admin_externalpage_print_header();
print_heading(get_string('adminreport', 'question'));
$probstr = '';
$contextupgradeversion = 2007081000;
if ($CFG->version < $contextupgradeversion){
///cwrqpfs issue
$probstr = print_heading(get_string('cwrqpfs', 'question'), '', 3, 'main', true);
if ($updates = question_cwqpfs_to_update()){
$probstr .=get_string('cwrqpfsinfo', 'question');
$probstr .= '<ul>';
$catlist = join(array_keys($updates), ',');
//get info about cateogries and no of questions used outside category's course
$categories = get_records_sql('SELECT qc.*, c.fullname as coursename FROM '.$CFG->prefix.'question_categories as qc, '
.$CFG->prefix.'course as c WHERE qc.course = c.id AND qc.id IN ('.$catlist.')');
foreach ($updates as $id => $publish){
$categories[$id]->caturl = "$CFG->wwwroot/question/category.php?sesskey=".sesskey().
"&amp;edit=$id&amp;courseid=".$categories[$id]->course;
if ($categories[$id]->publish){
$categories[$id]->changefrom = get_string('published', 'question');
$categories[$id]->changeto = get_string('unpublished', 'question');
} else {
$categories[$id]->changefrom = get_string('unpublished', 'question');
$categories[$id]->changeto = get_string('published', 'question');
}
$probstr .= '<li>'.get_string('changepublishstatuscat', 'question', $categories[$id]);
if ($questions = get_records_sql('SELECT q.*, qui.id as quizid, qui.name as quizname, cm.id as cmid, '
.'qui.course, c.fullname as coursename FROM '.$CFG->prefix.'question q, '
.$CFG->prefix.'quiz_question_instances qqi, '
.$CFG->prefix.'quiz qui, '
.$CFG->prefix.'course_modules cm, '
.$CFG->prefix.'modules m, '
.$CFG->prefix.'course c '
.'WHERE (q.category = '.$id.' AND qqi.question = q.id '
.'AND qqi.quiz = qui.id '
.'AND qui.course = c.id '
.'AND cm.instance = qui.id '
.'AND cm.module = m.id '
.'AND m.name = \'quiz\''
.'AND ('.$categories[$id]->course.' <> qui.course)) ORDER BY qui.id ASC')){
$probstr .= '<ul>';
foreach ($questions as $question){
$question->quizurl = "$CFG->wwwroot/mod/quiz/edit.php?cmid=".$question->cmid;
$question->qurl = "$CFG->wwwroot/question/question.php?cmid={$question->cmid}&amp;id={$question->id}&amp;returnurl=".urlencode($FULLME);
$probstr .= '<li>'.get_string('questionaffected', 'question', $question).'</li>';
}
$probstr .= '</ul>';
}
$probstr .= '</li>';
}
$probstr .= '</ul>';
} else {
$probstr .=('<p>'.get_string('cwrqpfsnoprob', 'question').'</p>');
}
}
if ($probstr) {
print_box($probstr);
} else {
print_box(get_string('noprobs', 'question'), 'boxwidthnarrow boxaligncenter generalbox');
}
admin_externalpage_print_footer();
?>
-3
View File
@@ -1,3 +0,0 @@
<?php // $Id$
$ADMIN->add('reports', new admin_externalpage('reportquestion', get_string('question', 'admin'), "$CFG->wwwroot/$CFG->admin/report/question/index.php", 'moodle/site:config'));
?>
-36
View File
@@ -1,36 +0,0 @@
<?php // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
$report_security_capabilities = array(
'report/security:view' => array(
'riskbitmask' => RISK_CONFIG,
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
'admin' => CAP_ALLOW
),
)
);
-127
View File
@@ -1,127 +0,0 @@
<?php //$Id$
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.org //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
require_once('../../../config.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/report/security/lib.php');
require_once($CFG->libdir.'/adminlib.php');
require_login();
$issue = optional_param('issue', '', PARAM_FILE); // show detailed info about one issue only
$issues = report_security_get_issue_list();
// test if issue valid string
if (array_search($issue, $issues, true) === false) {
$issue = '';
}
// we may need a bit more memory and this may take a long time to process
@raise_memory_limit('128M');
@set_time_limit(0);
// Print the header.
admin_externalpage_setup('reportsecurity');
admin_externalpage_print_header();
print_heading(get_string('reportsecurity', 'report_security'));
echo '<div id="timewarning">'.get_string('timewarning', 'report_security').'</div>';
while(@ob_end_flush());
@flush();
$strok = '<span class="statusok">'.get_string('statusok', 'report_security').'</span>';
$strinfo = '<span class="statusinfo">'.get_string('statusinfo', 'report_security').'</span>';
$strwarning = '<span class="statuswarning">'.get_string('statuswarning', 'report_security').'</span>';
$strserious = '<span class="statusserious">'.get_string('statusserious', 'report_security').'</span>';
$strcritical = '<span class="statuscritical">'.get_string('statuscritical', 'report_security').'</span>';
$strissue = get_string('issue', 'report_security');
$strstatus = get_string('status', 'report_security');
$strdesc = get_string('description', 'report_security');
$strconfig = get_string('configuration', 'report_security');
$statusarr = array(REPORT_SECURITY_OK => $strok,
REPORT_SECURITY_INFO => $strinfo,
REPORT_SECURITY_WARNING => $strwarning,
REPORT_SECURITY_SERIOUS => $strserious,
REPORT_SECURITY_CRITICAL => $strcritical);
$url = "$CFG->wwwroot/$CFG->admin/report/security/index.php";
if ($issue and ($result = $issue(true))) {
report_security_hide_timearning();
$table = new object();
$table->head = array($strissue, $strstatus, $strdesc, $strconfig);
$table->size = array('30%', '10%', '50%', '10%' );
$table->align = array('left', 'left', 'left', 'left');
$table->width = '90%';
$table->data = array();
// print detail of one issue only
$row = array();
$row[0] = report_security_doc_link($issue, $result->name);
$row[1] = $statusarr[$result->status];
$row[2] = $result->info;
$row[3] = is_null($result->link) ? '&nbsp;' : $result->link;
$CFG->pagepath = "report/security/$issue"; // help link in footer
$table->data[] = $row;
print_table($table);
print_box($result->details, 'generalbox boxwidthnormal boxaligncenter'); // TODO: add proper css
print_continue($url);
} else {
report_security_hide_timearning();
$table = new object();
$table->head = array($strissue, $strstatus, $strdesc);
$table->size = array('30%', '10%', '60%' );
$table->align = array('left', 'left', 'left');
$table->width = '90%';
$table->data = array();
foreach ($issues as $issue) {
$result = $issue(false);
if (!$result) {
// ignore this test
continue;
}
$row = array();
$row[0] = "<a href='$url?issue=$result->issue'>$result->name</a>";
$row[1] = $statusarr[$result->status];
$row[2] = $result->info;
$table->data[] = $row;
}
print_table($table);
}
print_footer();
File diff suppressed because it is too large Load Diff
-3
View File
@@ -1,3 +0,0 @@
<?php //$Id$
$ADMIN->add('reports', new admin_externalpage('reportsecurity', get_string('reportsecurity', 'report_security'), "$CFG->wwwroot/$CFG->admin/report/security/index.php",'report/security:view'));
-29
View File
@@ -1,29 +0,0 @@
<?PHP // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
$plugin->version = 2007101500;
$plugin->requires = 2007101533;
?>
-373
View File
@@ -1,373 +0,0 @@
<?php
/**
* Spam Cleaner
*
* Helps an admin to clean up spam in Moodle
*
* @version $Id$
* @authors Dongsheng Cai, Martin Dougiamas, Amr Hourani
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/
// Configuration
// List of known spammy keywords, please add more here
$autokeywords = array(
"<img",
"fuck",
"casino",
"porn",
"xxx",
"cialis",
"viagra",
"poker",
"warcraft"
);
/////////////////////////////////////////////////////////////////////////////////
require_once('../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_js(array('yui_dom-event', 'yui_connection', 'yui_json'));
$keyword = optional_param('keyword', '', PARAM_RAW);
$autodetect = optional_param('autodetect', '', PARAM_RAW);
$del = optional_param('del', '', PARAM_RAW);
$delall = optional_param('delall', '', PARAM_RAW);
$ignore = optional_param('ignore', '', PARAM_RAW);
$reset = optional_param('reset', '', PARAM_RAW);
$id = optional_param('id', '', PARAM_INT);
require_login();
admin_externalpage_setup('reportspamcleaner');
// Implement some AJAX calls
// Delete one user
if (!empty($del) && confirm_sesskey() && ($id != $USER->id)) {
if (isset($SESSION->users_result[$id])) {
$user = $SESSION->users_result[$id];
if (delete_user($user)) {
unset($SESSION->users_result[$id]);
echo json_encode(true);
} else {
echo json_encode(false);
}
} else {
echo json_encode(false);
}
exit;
}
// Delete lots of users
if (!empty($delall) && confirm_sesskey()) {
if (!empty($SESSION->users_result)) {
foreach ($SESSION->users_result as $userid => $user) {
if ($userid != $USER->id) {
if (delete_user($user)) {
unset($SESSION->users_result[$userid]);
}
}
}
}
echo json_encode(true);
exit;
}
if (!empty($ignore)) {
unset($SESSION->users_result[$id]);
echo json_encode(true);
exit;
}
admin_externalpage_print_header();
// Print headers and things
print_spamcleaner_javascript();
print_box(get_string('spamcleanerintro', 'report_spamcleaner'));
print_box_start(); // The forms section at the top
?>
<div class="mdl-align">
<form method="post" action="index.php">
<div>
<input type="text" name="keyword" id="keyword_el" value="<?php p($keyword) ?>" />
<input type="hidden" name="sesskey" value="<?php echo sesskey();?>" />
<input type="submit" value="<?php echo get_string('spamsearch', 'report_spamcleaner')?>" />
</div>
</form>
<p><?php echo get_string('spameg', 'report_spamcleaner');?></p>
<hr />
<form method="post" action="index.php">
<div>
<input type="submit" name="autodetect" value="<?php echo get_string('spamauto', 'report_spamcleaner');?>" />
</div>
</form>
</div>
<?php
print_box_end();
echo '<div id="result" class="mdl-align">';
// Print list of resulting profiles
if (!empty($keyword)) { // Use the keyword(s) supplied by the user
$keywords = explode(',', $keyword);
foreach ($keywords as $key => $keyword) {
$keywords[$key] = trim($keyword);
}
search_spammers($keywords);
} else if (!empty($autodetect)) { // Use the inbuilt keyword list to detect users
search_spammers($autokeywords);
}
echo '</div>';
/////////////////////////////////////////////////////////////////////////////////
/// Functions
function search_spammers($keywords) {
global $CFG, $USER;
if (!is_array($keywords)) {
$keywords = array($keywords); // Make it into an array
}
$like = sql_ilike();
$keywordfull = array();
foreach ($keywords as $keyword) {
$keyword = addslashes($keyword); // Just to be safe
$keywordfull[] = " description $like '%$keyword%' ";
$keywordfull2[] = " p.summary $like '%$keyword%' ";
}
$conditions = '( '.implode(' OR ', $keywordfull).' )';
$conditions2 = '( '.implode(' OR ', $keywordfull2).' )';
$sql = "SELECT * FROM {$CFG->prefix}user WHERE deleted = 0 AND id <> {$USER->id} AND $conditions"; // Exclude oneself
$sql2= "SELECT u.*, p.summary FROM {$CFG->prefix}user AS u, {$CFG->prefix}post AS p WHERE $conditions2 AND u.deleted = 0 AND u.id=p.userid AND u.id <> {$USER->id}";
$spamusers_desc = get_recordset_sql($sql);
$spamusers_blog = get_recordset_sql($sql2);
$keywordlist = implode(', ', $keywords);
print_box(get_string('spamresult', 'report_spamcleaner').s($keywordlist)).' ...';
print_user_list(array($spamusers_desc, $spamusers_blog), $keywords);
}
function print_user_list($users_rs, $keywords) {
global $CFG, $SESSION;
// reset session everytime this function is called
$SESSION->users_result = array();
$count = 0;
foreach ($users_rs as $rs) {
while ($user = rs_fetch_next_record($rs)) {
if (!$count) {
echo '<table border="1" width="100%" id="data-grid"><tr><th>&nbsp;</th><th>'.get_string('user','admin').'</th><th>'.get_string('spamdesc', 'report_spamcleaner').'</th><th>'.get_string('spamoperation', 'report_spamcleaner').'</th></tr>';
}
$count++;
filter_user($user, $keywords, $count);
}
}
if (!$count) {
echo get_string('spamcannotfinduser', 'report_spamcleaner');
} else {
echo '</table>';
echo '<div class="mld-align">
<button id="removeall_btn">'.get_string('spamdeleteall', 'report_spamcleaner').'</button>
</div>';
}
}
function filter_user($user, $keywords, $count) {
global $CFG;
$image_search = false;
if (in_array('<img', $keywords)) {
$image_search = true;
}
if (isset($user->summary)) {
$user->description = '<h3>'.get_string('spamfromblog', 'report_spamcleaner').'</h3>'.$user->summary;
unset($user->summary);
}
if (preg_match('#<img.*src=[\"\']('.$CFG->pixpath.')#', $user->description, $matches)
&& $image_search) {
$result = false;
foreach ($keywords as $keyword) {
if (preg_match('#'.$keyword.'#', $user->description)
&& ($keyword != '<img')) {
$result = true;
}
}
if ($result) {
echo print_user_entry($user, $keywords, $count);
} else {
unset($user);
}
} else {
echo print_user_entry($user, $keywords, $count);
}
}
function print_user_entry($user, $keywords, $count) {
global $SESSION, $CFG;
$smalluserobject = new object; // All we need to delete them later
$smalluserobject->id = $user->id;
$smalluserobject->email = $user->email;
$smalluserobject->auth = $user->auth;
$smalluserobject->firstname = $user->firstname;
$smalluserobject->lastname = $user->lastname;
if (empty($SESSION->users_result[$user->id])) {
$SESSION->users_result[$user->id] = $smalluserobject;
$html = '<tr valign="top" id="row-'.$user->id.'" class="result-row">';
$html .= '<td width="10">'.$count.'</td>';
$html .= '<td width="30%" align="left"><a href="'.$CFG->wwwroot."/user/view.php?course=1&amp;id=".$user->id.'" title="'.s($user->username).'">'.fullname($user).'</a>';
$html .= "<ul>";
$profile_set = array('city'=>true, 'country'=>true, 'email'=>true);
foreach ($profile_set as $key=>$value) {
if (isset($user->$key)){
$html .= '<li>'.$user->$key.'</li>';
}
}
$html .= "</ul>";
$html .= '</td>';
foreach ($keywords as $keyword) {
$user->description = highlight($keyword, $user->description);
}
$html .= '<td align="left">'.format_text($user->description, FORMAT_MOODLE).'</td>';
$html .= '<td width="100px" align="center">';
$html .= '<button onclick="del_user(this,'.$user->id.')">'.get_string('deleteuser', 'admin').'</button><br />';
$html .= '<button onclick="ignore_user(this,'.$user->id.')">'.get_string('ignore', 'admin').'</button>';
$html .= '</td>';
$html .= '</tr>';
return $html;
} else {
return null;
}
}
function print_spamcleaner_javascript() {
$sesskey = sesskey();
?>
<script type="text/javascript">
//<![CDATA[
var row = null;
var delall_cb = {
success: function(o){
try {
var resp = YAHOO.lang.JSON.parse(o.responseText);
} catch(e) {
alert('<?php echo get_string('spaminvalidresult', 'report_spamcleaner');?>');
return;
}
if(resp == true){
window.location.href=window.location.href;
}
}
}
function init() {
YAHOO.util.Event.addListener("removeall_btn", "click", function(){
var yes = confirm('<?php echo get_string('spamdeleteallconfirm', 'report_spamcleaner');?>');
if(yes){
var cObj = YAHOO.util.Connect.asyncRequest('POST', '<?php echo me();?>?delall=yes&sesskey=<?php echo $sesskey;?>', delall_cb);
}
});
}
var del_cb = {
success: function(o) {
try {
var resp = YAHOO.lang.JSON.parse(o.responseText);
} catch(e) {
alert('<?php echo get_string('spaminvalidresult', 'report_spamcleaner');?>');
return;
}
if(row) {
if(resp == true){
while(row.tagName != 'TR') {
row = row.parentNode;
}
row.parentNode.removeChild(row);
row = null;
} else {
alert('<?php echo get_string('spamcannotdelete', 'report_spamcleaner');?>');
}
}
}
}
var ignore_cb = {
success: function(o){
try {
var resp = YAHOO.lang.JSON.parse(o.responseText);
} catch(e) {
alert('<?php echo get_string('spaminvalidresult', 'report_spamcleaner');?>');
return;
}
if(row) {
if(resp == true){
while(row.tagName != 'TR') {
row = row.parentNode;
}
row.parentNode.removeChild(row);
row = null;
}
}
}
}
function del_user(obj, id) {
var yes = confirm('<?php echo get_string('spamdeleteconfirm', 'report_spamcleaner');?>');
if(yes){
row = obj;
var cObj = YAHOO.util.Connect.asyncRequest('POST', '<?php echo me();?>?del=yes&sesskey=<?php echo $sesskey;?>&id='+id, del_cb);
}
}
function ignore_user(obj, id) {
row = obj;
var cObj = YAHOO.util.Connect.asyncRequest('POST', '<?php echo me();?>?ignore=yes&sesskey=<?php echo $sesskey;?>&id='+id, ignore_cb);
}
YAHOO.util.Event.onDOMReady(init);
//]]>
</script>
<?php
}
admin_externalpage_print_footer();
?>
-5
View File
@@ -1,5 +0,0 @@
<?php
// spam cleaner
$ADMIN->add('reports', new admin_externalpage('reportspamcleaner', get_string('spamcleaner','report_spamcleaner'), "$CFG->wwwroot/$CFG->admin/report/spamcleaner/index.php", 'moodle/site:config'));
-4
View File
@@ -1,4 +0,0 @@
<?php // $Id$
// just a link to course report
$ADMIN->add('reports', new admin_externalpage('reportstats', get_string('stats', 'admin'), "$CFG->wwwroot/course/report/stats/index.php", 'coursereport/stats:view'));
?>
-40
View File
@@ -1,40 +0,0 @@
<?php // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
$report_unittest_capabilities = array(
'report/unittest:view' => array(
'riskbitmask' => RISK_DATALOSS,
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
'admin' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:config',
)
);
?>
-196
View File
@@ -1,196 +0,0 @@
<?php
/**
* A SimpleTest report format for Moodle.
*
* @copyright &copy; 2006 The Open University
* @author N.D.Freear@open.ac.uk, T.J.Hunt@open.ac.uk
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @version $Id$
* @package SimpleTestEx
*/
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
require_once($CFG->libdir . '/simpletestlib/reporter.php');
/**
* Extended in-browser test displayer. HtmlReporter generates
* only failure messages and a pass count. ExHtmlReporter also
* generates pass messages and a time-stamp.
*
* @package SimpleTestEx
*/
class ExHtmlReporter extends HtmlReporter {
// Options set when the class is created.
var $showpasses;
// Lang strings. Set in the constructor.
var $strrunonlyfolder;
var $strrunonlyfile;
var $strseparator;
/**
* Constructor.
*
* @param bool $showpasses Whether this reporter should output anything for passes.
*/
function ExHtmlReporter($showpasses) {
global $CFG, $THEME;
$this->HtmlReporter();
$this->showpasses = $showpasses;
$this->strrunonlyfolder = $this->get_string('runonlyfolder');
$this->strrunonlyfile = $this->get_string('runonlyfile');
$this->strseparator = get_separator();
}
/**
* Called when a pass needs to be output.
*/
function paintPass($message) {
//(Implicitly call grandparent, as parent not implemented.)
parent::paintPass($message);
if ($this->showpasses) {
$this->_paintPassFail('pass', $message);
}
}
/**
* Called when a fail needs to be output.
*/
function paintFail($message) {
// Explicitly call grandparent, not parent::paintFail.
SimpleScorer::paintFail($message);
$this->_paintPassFail('fail', $message);
}
/**
* Called when an error (uncaught exception or PHP error) needs to be output.
*/
function paintError($message) {
// Explicitly call grandparent, not parent::paintFail.
SimpleScorer::paintError($message);
$this->_paintPassFail('exception', $message);
}
/**
* Private method. Used by printPass/Fail/Error.
*/
function _paintPassFail($passorfail, $message) {
global $FULLME, $CFG;
print_simple_box_start('', '100%', '', 5, $passorfail . ' generalbox');
$url = $this->_htmlEntities($this->_stripParameterFromUrl($FULLME, 'path'));
echo '<b class="', $passorfail, '">', $this->get_string($passorfail), '</b>: ';
$breadcrumb = $this->getTestList();
array_shift($breadcrumb);
$file = array_shift($breadcrumb);
$pathbits = preg_split('/\/|\\\\/', substr($file, strlen($CFG->dirroot) + 1));
$file = array_pop($pathbits);
$folder = '';
foreach ($pathbits as $pathbit) {
$folder .= $pathbit . '/';
echo "<a href=\"{$url}path=$folder\" title=\"$this->strrunonlyfolder\">$pathbit</a>/";
}
echo "<a href=\"{$url}path=$folder$file\" title=\"$this->strrunonlyfile\">$file</a>";
echo $this->strseparator, implode($this->strseparator, $breadcrumb);
echo $this->strseparator, '<br />', $this->_htmlEntities($message), "\n\n";
print_simple_box_end();
flush();
}
/**
* Called when a notice needs to be output.
*/
function paintNotice($message) {
$this->paintMessage($this->_htmlEntities($message));
}
/**
* Paints a simple supplementary message.
* @param string $message Text to display.
*/
function paintMessage($message) {
if ($this->showpasses) {
print_simple_box_start('', '100%');
echo '<span class="notice">', $this->get_string('notice'), '</span>: ';
$breadcrumb = $this->getTestList();
array_shift($breadcrumb);
echo implode($this->strseparator, $breadcrumb);
echo $this->strseparator, '<br />', $message, "\n";
print_simple_box_end();
flush();
}
}
/**
* Output anything that should appear above all the test output.
*/
function paintHeader($test_name) {
// We do this the moodle way instead.
}
/**
* Output anything that should appear below all the test output, e.g. summary information.
*/
function paintFooter($test_name) {
$summarydata = new stdClass;
$summarydata->run = $this->getTestCaseProgress();
$summarydata->total = $this->getTestCaseCount();
$summarydata->passes = $this->getPassCount();
$summarydata->fails = $this->getFailCount();
$summarydata->exceptions = $this->getExceptionCount();
if ($summarydata->fails == 0 && $summarydata->exceptions == 0) {
$status = "passed";
} else {
$status = "failed";
}
echo '<div class="unittestsummary ', $status, '">';
echo $this->get_string('summary', $summarydata);
echo '</div>';
echo '<div class="performanceinfo">',
$this->get_string('runat', date('<b>d-m-Y H:i T</b>')),
$this->get_string('version', SimpleTestOptions::getVersion()),
'</div>';
}
/**
* Strip a specified parameter from the query string of a URL, if present.
* Adds a separator to the end of the URL, so that a new parameter
* can easily be appended. For example (assuming $param = 'frog'):
*
* http://example.com/index.php -> http://example.com/index.php?
* http://example.com/index.php?frog=1 -> http://example.com/index.php?
* http://example.com/index.php?toad=1 -> http://example.com/index.php?toad=1&
* http://example.com/index.php?frog=1&toad=1 -> http://example.com/index.php?toad=1&
*
* @param string $url the URL to modify.
* @param string $param the parameter to strip from the URL, if present.
*
* @return string The modified URL.
*/
function _stripParameterFromUrl($url, $param) {
$url = preg_replace('/(\?|&)' . $param . '=[^&]*&?/', '$1', $url);
if (strpos($url, '?') === false) {
$url = $url . '?';
} else {
$url = $url . '&';
}
return $url;
}
/**
* Look up a lang string in the appropriate file.
*/
function get_string($identifier, $a = NULL) {
return get_string($identifier, 'simpletest', $a);
}
}
?>
-210
View File
@@ -1,210 +0,0 @@
<?php
/**
* A SimpleTest GroupTest that automatically finds all the
* test files in a directory tree according to certain rules.
*
* @copyright &copy; 2006 The Open University
* @author N.D.Freear@open.ac.uk, T.J.Hunt@open.ac.uk
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @version $Id$
* @package SimpleTestEx
*/
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
require_once($CFG->libdir . '/simpletestlib/test_case.php');
/**
* This is a composite test class for finding test cases and
* other RunnableTest classes in a directory tree and combining
* them into a group test.
* @package SimpleTestEx
*/
class AutoGroupTest extends TestSuite {
var $thorough;
var $showsearch;
function AutoGroupTest($showsearch, $thorough, $test_name = null) {
$this->TestSuite($test_name);
$this->showsearch = $showsearch;
$this->thorough = $thorough;
}
function setLabel($test_name) {
//:HACK: there is no GroupTest::setLabel, so access parent::_label.
$this->_label = $test_name;
}
function addIgnoreFolder($ignorefolder) {
$this->ignorefolders[]=$ignorefolder;
}
function _recurseFolders($path) {
if ($this->showsearch) {
echo '<li>' . basename(realpath($path)) . '<ul>';
}
$files = scandir($path);
static $s_count = 0;
foreach ($files as $file) {
if ($file == '.' || $file == '..') {
continue;
}
$file_path = $path . '/' . $file;
if (is_dir($file_path)) {
if ($file != 'CVS' && $file != '.git' && !in_array($file_path, $this->ignorefolders)) {
$this->_recurseFolders($file_path);
}
} elseif (preg_match('/simpletest(\/|\\\\)test.*\.php$/', $file_path) ||
($this->thorough && preg_match('/simpletest(\/|\\\\)slowtest.*\.php$/', $file_path))) {
$s_count++;
// OK, found: this shows as a 'Notice' for any 'simpletest/test*.php' file.
$this->addTestCase(new FindFileNotice($file_path, 'Found unit test file, '. $s_count));
// addTestFile: Unfortunately this doesn't return fail/success (bool).
$this->addTestFile($file_path, true);
}
}
if ($this->showsearch) {
echo '</ul></li>';
}
return $s_count;
}
function findTestFiles($dir) {
if ($this->showsearch) {
echo '<p>Searching folder: ' . realpath($dir) . '</p><ul>';
}
$path = $dir;
$count = $this->_recurseFolders($path);
if ($count <= 0) {
$this->addTestCase(new BadAutoGroupTest($path, 'Search complete. No unit test files found'));
} else {
$this->addTestCase(new AutoGroupTestNotice($path, 'Search complete. Total unit test files found: '. $count));
}
if ($this->showsearch) {
echo '</ul>';
}
return $count;
}
function addTestFile($file, $internalcall = false) {
if ($this->showsearch) {
if ($internalcall) {
echo '<li><b>' . basename($file) . '</b></li>';
} else {
echo '<p>Adding test file: ' . realpath($file) . '</p>';
}
// Make sure that syntax errors show up suring the search, otherwise you often
// get blank screens because evil people turn down error_reporting elsewhere.
error_reporting(E_ALL);
}
if(!is_file($file) ){
parent::addTestCase(new BadTest($file, 'Not a file or does not exist'));
}
parent::addTestFile($file);
}
}
/* ======================================================================= */
// get_class_ex: Insert spaces to prettify the class-name.
function get_class_ex($object) {
return preg_replace('/(.?)([A-Z])/', '${1} ${2}', get_class($object));
}
/**
* A failing test base-class for when a test suite has NOT loaded properly.
* See class, simple_test.php: BadGroupTest.
* @package SimpleTestEx
*/
class BadTest {
var $label;
var $error;
function BadTest($label, $error) {
$this->label = $label;
$this->error = $error;
}
function getLabel() {
return $this->label;
}
function run(&$reporter) {
$reporter->paintGroupStart(basename(__FILE__), $this->getSize());
$reporter->paintFail(get_class_ex($this) .' [' . $this->getLabel() .
'] with error [' . $this->error . ']');
$reporter->paintGroupEnd($this->getLabel());
return $reporter->getStatus();
}
/**
* @return int the number of test cases starting.
*/
function getSize() {
return 0;
}
}
/**
* An informational notice base-class for when a test suite is being processed.
* See class, simple_test.php: BadGroupTest.
* @package SimpleTestEx
*/
class Notice {
var $label;
var $status;
function Notice($label, $error) {
$this->label = $label;
$this->status = $error;
}
function getLabel() {
return $this->label;
}
function run(&$reporter) {
$reporter->paintGroupStart(basename(__FILE__), $this->getSize());
$reporter->paintNotice(get_class_ex($this) .
' ['. $this->getLabel() .'] with status [' . $this->status . ']');
$reporter->paintGroupEnd($this->getLabel());
return $reporter->getStatus();
}
function getSize() {
return 0;
}
}
/**
* A failing folder test for when the test-user specifies an invalid directory
* (run.php?folder=woops).
* @package SimpleTestEx
*/
class BadFolderTest extends BadTest { }
/**
* A failing auto test for when no unit test files are found.
* @package SimpleTestEx
*/
class BadAutoGroupTest extends BadTest { }
/**
* Auto group test notices - 1. Search complete. 2. A test file has been found.
* @package SimpleTestEx
*/
class AutoGroupTestNotice extends Notice { }
class FindFileNotice extends Notice { }
?>
-109
View File
@@ -1,109 +0,0 @@
<?php
/**
* Run the unit tests.
*
* @copyright &copy; 2006 The Open University
* @author N.D.Freear@open.ac.uk, T.J.Hunt@open.ac.uk
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @version $Id$
* @package SimpleTestEx
*/
/** */
require_once(dirname(__FILE__).'/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/simpletestlib.php');
require_once('ex_simple_test.php');
require_once('ex_reporter.php');
// CGI arguments
$path = optional_param('path', null, PARAM_PATH);
$showpasses = optional_param('showpasses', false, PARAM_BOOL);
$showsearch = optional_param('showsearch', false, PARAM_BOOL);
$thorough = optional_param('thorough', false, PARAM_BOOL);
// Print the header.
admin_externalpage_setup('reportunittest', '', array('showpasses' => $showpasses,
'showsearch' => $showsearch, 'thorough' => $thorough));
admin_externalpage_print_header();
/* The UNITTEST constant can be checked elsewhere if you need to know
* when your code is being run as part of a unit test. */
define('UNITTEST', true);
$langfile = 'simpletest';
$strtitle = get_string('unittests', $langfile);
if (!is_null($path)) {
// Create the group of tests.
$test =& new AutoGroupTest($showsearch, $thorough);
// OU specific. We use the _nonproject folder for stuff we want to
// keep in CVS, but which is not really relevant. It does no harm
// to leave this here.
$test->addIgnoreFolder($CFG->dirroot . '/_nonproject');
// Make the reporter, which is what displays the results.
$reporter = new ExHtmlReporter($showpasses);
if ($showsearch) {
print_heading('Searching for test cases');
}
flush();
// Work out what to test.
if (substr($path, 0, 1) == '/') {
$path = substr($path, 1);
}
$path = $CFG->dirroot . '/' . $path;
if (substr($path, -1) == '/') {
$path = substr($path, 0, -1);
}
$displaypath = substr($path, strlen($CFG->dirroot) + 1);
$ok = true;
if (is_file($path)) {
$test->addTestFile($path);
} else if (is_dir($path)){
$test->findTestFiles($path);
} else {
print_simple_box(get_string('pathdoesnotexist', $langfile, $path), '', '', '', '', 'errorbox');
$ok = false;
}
// If we have something to test, do it.
if ($ok) {
if ($path == $CFG->dirroot) {
$title = get_string('moodleunittests', $langfile, get_string('all', $langfile));
} else {
$title = get_string('moodleunittests', $langfile, $displaypath);
}
print_heading($title);
$test->run($reporter);
}
$formheader = get_string('retest', $langfile);
} else {
$displaypath = '';
$formheader = get_string('rununittests', $langfile);
}
// Print the form for adjusting options.
print_simple_box_start('center', '70%');
echo '<form method="get" action="index.php">';
echo '<fieldset class="invisiblefieldset">';
print_heading($formheader);
echo '<p>'; print_checkbox('showpasses', 1, $showpasses, get_string('showpasses', $langfile)); echo '</p>';
echo '<p>'; print_checkbox('showsearch', 1, $showsearch, get_string('showsearch', $langfile)); echo '</p>';
echo '<p>'; print_checkbox('thorough', 1, $thorough, get_string('thorough', $langfile)); echo '</p>';
echo '<p>';
echo '<label for="path">', get_string('onlytest', $langfile), '</label> ';
echo '<input type="text" id="path" name="path" value="', $displaypath, '" size="40" />';
echo '</p>';
echo '<input type="submit" value="' . get_string('runtests', $langfile) . '" />';
echo '</fieldset>';
echo '</form>';
print_simple_box_end();
// Footer.
admin_externalpage_print_footer();
?>
-3
View File
@@ -1,3 +0,0 @@
<?php //$Id$
$ADMIN->add('reports', new admin_externalpage('reportunittest', get_string('simpletest', 'admin'), "$CFG->wwwroot/$CFG->admin/report/unittest/index.php", 'report/unittest:view'));
?>
-29
View File
@@ -1,29 +0,0 @@
<?PHP // $Id$
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
$plugin->version = 2007101501;
$plugin->requires = 2007101532;
?>
-102
View File
@@ -1,102 +0,0 @@
<?php
/**
* this page defines what roles can access (grant user that role and override that roles'
* capabilities in different context. For example, we can say that Teachers can only grant
* student role or modify student role's capabilities. Note that you need both the right
* capability moodle/role:assign or moodle/role:manage and this database table roles_deny_grant
* to be able to grant roles. If a user has moodle/role:manage at site level assignment
* then he can modify the roles_allow_assign table via this interface.
*/
require_once('../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('defineroles', '', array(), $CFG->wwwroot . '/' . $CFG->admin . '/roles/allowassign.php');
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/role:manage', $sitecontext);
/// form processiong here
/// get all roles
$roles = get_all_roles();
if ($grant = data_submitted() and confirm_sesskey()) {
foreach ($grant as $grole => $val) {
if ($grole == 'dummy' or !strpos($grole, '_')) {
continue;
}
$string = explode('_', $grole);
$temp[$string[1]][$string[2]] = 1; // if set, means can access
}
// if current assignment is in data_submitted, ignore, else, write deny into db
foreach ($roles as $srole) {
foreach ($roles as $trole) {
if (isset($temp[$srole->id][$trole->id])) { // if set, need to write to db
if (!$record = get_record('role_allow_assign', 'roleid', $srole->id, 'allowassign', $trole->id)) {
allow_assign($srole->id, $trole->id);
}
} else { //if set, means can access, attempt to remove it from db
delete_records('role_allow_assign', 'roleid', $srole->id, 'allowassign', $trole->id);
}
}
}
// updated allowassigns sitewide...
mark_context_dirty($sitecontext->path);
}
/// displaying form here
admin_externalpage_print_header();
$currenttab='allowassign';
require_once('managetabs.php');
$table->tablealign = 'center';
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '90%';
$table->align[] = 'right';
/// get all the roles identifier
foreach ($roles as $role) {
$rolesname[] = format_string($role->name);
$roleids[] = $role->id;
$table->align[] = 'center';
$table->wrap[] = 'nowrap';
}
$table->head = array_merge(array(''), $rolesname);
foreach ($roles as $role) {
$beta = get_box_list($role->id, $roleids);
$table->data[] = array_merge(array(format_string($role->name)), $beta);
}
print_simple_box(get_string('configallowassign', 'admin'), 'center');
echo '<form action="allowassign.php" method="post">';
print_table($table);
echo '<div class="buttons"><input type="submit" value="'.get_string('savechanges').'"/>';
echo '<input type="hidden" name="dummy" value="1" />'; // this is needed otherwise we do not know a form has been submitted
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '</div></form>';
admin_externalpage_print_footer();
function get_box_list($roleid, $arraylist){
foreach ($arraylist as $targetid) {
if (get_record('role_allow_assign', 'roleid', $roleid, 'allowassign', $targetid)) {
$array[] = '<input type="checkbox" name="s_'.$roleid.'_'.$targetid.'" value="1" checked="checked"/>';
} else {
$array[] = '<input type="checkbox" name="s_'.$roleid.'_'.$targetid.'" value="1" />';
}
}
return $array;
}
?>
-99
View File
@@ -1,99 +0,0 @@
<?php
/**
* this page defines what roles can override (override roles in different context. For example,
* we can say that Admin can override teacher roles in a course
* To be able to override roles. If a user has moodle/role:override at context level
* and be in the roles_allow_override table.
*/
require_once('../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('defineroles', '', array(), $CFG->wwwroot . '/' . $CFG->admin . '/roles/allowoverride.php');
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/role:manage', $sitecontext);
/// form processiong here
/// get all roles
$roles = get_all_roles();
if ($grant = data_submitted() and confirm_sesskey()) {
foreach ($grant as $grole => $val) {
if ($grole == 'dummy' or !strpos($grole, '_')) {
continue;
}
$string = explode('_', $grole);
$temp[$string[1]][$string[2]] = 1; // if set, means can access
}
// if current assignment is in data_submitted, ignore, else, write deny into db
foreach ($roles as $srole) {
foreach ($roles as $trole) {
if (isset($temp[$srole->id][$trole->id])) { // if set, need to write to db
if (!$record = get_record('role_allow_override', 'roleid', $srole->id, 'allowoverride', $trole->id)) {
allow_override($srole->id, $trole->id);
}
} else { //if set, means can access, attempt to remove it from db
delete_records('role_allow_override', 'roleid', $srole->id, 'allowoverride', $trole->id);
}
}
}
// updated allowoverride sitewide...
mark_context_dirty($sitecontext->path);
}
/// displaying form here
admin_externalpage_print_header();
$currenttab='allowoverride';
require_once('managetabs.php');
$table->tablealign = 'center';
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '90%';
$table->align[] = 'right';
/// get all the roles identifier
foreach ($roles as $role) {
$rolesname[] = format_string($role->name);
$roleids[] = $role->id;
$table->align[] = 'center';
$table->wrap[] = 'nowrap';
}
$table->head = array_merge(array(''), $rolesname);
foreach ($roles as $role) {
$beta = get_box_list($role->id, $roleids);
$table->data[] = array_merge(array(format_string($role->name)), $beta);
}
print_simple_box(get_string('configallowoverride2', 'admin'), 'center');
echo '<form action="allowoverride.php" method="post">';
print_table($table);
echo '<div class="buttons"><input type="submit" value="'.get_string('savechanges').'"/>';
echo '<input type="hidden" name="dummy" value="1" />'; // this is needed otherwise we do not know a form has been submitted
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '</div></form>';
admin_externalpage_print_footer();
// returns array
function get_box_list($roleid, $arraylist){
foreach ($arraylist as $targetid) {
if (get_record('role_allow_override', 'roleid', $roleid, 'allowoverride', $targetid)) {
$array[] = '<input type="checkbox" name="s_'.$roleid.'_'.$targetid.'" value="1" checked="checked"/>';
} else {
$array[] = '<input type="checkbox" name="s_'.$roleid.'_'.$targetid.'" value="1" />';
}
}
return $array;
}
?>
-112
View File
@@ -1,112 +0,0 @@
<form id="assignform" method="post" action="">
<div style="text-align:center;">
<label for="extendperiod"><?php print_string('enrolperiod') ?></label> <?php choose_from_menu($periodmenu, "extendperiod", $defaultperiod, $unlimitedperiod); ?>
<label for="extendbase"><?php print_string('startingfrom') ?></label> <?php choose_from_menu($basemenu, "extendbase", 3, ""); ?>
<input type="hidden" name="previoussearch" value="<?php p($previoussearch) ?>" />
<input type="hidden" name="userid" value="<?php p($userid) ?>" />
<input type="hidden" name="courseid" value="<?php p($courseid) ?>" />
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
<input type="hidden" name="contextid" value="<?php p($contextid) ?>" />
<input type="hidden" name="roleid" value="<?php p($roleid) ?>" />
<table summary="" style="margin-left:auto;margin-right:auto" border="0" cellpadding="5" cellspacing="0">
<tr>
<td valign="top">
<label for="removeselect"><?php print_string('existingusers', 'role', count($contextusers)); ?></label>
<br />
<select name="removeselect[]" size="20" id="removeselect" multiple="multiple"
onfocus="getElementById('assignform').add.disabled=true;
getElementById('assignform').remove.disabled=false;
getElementById('assignform').addselect.selectedIndex=-1;">
<?php
$i = 0;
foreach ($contextusers as $contextuser) {
$fullname = fullname($contextuser, true);
if ($contextuser->hidden) {
$hidden=' ('.get_string('hiddenassign').') ';
} else {
$hidden="";
}
echo "<option value=\"$contextuser->id\">".$fullname.", ".$contextuser->email.$hidden."</option>\n";
$i++;
}
if ($i==0) {
echo '<option/>'; // empty select breaks xhtml strict
}
?>
</select></td>
<td valign="top">
<br />
<label title="<?php print_string('hiddenassign') ?>">
<input type="checkbox" name="hidden" value="1" />
<img src="<?php echo $CFG->pixpath; ?>/t/hide.gif" alt="<?php print_string('hiddenassign') ?>" class="hide-show-image" />
<?php helpbutton('hiddenassign', get_string('hiddenassign')); ?>
</label>
<?php check_theme_arrows(); ?>
<p class="arrow_button">
<input name="add" id="add" type="submit" value="<?php echo $THEME->larrow.'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$THEME->rarrow; ?>" title="<?php print_string('remove'); ?>" />
</p>
</td>
<td valign="top">
<label for="addselect"><?php print_string('potentialusers', 'role', $usercount); ?></label>
<br />
<select name="addselect[]" size="20" id="addselect" multiple="multiple"
onfocus="getElementById('assignform').add.disabled=false;
getElementById('assignform').remove.disabled=true;
getElementById('assignform').removeselect.selectedIndex=-1;">
<?php
$i=0;
if (!empty($searchtext)) {
echo "<optgroup label=\"$strsearchresults (" . $usercount . ")\">\n";
while ($user = rs_fetch_next_record($availableusers)) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
$i++;
}
echo "</optgroup>\n";
} else {
if ($usercount > MAX_USERS_PER_PAGE) {
echo '<optgroup label="'.get_string('toomanytoshow').'"><option></option></optgroup>'."\n"
.'<optgroup label="'.get_string('trysearching').'"><option></option></optgroup>'."\n";
} else {
while ($user = rs_fetch_next_record($availableusers)) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
$i++;
}
}
}
if ($i==0) {
echo '<option/>'; // empty select breaks xhtml strict
}
?>
</select>
<br />
<label for="searchtext" class="accesshide"><?php p($strsearch) ?></label>
<input type="text" name="searchtext" id="searchtext" size="30" value="<?php p($searchtext, true) ?>"
onfocus ="getElementById('assignform').add.disabled=true;
getElementById('assignform').remove.disabled=true;
getElementById('assignform').removeselect.selectedIndex=-1;
getElementById('assignform').addselect.selectedIndex=-1;"
onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
if (keyCode == 13) {
getElementById('assignform').previoussearch.value=1;
getElementById('assignform').submit();
} " />
<input name="search" id="search" type="submit" value="<?php p($strsearch) ?>" />
<?php
if (!empty($searchtext)) {
echo '<input name="showall" id="showall" type="submit" value="'.$strshowall.'" />'."\n";
}
?>
</td>
</tr>
</table>
</div>
</form>
-472
View File
@@ -1,472 +0,0 @@
<?php // $Id$
// Script to assign users to contexts
require_once('../../config.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');
require_once($CFG->libdir.'/adminlib.php');
define("MAX_USERS_PER_PAGE", 5000);
define("MAX_USERS_TO_LIST_PER_ROLE", 10);
$contextid = required_param('contextid',PARAM_INT); // context id
$roleid = optional_param('roleid', 0, PARAM_INT); // required role id
$add = optional_param('add', 0, PARAM_BOOL);
$remove = optional_param('remove', 0, PARAM_BOOL);
$showall = optional_param('showall', 0, PARAM_BOOL);
$searchtext = optional_param('searchtext', '', PARAM_RAW); // search string
$previoussearch = optional_param('previoussearch', 0, PARAM_BOOL);
$hidden = optional_param('hidden', 0, PARAM_BOOL); // whether this assignment is hidden
$extendperiod = optional_param('extendperiod', 0, PARAM_INT);
$extendbase = optional_param('extendbase', 0, PARAM_INT);
$userid = optional_param('userid', 0, PARAM_INT); // needed for user tabs
$courseid = optional_param('courseid', 0, PARAM_INT); // needed for user tabs
$errors = array();
$previoussearch = ($searchtext != '') or ($previoussearch) ? 1:0;
$baseurl = 'assign.php?contextid='.$contextid;
if (!empty($userid)) {
$baseurl .= '&amp;userid='.$userid;
}
if (!empty($courseid)) {
$baseurl .= '&amp;courseid='.$courseid;
}
if (! $context = get_context_instance_by_id($contextid)) {
error("Context ID was incorrect (can't find it)");
}
$inmeta = 0;
if ($context->contextlevel == CONTEXT_COURSE) {
$courseid = $context->instanceid;
if ($course = get_record('course', 'id', $courseid)) {
$inmeta = $course->metacourse;
} else {
error('Invalid course id');
}
} else if (!empty($courseid)){ // we need this for user tabs in user context
if (!$course = get_record('course', 'id', $courseid)) {
error('Invalid course id');
}
} else {
$courseid = SITEID;
$course = clone($SITE);
}
require_login($course);
require_capability('moodle/role:assign', $context);
/// needed for tabs.php
$overridableroles = get_overridable_roles($context, 'name', ROLENAME_BOTH);
$assignableroles = get_assignable_roles($context, 'name', ROLENAME_BOTH);
/// Get some language strings
$strpotentialusers = get_string('potentialusers', 'role');
$strexistingusers = get_string('existingusers', 'role');
$straction = get_string('assignroles', 'role');
$strroletoassign = get_string('roletoassign', 'role');
$strsearch = get_string('search');
$strshowall = get_string('showall');
$strparticipants = get_string('participants');
$strsearchresults = get_string('searchresults');
$unlimitedperiod = get_string('unlimited');
$defaultperiod = $course->enrolperiod;
for ($i=1; $i<=365; $i++) {
$seconds = $i * 86400;
$periodmenu[$seconds] = get_string('numdays', '', $i);
}
$timeformat = get_string('strftimedate');
$today = time();
$today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), 0, 0, 0);
// MDL-12420, preventing course start date showing up as an option at system context and front page roles.
if ($course->startdate > 0) {
$basemenu[0] = get_string('startdate') . ' (' . userdate($course->startdate, $timeformat) . ')';
}
if ($course->enrollable != 2 || ($course->enrolstartdate == 0 || $course->enrolstartdate <= $today) && ($course->enrolenddate == 0 || $course->enrolenddate > $today)) {
$basemenu[3] = get_string('today') . ' (' . userdate($today, $timeformat) . ')' ;
}
if($course->enrollable == 2) {
if($course->enrolstartdate > 0) {
$basemenu[4] = get_string('courseenrolstartdate') . ' (' . userdate($course->enrolstartdate, $timeformat) . ')';
}
if($course->enrolenddate > 0) {
$basemenu[5] = get_string('courseenrolenddate') . ' (' . userdate($course->enrolenddate, $timeformat) . ')';
}
}
/// Make sure this user can assign that role
if ($roleid) {
if (!isset($assignableroles[$roleid])) {
error ('you can not override this role in this context');
}
}
if ($userid) {
$user = get_record('user', 'id', $userid);
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $context));
}
/// Print the header and tabs
if ($context->contextlevel == CONTEXT_USER) {
/// course header
$navlinks = array();
if ($courseid != SITEID) {
if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $course->id))) {
$navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'misc');
}
$navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
$navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$fullname", "$fullname", $navigation, "", "", true, "&nbsp;", navmenu($course));
/// site header
} else {
$navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
$navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$course->fullname: $fullname", $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
}
$showroles = 1;
$currenttab = 'assign';
include_once($CFG->dirroot.'/user/tabs.php');
} else if ($context->contextlevel == CONTEXT_SYSTEM) {
admin_externalpage_setup('assignroles', '', array('contextid' => $contextid, 'roleid' => $roleid));
admin_externalpage_print_header('');
} else if ($context->contextlevel==CONTEXT_COURSE and $context->instanceid == SITEID) {
admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid, 'roleid' => $roleid));
admin_externalpage_print_header('');
$currenttab = 'assign';
include_once('tabs.php');
} else {
$currenttab = 'assign';
include_once('tabs.php');
}
/// Process incoming role assignment
if ($frm = data_submitted()) {
if ($add and !empty($frm->addselect) and confirm_sesskey()) {
foreach ($frm->addselect as $adduser) {
if (!$adduser = clean_param($adduser, PARAM_INT)) {
continue;
}
$allow = true;
if ($inmeta) {
if (has_capability('moodle/course:managemetacourse', $context, $adduser)) {
//ok
} else {
$managerroles = get_roles_with_capability('moodle/course:managemetacourse', CAP_ALLOW, $context);
if (!empty($managerroles) and !array_key_exists($roleid, $managerroles)) {
$erruser = get_record('user', 'id', $adduser, '','','','', 'id, firstname, lastname');
$errors[] = get_string('metaassignerror', 'role', fullname($erruser));
$allow = false;
}
}
}
if ($allow) {
switch($extendbase) {
case 0:
$timestart = $course->startdate;
break;
case 3:
$timestart = $today;
break;
case 4:
$timestart = $course->enrolstartdate;
break;
case 5:
$timestart = $course->enrolenddate;
break;
}
if($extendperiod > 0) {
$timeend = $timestart + $extendperiod;
} else {
$timeend = 0;
}
if (! role_assign($roleid, $adduser, 0, $context->id, $timestart, $timeend, $hidden)) {
$errors[] = "Could not add user with id $adduser to this role!";
}
}
}
$rolename = get_field('role', 'name', 'id', $roleid);
add_to_log($course->id, 'role', 'assign', 'admin/roles/assign.php?contextid='.$context->id.'&roleid='.$roleid, $rolename, '', $USER->id);
} else if ($remove and !empty($frm->removeselect) and confirm_sesskey()) {
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$topleveladmin = false;
// we only worry about this if the role has doanything capability at site level
if ($context->id == $sitecontext->id && $adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext)) {
foreach ($adminroles as $adminrole) {
if ($adminrole->id == $roleid) {
$topleveladmin = true;
}
}
}
foreach ($frm->removeselect as $removeuser) {
$removeuser = clean_param($removeuser, PARAM_INT);
if ($topleveladmin && ($removeuser == $USER->id)) { // Prevent unassigning oneself from being admin
continue;
}
if (! role_unassign($roleid, $removeuser, 0, $context->id)) {
$errors[] = "Could not remove user with id $removeuser from this role!";
} else if ($inmeta) {
sync_metacourse($courseid);
$newroles = get_user_roles($context, $removeuser, false);
if (!empty($newroles) and !array_key_exists($roleid, $newroles)) {
$erruser = get_record('user', 'id', $removeuser, '','','','', 'id, firstname, lastname');
$errors[] = get_string('metaunassignerror', 'role', fullname($erruser));
$allow = false;
}
}
}
$rolename = get_field('role', 'name', 'id', $roleid);
add_to_log($course->id, 'role', 'unassign', 'admin/roles/assign.php?contextid='.$context->id.'&roleid='.$roleid, $rolename, '', $USER->id);
} else if ($showall) {
$searchtext = '';
$previoussearch = 0;
}
}
if ($context->contextlevel==CONTEXT_COURSE and $context->instanceid == SITEID) {
print_heading_with_help(get_string('frontpageroles', 'admin'), 'assignroles');
} else {
print_heading_with_help(get_string('assignrolesin', 'role', print_context_name($context)), 'assignroles');
}
if ($context->contextlevel==CONTEXT_SYSTEM) {
print_box(get_string('globalroleswarning', 'role'));
}
if ($roleid) { /// prints a form to swap roles
/// Get all existing participants in this context.
// Why is this not done with get_users???
if (!$contextusers = get_role_users($roleid, $context, false, 'u.id, u.firstname, u.lastname, u.email, ra.hidden')) {
$contextusers = array();
}
$select = "username <> 'guest' AND deleted = 0 AND confirmed = 1";
$usercount = count_records_select('user', $select) - count($contextusers);
$searchtext = trim($searchtext);
if ($searchtext !== '') { // Search for a subset of remaining users
$LIKE = sql_ilike();
$FULLNAME = sql_fullname();
$selectsql = " AND ($FULLNAME $LIKE '%$searchtext%' OR email $LIKE '%$searchtext%') ";
$select .= $selectsql;
} else {
$selectsql = "";
}
if ($context->contextlevel > CONTEXT_COURSE && !is_inside_frontpage($context)) { // mod or block (or group?)
/************************************************************************
* *
* context level is above or equal course context level *
* in this case we pull out all users matching search criteria (if any) *
* *
* MDL-11324 *
* a mini get_users_by_capability() call here, this is done instead of *
* get_users_by_capability() because *
* 1) get_users_by_capability() does not deal with searching by name *
* 2) exceptions array can be potentially large for large courses *
* 3) get_recordset_sql() is more efficient *
* *
************************************************************************/
if ($possibleroles = get_roles_with_capability('moodle/course:view', CAP_ALLOW, $context)) {
$doanythingroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM));
$validroleids = array();
foreach ($possibleroles as $possiblerole) {
if (isset($doanythingroles[$possiblerole->id])) { // We don't want these included
continue;
}
if ($caps = role_context_capabilities($possiblerole->id, $context, 'moodle/course:view')) { // resolved list
if (isset($caps['moodle/course:view']) && $caps['moodle/course:view'] > 0) { // resolved capability > 0
$validroleids[] = $possiblerole->id;
}
}
}
if ($validroleids) {
$roleids = '('.implode(',', $validroleids).')';
$select = " SELECT DISTINCT u.id, u.firstname, u.lastname, u.email";
$countselect = "SELECT COUNT(u.id)";
$from = " FROM {$CFG->prefix}user u
INNER JOIN {$CFG->prefix}role_assignments ra ON ra.userid = u.id
INNER JOIN {$CFG->prefix}role r ON r.id = ra.roleid";
$where = " WHERE ra.contextid ".get_related_contexts_string($context)."
AND u.deleted = 0
AND ra.roleid in $roleids";
$excsql = " AND u.id NOT IN (
SELECT u.id
FROM {$CFG->prefix}role_assignments r,
{$CFG->prefix}user u
WHERE r.contextid = $contextid
AND u.id = r.userid
AND r.roleid = $roleid
$selectsql)";
$availableusers = get_recordset_sql($select . $from . $where . $selectsql . $excsql);
}
$usercount = $availableusers->_numOfRows;
}
} else {
/************************************************************************
* *
* context level is above or equal course context level *
* in this case we pull out all users matching search criteria (if any) *
* *
************************************************************************/
/// MDL-11111 do not include user already assigned this role in this context as available users
/// so that the number of available users is right and we save time looping later
$availableusers = get_recordset_sql('SELECT id, firstname, lastname, email
FROM '.$CFG->prefix.'user
WHERE '.$select.'
AND id NOT IN (
SELECT u.id
FROM '.$CFG->prefix.'role_assignments r,
'.$CFG->prefix.'user u
WHERE r.contextid = '.$contextid.'
AND u.id = r.userid
AND r.roleid = '.$roleid.'
'.$selectsql.')
ORDER BY lastname ASC, firstname ASC');
$usercount = $availableusers->_numOfRows;
}
echo '<div class="selector">';
$assignableroles = array('0'=>get_string('listallroles', 'role').'...') + $assignableroles;
popup_form("$CFG->wwwroot/$CFG->admin/roles/assign.php?userid=$userid&amp;courseid=$courseid&amp;contextid=$contextid&amp;roleid=",
$assignableroles, 'switchrole', $roleid, '', '', '', false, 'self', $strroletoassign);
echo '</div>';
print_simple_box_start('center');
include('assign.html');
print_simple_box_end();
if (!empty($errors)) {
$msg = '<p>';
foreach ($errors as $e) {
$msg .= $e.'<br />';
}
$msg .= '</p>';
print_simple_box_start('center');
notify($msg);
print_simple_box_end();
}
//Back to Assign Roles button
echo "<br/>";
echo "<div class='continuebutton'>";
print_single_button('assign.php', array('contextid' => $contextid), get_string('assignrolesin', 'role', print_context_name($context)));
echo "</div>";
} else { // Print overview table
// sync metacourse enrolments if needed
if ($inmeta) {
sync_metacourse($course);
}
// Get the names of role holders for roles with between 1 and MAX_USERS_TO_LIST_PER_ROLE users,
// and so determine whether to show the extra column.
$rolehodlercount = array();
$rolehodlernames = array();
$strmorethanten = get_string('morethan', 'role', MAX_USERS_TO_LIST_PER_ROLE);
$showroleholders = false;
foreach ($assignableroles as $roleid => $rolename) {
$countusers = count_role_users($roleid, $context);
$rolehodlercount[$roleid] = $countusers;
$roleusers = '';
if (0 < $countusers && $countusers <= MAX_USERS_TO_LIST_PER_ROLE) {
$roleusers = get_role_users($roleid, $context, false, 'u.id, u.lastname, u.firstname');
if (!empty($roleusers)) {
$strroleusers = array();
foreach ($roleusers as $user) {
$strroleusers[] = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $user->id . '" >' . fullname($user) . '</a>';
}
$rolehodlernames[$roleid] = implode('<br />', $strroleusers);
$showroleholders = true;
}
} else if ($countusers > MAX_USERS_TO_LIST_PER_ROLE) {
$rolehodlernames[$roleid] = '<a href="'.$baseurl.'&amp;roleid='.$roleid.'">'.$strmorethanten.'</a>';
} else {
$rolehodlernames[$roleid] = '';
}
}
// Print overview table
$table->tablealign = 'center';
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '60%';
$table->head = array(get_string('roles', 'role'), get_string('description'), get_string('users'));
$table->wrap = array('nowrap', '', 'nowrap');
$table->align = array('right', 'left', 'center');
if ($showroleholders) {
$table->head[] = '';
$table->wrap[] = 'nowrap';
$table->align[] = 'left';
}
foreach ($assignableroles as $roleid => $rolename) {
$description = format_string(get_field('role', 'description', 'id', $roleid));
$row = array('<a href="'.$baseurl.'&amp;roleid='.$roleid.'">'.$rolename.'</a>',$description, $rolehodlercount[$roleid]);
if ($showroleholders) {
$row[] = $rolehodlernames[$roleid];
}
$table->data[] = $row;
}
print_table($table);
//Continue to Course Button
echo "<br/>";
echo "<div class='continuebutton'>";
print_single_button($CFG->wwwroot.'/course/view.php', array('id' => $courseid), get_string('continuetocourse'));
echo "</div>";
}
print_footer($course);
?>
-219
View File
@@ -1,219 +0,0 @@
<?php //$Id$
switch ($action) {
case 'add':
$submitlabel = get_string('addrole', 'role');
break;
case 'edit':
default:
$submitlabel = get_string('savechanges');
}
if ($action == 'view') {
?>
<?php
}
?>
<form id="rolesform" action="manage.php" method="post">
<fieldset class="invisiblefieldset">
<input type="hidden" name="roleid" value="<?php p($roleid) ?>" />
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
<input type="hidden" name="action" value="<?php if ($action != 'view') { echo p($action); } ?>" />
</fieldset>
<table class="roledesc" cellpadding="9" cellspacing="0">
<?php if ($action == 'view') { ?>
<tr valign="top">
<td align="right"><?php print_string('name') ?>:</td>
<td><?php p(format_string($role->name)); ?></td>
</tr>
<tr valign="top">
<td align="right"><?php print_string('shortname') ?>:</td>
<td><?php p($role->shortname); ?></td>
</tr>
<tr valign="top">
<td align="right"><?php print_string('description') ?>:</td>
<td><?php p(format_text($role->description, FORMAT_HTML)); $usehtmleditor = false; ?></td>
</tr>
<tr valign="top">
<td align="right"><?php print_string('legacytype', 'role') ?>:</td>
<td><?php
$usehtmleditor = false;
if (empty($role->legacytype)) {
print_string('none');
} else {
print_string('legacy:'.$role->legacytype, 'role');
}
?>
</td>
</tr>
<?php } else { ?>
<tr valign="top">
<td align="right"><label for="name"><?php print_string('name') ?></label></td>
<td><?php
echo '<input type="text" id="name" name="name" maxlength="254" size="50" value="'.s($role->name).'" />';
if (isset($errors["name"])) formerr($errors["name"]);
?>
</td>
</tr>
<tr valign="top">
<td align="right"><label for="shortname"><?php print_string('shortname') ?></label></td>
<td><?php
echo '<input type="text" id="shortname" name="shortname" maxlength="100" size="15" value="'.s($role->shortname).'" />';
if (isset($errors["shortname"])) formerr($errors["shortname"]);
?>
</td>
</tr>
<tr valign="top">
<td align="right"><label for="edit-description"><?php print_string('description') ?></label></td>
<td><?php
print_textarea($usehtmleditor, 10, 50, 50, 10, 'description', $role->description);
?>
</td>
</tr>
<tr valign="top">
<td align="right"><label for="menulegacytype"><?php print_string('legacytype', 'role') ?></label></td>
<td><?php
$options = array();
$options[''] = get_string('none');
$legacyroles = get_legacy_roles();
foreach($legacyroles as $ltype=>$lcap) {
$options[$ltype] = get_string('legacy:'.$ltype, 'role');
}
choose_from_menu($options, 'legacytype', $role->legacytype, '');
?>
</td>
</tr>
<?php } ?>
</table>
<?php
print_heading_with_help(get_string('permissions','role'), 'permissions');
$strinherit = get_string('notset','role');
$strallow = get_string('allow','role');
$strprevent = get_string('prevent','role');
$strprohibit = get_string('prohibit','role');
?>
<table class="rolecap">
<tr>
<th class="name" align="left" scope="col"><?php print_string('capability','role') ?></th>
<th class="inherit" scope="col"><?php p($strinherit); ?></th>
<th class="allow" scope="col"><?php p($strallow); ?></th>
<th class="prevent" scope="col"><?php p($strprevent); ?></th>
<th class="prohibit" scope="col"><?php p($strprohibit); ?></th>
<th class="risk" colspan="5" scope="col"><?php print_string('risks','role') ?></th>
</tr>
<?php
// init these 2
$contextlevel = 0;
$component = '';
$strrisks = s(get_string('risks', 'role'));
// MDL-11687
$strcapabilities = 'Capabilities';//s(get_string('capabilities', 'role'));
// prepare legacy defaults
if (!empty($role->legacytype)) {
$defaultcaps = get_default_capabilities($role->legacytype);
} else {
$defaultcaps = false;
}
foreach ($capabilities as $capability) {
//legacy caps have their own selector
if (islegacy($capability->name)) {
continue;
}
// prints a breaker if component or name or context level
if (component_level_changed($capability, $component, $contextlevel)) {
//if ($capability->component != $component or $capability->contextlevel != $contextlevel) {
echo ('<tr class="rolecapheading header"><td colspan="10" class="header"><strong>'.
get_component_string($capability->component, $capability->contextlevel).'</strong></td></tr>');
}
// these 2 are used to see to group same mod/core capabilities together
$contextlevel = $capability->contextlevel;
$component = $capability->component;
if (empty($errors)) {
// check the capability override for this cap, this role in this context
$localoverride = get_local_override($roleid, $sitecontext->id, $capability->name);
} else {
$localoverride = new object();
$localoverride->permission = $role->{$capability->name};
}
$disabled = ($action != 'edit' and $action != 'add') ? ' disabled="disabled" ' : '';
$riskinfo = '<td class="risk managetrust">';
$rowclasses = '';
if (RISK_MANAGETRUST & (int)$capability->riskbitmask) {
$riskinfo .= '<a onclick="this.target=\'docspopup\'" title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">';
$riskinfo .= '<img src="'.$CFG->pixpath.'/i/risk_managetrust.gif" alt="'.get_string('riskmanagetrustshort', 'admin').'" /></a>';
$rowclasses .= ' riskmanagetrust';
}
$riskinfo .= '</td><td class="risk config">';
if (RISK_CONFIG & (int)$capability->riskbitmask) {
$riskinfo .= '<a onclick="this.target=\'docspopup\'" title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">';
$riskinfo .= '<img src="'.$CFG->pixpath.'/i/risk_config.gif" alt="'.get_string('riskconfigshort', 'admin').'" /></a>';
$rowclasses .= ' riskconfig';
}
$riskinfo .= '</td><td class="risk xss">';
if (RISK_XSS & (int)$capability->riskbitmask) {
$riskinfo .= '<a onclick="this.target=\'docspopup\'" title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">';
$riskinfo .= '<img src="'.$CFG->pixpath.'/i/risk_xss.gif" alt="'.get_string('riskxssshort', 'admin').'" /></a>';
$rowclasses .= ' riskxss';
}
$riskinfo .= '</td><td class="risk personal">';
if (RISK_PERSONAL & (int)$capability->riskbitmask) {
$riskinfo .= '<a onclick="this.target=\'docspopup\'" title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">';
$riskinfo .= '<img src="'.$CFG->pixpath.'/i/risk_personal.gif" alt="'.get_string('riskpersonalshort', 'admin').'" /></a>';
$rowclasses .= ' riskpersonal';
}
$riskinfo .= '</td><td class="risk spam">';
if (RISK_SPAM & (int)$capability->riskbitmask) {
$riskinfo .= '<a onclick="this.target=\'docspopup\'" title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">';
$riskinfo .= '<img src="'.$CFG->pixpath.'/i/risk_spam.gif" alt="'.get_string('riskspamshort', 'admin').'" /></a>';
$rowclasses .= ' riskspam';
}
$riskinfo .= '</td>';
$isinherit = (!isset($defaultcaps[$capability->name]) or $defaultcaps[$capability->name] == CAP_INHERIT) ? 'capdefault' : '';
$isallow = (isset($defaultcaps[$capability->name]) and $defaultcaps[$capability->name] == CAP_ALLOW) ? 'capdefault' : '';
$isprevent = (isset($defaultcaps[$capability->name]) and $defaultcaps[$capability->name] == CAP_PREVENT) ? 'capdefault' : '';
$isprohibit = (isset($defaultcaps[$capability->name]) and $defaultcaps[$capability->name] == CAP_PROHIBIT) ? 'capdefault' : '';
?>
<tr class="rolecap <?php echo $rowclasses; ?>">
<td class="name"><span class="cap-desc"><a onclick="this.target='docspopup'" href="<?php echo $CFG->docroot.'/'.$lang.'/'.$strcapabilities.'/'.$capability->name ?>"><?php echo get_capability_string($capability->name); ?></a><span class="cap-name"><?php echo $capability->name ?></span></span></td>
<td class="inherit <?php echo $isinherit ?>">
<input type="radio" title="<?php p($strinherit); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_INHERIT ?>" <?php if (!isset($localoverride->permission) || $localoverride->permission==CAP_INHERIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<td class="allow <?php echo $isallow ?>">
<input type="radio" title="<?php p($strallow); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_ALLOW ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_ALLOW){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<td class="prevent <?php echo $isprevent ?>" >
<input type="radio" title="<?php p($strprevent); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PREVENT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PREVENT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<td class="prohibit <?php echo $isprohibit ?>" >
<input type="radio" title="<?php p($strprohibit); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PROHIBIT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PROHIBIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<?php echo $riskinfo; ?>
</tr>
<?php } ?>
</table>
<?php if ($action != 'view') { ?>
<div class="submit buttons">
<input type="submit" value="<?php p($submitlabel) ?>" />
<input type="submit" name="cancel" value="<?php print_string('cancel') ?>" />
</div>
<?php } ?>
</form>
-575
View File
@@ -1,575 +0,0 @@
<?php //$Id$
require_once('../../config.php');
require_once($CFG->libdir.'/adminlib.php');
$roleid = optional_param('roleid', 0, PARAM_INT); // if set, we are editing a role
$name = optional_param('name', '', PARAM_MULTILANG); // new role name
$shortname = optional_param('shortname', '', PARAM_RAW); // new role shortname, special cleaning before storage
$description = optional_param('description', '', PARAM_CLEAN); // new role desc
$action = optional_param('action', '', PARAM_ALPHA);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$cancel = optional_param('cancel', 0, PARAM_BOOL);
admin_externalpage_setup('defineroles', '', array('roleid' => $roleid));
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/role:manage', $sitecontext);
if ($cancel) {
redirect('manage.php');
}
$errors = array();
$newrole = false;
$roles = get_all_roles();
$rolescount = count($roles);
/// fix sort order if needed
$rolesort = array();
$i = 0;
foreach ($roles as $rolex) {
$rolesort[$i] = $rolex->id;
if ($rolex->sortorder != $i) {
$r = new object();
$r->id = $rolex->id;
$r->sortorder = $i;
update_record('role', $r);
$roles[$rolex->id]->sortorder = $i;
}
$i++;
}
// do not delete these default system roles
$defaultroles = array();
$defaultroles[] = $CFG->notloggedinroleid;
$defaultroles[] = $CFG->guestroleid;
$defaultroles[] = $CFG->defaultuserroleid;
$defaultroles[] = $CFG->defaultcourseroleid;
/// form processing, editing a role, adding a role, deleting a role etc.
switch ($action) {
case 'add':
if ($data = data_submitted() and confirm_sesskey()) {
$shortname = moodle_strtolower(clean_param(clean_filename($shortname), PARAM_SAFEDIR)); // only lowercase safe ASCII characters
$legacytype = required_param('legacytype', PARAM_RAW);
$legacyroles = get_legacy_roles();
if (!array_key_exists($legacytype, $legacyroles)) {
$legacytype = '';
}
if (empty($name)) {
$errors['name'] = get_string('errorbadrolename', 'role');
} else if (count_records('role', 'name', $name)) {
$errors['name'] = get_string('errorexistsrolename', 'role');
}
if (empty($shortname)) {
$errors['shortname'] = get_string('errorbadroleshortname', 'role');
} else if (count_records('role', 'shortname', $shortname)) {
$errors['shortname'] = get_string('errorexistsroleshortname', 'role');
}
if (empty($errors)) {
$newroleid = create_role($name, $shortname, $description);
// set proper legacy type
if (!empty($legacytype)) {
assign_capability($legacyroles[$legacytype], CAP_ALLOW, $newroleid, $sitecontext->id);
}
} else {
$newrole = new object();
$newrole->name = $name;
$newrole->shortname = $shortname;
$newrole->description = $description;
$newrole->legacytype = $legacytype;
}
$allowed_values = array(CAP_INHERIT, CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT);
$capabilities = fetch_context_capabilities($sitecontext); // capabilities applicable in this context
foreach ($capabilities as $cap) {
if (!isset($data->{$cap->name})) {
continue;
}
// legacy caps have their own selector
if (islegacy($data->{$cap->name})) {
continue;
}
$capname = $cap->name;
$value = clean_param($data->{$cap->name}, PARAM_INT);
if (!in_array($value, $allowed_values)) {
continue;
}
if (empty($errors)) {
assign_capability($capname, $value, $newroleid, $sitecontext->id);
} else {
$newrole->$capname = $value;
}
}
// added a role sitewide...
mark_context_dirty($sitecontext->path);
if (empty($errors)) {
$rolename = get_field('role', 'name', 'id', $newroleid);
add_to_log(SITEID, 'role', 'add', 'admin/roles/manage.php?action=add', $rolename, '', $USER->id);
redirect('manage.php');
}
}
break;
case 'edit':
if ($data = data_submitted() and confirm_sesskey()) {
$shortname = moodle_strtolower(clean_param(clean_filename($shortname), PARAM_SAFEDIR)); // only lowercase safe ASCII characters
$legacytype = required_param('legacytype', PARAM_RAW);
$legacyroles = get_legacy_roles();
if (!array_key_exists($legacytype, $legacyroles)) {
$legacytype = '';
}
if (empty($name)) {
$errors['name'] = get_string('errorbadrolename', 'role');
} else if ($rs = get_records('role', 'name', $name)) {
unset($rs[$roleid]);
if (!empty($rs)) {
$errors['name'] = get_string('errorexistsrolename', 'role');
}
}
if (empty($shortname)) {
$errors['shortname'] = get_string('errorbadroleshortname', 'role');
} else if ($rs = get_records('role', 'shortname', $shortname)) {
unset($rs[$roleid]);
if (!empty($rs)) {
$errors['shortname'] = get_string('errorexistsroleshortname', 'role');
}
}
if (!empty($errors)) {
$newrole = new object();
$newrole->name = $name;
$newrole->shortname = $shortname;
$newrole->description = $description;
$newrole->legacytype = $legacytype;
}
$allowed_values = array(CAP_INHERIT, CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT);
$capabilities = fetch_context_capabilities($sitecontext); // capabilities applicable in this context
foreach ($capabilities as $cap) {
if (!isset($data->{$cap->name})) {
continue;
}
// legacy caps have their own selector
if (islegacy($data->{$cap->name}) === 0 ) {
continue;
}
$capname = $cap->name;
$value = clean_param($data->{$cap->name}, PARAM_INT);
if (!in_array($value, $allowed_values)) {
continue;
}
if (!empty($errors)) {
$newrole->$capname = $value;
continue;
}
// edit default caps
$SQL = "SELECT * FROM {$CFG->prefix}role_capabilities
WHERE roleid = $roleid AND capability = '$capname'
AND contextid = $sitecontext->id";
$localoverride = get_record_sql($SQL);
if ($localoverride) { // update current overrides
if ($value == CAP_INHERIT) { // inherit = delete
unassign_capability($capname, $roleid, $sitecontext->id);
} else {
$localoverride->permission = $value;
$localoverride->timemodified = time();
$localoverride->modifierid = $USER->id;
update_record('role_capabilities', $localoverride);
}
} else { // insert a record
if ($value != CAP_INHERIT) {
assign_capability($capname, $value, $roleid, $sitecontext->id);
}
}
}
if (empty($errors)) {
// update normal role settings
$role->id = $roleid;
$role->name = $name;
$role->shortname = $shortname;
$role->description = $description;
if (!update_record('role', $role)) {
error('Could not update role!');
}
// set proper legacy type
foreach($legacyroles as $ltype=>$lcap) {
if ($ltype == $legacytype) {
assign_capability($lcap, CAP_ALLOW, $roleid, $sitecontext->id);
} else {
unassign_capability($lcap, $roleid);
}
}
// edited a role sitewide...
mark_context_dirty($sitecontext->path);
add_to_log(SITEID, 'role', 'edit', 'admin/roles/manage.php?action=edit&roleid='.$role->id, $role->name, '', $USER->id);
redirect('manage.php');
}
// edited a role sitewide - with errors, but still...
mark_context_dirty($sitecontext->path);
}
break;
case 'delete':
if (in_array($roleid, $defaultroles)) {
error('This role is used as one of the default system roles, it can not be deleted');
}
if ($confirm and data_submitted() and confirm_sesskey()) {
if (!delete_role($roleid)) {
// partially deleted a role sitewide...?
mark_context_dirty($sitecontext->path);
error('Could not delete role with ID '.$roleid);
}
// deleted a role sitewide...
mark_context_dirty($sitecontext->path);
} else if (confirm_sesskey()){
// show confirmation
admin_externalpage_print_header();
$optionsyes = array('action'=>'delete', 'roleid'=>$roleid, 'sesskey'=>sesskey(), 'confirm'=>1);
$a = new object();
$a->id = $roleid;
$a->name = $roles[$roleid]->name;
$a->shortname = $roles[$roleid]->shortname;
$a->count = (int)count_records('role_assignments', 'roleid', $roleid);
notice_yesno(get_string('deleterolesure', 'role', $a), 'manage.php', 'manage.php', $optionsyes, NULL, 'post', 'get');
admin_externalpage_print_footer();
die;
}
redirect('manage.php');
break;
case 'moveup':
if (array_key_exists($roleid, $roles) and confirm_sesskey()) {
$role = $roles[$roleid];
if ($role->sortorder > 0) {
$above = $roles[$rolesort[$role->sortorder - 1]];
if (!switch_roles($role, $above)) {
error("Cannot move role with ID $roleid");
}
}
}
redirect('manage.php');
break;
case 'movedown':
if (array_key_exists($roleid, $roles) and confirm_sesskey()) {
$role = $roles[$roleid];
if ($role->sortorder + 1 < $rolescount) {
$below = $roles[$rolesort[$role->sortorder + 1]];
if (!switch_roles($role, $below)) {
error("Cannot move role with ID $roleid");
}
}
}
redirect('manage.php');
break;
case 'duplicate':
if (!array_key_exists($roleid, $roles)) {
redirect('manage.php');
}
if ($confirm and data_submitted() and confirm_sesskey()) {
//ok - lets duplicate!
} else {
// show confirmation
admin_externalpage_print_header();
$optionsyes = array('action'=>'duplicate', 'roleid'=>$roleid, 'sesskey'=>sesskey(), 'confirm'=>1);
$optionsno = array('action'=>'view', 'roleid'=>$roleid);
$a = new object();
$a->id = $roleid;
$a->name = $roles[$roleid]->name;
$a->shortname = $roles[$roleid]->shortname;
notice_yesno(get_string('duplicaterolesure', 'role', $a), 'manage.php', 'manage.php', $optionsyes, $optionsno, 'post', 'get');
admin_externalpage_print_footer();
die;
}
// duplicate current role
$sourcerole = get_record('role','id',$roleid);
$fullname = $sourcerole->name;
$shortname = $sourcerole->shortname;
$currentfullname = "";
$currentshortname = "";
$counter = 0;
// find a name for the duplicated role
do {
if ($counter) {
$suffixfull = " ".get_string("copyasnoun")." ".$counter;
$suffixshort = "_".$counter;
} else {
$suffixfull = "";
$suffixshort = "";
}
$currentfullname = $fullname.$suffixfull;
// Limit the size of shortname - database column accepts <= 100 chars
$currentshortname = substr($shortname, 0, 100 - strlen($suffixshort)).$suffixshort;
$coursefull = get_record("role","name",addslashes($currentfullname));
$courseshort = get_record("role","shortname",addslashes($currentshortname));
$counter++;
} while ($coursefull || $courseshort);
$description = 'duplicate of '.$fullname;
if ($newrole = create_role($currentfullname, $currentshortname, $description)) {
// dupilcate all the capabilities
role_cap_duplicate($sourcerole, $newrole);
// dup'ed a role sitewide...
mark_context_dirty($sitecontext->path);
}
$rolename = get_field('role', 'name', 'id', $newrole);
add_to_log(SITEID, 'role', 'duplicate', 'admin/roles/manage.php?roleid='.$newrole.'&action=duplicate', $rolename, '', $USER->id);
redirect('manage.php');
break;
case 'reset':
if (!array_key_exists($roleid, $roles)) {
redirect('manage.php');
}
if ($confirm and data_submitted() and confirm_sesskey()) {
reset_role_capabilities($roleid);
// reset a role sitewide...
mark_context_dirty($sitecontext->path);
$rolename = get_field('role', 'name', 'id', $roleid);
add_to_log(SITEID, 'role', 'reset', 'admin/roles/manage.php?roleid='.$roleid.'&action=reset', $rolename, '', $USER->id);
redirect('manage.php?action=view&amp;roleid='.$roleid);
} else {
// show confirmation
admin_externalpage_print_header();
$optionsyes = array('action'=>'reset', 'roleid'=>$roleid, 'sesskey'=>sesskey(), 'confirm'=>1);
$optionsno = array('action'=>'view', 'roleid'=>$roleid);
$a = new object();
$a->id = $roleid;
$a->name = $roles[$roleid]->name;
$a->shortname = $roles[$roleid]->shortname;
$a->legacytype = get_legacy_type($roleid);
if (empty($a->legacytype)) {
$warning = get_string('resetrolesurenolegacy', 'role', $a);
} else {
$warning = get_string('resetrolesure', 'role', $a);
}
notice_yesno($warning, 'manage.php', 'manage.php', $optionsyes, $optionsno, 'post', 'get');
admin_externalpage_print_footer();
die;
}
break;
default:
break;
}
/// print UI now
admin_externalpage_print_header('');
$currenttab = 'manage';
include_once('managetabs.php');
if (($roleid and ($action == 'view' or $action == 'edit')) or $action == 'add') { // view or edit role details
if ($action == 'add') {
$roleid = 0;
if (empty($errors) or empty($newrole)) {
$role = new object();
$role->name = '';
$role->shortname = '';
$role->description = '';
$role->legacytype = '';
} else {
$role = stripslashes_safe($newrole);
}
} else if ($action == 'edit' and !empty($errors) and !empty($newrole)) {
$role = stripslashes_safe($newrole);
} else {
if(!$role = get_record('role', 'id', $roleid)) {
error('Incorrect role ID!');
}
$role->legacytype = get_legacy_type($role->id);
}
foreach ($roles as $rolex) {
$roleoptions[$rolex->id] = strip_tags(format_string($rolex->name));
}
// this is the array holding capabilities of this role sorted till this context
$r_caps = role_context_capabilities($roleid, $sitecontext);
// this is the available capabilities assignable in this context
$capabilities = fetch_context_capabilities($sitecontext);
$usehtmleditor = can_use_html_editor();
switch ($action) {
case 'add':
print_heading_with_help(get_string('addrole', 'role'), 'roles');
break;
case 'view':
print_heading_with_help(get_string('viewrole', 'role'), 'roles');
break;
case 'edit':
print_heading_with_help(get_string('editrole', 'role'), 'roles');
break;
}
echo '<div class="selector">';
if ($action == 'view') {
popup_form('manage.php?action=view&amp;roleid=', $roleoptions, 'switchrole', $roleid, '', '', '',
false, 'self', get_string('selectrole', 'role'));
echo '<div class="buttons">';
$legacytype = get_legacy_type($roleid);
$options = array();
$options['roleid'] = $roleid;
$options['action'] = 'edit';
print_single_button('manage.php', $options, get_string('edit'));
$options['action'] = 'reset';
if (empty($legacytype)) {
print_single_button('manage.php', $options, get_string('resetrolenolegacy', 'role'));
} else {
print_single_button('manage.php', $options, get_string('resetrole', 'role'));
}
$options['action'] = 'duplicate';
print_single_button('manage.php', $options, get_string('duplicaterole', 'role'));
print_single_button('manage.php', null, get_string('listallroles', 'role'));
echo '</div>';
}
echo '</div>';
$lang = str_replace('_utf8', '', current_language());
print_simple_box_start('center');
include_once('manage.html');
print_simple_box_end();
if ($usehtmleditor) {
use_html_editor('description');
}
} else {
print_heading_with_help(get_string('roles', 'role'), 'roles');
$table = new object;
$table->tablealign = 'center';
$table->align = array('right', 'left', 'left', 'left');
$table->wrap = array('nowrap', '', 'nowrap','nowrap');
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '90%';
$table->data = array();
$table->head = array(get_string('name'),
get_string('description'),
get_string('shortname'),
get_string('edit'));
/*************************
* List all current roles *
**************************/
foreach ($roles as $role) {
$stredit = get_string('edit');
$strdelete = get_string('delete');
$strmoveup = get_string('moveup');
$strmovedown = get_string('movedown');
$row = array();
$row[0] = '<a href="manage.php?roleid='.$role->id.'&amp;action=view">'.format_string($role->name).'</a>';
$row[1] = format_text($role->description, FORMAT_HTML);
$row[2] = s($role->shortname);
$row[3] = '<a title="'.$stredit.'" href="manage.php?action=edit&amp;roleid='.$role->id.'">'.
'<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'.$stredit.'" /></a> ';
if (in_array($role->id, $defaultroles)) {
$row[3] .= '<img src="'.$CFG->wwwroot.'/pix/spacer.gif" class="iconsmall" alt="" /> ';
} else {
$row[3] .= '<a title="'.$strdelete.'" href="manage.php?action=delete&amp;roleid='.$role->id.'&amp;sesskey='.sesskey().'">'.
'<img src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="'.$strdelete.'" /></a> ';
}
if ($role->sortorder != 0) {
$row[3] .= '<a title="'.$strmoveup.'" href="manage.php?action=moveup&amp;roleid='.$role->id.'&amp;sesskey='.sesskey().'">'.
'<img src="'.$CFG->pixpath.'/t/up.gif" class="iconsmall" alt="'.$strmoveup.'" /></a> ';
} else {
$row[3] .= '<img src="'.$CFG->wwwroot.'/pix/spacer.gif" class="iconsmall" alt="" /> ';
}
if ($role->sortorder+1 < $rolescount) {
$row[3] .= '<a title="'.$strmovedown.'" href="manage.php?action=movedown&amp;roleid='.$role->id.'&amp;sesskey='.sesskey().'">'.
'<img src="'.$CFG->pixpath.'/t/down.gif" class="iconsmall" alt="'.$strmovedown.'" /></a> ';
} else {
$row[3] .= '<img src="'.$CFG->wwwroot.'/pix/spacer.gif" class="iconsmall" alt="" /> ';
}
$table->data[] = $row;
}
print_table($table);
$options = new object();
$options->action = 'add';
echo '<div class="buttons">';
print_single_button('manage.php', $options, get_string('addrole', 'role'), 'get');
echo '</div>';
}
admin_externalpage_print_footer();
die;
?>
-20
View File
@@ -1,20 +0,0 @@
<?php
// this page deals with the 2 tabs for manage.php and grant.php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
$toprow = array();
$toprow[] = new tabobject('manage', $CFG->wwwroot.'/'.$CFG->admin.'/roles/manage.php', get_string('manageroles', 'role'));
$toprow[] = new tabobject('allowassign', $CFG->wwwroot.'/'.$CFG->admin.'/roles/allowassign.php', get_string('allowassign', 'role'));
$toprow[] = new tabobject('allowoverride', $CFG->wwwroot.'/'.$CFG->admin.'/roles/allowoverride.php', get_string('allowoverride', 'role'));
$tabs = array($toprow);
print_tabs($tabs, $currenttab);
?>

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