Compare commits

..

811 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
3047 changed files with 198931 additions and 102320 deletions
-1
View File
@@ -32,7 +32,6 @@
}
if (count($err) == 0) {
print_header();
foreach ($config as $name => $value) {
if (preg_match('/^pluginconfig_(.+?)$/', $name, $matches)) {
$plugin = "auth/$auth";
-1
View File
@@ -54,7 +54,6 @@
$config = (object)$a_config;
//weekdays conversions done. Continue
print_header();
foreach ($config as $name => $value) {
backup_set_config($name, $value);
}
-1
View File
@@ -47,7 +47,6 @@
unset($config->$item);
}
$block->config_save($config);
print_header();
redirect("$CFG->wwwroot/$CFG->admin/blocks.php", get_string("changessaved"), 1);
exit;
}
-1
View File
@@ -30,7 +30,6 @@
validate_form($config, $err);
if (count($err) == 0) {
print_header();
foreach ($config as $name => $value) {
if ($name == "sessioncookie") {
$value = eregi_replace("[^a-zA-Z]", "", $value);
+6
View File
@@ -74,6 +74,9 @@ class configvar {
$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() {
@@ -135,6 +138,9 @@ class configvarrss extends configvar {
$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";
+1 -1
View File
@@ -178,7 +178,7 @@ function editor_get_dictionaries () {
$dictionaries = array();
$dicts = array();
if(!($handle = @popen($cmd .' dump dicts', 'r'))) {
if(!($handle = @popen(escapeshellarg($cmd) .' dump dicts', 'r'))) {
return $strerror = "Couldn't create handle!";
exit;
}
+1 -17
View File
@@ -96,7 +96,7 @@
}
/// Print form and popup menu
echo '<center><form method="post" action="'.$CFG->wwwroot.'/admin/environment.php">';
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.'" />';
@@ -107,22 +107,6 @@
/// Gather and show results
$status = check_moodle_environment($version, $environment_results);
/// Process action
if ($form = data_submitted()) {
if (confirm_sesskey()) {
if ($form->action == "disable") {
} else {
}
}
}
/// Default action, show explanation and popup menu
/// Print footer
print_footer();
?>
+16 -3
View File
@@ -12,13 +12,26 @@
</MOODLE>
<MOODLE version="1.6">
<DATABASE level="required">
<VENDOR name="mysql" version="4.1.12" />
<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" />
</DATABASE>
<PHP version="4.3.0" level="required" />
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="optional" />
<PHP_EXTENSION name="mbstring" level="optional" />
<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>
</COMPATIBILITY_MATRIX>
+1 -1
View File
@@ -1,4 +1,4 @@
<?
<?php // $Id$
/** This expects the output from a command like
* clamscan -r --infected --no-summary <files> 2>&1 | php -d error_log=/path/to/log thisfile.php
* also it's important that the output of clamscan prints the FULL PATH to each infected file, so use absolute paths for area to scan
+17 -1
View File
@@ -18,6 +18,13 @@
die;
}
/// 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);
}
/// Check some PHP server settings
@@ -312,6 +319,11 @@
print_spacer(10,10);
}
if (ini_get_bool('register_globals') && !ini_get_bool('magic_quotes_gpc')) {
print_simple_box(get_string('globalsquoteswarning', 'admin'), 'center');
}
/// If no recently cron run
$lastcron = get_field_sql('SELECT max(lastcron) FROM ' . $CFG->prefix . 'modules');
if (time() - $lastcron > 3600 * 24) {
@@ -403,8 +415,12 @@
"<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"));
@@ -416,7 +432,7 @@
//// 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-2005 Martin Dougiamas<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>";
//////////////////////////////////////////////////////////////////////////////////////////////////
-2
View File
@@ -37,8 +37,6 @@
$moduleprefix = '';
}
print_header();
foreach ($config as $name => $value) {
set_config($moduleprefix.$name, $value);
}
+15 -2
View File
@@ -29,7 +29,20 @@ function online_assignment_cleanup($output=false) {
echo '<center>';
}
// get the module id for assignments from db
/// We don't want to run this code if we are doing an upgrade from an assignment
/// version earlier than 2005041400
/// because the assignment type field will not exist
$amv = get_field('modules', 'version', 'name', 'assignment');
if ((int)$amv < 2005041400) {
if ($output) {
echo '</center>';
}
return;
}
/// get the module id for assignments from db
$arecord = get_record('modules', 'name', 'assignment');
$aid = $arecord->id;
@@ -44,7 +57,7 @@ function online_assignment_cleanup($output=false) {
if ($output) print_heading($fullname);
/// retrieve a list of sections beyond what is currently being shown
$sql = 'SELECT * FROM '.$CFG->prefix.'course_sections WHERE `course`='.$course->id.' AND `section`>'.$course->numsections.' ORDER BY `section` ASC';
$sql = 'SELECT * FROM '.$CFG->prefix.'course_sections WHERE course='.$course->id.' AND section>'.$course->numsections.' ORDER BY section ASC';
if (!($xsections = get_records_sql($sql))) {
if ($output) echo 'No extra sections<br />';
continue;
+20 -15
View File
@@ -3,32 +3,37 @@
require_once("../config.php");
$topframe = optional_param('topframe', false, PARAM_BOOL);
$bottomframe = optional_param('bottomframe', false, PARAM_BOOL);
require_login();
if (!isadmin()) {
error("Only the admin can use this page");
}
if (isset($topframe)) {
if (!$topframe && !$bottomframe) {
?>
<head>
<title>PHP info</title>
</head>
<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>
<?php
} else if ($topframe && confirm_sesskey()) {
$stradministration = get_string("administration");
$site = get_site();
print_header("$site->shortname: phpinfo", "$site->fullname",
print_header("$site->shortname: phpinfo", "$site->fullname",
"<a target=\"$CFG->framename\" href=\"index.php\">$stradministration</a> -> PHP info");
exit;
}
if (isset($bottomframe)) {
} else if ($bottomframe && confirm_sesskey()) {
phpinfo();
exit;
}
?>
<head>
<title>PHP info</title>
</head>
<frameset rows="80,*">
<frame src="phpinfo.php?topframe=true">
<frame src="phpinfo.php?bottomframe=true">
</frameset>
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/php -f
<?
<?php // $Id$
define('FULLME','cron'); // prevent warnings
//error_reporting(0);
//ini_set('display_errors',0);
+35
View File
@@ -0,0 +1,35 @@
<?php
include("../config.php");
$action = optional_param('action','LIST',PARAM_ALPHA);
$url = optional_param('url');
$info = optional_param('info');
if (!isadmin()) {
error("Only the admin can use this page");
}
print_header('Admin : Unchecked Vars' );
if ($action == 'DELETE') {
delete_records('log', 'url', $url, 'info', $info);
}
if ($errors = get_records_sql("SELECT DISTINCT url, info
FROM {$CFG->prefix}log
WHERE module = 'dev' AND
action = 'unchecked vars'")) {
echo '<table border="1" cellpadding="5">';
foreach ($errors as $error) {
echo '<tr>';
echo '<td>'.$error->url.'</td>';
echo '<td>'.$error->info.'</td>';
echo '<td><a href="unchecked_vars.php?action=DELETE&amp;url='.$error->url.'&amp;info='.$error->info.'">Delete this</a></td>';
echo '</tr>';
}
echo '</table>';
} else {
echo "No unchecked vars were detected";
}
?>
+2 -2
View File
@@ -5,7 +5,7 @@
require_once("../config.php");
optional_variable($numusers, 0);
$numusers = optional_param('numusers', 0, PARAM_INT);
require_login();
@@ -141,7 +141,7 @@
}
if ($record[$header[0]]) {
// add a new user to the database
optional_variable($newuser, "");
$newuser = optional_param('newuser', "", PARAM_CLEAN);
// add fields to object $user
foreach ($record as $name => $value) {
+21 -7
View File
@@ -1,13 +1,27 @@
<?php
require_once('languages.php');
// Initialize vars
optional_variable($config->cas_hostname,"");
optional_variable($config->cas_port,"");
optional_variable($config->cas_version,"");
optional_variable($config->cas_baseuri,"");
optional_variable($config->cas_language,"");
optional_variable($config->cas_use_cas,"");
optional_variable($config->cas_create_user,"0");
if (!isset ($config->cas_hostname)) {
$config->cas_hostname = "";
}
if (!isset ($config->cas_port)) {
$config->cas_port = "";
}
if (!isset ($config->cas_version)) {
$config->cas_version = "";
}
if (!isset ($config->cas_baseuri)) {
$config->cas_baseuri = "";
}
if (!isset ($config->cas_language)) {
$config->cas_language = "";
}
if (!isset ($config->cas_use_cas)) {
$config->cas_use_cas = "";
}
if (!isset ($config->cas_create_user)) {
$config->cas_create_user = "0";
}
?>
+1 -1
View File
@@ -136,7 +136,7 @@ function cas_automatic_authenticate ($user="") {
global $CFG;
if (!$cas_validate){
$cas_validate=true;
phpCAS::client($CFG->cas_version,$CFG->cas_hostname,(Integer)$CFG->cas_port,$CFG->cas_baseuri);
phpCAS::client($CFG->cas_version,$CFG->cas_hostname,(int)$CFG->cas_port,$CFG->cas_baseuri);
phpCAS::setLang($CFG->cas_language);
if (!phpCAS::isAuthenticated() && !$CFG->guestloginbutton){
phpCAS::authenticateIfNeeded();
+1 -1
View File
@@ -76,7 +76,7 @@ function auth_get_userinfo($username){
if ($rs = $authdb->Execute("SELECT ".$pcfg["field_map_$field"]." FROM $CFG->auth_dbtable
WHERE $CFG->auth_dbfielduser = '$username'")) {
if ( $rs->RecordCount() == 1 ) {
$result["$field"] = $rs->fields[0];
$result["$field"] = addslashes(stripslashes(utf8_decode($rs->fields[0])));
}
}
}
+67 -25
View File
@@ -1,29 +1,71 @@
<?php
// Initialize vars
optional_variable($config->ldap_host_url, "");
optional_variable($config->ldap_contexts, "");
optional_variable($config->ldap_user_type, "");
optional_variable($config->ldap_user_attribute, "");
optional_variable($config->ldap_search_sub, "");
optional_variable($config->ldap_opt_deref, "");
optional_variable($config->ldap_preventpassindb, 0);
optional_variable($config->ldap_bind_dn, "");
optional_variable($config->ldap_bind_pw, "");
optional_variable($config->ldap_version, "2");
optional_variable($config->ldap_objectclass, "");
optional_variable($config->ldap_memberattribute, "");
optional_variable($config->ldap_creators, "");
optional_variable($config->ldap_create_context, "");
optional_variable($config->ldap_expiration, "");
optional_variable($config->ldap_expiration_warning, "10");
optional_variable($config->ldap_expireattr, "");
optional_variable($config->ldap_gracelogins, "");
optional_variable($config->ldap_graceattr, "");
optional_variable($config->auth_user_create, "");
optional_variable($config->auth_user_create, "");
optional_variable($config->auth_ldap_forcechangepassword, "");
optional_variable($config->auth_ldap_stdchangepassword, false);
if (!isset ($config->ldap_host_url)) {
$config->ldap_host_url = "";
}
if (!isset ($config->ldap_contexts)) {
$config->ldap_contexts = "";
}
if (!isset ($config->ldap_user_attribute)) {
$config->ldap_user_attribute = "";
}
if (!isset ($config->ldap_user_type)) {
$config->ldap_user_type = "";
}
if (!isset ($config->ldap_search_sub)) {
$config->ldap_search_sub = "";
}
if (!isset ($config->ldap_opt_deref)) {
$config->ldap_opt_deref = "";
}
if (!isset ($config->ldap_preventpassindb)) {
$config->ldap_preventpassindb = 0;
}
if (!isset ($config->ldap_bind_dn)) {
$config->ldap_bind_dn = "";
}
if (!isset ($config->ldap_bind_pw)) {
$config->ldap_bind_pw = "";
}
if (!isset ($config->ldap_version)) {
$config->ldap_version = "2";
}
if (!isset ($config->ldap_objectclass)) {
$config->ldap_objectclass = "";
}
if (!isset ($config->ldap_memberattribute)) {
$config->ldap_memberattribute = "";
}
if (!isset ($config->ldap_creators)) {
$config->ldap_creators = "";
}
if (!isset ($config->ldap_create_context)) {
$config->ldap_create_context = "";
}
if (!isset ($config->ldap_expiration)) {
$config->ldap_expiration = "";
}
if (!isset ($config->ldap_expiration_warning)) {
$config->ldap_expiration_warning = "10";
}
if (!isset ($config->ldap_expireattr)) {
$config->ldap_expireattr = "";
}
if (!isset ($config->ldap_gracelogins)) {
$config->ldap_gracelogins = "";
}
if (!isset ($config->ldap_graceattr)) {
$config->ldap_graceattr = "";
}
if (!isset ($config->auth_user_create)) {
$config->auth_user_create = "";
}
if (!isset ($config->auth_ldap_forcechangepassword)) {
$config->auth_ldap_forcechangepassword = "";
}
if (!isset ($config->auth_ldap_stdchangepassword)) {
$config->auth_ldap_stdchangepassword = false;
}
if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
print '<tr><td><p align="center"><font color="red"><strong>Warning:
@@ -38,7 +80,7 @@ if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
</td>
</tr>
<tr valign="top" class="required">
<tr valign="top" class="required">
<td align="right">ldap_host_url:</td>
<td>
<input name="ldap_host_url" type="text" size="30" value="<?php echo $config->ldap_host_url?>">
+79 -44
View File
@@ -68,7 +68,7 @@ function auth_user_login ($username, $password) {
}
// Try to bind with current username and password
$ldap_login = @ldap_bind($ldapconnection, $ldap_user_dn, $password);
$ldap_login = @ldap_bind($ldapconnection, $ldap_user_dn, stripslashes($password));
ldap_close($ldapconnection);
if ($ldap_login) {
return true;
@@ -124,11 +124,19 @@ function auth_get_userinfo($username){
if (!is_array($values)) {
$values = array($values);
}
$ldapval = NULL;
foreach ($values as $value) {
if(isset($user_entry[0][strtolower($value)][0])){
$result[$key]=addslashes(stripslashes(utf8_decode($user_entry[0][strtolower($value)][0])));
if(is_array($user_entry[0][strtolower($value)])) {
$newval = addslashes(stripslashes(utf8_decode($user_entry[0][strtolower($value)][0])));
}
else {
$newval = addslashes(stripslashes(utf8_decode($user_entry[0][strtolower($value)])));
}
if (!empty($newval)) { // favour ldap entries that are set
$ldapval = $newval;
}
}
$result[$key] = $ldapval;
}
}
@@ -210,14 +218,14 @@ function auth_user_create ($userobject,$plainpass) {
switch ($CFG->ldap_user_type) {
case 'edir':
$newuser['objectClass']= array("inetOrgPerson","organizationalPerson","person","top");
$newuser['uniqueId']= $userobject->username;
$newuser['logindisabled']="TRUE";
$newuser['userpassword']=$plainpass;
$newuser['objectClass']= array("inetOrgPerson","organizationalPerson","person","top");
$newuser['uniqueId']= $userobject->username;
$newuser['logindisabled']="TRUE";
$newuser['userpassword']=$plainpass;
break;
default:
error('auth: ldap auth_user_create() does not support selected usertype (..yet)');
error('auth: ldap auth_user_create() does not support selected usertype:"'.$CFG->ldap_user_type.'" (..yet)');
}
$uadd = ldap_add($ldapconnection, $CFG->ldap_user_attribute."=$userobject->username,".$CFG->ldap_create_context, $newuser);
ldap_close($ldapconnection);
@@ -379,10 +387,10 @@ function auth_sync_users ($bulk_insert_records = 1000, $do_updates=1) {
if(strtolower($CFG->dbtype) === 'mysql'){
// help old mysql versions cope with large temp tables
execute_sql('SET SQL_BIG_TABLES=1', false);
execute_sql('CREATE TEMPORARY TABLE ' . $CFG->prefix .'extuser (idnumber VARCHAR(12), PRIMARY KEY (idnumber)) TYPE=MyISAM',false);
execute_sql('CREATE TEMPORARY TABLE ' . $CFG->prefix .'extuser (idnumber VARCHAR(64), PRIMARY KEY (idnumber)) TYPE=MyISAM',false);
} elseif (strtolower($CFG->dbtype) === 'postgres7'){
$bulk_insert_records = 1; // no support for multiple sets of values
execute_sql('CREATE TEMPORARY TABLE '.$CFG->prefix.'extuser (idnumber VARCHAR(12), PRIMARY KEY (idnumber))',false);
execute_sql('CREATE TEMPORARY TABLE '.$CFG->prefix.'extuser (idnumber VARCHAR(64), PRIMARY KEY (idnumber))',false);
}
@@ -508,7 +516,11 @@ function auth_sync_users ($bulk_insert_records = 1000, $do_updates=1) {
$updatekeys = array();
foreach ($all_keys as $key) {
if (preg_match('/^field_updatelocal_(.+)$/',$key, $match)) {
if ($pcfg->{$match[0]}) { // if it has a true value
// if we have a field to update it from
// and it must be updated 'onlogin' we
// update it on cron
if ( !empty($pcfg->{'field_map_'.$match[1]})
&& $pcfg->{$match[0]} === 'onlogin') {
array_push($updatekeys, $match[1]); // the actual key name
}
}
@@ -600,7 +612,7 @@ function auth_sync_users ($bulk_insert_records = 1000, $do_updates=1) {
$CFG->debug=$old_debug;
$userobj = auth_ldap_update_user_record($user->username);
if(isset($CFG->{'auth_ldap_forcechangepassword'}) && $CFG->{'auth_ldap_forcechangepassword'}){
set_user_preference('auth_forcepasswordchange', 1, $userobj);
set_user_preference('auth_forcepasswordchange', 1, $userobj->id);
}
// update course creators
@@ -614,7 +626,7 @@ function auth_sync_users ($bulk_insert_records = 1000, $do_updates=1) {
}
} else {
if ( record_exists("user_coursecreators", "userid", $user->id)) {
$creator = delete_records("user_coursecreators", "userid", $$user->id);
$creator = delete_records("user_coursecreators", "userid", $user->id);
if (! $creator) {
error("Cannot remove user from course creators.");
}
@@ -703,17 +715,19 @@ function auth_ldap_bulk_insert($users){
* @return boolen result
*/
function auth_user_activate ($username) {
global $CFG;
$ldapconnection = auth_ldap_connect();
global $CFG;
$ldapconnection = auth_ldap_connect();
$userdn = auth_ldap_find_userdn($ldapconnection, $username);
switch ($CFG->ldap_user_type) {
case 'edir':
$newinfo['loginDisabled']="FALSE";
default;
error ('auth: ldap auth_user_activate() does not support selected usertype (..yet)');
}
case 'edir':
$newinfo['loginDisabled']="FALSE";
break;
default:
error ('auth: ldap auth_user_activate() does not support selected usertype:"'.$CFG->ldap_user_type.'" (..yet)');
}
$result = ldap_modify($ldapconnection, $userdn, $newinfo);
ldap_close($ldapconnection);
return $result;
@@ -735,7 +749,8 @@ function auth_user_disable ($username) {
$userdn = auth_ldap_find_userdn($ldapconnection, $username);
switch ($CFG->ldap_user_type) {
case 'edir':
$newinfo['loginDisabled']="TRUE";
$newinfo['loginDisabled']="TRUE";
break;
default:
error ('auth: ldap auth_user_disable() does not support selected usertype (..yet)');
}
@@ -811,10 +826,19 @@ function auth_user_update($olduser, $newuser) {
if ($user_info_result){
$user_entry = auth_ldap_get_entries($ldapconnection, $user_info_result);
if (count($user_entry)) {
trigger_error("ldap: Strange! More than one user record found in ldap. Only using the first one.");
}
$user_entry = $user_entry[0];
//error_log(var_export($user_entry) . 'fpp' );
foreach ($attrmap as $key=>$ldapkeys){
if (!empty($pcfg->{'field_updateremote_'. $key})) {
// only process if the moodle field ($key) has changed and we
// are set to update LDAP with it
if ($olduser->$key !== $newuser->$key &&
!empty($pcfg->{'field_updateremote_'. $key})) {
// for ldap values that could be in more than one
// ldap key, we will do our best to match
@@ -822,33 +846,42 @@ function auth_user_update($olduser, $newuser) {
$ambiguous = true;
$changed = false;
if (!is_array($ldapkeys)) {
$ldapkeys = $array($ldapkeys);
$ldapkeys = array($ldapkeys);
}
if (count($ldapkeys) < 2) {
$ambiguous = false;
}
foreach ($ldapkeys as $ldapkey) {
$ldapkey = strtolower($ldapkey);
$ldapvalue = $user_entry[$ldapkey][0];
if (!$ambiguous) {
// skip update if the values already match
if( !($newuser->$key === $user_entry[0][strtolower($ldapkey)][0]) ){
if( !($newuser->$key === $ldapvalue) ){
ldap_modify($ldapconnection, $user_dn, array($ldapkey => $newuser->$key));
} else {
error_log("Skip updating field $key for entry $user_dn: it seems to be already same on LDAP. " .
" old moodle value: '" . $olduser->$key .
"' new value '" . $newuser->$key .
"' current value in ldap entry " . $user_entry[0][strtolower($ldapkey)][0]);
"' current value in ldap entry " . $ldapvalue);
}
} else { // ambiguous
// check the old values match
//error_log("keys $key $ldapkey");
//error_log("olduser " . $olduser->$key);
//error_log("ldapuser " . $user_entry[0][strtolower($ldapkey)][0]);
if ( !empty($olduser->$key)
&& !empty($user_entry[0][strtolower($ldapkey)][0])
&& $olduser->$key === $user_entry[0][strtolower($ldapkey)][0] ) {
// we found which value to update!
error_log("Matched: ". $olduser->$key . " === " . $user_entry[0][strtolower($ldapkey)][0]);
// value empty before in Moodle (and LDAP) - use 1st ldap candidate field
// no need to guess
if (empty($olduser->$key)) { // value empty before - use 1st ldap candidate
if(ldap_modify($ldapconnection, $user_dn, array($ldapkey => $newuser->$key))){
$changed=true;
last;
} else {
error ('Error updating LDAP record. Error code: '
. ldap_errno($ldapconnection) . '; Error string : '
. ldap_err2str(ldap_errno($ldapconnection)));
}
}
// we found which ldap key to update!
if ( !empty($ldapvalue) && $olduser->$key === $ldapvalue ) {
// error_log("Matched: ". $olduser->$key . " === " . $ldapvalue);
if(ldap_modify($ldapconnection, $user_dn, array($ldapkey => $newuser->$key))){
$changed=true;
last;
@@ -1030,7 +1063,7 @@ function auth_ldap_getdefaults(){
'rfc2307' => 'member',
'rfc2307bis' => 'member',
'samba' => 'member',
'ad' => 'member', //is this right?
'ad' => 'member',
'default' => 'member'
);
$default['ldap_memberattribute_isdn'] = array(
@@ -1038,7 +1071,7 @@ function auth_ldap_getdefaults(){
'rfc2307' => '0',
'rfc2307bis' => '1',
'samba' => '0', //is this right?
'ad' => '0', //is this right?
'ad' => '1',
'default' => '0'
);
$default['ldap_expireattr'] = array (
@@ -1213,7 +1246,8 @@ function auth_ldap_isgroupmember ($username='', $groupdns='') {
}
//echo "Checking group $group for member $username\n";
$search = @ldap_read($ldapconnection, $group, '('.$CFG->ldap_memberattribute.'='.$username.')', array($CFG->ldap_memberattribute));
if (ldap_count_entries($ldapconnection, $search)) {$info = auth_ldap_get_entries($ldapconnection, $search);
if (!empty($search) AND ldap_count_entries($ldapconnection, $search)) {$info = auth_ldap_get_entries($ldapconnection, $search);
if (count($info) > 0 ) {
// user is member of group
@@ -1270,7 +1304,8 @@ function auth_ldap_connect($binddn='',$bindpwd=''){
if (!empty($binddn)){
//bind with search-user
$bindresult=@ldap_bind($connresult, $binddn,$bindpwd);
//$debuginfo .= 'Using bind user'.$binddn.'and password:'.$bindpwd;
$bindresult=ldap_bind($connresult, $binddn,$bindpwd);
} else {
//bind anonymously
$bindresult=@ldap_bind($connresult);
@@ -1284,7 +1319,7 @@ function auth_ldap_connect($binddn='',$bindpwd=''){
return $connresult;
}
$debuginfo == "<br/>Server: '$server' <br/> Connection: '$connresult'<br/> Bind result: '$bindresult'</br>";
$debuginfo .= "<br/>Server: '$server' <br/> Connection: '$connresult'<br/> Bind result: '$bindresult'</br>";
}
//If any of servers are alive we have already returned connection
@@ -1414,7 +1449,7 @@ function auth_ldap_get_userlist($filter="*") {
$filter,
array($CFG->ldap_user_attribute));
}
$users = auth_ldap_get_entries($ldapconnection, $ldap_result);
//add found users to list
@@ -1442,7 +1477,7 @@ function auth_ldap_get_entries($conn, $searchresult){
$fresult=array();
$entry = ldap_first_entry($conn, $searchresult);
do {
$attributes = ldap_get_attributes($conn, $entry);
$attributes = @ldap_get_attributes($conn, $entry);
for($j=0; $j<$attributes['count']; $j++) {
$values = ldap_get_values_len($conn, $entry,$attributes[$j]);
if (is_array($values)) {
@@ -1453,7 +1488,7 @@ function auth_ldap_get_entries($conn, $searchresult){
}
$i++;
}
while ($entry = ldap_next_entry($conn, $entry));
while ($entry = @ldap_next_entry($conn, $entry));
//were done
return ($fresult);
}
+12 -9
View File
@@ -1,14 +1,17 @@
<?php
// Set default values
$pluginconfig = get_config('auth/shibboleth');
// Set default values
$pluginconfig = get_config('auth/shibboleth');
if (!isset($config->auth_instructions) or empty($pluginconfig->shib_user_attribute)) {
$config->auth_instructions = get_string('auth_shib_instructions', 'auth', $CFG->wwwroot.'/auth/shibboleth/shib-protected.php');
}
optional_variable($pluginconfig->user_attribute, '');
optional_variable($pluginconfig->convert_data, '');
if (!isset($config->auth_instructions) or empty($pluginconfig->shib_user_attribute)) {
$config->auth_instructions = get_string('auth_shib_instructions', 'auth', $CFG->wwwroot.'/auth/shibboleth/shib-protected.php');
}
if (!isset ($pluginconfig->user_attribute)) {
$pluginconfig->user_attribute = '';
}
if (!isset ($pluginconfig->convert_data)) {
$pluginconfig->convert_data = '';
}
?>
<tr>
<td colspan="3" align="left">
@@ -42,7 +45,7 @@ optional_variable($pluginconfig->convert_data, '');
<td align="right"><?php print_string("auth_shib_convert_data", "auth") ?>:</td>
<td>
<input name="pluginconfig_convert_data" type="text" size="30" value="<?php echo $pluginconfig->convert_data?>">
<?
<?php
if ($pluginconfig->convert_data && $pluginconfig->convert_data != '' && !is_readable($pluginconfig->convert_data)){
echo '<br><font color="red">';
print_string("auth_shib_convert_data_warning", "auth");
+7 -8
View File
@@ -26,7 +26,6 @@ function auth_get_userinfo($username) {
// reads user information from shibboleth attributes and return it in array()
global $CFG;
$config = (array)$CFG;
$pluginconfig = get_config('auth/shibboleth');
// Check whether we have got all the essential attributes
@@ -47,20 +46,20 @@ function auth_get_userinfo($username) {
foreach ($attrmap as $key=>$value) {
$result[$key]=utf8_decode($_SERVER[$value]);
}
// Provide an API to modify the information to fit the Moodle internal
// Provide an API to modify the information to fit the Moodle internal
// data representation
if (
$config["shib_convert_data"]
&& $config["shib_convert_data"] != ''
&& is_readable($config["shib_convert_data"])
$pluginconfig->convert_data
&& $pluginconfig->convert_data != ''
&& is_readable($pluginconfig->convert_data)
){
// Include a custom file outside the Moodle dir to
// modify the variable $moodleattributes
include($config["shib_convert_data"]);
include($pluginconfig->convert_data);
}
return $result;
}
+1 -1
View File
@@ -190,7 +190,7 @@
echo "</ul></li>";
//User info
if ($status && $preferences->backup_users) {
if ($status) {
echo "<li>".get_string("writinguserinfo").'</li>';
if (!$status = backup_user_info($backup_file,$preferences)) {
notify("An error occurred while backing up user info");
+14 -2
View File
@@ -271,7 +271,7 @@
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_files
(backup_code, file_type, path, old_id)
VALUES
('$backup_unique_code','user','$dir','$userid')",false);
('$backup_unique_code','user','".addslashes($dir)."','$userid')",false);
}
//Do some output
backup_flush(30);
@@ -315,7 +315,7 @@
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_files
(backup_code, file_type, path)
VALUES
('$backup_unique_code','course','$dir')",false);
('$backup_unique_code','course','".addslashes($dir)."')",false);
}
//Do some output
backup_flush(30);
@@ -435,8 +435,20 @@
//Return the start tag, the contents and the end tag
function full_tag($tag,$level=0,$endline=true,$content,$to_utf=true) {
global $CFG;
//Here we encode absolute links
$content = backup_encode_absolute_links($content);
//If enabled, we strip all the control chars from the text but tabs, newlines and returns
//because they are forbiden in XML 1.0 specs. The expression below seems to be
//UTF-8 safe too because it simply ignores the rest of characters.
if (!empty($CFG->backup_strip_controlchars)) {
$content = preg_replace("/(?(?=[[:cntrl:]])[^\n\r\t])/is","",$content);
}
//Start to build the tag
$st = start_tag($tag,$level,$endline);
$co="";
if ($to_utf) {
+5 -3
View File
@@ -1,9 +1,11 @@
<?php
<?php // $Id$
// This file facilitates the conversion of a Blackboard course export
// into a Moodle course export. It assumes an unzipped directory and makes in-place alterations.
defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
// Ziba Scott <ziba@linuxbox.com> 10-25-04
require_once('xsl_emulate_xslt.inc');
require_once($CFG->dirroot.'/backup/bb/xsl_emulate_xslt.inc');
function get_subdirs($directory){
$opendirectory = opendir( $directory );
+2 -19
View File
@@ -81,24 +81,6 @@
return $status;
}
//Function to check if a directory exists
//and, optionally, create it
function check_dir_exists($dir,$create=false) {
global $CFG;
$status = true;
if(!is_dir($dir)) {
if (!$create) {
$status = false;
} else {
umask(0000);
$status = mkdir ($dir,$CFG->directorypermissions);
}
}
return $status;
}
//Function to check and create the needed dir to
//save all the backup
function check_and_create_backup_dir($backup_unique_code) {
@@ -289,7 +271,8 @@
//$perms=fileperms($from_file);
//return copy($from_file,$to_file) && chmod($to_file,$perms);
umask(0000);
if (copy($from_file,$to_file) && chmod($to_file,$CFG->directorypermissions)) {
if (copy($from_file,$to_file)) {
chmod($to_file,$CFG->directorypermissions);
if (!empty($log_clam)) {
clam_log_upload($to_file,null,true);
}
+1 -1
View File
@@ -112,7 +112,7 @@
//Adjust some php variables to the execution of this script
@ini_set("max_execution_time","3000");
raise_memory_limit("memory_limit","128M");
raise_memory_limit("128M");
//Call the form, depending the step we are
+16 -2
View File
@@ -149,11 +149,19 @@
//Now, select the course if needed
if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0) and (iscreator())) {
if ($courses = get_courses("all","c.fullname","c.id,c.fullname,c.shortname")) {
if ($courses = get_courses("all","c.fullname","c.id,c.fullname,c.shortname,c.visible")) {
print_heading(get_string("choosecourse"));
print_simple_box_start("center");
foreach ($courses as $course) {
echo "<a href=\"restore.php?course_id=$course->id&launch=check&id=$id&file=$file\">$course->fullname ($course->shortname)</a><br />";
if (!isteacheredit($course->id)) {
continue;
}
if (empty($course->visible)) {
$optdimmed = ' class="dimmed" ';
} else {
$optdimmed = '';
}
echo "<a $optdimmed href=\"restore.php?course_id=$course->id&launch=check&id=$id&file=$file\">$course->fullname ($course->shortname)</a><br />";
}
print_simple_box_end();
} else {
@@ -162,6 +170,12 @@
}
//Checks everything and execute restore
} else if ((($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id != 0)) or ($restore->restoreto == 2)) {
//Final access control check
if ($restore->course_id == 0 and !iscreator()) {
error("You need to be a creator or admin to restore into new course!");
} else if ($restore->course_id != 0 and !isteacheredit($restore->course_id)) {
error("You need to be an edit teacher or admin to restore into selected course!");
}
$show_continue_button = true;
//Check if we've selected any mod's user info and restore->users
//is set to none. Change it to course and inform.
+65 -38
View File
@@ -446,9 +446,10 @@
}
$currentfullname = $fullname.$suffixfull;
$currentshortname = $shortname.$suffixshort;
$course = get_record("course","fullname",addslashes($currentfullname));
$coursefull = get_record("course","fullname",addslashes($currentfullname));
$courseshort = get_record("course","shortname",addslashes($currentshortname));
$counter++;
} while ($course);
} while ($coursefull || $courseshort);
//New name = currentname
$course_header->course_fullname = $currentfullname;
@@ -1015,6 +1016,7 @@
$preferencescount = count_records ('backup_ids', 'backup_code', $restore->backup_unique_code, 'table_name', 'grade_preferences');
$letterscount = count_records ('backup_ids', 'backup_code', $restore->backup_unique_code, 'table_name', 'grade_letter');
$categoriescount = count_records ('backup_ids', 'backup_code', $restore->backup_unique_code, 'table_name', 'grade_category');
if ($preferencescount || $letterscount || $categoriescount) {
//Start ul
echo '<ul>';
@@ -1055,7 +1057,7 @@
foreach ($recs as $rec) {
//Get the full record from backup_ids
$data = backup_getid($restore->backup_unique_code,'grade_preferences',$rec->old_id);
if ($data) {
if ($data) {
//Now get completed xmlized object
$info = $data->info;
//traverse_xmlize($info); //Debug
@@ -1071,16 +1073,16 @@
if (!$prerec = get_record('grade_preferences','courseid',$dbrec->courseid,'preference',$dbrec->preference)) {
$status = insert_record('grade_preferences',$dbrec);
}
//Do some output
$counter++;
if ($counter % 1 == 0) {
echo ".";
if ($counter % 20 == 0) {
echo "<br />";
}
backup_flush(300);
}
//Increment counters
$counter++;
//Do some output
if ($counter % 1 == 0) {
echo ".";
if ($counter % 20 == 0) {
echo "<br />";
}
backup_flush(300);
}
}
}
@@ -1091,7 +1093,7 @@
//If destination course has letters, skip restoring letters
$hasletters = get_records('grade_letter', 'courseid', $restore->course_id);
if ($preferencescount && $continue && !$hasletters) {
if ($letterscount && $continue && !$hasletters) {
echo '<li>'.get_string('letters','grades').'</li>';
$counter = 0;
while ($counter < $letterscount) {
@@ -1105,7 +1107,7 @@
foreach ($recs as $rec) {
//Get the full record from backup_ids
$data = backup_getid($restore->backup_unique_code,'grade_letter',$rec->old_id);
if ($data) {
if ($data) {
//Now get completed xmlized object
$info = $data->info;
//traverse_xmlize($info); //Debug
@@ -1119,16 +1121,16 @@
//Structure is equal to db, insert record
$status = insert_record('grade_letter',$dbrec);
//Do some output
$counter++;
if ($counter % 1 == 0) {
echo ".";
if ($counter % 20 == 0) {
echo "<br />";
}
backup_flush(300);
}
//Increment counters
$counter++;
//Do some output
if ($counter % 1 == 0) {
echo ".";
if ($counter % 20 == 0) {
echo "<br />";
}
backup_flush(300);
}
}
}
@@ -1145,13 +1147,13 @@
$recs = get_records_select("backup_ids","table_name = 'grade_category' AND backup_code = '$restore->backup_unique_code'",
"old_id",
"old_id, old_id",
$counter,
$countercat,
$recordset_size);
if ($recs) {
foreach ($recs as $rec) {
//Get the full record from backup_ids
$data = backup_getid($restore->backup_unique_code,'grade_category',$rec->old_id);
if ($data) {
if ($data) {
//Now get completed xmlized object
$info = $data->info;
//traverse_xmlize($info); //Debug
@@ -1252,16 +1254,18 @@
$order++;
}
}
//Do some output
$countercat++;
if ($countercat % 1 == 0) {
echo ".";
if ($countercat % 20 == 0) {
echo "<br />";
}
backup_flush(300);
}
}
//Increment counters
$countercat++;
//Do some output
if ($countercat % 1 == 0) {
echo ".";
if ($countercat % 20 == 0) {
echo "<br />";
}
backup_flush(300);
}
}
}
}
@@ -2524,6 +2528,10 @@
$log->info = $log->course;
$toinsert = true;
break;
case "guest":
$log->url = "view.php?id=".$log->course;
$toinsert = true;
break;
case "user report":
//recode the info field (it's the user id)
$user = backup_getid($restore->backup_unique_code,"user",$log->info);
@@ -2531,7 +2539,7 @@
$log->info = $user->new_id;
//Now, extract the mode from the url field
$mode = substr(strrchr($log->url,"="),1);
$log->url = "user.php?id=".$log->course."&amp;user=".$log->info."&amp;mode=".$mode;
$log->url = "user.php?id=".$log->course."&user=".$log->info."&mode=".$mode;
$toinsert = true;
}
break;
@@ -2657,7 +2665,7 @@
$user = backup_getid($restore->backup_unique_code,"user",$log->info);
if ($user) {
$log->info = $user->new_id;
$log->url = "view.php?id=".$log->info."&amp;course=".$log->course;
$log->url = "view.php?id=".$log->info."&course=".$log->course;
$toinsert = true;
}
break;
@@ -2666,7 +2674,25 @@
$user = backup_getid($restore->backup_unique_code,"user",$log->info);
if ($user) {
$log->info = $user->new_id;
$log->url = "view.php?id=".$log->info."&amp;course=".$log->course;
$log->url = "view.php?id=".$log->info."&course=".$log->course;
$toinsert = true;
}
break;
case "login":
//recode the info field (it's the user id)
$user = backup_getid($restore->backup_unique_code,"user",$log->info);
if ($user) {
$log->info = $user->new_id;
$log->url = "view.php?id=".$log->info."&course=".$log->course;
$toinsert = true;
}
break;
case "logout":
//recode the info field (it's the user id)
$user = backup_getid($restore->backup_unique_code,"user",$log->info);
if ($user) {
$log->info = $user->new_id;
$log->url = "view.php?id=".$log->info."&course=".$log->course;
$toinsert = true;
}
break;
@@ -2683,7 +2709,7 @@
$user = backup_getid($restore->backup_unique_code,"user",$userid);
if ($user) {
$log->info = "";
$log->url = "view.php?id=".$user->new_id."&amp;course=".$log->course;
$log->url = "view.php?id=".$user->new_id."&course=".$log->course;
$toinsert = true;
}
break;
@@ -4564,6 +4590,7 @@
global $SESSION;
$restore->backup_unique_code=$backup_unique_code;
$restore->users = 2; // yuk
$restore->course_files = $SESSION->restore->restore_course_files;
if ($allmods = get_records("modules")) {
foreach ($allmods as $mod) {
$modname = $mod->name;
+1 -1
View File
@@ -7,4 +7,4 @@
$backup_version = 2005070500; // The current version is a date (YYYYMMDDXX)
$backup_release = "1.5.1"; // User-friendly version number
$backup_release = "1.5.3"; // User-friendly version number
@@ -3,14 +3,23 @@
class block_activity_modules extends block_list {
function init() {
$this->title = get_string('activities');
$this->version = 2004041000;
$this->version = 2004041001;
}
function get_content() {
global $USER, $CFG;
// This is really NOT pretty, but let's do it simple for now...
global $modnamesused, $modnamesplural;
// TODO: FIX: HACK: (any other tags I should add? :P)
// Hacker's improvised caching scheme: avoid fetching the mod
// data from db if the course format has already fetched them
if(!isset($GLOBALS['modnamesplural']) || !isset($GLOBALS['modnamesused'])) {
require_once($CFG->dirroot.'/course/lib.php');
get_all_mods($this->instance->pageid, $mods, $modnames, $modnamesplural, $modnamesused);
}
else {
$modnamesplural = $GLOBALS['modnamesplural'];
$modnamesused = $GLOBALS['modnamesused'];
}
if($this->content !== NULL) {
return $this->content;
+4 -4
View File
@@ -121,7 +121,7 @@ class block_admin extends block_list {
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/users.gif" height="16" width="16" alt="" />';
} else {
$this->content->items[]='<a href="importstudents.php?id='.$this->instance->pageid.'">'.$course->students.'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/users.gif" height="16" width="16" alt="">';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/users.gif" height="16" width="16" alt="" />';
}
if ($course->groupmode || !$course->groupmodeforce) {
$strgroups = get_string('groups');
@@ -182,14 +182,14 @@ class block_admin extends block_list {
}
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="" />';
if (is_internal_auth()) {
if (is_internal_auth() && !is_restricted_user($USER->username)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/login/change_password.php?id='.$this->instance->pageid.'">'.get_string('changepassword').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="" />';
} else if ($CFG->changepassword) {
} else if ($CFG->changepassword && !is_restricted_user($USER->username)) {
$this->content->items[]='<a href="'.$CFG->changepassword.'">'.get_string('changepassword').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="" />';
}
if ($CFG->allowunenroll) {
if ($CFG->allowunenroll && !$course->metacourse) {
$this->content->items[]='<a href="unenrol.php?id='.$this->instance->pageid.'">'.get_string('unenrolme', '', $course->shortname).'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" height="16" width="16" alt="" />';
}
+1 -1
View File
@@ -53,7 +53,7 @@ class block_course_list extends block_list {
$categories = get_categories("0"); // Parent = 0 ie top-level categories only
if ($categories) { //Check we have categories
if (count($categories) > 1) { // Just print top level category links
if (count($categories) > 1 || (count($categories) == 1 && count_records('course') > 200)) { // Just print top level category links
foreach ($categories as $category) {
$linkcss = $category->visible ? "" : " class=\"dimmed\" ";
$this->content->items[]="<a $linkcss href=\"$CFG->wwwroot/course/category.php?id=$category->id\">$category->name</a>";
+9 -4
View File
@@ -58,7 +58,7 @@ global $CFG;
if(!empty($records)) {
foreach($records as $block) {
$block->multiple = 0;
insert_record('block', $block);
insert_record('block', $block, false);
}
}
@@ -82,7 +82,7 @@ global $CFG;
return false;
}
$records = get_records('course');
$records = get_records('course', '','','', 'id, shortname, blockinfo');
if(!empty($records)) {
foreach($records as $thiscourse) {
// The @ suppresses a notice emitted if there is no : in the string
@@ -98,7 +98,7 @@ global $CFG;
$instance->weight = $weight;
$instance->visible = ($blk > 0) ? 1 : 0;
$instance->configdata = '';
insert_record('block_instance', $instance);
insert_record('block_instance', $instance, false);
}
}
if(!empty($right)) {
@@ -112,7 +112,7 @@ global $CFG;
$instance->weight = $weight;
$instance->visible = ($blk > 0) ? 1 : 0;
$instance->configdata = '';
insert_record('block_instance', $instance);
insert_record('block_instance', $instance, false);
}
}
}
@@ -143,6 +143,11 @@ global $CFG;
}
}
if ($oldversion < 2005022401) {
// add an index where we really need it
modify_database('','ALTER TABLE prefix_block_instance ADD INDEX pagetype (pagetype);');
}
//Finally, return result
return $result;
}
+2 -1
View File
@@ -24,6 +24,7 @@ CREATE TABLE `prefix_block_instance` (
`visible` tinyint(1) not null default '0',
`configdata` text not null default '',
PRIMARY KEY(`id`),
INDEX pageid(`pageid`)
INDEX pageid(`pageid`),
INDEX pagetype(`pagetype`)
) TYPE=MyISAM;
# --------------------------------------------------------
+18 -5
View File
@@ -59,9 +59,9 @@ global $CFG;
if(!empty($records)) {
foreach($records as $block) {
$block->multiple = 0;
unset($block->id);
insert_record('block', $block);
insert_record('block', $block, false);
}
execute_sql("SELECT setval('{$CFG->prefix}block_id_seq', (SELECT MAX(id) FROM {$CFG->prefix}block), true)");
}
execute_sql("DROP TABLE {$CFG->prefix}blocks");
@@ -81,7 +81,7 @@ global $CFG;
return false;
}
$records = get_records('course');
$records = get_records('course', '','','', 'id, shortname, blockinfo');
if(!empty($records)) {
foreach($records as $thiscourse) {
// The @ suppresses a notice emitted if there is no : in the string
@@ -97,7 +97,7 @@ global $CFG;
$instance->weight = $weight;
$instance->visible = ($blk > 0) ? 1 : 0;
$instance->configdata = '';
insert_record('block_instance', $instance);
insert_record('block_instance', $instance, false);
}
}
if(!empty($right)) {
@@ -111,7 +111,7 @@ global $CFG;
$instance->weight = $weight;
$instance->visible = ($blk > 0) ? 1 : 0;
$instance->configdata = '';
insert_record('block_instance', $instance);
insert_record('block_instance', $instance, false);
}
}
}
@@ -138,6 +138,19 @@ global $CFG;
}
}
if ($oldversion < 2005022401 && $result) { // Mass cleanup of bad upgrade scripts
execute_sql("CREATE INDEX {$CFG->prefix}block_instance_pageid_idx ON {$CFG->prefix}block_instance (pageid)",false); // this one should be quiet...
modify_database('','ALTER TABLE prefix_block_instance ALTER pagetype SET DEFAULT \'\'');
modify_database('','ALTER TABLE prefix_block_instance ALTER position SET DEFAULT \'\'');
modify_database('','ALTER TABLE prefix_block_instance ALTER pagetype SET NOT NULL');
modify_database('','ALTER TABLE prefix_block_instance ALTER position SET NOT NULL');
}
if ($oldversion < 2005022401) {
// add an index where we really need it
modify_database('','CREATE INDEX prefix_block_instance_pagetype_idx ON prefix_block_instance (pagetype);');
}
//Finally, return result
return $result;
}
+4 -1
View File
@@ -10,7 +10,7 @@ CREATE TABLE prefix_block (
cron INT8 NOT NULL default '0',
lastcron INT8 NOT NULL default '0',
visible int NOT NULL default '1',
multiple int NOT NULL default '1'
multiple int NOT NULL default '0'
) ;
CREATE TABLE prefix_block_instance (
@@ -23,5 +23,8 @@ CREATE TABLE prefix_block_instance (
visible int not null default '0',
configdata text not null default ''
) ;
CREATE INDEX prefix_block_instance_pageid_idx ON prefix_block_instance (pageid);
CREATE INDEX prefix_block_instance_pagetype_idx ON prefix_block_instance (pagetype);
# --------------------------------------------------------
@@ -118,9 +118,12 @@ class block_glossary_random extends block_base {
// select glossaries to put in dropdown box ...
$glossaries = get_records_select_menu('glossary', 'course='.$this->course->id,'name','id,name');
//format menu texts to avoid html and to filter multilang values
foreach($glossaries as $key => $value) {
$glossaries[$key] = strip_tags(format_string($value,true));
if(!empty($glossaries)) {
foreach($glossaries as $key => $value) {
$glossaries[$key] = strip_tags(format_string($value,true));
}
}
// and select quotetypes to put in dropdown box
+10 -6
View File
@@ -27,16 +27,20 @@ class block_login extends block_base {
$wwwroot = str_replace("http://", "https://", $CFG->wwwroot);
}
if (is_internal_auth()) {
if ($CFG->auth == 'email') {
$signup = $wwwroot . '/login/signup.php';
$forgot = $wwwroot . '/login/forgot_password.php';
} else {
if (!empty($CFG->changepassword)) {
$forgot = $CFG->changepassword;
} else {
$forgot = '';
if (!empty($CFG->{'auth_'.$CFG->auth.'_stdchangepassword'})
|| $CFG->changepassword
|| is_internal_auth() ) {
if (is_internal_auth() || !empty($CFG->{'auth_'.$CFG->auth.'_stdchangepassword'})) {
$forgot = $wwwroot . '/login/forgot_password.php';
}
else {
$forgot = $CFG->changepassword;
}
}
$signup = $wwwroot . '/login/index.php'; // to see instructions!
}
$username = get_moodle_cookie() === 'nobody' ? '' : get_moodle_cookie();
+14 -6
View File
@@ -61,7 +61,8 @@ class block_online_users extends block_base {
{$CFG->prefix}user_students s
$groupmembers
WHERE u.id = s.userid $courseselect $groupselect $timeselect
ORDER BY s.timeaccess DESC")) {
ORDER BY s.timeaccess DESC ".sql_paging_limit(0,20))) {
foreach ($students as $student) {
$student->fullname = fullname($student);
$users[$student->id] = $student;
@@ -72,7 +73,7 @@ class block_online_users extends block_base {
if ($siteusers = get_records_sql("SELECT u.id, u.username, u.firstname, u.lastname, u.picture, u.lastaccess
FROM {$CFG->prefix}user u
WHERE u.lastaccess > $timefrom AND u.username <> 'guest'
ORDER BY u.lastaccess DESC")) {
ORDER BY u.lastaccess DESC ".sql_paging_limit(0,20))) {
foreach ($siteusers as $siteuser) {
$siteuser->fullname = fullname($siteuser);
$siteuser->timeaccess = $siteuser->lastaccess;
@@ -81,14 +82,21 @@ class block_online_users extends block_base {
}
}
if ($teachers = get_records_sql("SELECT u.id, u.username, u.firstname, u.lastname, u.picture, u.lastaccess, s.timeaccess
$findteacherssql = "SELECT u.id, u.username, u.firstname, u.lastname, u.picture, u.lastaccess, s.timeaccess
FROM {$CFG->prefix}user u,
{$CFG->prefix}user_teachers s
$groupmembers
WHERE u.id = s.userid $courseselect $groupselect $timeselect
ORDER BY s.timeaccess DESC")) {
WHERE u.id = s.userid $courseselect $groupselect $timeselect ";
if (!isteacher($course->id)) {
// Hide hidden teachers from students.
$findteacherssql .= 'AND s.authority > 0 ';
}
$findteacherssql .= 'ORDER BY s.timeaccess DESC';
if ($teachers = get_records_sql($findteacherssql)) {
foreach ($teachers as $teacher) {
$teacher->fullname = '<b>'.fullname($teacher).'</b>';
$teacher->fullname = '<strong>'.fullname($teacher).'</strong>';
$users[$teacher->id] = $teacher;
}
}
+2
View File
@@ -1,5 +1,7 @@
<?php // $Id$
die; //must be fixed before enabling again, see SC#971
// All of this is standard Moodle fixtures
require_once('../config.php');
+4 -4
View File
@@ -20,15 +20,15 @@ class block_quiz_results extends block_base {
if ($this->content !== NULL) {
return $this->content;
}
if (empty($this->instance)) {
$this->content = '';
return $this->content;
}
$this->content = new stdClass;
$this->content->text = '';
$this->content->footer = '';
if (empty($this->instance)) {
return $this->content;
}
if($this->instance->pagetype == 'course-view') {
// We need to see if we are monitoring a quiz
$quizid = empty($this->config->quizid) ? 0 : $this->config->quizid;
+48 -34
View File
@@ -1,20 +1,35 @@
<?php //$Id$
// Developer's debug assistant - if true then the display string will not cache, only
// the magpie object's built in caching will be used
define('BLOCK_RSS_SECONDARY_CACHE_ENABLED', true);
/*******************************************************************
* This file contains one class which defines a block for display on
* any Moodle page. This block can be configured to display the contents
* of a remote RSS news feed in your web site.
*
* @author Daryl Hawes
* @version $Id$
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package base
******************************************************************/
class block_rss_client extends block_base {
/**
* This class is for a block which defines a block for display on
* any Moodle page.
*/
class block_rss_client extends block_base {
function init() {
$this->title = get_string('feedstitle', 'block_rss_client');
$this->version = 2004112000;
$this->version = 2004112001;
}
function preferred_width() {
return 210;
}
function applicable_formats() {
return array('all' => true);
}
function specialization() {
// After the block has been loaded we customize the block's title display
if (!empty($this->config) && !empty($this->config->title)) {
@@ -25,7 +40,7 @@ class block_rss_client extends block_base {
$this->title = get_string('remotenewsfeed', 'block_rss_client');
}
}
function get_content() {
global $CFG, $editing;
@@ -36,11 +51,11 @@ class block_rss_client extends block_base {
}
$this->content = new stdClass;
$this->content->text = '';
$this->content->footer = '';
if (empty($this->instance)) {
// We're being asked for content without an associated instance
$this->content->text = '';
return $this->content;
}
@@ -90,11 +105,11 @@ class block_rss_client extends block_base {
$page = page_create_object($this->instance->pagetype, $this->instance->pageid);
if (isset($this->config)) {
// this instance is configured - show Add/Edit feeds link
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds'));
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $this->courseid));
$output .= '<div align="center"><a title="'. get_string('feedsaddedit', 'block_rss_client') .'" href="'. $script .'">'. get_string('feedsaddedit', 'block_rss_client') .'</a></div>';
} else {
// this instance has not been configured yet - show configure link
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock'));
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $this->courseid));
$output .= '<div align="center"><a title="'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'" href="'. $script.'">'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'</a></div>';
}
}
@@ -113,11 +128,11 @@ class block_rss_client extends block_base {
$count ++;
}
}
$this->content->text = $output;
return $this->content;
}
function instance_allow_multiple() {
return true;
}
@@ -129,7 +144,7 @@ class block_rss_client extends block_base {
function instance_allow_config() {
return true;
}
/**
* @param int $rssid The feed to be displayed
* @param bool $display_description Should the description information from the feed be displayed or simply the title?
@@ -146,20 +161,9 @@ class block_rss_client extends block_base {
if (!defined('MAGPIE_OUTPUT_ENCODING')) {
define('MAGPIE_OUTPUT_ENCODING', get_string('thischarset')); // see bug 3107
}
// Check if there is a cached string which has not timed out.
if (BLOCK_RSS_SECONDARY_CACHE_ENABLED &&
isset($this->config->{'rssid'. $rssid}) &&
isset($this->config->{'rssid'. $rssid .'timestamp'}) &&
$this->config->{'rssid'. $rssid .'timestamp'} >= $now - $CFG->block_rss_timeout * 60) {
// If the cached string is not too stale
// use it rather than going any further
return stripslashes_safe($this->config->{'rssid'. $rssid});
}
$rss_record = get_record('block_rss_client', 'id', $rssid);
if (isset($rss_record) && isset($rss_record->id)) {
// By capturing the output from fetch_rss this way
// error messages do not display and clutter up the moodle interface
// however, we do lose out on seeing helpful messages like "cache hit", etc.
@@ -167,7 +171,7 @@ class block_rss_client extends block_base {
$rss = fetch_rss($rss_record->url);
$rsserror = ob_get_contents();
ob_end_clean();
if ($rss === false) {
if ($CFG->debug && !empty($rsserror)) {
// There was a failure in loading the rss feed, print link to full error text
@@ -180,9 +184,9 @@ class block_rss_client extends block_base {
}
if (empty($rss_record->preferredtitle)) {
$feedtitle = stripslashes_safe(rss_unhtmlentities($rss->channel['title']));
$feedtitle = $this->format_title(stripslashes_safe(rss_unhtmlentities($rss->channel['title'])));
} else {
$feedtitle = stripslashes_safe($rss_record->preferredtitle);
$feedtitle = $this->format_title(stripslashes_safe($rss_record->preferredtitle));
}
// print_object($rss);
if (isset($this->config) &&
@@ -198,6 +202,12 @@ class block_rss_client extends block_base {
$formatoptions->para = false;
// first we must verify that the rss feed is loaded
// by checking $rss and $rss->items exist before using them
if (empty($rss) || empty($rss->items)) {
return '';
}
foreach ($rss->items as $item) {
$item['title'] = stripslashes_safe(rss_unhtmlentities($item['title']));
$item['description'] = stripslashes_safe(rss_unhtmlentities($item['description']));
@@ -207,7 +217,7 @@ class block_rss_client extends block_base {
} else {
$item['title'] = break_up_long_words($item['title'], 30);
}
if ($item['link'] == '') {
$item['link'] = $item['guid'];
}
@@ -216,7 +226,6 @@ class block_rss_client extends block_base {
$returnstring .= '<div class="link"><a href="'. $item['link'] .'" target="_blank">'. $item['title'] . '</a></div>' ."\n";
if ($display_description && !empty($item['description'])) {
$item['description'] = break_up_long_words($item['description'], 30);
$returnstring .= '<div class="description">'.
@@ -243,12 +252,17 @@ class block_rss_client extends block_base {
$this->title = $feedtitle;
}
}
// store config setting for this rssid so we do not need to read from file each time
$this->config->{'rssid'. $rssid} = addslashes($returnstring);
$this->config->{'rssid'. $rssid .'timestamp'} = $now;
$this->instance_config_save($this->config);
return $returnstring;
}
// just strips the title down and adds ... for excessively long titles.
function format_title($title,$max=64) {
if (strlen($title) <= $max) {
return $title;
}
else {
return substr($title,0,$max-3).'...';
}
}
}
?>
+211 -190
View File
@@ -1,227 +1,248 @@
<?php //$Id$
require_once('../../config.php');
require_once($CFG->libdir .'/rsslib.php');
require_once(MAGPIE_DIR .'rss_fetch.inc');
/*******************************************************************
* This file contains no classes. It will display a list of existing feeds
* defined for the site and allow add/edit/delete of site feeds.
*
* @author Daryl Hawes
* @version $Id$
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package base
******************************************************************/
require_login();
global $USER;
//ensure that the logged in user is not using the guest account
if (isset($_SERVER['HTTP_REFERER'])) {
$referrer = $_SERVER['HTTP_REFERER'];
require_once('../../config.php');
require_once($CFG->libdir .'/rsslib.php');
require_once(MAGPIE_DIR .'rss_fetch.inc');
require_login();
global $USER;
//ensure that the logged in user is not using the guest account
if (isset($_SERVER['HTTP_REFERER'])) {
$referrer = $_SERVER['HTTP_REFERER'];
} else {
$referrer = $CFG->wwwroot;
}
if (isguest()) {
error(get_string('noguestpost', 'forum'), $referrer);
}
$act = optional_param('act', NULL, PARAM_ALPHA);
$rssid = optional_param('rssid', NULL, PARAM_INT);
$id = optional_param('id', SITEID, PARAM_INT);
$url = optional_param('url', NULL, PARAM_URL);
$preferredtitle = optional_param('preferredtitle', '', PARAM_ALPHA);
if (!defined('MAGPIE_OUTPUT_ENCODING')) {
define('MAGPIE_OUTPUT_ENCODING', get_string('thischarset')); // see bug 3107
}
if (!empty($id)) {
// we get the complete $course object here because print_header assumes this is
// a complete object (needed for proper course theme settings)
$course = get_record('course', 'id', $id);
}
$straddedit = get_string('feedsaddedit', 'block_rss_client');
if ( isadmin() ) {
$navigation = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/index.php">'.get_string('administration').'</a> -> '.
'<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/configure.php">'.get_string('configuration').'</a> -> '.$straddedit;
} else if (!empty($course)) {
$navigation = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$id.'">'.$course->shortname.'</a> -> '.$straddedit;
} else {
$navigation = $straddedit;
}
print_header($straddedit, $straddedit, $navigation);
//check to make sure that the user is allowed to post new feeds
$submitters = $CFG->block_rss_client_submitters;
$isteacher = empty($course) ? false : isteacher($id);
if ( !isset($act) ) {
rss_display_feeds($id);
rss_print_form($act, $url, $rssid, $preferredtitle, $id);
print_footer();
die();
}
if ( isset($rssid) ) {
$rss_record = get_record('block_rss_client', 'id', $rssid);
}
//if the user is an admin or course teacher then allow the user to
//assign categories to other uses than personal
if (isset($rss_record) && !( isadmin() || $submitters == SUBMITTERS_ALL_ACCOUNT_HOLDERS ||
($submitters == SUBMITTERS_ADMIN_AND_TEACHER && $isteacher) ||
( ($act == 'rssedit' || $act == 'delfeed' || $act == 'updfeed') && $USER->id == $rss_record->userid) ) ) {
error(get_string('noguestpost', 'forum').' You are not allowed to make modifications to this RSS feed at this time.', $referrer);
}
if ($act == 'updfeed') {
if (empty($url)) {
error( 'url not defined for rss feed' );
}
// By capturing the output from fetch_rss this way
// error messages do not display and clutter up the moodle interface
// however, we do lose out on seeing helpful messages like "cache hit", etc.
$message = '';
ob_start();
$rss = fetch_rss($url);
if ($CFG->debug) {
$message .= ob_get_contents();
}
ob_end_clean();
$dataobject->id = $rssid;
if ($rss === false) {
$dataobject->description = '';
$dataobject->title = '';
$dataobject->preferredtitle = '';
} else {
$referrer = $CFG->wwwroot;
$dataobject->description = addslashes(rss_unhtmlentities($rss->channel['description']));
$dataobject->title = addslashes(rss_unhtmlentities($rss->channel['title']));
$dataobject->preferredtitle = addslashes($preferredtitle);
}
if (isguest()) {
error(get_string('noguestpost', 'forum'), $referrer);
$dataobject->url = addslashes($url);
if (!update_record('block_rss_client', $dataobject)) {
error('There was an error trying to update rss feed with id:'. $rssid);
}
optional_variable($act, 'none');
optional_variable($rssid, 'none');
$courseid = optional_param('courseid', 0, PARAM_INT);
optional_variable($url);
optional_variable($preferredtitle, '');
optional_variable($item);
$message .= '<br />'. get_string('feedupdated', 'block_rss_client');
redirect($referrer, $message);
if (!defined('MAGPIE_OUTPUT_ENCODING')) {
define('MAGPIE_OUTPUT_ENCODING', get_string('thischarset')); // see bug 3107
} else if ($act == 'addfeed' ) {
if (empty($url)) {
error('url not defined for rss feed');
}
$dataobject->userid = $USER->id;
$dataobject->description = '';
$dataobject->title = '';
// attempting to replace feed and rss url types with http
// it appears that the rss feed validator will validate these url types but magpie will not load them
$url = str_replace ("feed://", "http://", "$url");
$url = str_replace ("FEED://", "http://", "$url");
$url = str_replace ("rss://", "http://", "$url");
$url = str_replace ("RSS://", "http://", "$url");
$dataobject->url = addslashes($url);
$dataobject->preferredtitle = addslashes($preferredtitle);
$rssid = insert_record('block_rss_client', $dataobject);
if (!$rssid) {
error('There was an error trying to add a new rss feed:'. $url);
}
if (!empty($courseid)) {
$course = get_record('course', 'id', $courseid, '', '', '', '', 'shortname');
// By capturing the output from fetch_rss this way
// error messages do not display and clutter up the moodle interface
// however, we do lose out on seeing helpful messages like "cache hit", etc.
$message = '';
ob_start();
$rss = fetch_rss($url);
if ($CFG->debug) {
$message .= ob_get_contents();
}
ob_end_clean();
$straddedit = get_string('feedsaddedit', 'block_rss_client');
if ( isadmin() ) {
$stradmin = get_string('administration');
$strconfiguration = get_string('configuration');
$navigation = "<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradmin</a> -> ".
"<a href=\"$CFG->wwwroot/$CFG->admin/configure.php\">$strconfiguration</a> -> $straddedit";
} else if (!empty($course)) {
$navigation = "<a href=\"$CFG->wwwroot/course/view.php?id=$courseid\">$course->shortname</a> -> $straddedit";
if ($rss === false) {
$message .= '<br /><br />There was an error loading this rss feed. You may want to verify the url you have specified before using it.'; //Daryl Hawes note: localize this line
} else {
$navigation = $straddedit;
}
print_header(get_string('feedsaddedit', 'block_rss_client'),
get_string('feedsaddedit', 'block_rss_client'),
$navigation );
//check to make sure that the user is allowed to post new feeds
$submitters = $CFG->block_rss_client_submitters;
$isteacher = false;
if (!empty($course)) {
$isteacher = isteacher($course->id);
}
//if the user is an admin or course teacher then allow the user to
//assign categories to other uses than personal
if (!( isadmin() || $submitters == SUBMITTERS_ALL_ACCOUNT_HOLDERS || ($submitters == SUBMITTERS_ADMIN_AND_TEACHER && $isteacher) ) ) {
error(get_string('noguestpost', 'forum'), $referrer);
}
if ($act == 'none') {
rss_display_feeds();
rss_get_form($act, $url, $rssid, $preferredtitle);
} else if ($act == 'updfeed') {
require_variable($url);
// By capturing the output from fetch_rss this way
// error messages do not display and clutter up the moodle interface
// however, we do lose out on seeing helpful messages like "cache hit", etc.
ob_start();
$rss = fetch_rss($url);
$rsserror = ob_get_contents();
ob_end_clean();
$dataobject->id = $rssid;
if ($rss === false) {
$dataobject->description = '';
$dataobject->title = '';
$dataobject->preferredtitle = '';
} else {
if (!empty($rss->channel['description'])) {
$dataobject->description = addslashes(rss_unhtmlentities($rss->channel['description']));
$dataobject->title = addslashes(rss_unhtmlentities($rss->channel['title']));
$dataobject->preferredtitle = addslashes($preferredtitle);
}
$dataobject->url = addslashes($url);
if (!empty($rss->channel['title'])) {
$dataobject->title = addslashes(rss_unhtmlentities($rss->channel['title']));
}
if (!update_record('block_rss_client', $dataobject)) {
error('There was an error trying to update rss feed with id:'. $rssid);
}
redirect($referrer, get_string('feedupdated', 'block_rss_client'));
/* rss_display_feeds();
rss_get_form($act, $dataobject->url, $rssid, $dataobject->preferredtitle);
$message .= '<br />'. get_string('feedadded', 'block_rss_client');
}
redirect($referrer, $message);
/*
rss_display_feeds($id);
rss_print_form($act, $dataobject->url, $dataobject->id, $dataobject->preferredtitle, $id);
*/
} else if ($act == 'addfeed' ) {
} else if ( isset($rss_record) && $act == 'rssedit' ) {
require_variable($url);
$dataobject->userid = $USER->id;
$dataobject->description = '';
$dataobject->title = '';
$dataobject->url = addslashes($url);
$dataobject->preferredtitle = addslashes($preferredtitle);
$preferredtitle = stripslashes_safe($rss_record->preferredtitle);
if (empty($preferredtitle)) {
$preferredtitle = stripslashes_safe($rss_record->title);
}
$url = stripslashes_safe($rss_record->url);
rss_display_feeds($id, '', $rssid);
rss_print_form($act, $url, $rssid, $preferredtitle, $id);
$rssid = insert_record('block_rss_client', $dataobject);
if (!$rssid) {
error('There was an error trying to add a new rss feed:'. $url);
}
} else if ($act == 'delfeed') {
$file = $CFG->dataroot .'/cache/rsscache/'. $rssid .'.xml';
if (file_exists($file)) {
unlink($file);
}
// echo "DEBUG: act = delfeed"; //debug
delete_records('block_rss_client', 'id', $rssid);
redirect($referrer, get_string('feeddeleted', 'block_rss_client') );
} else if ( isset($rss_record) && $act == 'view' ) {
// echo $sql; //debug
// print_object($res); //debug
if (!$rss_record->id) {
print '<strong>'. get_string('couldnotfindfeed', 'block_rss_client') .': '. $rssid .'</strong>';
} else {
// By capturing the output from fetch_rss this way
// error messages do not display and clutter up the moodle interface
// however, we do lose out on seeing helpful messages like "cache hit", etc.
ob_start();
$rss = fetch_rss($url);
$rsserror = ob_get_contents();
$rss = fetch_rss($rss_record->url);
ob_end_clean();
if ($rss === false) {
$message = 'There was an error loading this rss feed. You may want to verify the url you have specified before using it.'; //Daryl Hawes note: localize this line
if (empty($rss_record->preferredtitle)) {
$feedtitle = stripslashes_safe($rss_record->preferredtitle);
} else {
$dataobject->id = $rssid;
if (!empty($rss->channel['description'])) {
$dataobject->description = addslashes(rss_unhtmlentities($rss->channel['description']));
$feedtitle = stripslashes_safe(rss_unhtmlentities($rss->channel['title']));
}
print '<table align="center" width="50%" cellspacing="1">'."\n";
print '<tr><td colspan="2"><strong>'. $feedtitle .'</strong></td></tr>'."\n";
for($y=0; $y < count($rss->items); $y++) {
$rss->items[$y]['title'] = stripslashes_safe(rss_unhtmlentities($rss->items[$y]['title']));
$rss->items[$y]['description'] = stripslashes_safe(rss_unhtmlentities($rss->items[$y]['description']));
if ($rss->items[$y]['link'] == '') {
$rss->items[$y]['link'] = $rss->items[$y]['guid'];
}
if (!empty($rss->channel['title'])) {
$dataobject->title = addslashes(rss_unhtmlentities($rss->channel['title']));
}
if (!update_record('block_rss_client', $dataobject)) {
error('There was an error trying to update rss feed with id:'. $rssid);
if ($rss->items[$y]['title'] == '') {
$rss->items[$y]['title'] = '&gt;&gt;';
}
$message = get_string('feedadded', 'block_rss_client');
}
redirect($referrer, $message);
/*
rss_display_feeds();
rss_get_form($act, $dataobject->url, $dataobject->id, $dataobject->preferredtitle);
*/
} else if ( $act == 'rss_edit') {
$rss_record = get_record('block_rss_client', 'id', $rssid);
$preferredtitle = stripslashes_safe($rss_record->preferredtitle);
if (empty($preferredtitle)) {
$preferredtitle = stripslashes_safe($rss_record->title);
}
$url = stripslashes_safe($rss_record->url);
rss_display_feeds('', $rssid);
rss_get_form($act, $url, $rssid, $preferredtitle);
} else if ($act == 'delfeed') {
$file = $CFG->dataroot .'/cache/rsscache/'. $rssid .'.xml';
if (file_exists($file)) {
unlink($file);
}
// echo "DEBUG: act = delfeed"; //debug
//Daryl Hawes note: convert this sql statement to a moodle function call
$sql = 'DELETE FROM '. $CFG->prefix .'block_rss_client WHERE id='. $rssid;
$res= $db->Execute($sql);
redirect($referrer, get_string('feeddeleted', 'block_rss_client') );
/* rss_display_feeds();
rss_get_form($act, $url, $rssid, $preferredtitle);
*/
} else if ($act == 'view') {
// echo $sql; //debug
// print_object($res); //debug
$rss_record = get_record('block_rss_client', 'id', $rssid);
if (!$rss_record->id) {
print '<strong>'. get_string('couldnotfindfeed', 'block_rss_client') .': '. $rssid .'</strong>';
} else {
// By capturing the output from fetch_rss this way
// error messages do not display and clutter up the moodle interface
// however, we do lose out on seeing helpful messages like "cache hit", etc.
ob_start();
$rss = fetch_rss($rss_record->url);
$rsserror = ob_get_contents();
ob_end_clean();
if (empty($rss_record->preferredtitle)) {
$feedtitle = stripslashes_safe($rss_record->preferredtitle);
print '<tr><td valign="middle">'."\n";
print '<a href="'. $rss->items[$y]['link'] .'" target="_blank"><strong>'. $rss->items[$y]['title'];
print '</strong></a>'."\n";
print '</td>'."\n";
if (file_exists($CFG->dirroot .'/blog/lib.php')) {
//Blog module is installed - provide "blog this" link
print '<td align="right">'."\n";
print '<img src="'. $CFG->pixpath .'/blog/blog.gif" alt="'. get_string('blogthis', 'blog').'" title="'. get_string('blogthis', 'blog') .'" border="0" align="middle" />'."\n";
print '<a href="'. $CFG->wwwroot .'/blog/blogthis.php?userid='. $userid .'&act=use&item='. $y .'&rssid='. $rssid .'"><small><strong>'. get_string('blogthis', 'blog') .'</strong></small></a>'."\n";
} else {
$feedtitle = stripslashes_safe(rss_unhtmlentities($rss->channel['title']));
print '<td>&nbsp;';
}
print '<table align="center" width="50%" cellspacing="1">'."\n";
print '<tr><td colspan="2"><strong>'. $feedtitle .'</strong></td></tr>'."\n";
for($y=0; $y < count($rss->items); $y++) {
$rss->items[$y]['title'] = stripslashes_safe(rss_unhtmlentities($rss->items[$y]['title']));
$rss->items[$y]['description'] = stripslashes_safe(rss_unhtmlentities($rss->items[$y]['description']));
if ($rss->items[$y]['link'] == '') {
$rss->items[$y]['link'] = $rss->items[$y]['guid'];
}
if ($rss->items[$y]['title'] == '') {
$rss->items[$y]['title'] = '&gt;&gt;';
}
print '<tr><td valign="middle">'."\n";
print '<a href="'. $rss->items[$y]['link'] .'" target="_blank"><strong>'. $rss->items[$y]['title'];
print '</strong></a>'."\n";
print '</td>'."\n";
if (file_exists($CFG->dirroot .'/blog/lib.php')) {
//Blog module is installed - provide "blog this" link
print '<td align="right">'."\n";
print '<img src="'. $CFG->pixpath .'/blog/blog.gif" alt="'. get_string('blogthis', 'blog').'" title="'. get_string('blogthis', 'blog') .'" border="0" align="middle" />'."\n";
print '<a href="'. $CFG->wwwroot .'/blog/blogthis.php?blogid='. $blogid .'&act=use&item='. $y .'&rssid='. $rssid .'"><small><strong>'. get_string('blogthis', 'blog') .'</strong></small></a>'."\n";
} else {
print '<td>&nbsp;';
}
print '</td></tr>'."\n";
print '<tr><td colspan=2><small>';
print $rss->items[$y]['description'] .'</small></td></tr>'."\n";
}
print '</table>'."\n";
print '</td></tr>'."\n";
print '<tr><td colspan=2><small>';
print $rss->items[$y]['description'] .'</small></td></tr>'."\n";
}
} else {
rss_display_feeds();
rss_get_form($act, $url, $rssid, $preferredtitle);
print '</table>'."\n";
}
print_footer();
?>
} else {
rss_display_feeds($id);
rss_print_form($act, $url, $rssid, $preferredtitle, $id);
}
print_footer();
?>
+9 -9
View File
@@ -1,14 +1,14 @@
<?php //$Id$
// Print an error page condition
require_once('../../config.php');
require_once('../../config.php');
$error = required_param('error', PARAM_CLEAN);
require_variable($error);
print_header(get_string('error'),
get_string('error'),
get_string('error') );
print_header(get_string('error'),
get_string('error'),
get_string('error') );
print clean_text(urldecode($error));
print clean_text(urldecode($error));
print_footer();
?>
print_footer();
?>
+9 -4
View File
@@ -17,6 +17,7 @@
<?php print_string('clientnumentries', 'block_rss_client') ?>
</td>
</tr>
<tr valign="top">
<td align="right">block_rss_timeout:</td>
<td>
@@ -31,6 +32,7 @@
<?php print_string('timeout', 'block_rss_client') ?>
</td>
</tr>
<tr valign="top">
<td align="right">block_rss_client_submitters:</td>
<td>
@@ -56,13 +58,16 @@
</td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="submit" value="<?php print_string('savechanges') ?>"></td>
</tr>
<tr>
<td colspan="3" align="center"><a href=" <?php echo $CFG->wwwroot; ?>/blocks/rss_client/block_rss_client_action.php?courseid=<?php echo $courseid; ?>"><?php print_string('feedsaddedit', 'block_rss_client')?></a></center><br /><br />
<td colspan="3" align="center"><a href=" <?php echo $CFG->wwwroot; ?>/blocks/rss_client/block_rss_client_action.php?id=<?php
if (!isset($id)) {
$id = '';
}
echo $id; ?>"><?php print_string('feedsaddedit', 'block_rss_client')?></a></center><br /><br />
</td>
</table>
</tr>
</table>
+14 -6
View File
@@ -1,11 +1,13 @@
<?php
<?php // $Id$ //
require_once($CFG->libdir .'/rsslib.php');
$id = optional_param('id', SITEID, PARAM_INT);
//create a page object for url_get_full()
$page = page_create_object($this->instance->pagetype, $this->instance->pageid);
/// Print tabs at top
global $currentaction;
$currentaction = optional_param('currentaction', '', PARAM_ALPHA);
if (empty($currentaction) || $currentaction == 'configblock') {
$currentaction = 'configblock';
} else {
@@ -36,6 +38,7 @@ if ($currentaction == 'configblock') {
?>
</td>
</tr>
<tr valign="top">
<td align="right" width="50%">
<?php print_string('shownumentrieslabel', 'block_rss_client') ?>
@@ -54,6 +57,7 @@ if ($currentaction == 'configblock') {
?>" />
</td>
</tr>
<tr valign="top">
<td align="right" width="50%">
<?php print_string('choosefeedlabel', 'block_rss_client') ?>
@@ -87,12 +91,13 @@ if ($currentaction == 'configblock') {
} else {
print_string('nofeeds', 'block_rss_client');
if ( isadmin() ) {
print '&nbsp;<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php"> '. get_string('editnewsfeeds', 'block_rss_client') .'</a><br />';
print '&nbsp;<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?id='. $id .'"> '. get_string('editnewsfeeds', 'block_rss_client') .'</a><br />';
}
}
?>
</td>
</tr>
<tr valign="top">
<td align="right" width="50%"><?php print_string('uploadlabel'); ?></td>
<?php
@@ -104,6 +109,7 @@ if ($currentaction == 'configblock') {
<td width="50%"><input type="text" name="title" size="30" value="<?php echo $title; ?>" />
</td>
</tr>
<tr valign="top">
<td align="right" width="50%"><?php print_string('clientshowchannellinklabel', 'block_rss_client'); ?></td>
<td width="50%">
@@ -120,6 +126,7 @@ if ($currentaction == 'configblock') {
?>
</td>
</tr>
<tr valign="top">
<td align="right" width="50%"><?php print_string('clientshowimagelabel', 'block_rss_client'); ?></td>
<td width="50%">
@@ -136,6 +143,7 @@ if ($currentaction == 'configblock') {
?>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="<?php print_string('savechanges') ?>">
@@ -147,8 +155,8 @@ if ($currentaction == 'configblock') {
global $act, $url, $rssid, $preferredtitle;
print '<table cellpadding="9" cellspacing="0" class="blockconfigtable">';
print '<tr valign="top"><td>';
rss_display_feeds();
rss_display_feeds($id);
print '</form>'; //not sure that this is needed
rss_get_form($act, $url, $rssid, $preferredtitle);
rss_print_form($act, $url, $rssid, $preferredtitle, $id);
print '</td></tr></table>';
} ?>
} ?>
+13 -13
View File
@@ -2,21 +2,21 @@
/// This file to be included so we can assume config.php has already been included.
/// We also assume that $inactive, $activetab and $currentaction have been set
global $USER;
$tabs = $row = array();
global $USER;
$tabs = $row = array();
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock'));
$row[] = new tabobject('configblock', $script,
get_string('configblock', 'block_rss_client'));
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id));
$row[] = new tabobject('configblock', $script,
get_string('configblock', 'block_rss_client'));
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds'));
$row[] = new tabobject('managefeeds', $script,
get_string('managefeeds', 'block_rss_client'));
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $id));
$row[] = new tabobject('managefeeds', $script,
get_string('managefeeds', 'block_rss_client'));
$tabs[] = $row;
$tabs[] = $row;
/// Print out the tabs and continue!
print '<div align="center">';
print_tabs($tabs, $currentaction);
print '</div>';
/// Print out the tabs and continue!
print '<div align="center">';
print_tabs($tabs, $currentaction);
print '</div>';
?>
+7 -1
View File
@@ -1,6 +1,6 @@
<?php //$Id$
function block_rss_client_upgrade($oldversion) {
function rss_client_upgrade($oldversion) {
/// This function does anything necessary to upgrade
/// older versions to match current functionality
@@ -10,6 +10,12 @@ function block_rss_client_upgrade($oldversion) {
# Do something ...
}
if ($oldversion < 2004112001) {
// title and description should be TEXT as we don't have control over their length.
table_column('block_rss_client','title','title','text',10,'unsigned','');
table_column('block_rss_client','description','description','text',10,'unsigned','');
}
return true;
}
+2 -2
View File
@@ -13,9 +13,9 @@
CREATE TABLE prefix_block_rss_client (
`id` int(11) NOT NULL auto_increment,
`userid` int(11) NOT NULL default '0',
`title` varchar(64) NOT NULL default '',
`title` text NOT NULL default '',
`preferredtitle` varchar(64) NOT NULL default '',
`description` varchar(128) NOT NULL default '',
`description` text NOT NULL default '',
`url` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Remote news feed information. Contains the news feed id, the userid of the user who added the feed, the title of the feed itself and a description of the feed contents along with the url used to access the remote feed. Preferredtitle is a field for future use - intended to allow for custom titles rather than those found in the feed.';
+6 -1
View File
@@ -1,11 +1,16 @@
<?php
function block_rss_client_upgrade($oldversion) {
function rss_client_upgrade($oldversion) {
/// This function does anything necessary to upgrade
/// older versions to match current functionality
global $CFG;
if ($oldversion < 2004112001) {
// title and description should be TEXT as we don't have control over their length.
table_column('block_rss_client','title','title','text');
table_column('block_rss_client','description','description','text');
}
return true;
}
+2 -2
View File
@@ -11,8 +11,8 @@
CREATE TABLE prefix_block_rss_client (
id SERIAL PRIMARY KEY,
userid INTEGER NOT NULL default '0',
title varchar(64) NOT NULL default '',
title text NOT NULL default '',
preferredtitle varchar(64) NOT NULL default '',
description varchar(128) NOT NULL default '',
description text NOT NULL default '',
url varchar(255) NOT NULL default ''
);
@@ -51,7 +51,7 @@ class block_social_activities extends block_list {
if ($ismoving) {
$this->content->icons[] = '&nbsp;<img align="bottom" src="'.$CFG->pixpath.'/t/move.gif" height="11" width="11" alt=\"\" />';
$this->content->items[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true">'.$strcancel.'</a>)';
$this->content->items[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true&amp;sesskey='.$USER->sesskey.'">'.$strcancel.'</a>)';
}
if (!empty($section->sequence)) {
+1 -1
View File
@@ -5,4 +5,4 @@
// database (blocks_version) to determine whether upgrades should
// be performed (see db/backup_*.php)
$blocks_version = 2005022400; // The current version is a date (YYYYMMDDXX)
$blocks_version = 2005022401; // The current version is a date (YYYYMMDDXX)
+13 -9
View File
@@ -113,7 +113,7 @@
if($form = data_submitted()) {
$form->name = strip_tags($form->name,'<lang>'); // Strip all tags, but <lang>
$form->name = clean_text(strip_tags($form->name,'<lang><span>'));
$form->timestart = make_timestamp($form->startyr, $form->startmon, $form->startday, $form->starthr, $form->startmin);
if($form->duration == 1) {
@@ -211,19 +211,23 @@
$eventid = insert_record('event', $form, true);
/// Log the event entry.
$form->name = stripslashes($form->name); //To avoid double-slashes
add_to_log($form->courseid, 'calendar', 'add', 'event.php?action=edit&amp;id='.$eventid, $form->name);
add_to_log($form->courseid, 'calendar', 'add', 'event.php?action=edit&amp;id='.$eventid, stripslashes($form->name));
if ($form->repeat) {
for($i = 1; $i < $form->repeats; $i++) {
// [pj]
// This will not necessarily work correctly because of DST
$form->timestart += 604800; // add one week
// What's the DST offset for the previous repeat?
$dst_offset_prev = dst_offset_on($form->timestart);
$form->timestart += WEEKSECS;
// If the offset has changed in the meantime, update this repeat accordingly
$form->timestart += $dst_offset_prev - dst_offset_on($form->timestart);
/// Get the event id for the log record.
$eventid = insert_record('event', $form, true);
/// Log the event entry.
$form->name = stripslashes($form->name); //To avoid double-slashes
add_to_log($form->courseid, 'calendar', 'add', 'event.php?action=edit&amp;id='.$eventid, $form->name);
add_to_log($form->courseid, 'calendar', 'add', 'event.php?action=edit&amp;id='.$eventid, stripslashes($form->name));
}
}
@@ -455,7 +459,7 @@
case 'site':
$form->name = '';
$form->description = '';
$form->courseid = 1;
$form->courseid = SITEID;
$form->groupid = 0;
$form->userid = $USER->id;
$form->modulename = '';
+2 -2
View File
@@ -1128,10 +1128,10 @@ function calendar_get_default_courses($ignoreref = false) {
}
}
if(isset($USER->student) && is_array($USER->student)) {
$courses = $USER->student;
$courses = $courses + $USER->student;
}
if(isset($USER->teacher) && is_array($USER->teacher)) {
$courses = $USER->teacher;
$courses = $courses + $USER->teacher;
}
return $courses;
}
-1
View File
@@ -17,7 +17,6 @@
/// If data submitted, then process and store.
if ($form = data_submitted()) {
print_header();
foreach ($form as $preference => $value) {
switch ($preference) {
case 'timeformat':
+4 -4
View File
@@ -84,8 +84,8 @@
// If a course has been supplied in the URL, change the filters to show that one
if (!empty($_GET['course'])) {
if ($course = get_record('course', 'id', $_GET['course'])) {
if ($course->id == 1) {
if ($course = get_record('course', 'id', intval($_GET['course']))) {
if ($course->id == SITEID) {
// If coming from the home page, show all courses
$SESSION->cal_courses_shown = calendar_get_default_courses(true);
calendar_set_referring_course(0);
@@ -108,7 +108,7 @@
// Let's see if we are supposed to provide a referring course link
// but NOT for the "main page" course
if ($SESSION->cal_course_referer > 1 &&
if ($SESSION->cal_course_referer != SITEID &&
($shortname = get_field('course', 'shortname', 'id', $SESSION->cal_course_referer)) !== false) {
// If we know about the referring course, show a return link and ALSO require login!
require_login();
@@ -558,7 +558,7 @@ function calendar_course_filter_selector($getvars = '') {
unset($courses[SITEID]);
$courseoptions[1] = get_string('fulllistofcourses');
$courseoptions[SITEID] = get_string('fulllistofcourses');
foreach ($courses as $course) {
$courseoptions[$course->id] = $course->shortname;
}
+7 -1
View File
@@ -196,7 +196,7 @@ $CFG->admin = 'admin';
// mailprefix must be EXACTLY four characters.
// Uncomment and customise this block for Postfix
// $CFG->mailprefix = 'mdl+'; // + is the separator for Exim and Postfix.
// $CFG->mailprefix = 'mdl-'l // - is the separator for qmail
// $CFG->mailprefix = 'mdl-'; // - is the separator for qmail
// $CFG->maildomain = 'youremaildomain.com';
//
// The following setting will tell Moodle to respect your PHP session
@@ -264,6 +264,12 @@ $CFG->admin = 'admin';
// If you are going to publish your log, or the output of your web stats analyzer
// this will weaken the security of your website.
//
// Email database connection errors to someone. If Moodle cannot connect to the
// database, then email this address with a notice.
//
// $CFG->emailconnectionerrorsto = 'your@emailaddress.com';
//
//
//=========================================================================
+28 -10
View File
@@ -6,9 +6,9 @@
require_once("../config.php");
require_once("lib.php");
require_variable($id); // Category id
optional_variable($page, "0"); // which page to show
optional_variable($perpage, "20"); // how many per page
$id = required_param('id', PARAM_INT); // Category id
$page = optional_param('page', 0, PARAM_INT); // which page to show
$perpage = optional_param('perpage', 20, PARAM_INT); // how many per page
if (!$site = get_site()) {
error("Site isn't defined!");
@@ -138,7 +138,15 @@
} else {
// figure out a sortorder that we can use in the destination category
$sortorder = get_field_sql('SELECT MIN(sortorder)-1 AS min
FROM ' . $CFG->prefix . 'course WHERE category=' . $destcategory->id) || 1000;
FROM ' . $CFG->prefix . 'course WHERE category=' . $destcategory->id);
if ($sortorder === false) {
// the category is empty
// rather than let the db default to 0
// set it to > 100 and avoid extra work in fix_coursesortorder()
$sortorder = 200;
} else if ($sortorder < 10) {
fix_course_sortorder($categoryid);
}
$newcourse = new stdClass;
$newcourse->id = $courseid;
@@ -295,10 +303,20 @@
$count = 0;
$abletomovecourses = false; // for now
// Checking if we are at the first or at the last page, to allow courses to
// be moved up and down beyond the paging border
if ($totalcount > $perpage) {
$atfirstpage = ($page == 0);
$atlastpage = (($page + 1) == ceil($totalcount / $perpage));
} else {
$atfirstpage = true;
$atlastpage = true;
}
foreach ($courses as $acourse) {
$count++;
$up = ($count == 1) ? false : true;
$down = ($count == $numcourses) ? false : true;
$up = ($count > 1 || !$atfirstpage);
$down = ($count < $numcourses || !$atlastpage);
$linkcss = $acourse->visible ? "" : ' class="dimmed" ';
echo '<tr>';
@@ -316,11 +334,11 @@
'<img src="'.$CFG->pixpath.'/t/delete.gif" height="11" width="11" border="0" alt="" /></a> ';
if (!empty($acourse->visible)) {
echo '<a title="'.$strhide.'" href="category.php?id='.$category->id.'&amp;page='.$page.
'&amp;hide='.$acourse->id.'&amp;sesskey='.$USER->sesskey.'">'.
'&amp;perpage='.$perpage.'&amp;hide='.$acourse->id.'&amp;sesskey='.$USER->sesskey.'">'.
'<img src="'.$CFG->pixpath.'/t/hide.gif" height="11" width="11" border="0" alt="" /></a> ';
} else {
echo '<a title="'.$strshow.'" href="category.php?id='.$category->id.'&amp;page='.$page.
'&amp;show='.$acourse->id.'&amp;sesskey='.$USER->sesskey.'">'.
'&amp;perpage='.$perpage.'&amp;show='.$acourse->id.'&amp;sesskey='.$USER->sesskey.'">'.
'<img src="'.$CFG->pixpath.'/t/show.gif" height="11" width="11" border="0" alt="" /></a> ';
}
@@ -333,7 +351,7 @@
if ($up) {
echo '<a title="'.$strmoveup.'" href="category.php?id='.$category->id.'&amp;page='.$page.
'&amp;moveup='.$acourse->id.'&amp;sesskey='.$USER->sesskey.'">'.
'&amp;perpage='.$perpage.'&amp;moveup='.$acourse->id.'&amp;sesskey='.$USER->sesskey.'">'.
'<img src="'.$CFG->pixpath.'/t/up.gif" height="11" width="11" border="0" alt="" /></a> ';
} else {
echo '<img src="'.$CFG->wwwroot.'/pix/spacer.gif" height="11" width="11" border="0" alt="" /> ';
@@ -341,7 +359,7 @@
if ($down) {
echo '<a title="'.$strmovedown.'" href="category.php?id='.$category->id.'&amp;page='.$page.
'&amp;movedown='.$acourse->id.'&amp;sesskey='.$USER->sesskey.'">'.
'&amp;perpage='.$perpage.'&amp;movedown='.$acourse->id.'&amp;sesskey='.$USER->sesskey.'">'.
'<img src="'.$CFG->pixpath.'/t/down.gif" height="11" width="11" border="0" alt="" /></a> ';
} else {
echo '<img src="'.$CFG->wwwroot.'/pix/spacer.gif" height="11" width="11" border="0" alt="" /> ';
+2
View File
@@ -40,6 +40,8 @@
notice_yesno("$strdeletecoursecheck<br /><br />$course->fullname ($course->shortname)",
"delete.php?id=$course->id&amp;delete=".md5($course->timemodified)."&amp;sesskey=$USER->sesskey",
"category.php?id=$course->category");
print_footer($course);
exit;
}
+2 -1
View File
@@ -287,7 +287,8 @@
} else {
echo ((empty($form->metacourse)) ? get_string("no") : get_string("yes"));
echo " - $disable_meta ";
} ?>
}
helpbutton("metacourse", get_string("metacourse")); ?>
</td>
</tr>
<tr>
+5 -8
View File
@@ -11,6 +11,7 @@
require_login();
$disable_meta = false;
$focus = "";
if ($id) {
if (! $course = get_record("course", "id", $id)) {
@@ -59,7 +60,7 @@
}
$form->startdate = make_timestamp($form->startyear, $form->startmonth, $form->startday);
$form->category = clean_param($form->category, PARAM_INT);
$form->format = optional_param('format', 'social', PARAM_ALPHA);
validate_form($course, $form, $err);
@@ -179,10 +180,6 @@
}
}
if (empty($focus)) {
$focus = "";
}
$form->categories = get_records_select_menu("course_categories", "", "name", "id,name");
$courseformats = get_list_of_plugins("course/format");
@@ -215,13 +212,13 @@
print_simple_box_start("center");
include("edit.html");
print_simple_box_end();
print_footer($course);
if ($usehtmleditor) {
use_html_editor("summary");
}
print_footer($course);
exit;
/// Functions /////////////////////////////////////////////////////////////////
+1 -3
View File
@@ -58,9 +58,7 @@
$strsummaryof = get_string('summaryof', '', " $sectionname $form->section");
}
print_header("$course->shortname: $stredit", "$course->fullname",
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-> $stredit");
print_header_simple($stredit, '', $stredit);
print_heading($strsummaryof);
print_simple_box_start('center');
+6
View File
@@ -19,6 +19,12 @@
error("Could not find a site!");
}
/// Check if the course is a meta course
if ($course->metacourse) {
print_header_simple();
notice(get_string('coursenotaccessible'), $CFG->wwwroot);
}
check_for_restricted_user($USER->username);
$enrol = new enrolment_plugin();
+4 -6
View File
@@ -10,12 +10,10 @@
define('BLOCK_R_MIN_WIDTH', 100);
define('BLOCK_R_MAX_WIDTH', 210);
optional_variable($preferred_width_left, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]));
optional_variable($preferred_width_right, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]));
$preferred_width_left = min($preferred_width_left, BLOCK_L_MAX_WIDTH);
$preferred_width_left = max($preferred_width_left, BLOCK_L_MIN_WIDTH);
$preferred_width_right = min($preferred_width_right, BLOCK_R_MAX_WIDTH);
$preferred_width_right = max($preferred_width_right, BLOCK_R_MIN_WIDTH);
$preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
BLOCK_L_MAX_WIDTH);
$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
BLOCK_R_MAX_WIDTH);
$strgroups = get_string('groups');
$strgroupmy = get_string('groupmy');
+5 -7
View File
@@ -14,12 +14,10 @@
define('BLOCK_R_MIN_WIDTH', 100);
define('BLOCK_R_MAX_WIDTH', 210);
optional_variable($preferred_width_left, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]));
optional_variable($preferred_width_right, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]));
$preferred_width_left = min($preferred_width_left, BLOCK_L_MAX_WIDTH);
$preferred_width_left = max($preferred_width_left, BLOCK_L_MIN_WIDTH);
$preferred_width_right = min($preferred_width_right, BLOCK_R_MAX_WIDTH);
$preferred_width_right = max($preferred_width_right, BLOCK_R_MIN_WIDTH);
$preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
BLOCK_L_MAX_WIDTH);
$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
BLOCK_R_MAX_WIDTH);
if (isset($topic)) {
$displaysection = course_set_display($course->id, $topic);
@@ -148,7 +146,7 @@
if (!empty($displaysection) and $displaysection != $section) {
if ($showsection) {
$strsummary = ' - '.strip_tags($thissection->summary);
$strsummary = strip_tags(format_string($thissection->summary,true));
if (strlen($strsummary) < 57) {
$strsummary = ' - '.$strsummary;
} else {
+4 -6
View File
@@ -10,12 +10,10 @@
define('BLOCK_R_MIN_WIDTH', 100);
define('BLOCK_R_MAX_WIDTH', 210);
optional_variable($preferred_width_left, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]));
optional_variable($preferred_width_right, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]));
$preferred_width_left = min($preferred_width_left, BLOCK_L_MAX_WIDTH);
$preferred_width_left = max($preferred_width_left, BLOCK_L_MIN_WIDTH);
$preferred_width_right = min($preferred_width_right, BLOCK_R_MAX_WIDTH);
$preferred_width_right = max($preferred_width_right, BLOCK_R_MIN_WIDTH);
$preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
BLOCK_L_MAX_WIDTH);
$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
BLOCK_R_MAX_WIDTH);
if (isset($week)) {
$displaysection = course_set_display($course->id, $week);
+14 -5
View File
@@ -51,11 +51,20 @@
$group->picture = 1;
}
}
$group->name = clean_text($form->name);
$group->description = clean_text($form->description);
$group->hidepicture = $form->hidepicture;
$group->password = $form->password;
if (!update_record("groups", $group)) {
// Setting a new object in order to avoid updating other columns for the record,
// which could lead to SQL injection vulnerabilities.
// Be VERY sure to sanitize all parameters that go into $dataobj!
$dataobj = new stdClass;
$dataobj->id = $group->id;
$dataobj->name = clean_text($form->name);
$dataobj->description = clean_text($form->description);
$dataobj->hidepicture = empty($form->hidepicture) ? 0 : 1;
$dataobj->password = required_param('password', PARAM_ALPHANUM);
if (!update_record('groups', $dataobj)) {
notify("A strange error occurred while trying to save");
} else {
notify(get_string('changessaved'));
+1 -1
View File
@@ -10,7 +10,7 @@
foreach ($listmember as $userid => $username) {
$count++;
$useridstring .= "\"$userid\"";
$usernamestring .= "\"$username\"";
$usernamestring .= '"'.addslashes($username).'"';
if ($count < $max) {
$useridstring .= ', ';
$usernamestring .= ', ';
+11 -2
View File
@@ -47,6 +47,12 @@
if ($data = data_submitted() and confirm_sesskey()) {
// Clean ALL incoming parameters which go in SQL queries here for good measure
$data->id = required_param('id', PARAM_INT);
$data->groups = optional_param('groups', 0, PARAM_INT);
$data->groupid = optional_param('groupid', 0, PARAM_INT);
$data->members = optional_param('members', array(), PARAM_INT);
if (!empty($data->nonmembersadd)) { /// Add people to a group
if (!empty($data->nonmembers) and !empty($data->groupid)) {
$groupmodified = false;
@@ -76,6 +82,9 @@
} else if (!empty($data->groupsremove)) { /// Remove a group, all members become nonmembers
if (!empty($data->groups)) {
if(!isset($groups[$data->groups])) {
error("This is not a valid group to remove");
}
delete_records("groups", "id", $data->groups);
delete_records("groups_members", "groupid", $data->groups);
unset($groups[$data->groups]);
@@ -102,8 +111,8 @@
if (!empty($data->members) and !empty($data->groupid)) {
foreach ($data->members as $userid) {
delete_records('groups_members', 'userid', $userid, "groupid", $data->groupid);
set_field('groups', 'timemodified', time(), 'id', $data->groupid);
}
set_field('groups', 'timemodified', time(), 'id', $data->groupid);
}
$selectedgroup = $data->groupid;
@@ -176,7 +185,7 @@
natcasesort($nonmembers);
if (empty($selectedgroup)) { // Choose the first group by default
if ($selectedgroup = array_shift(array_keys($listgroups))) {
if ($selectedgroup = array_shift($temparr = array_keys($listgroups))) {
$members = $listmembers[$selectedgroup];
}
} else {
+44 -6
View File
@@ -24,7 +24,15 @@ optional_variable($filename,0);
error("You need to be a teacher or an admin to use this page");
}
// if we're not a course creator , we can only import from our own courses.
if (iscreator()) {
$creator = true;
}
if ($from = get_record("course","id",$fromcourse)) {
if (!isteacheredit($fromcourse)) {
error("You need to be a course creator, or a teacher in the course you are importing data from, as well");
}
if (!empty($filename) && file_exists($CFG->dataroot.'/'.$filename) && !empty($SESSION->import_preferences)) {
$restore = backup_to_restore_array($SESSION->import_preferences);
$restore->restoreto = 1;
@@ -43,10 +51,30 @@ optional_variable($filename,0);
print_header("$course->fullname: $strimport", "$course->fullname: $strimport", "$course->shortname");
$taught_courses = get_my_courses($USER->id,"visible DESC,sortorder ASC",0,1);
$cat_courses = get_courses($course->category);
print_heading(get_string("importdatafrom"));
$tcourseids = '';
if ($teachers = get_records_select('user_teachers', "userid = $USER->id AND editall = 1",'','id,course')) {
foreach ($teachers as $teacher) {
if ($teacher->course != $course->id && $teacher->course != $site->id){
$tcourseids .= $teacher->course.',';
}
}
}
$taught_courses = array();
if (!empty($tcourseids)) {
$tcourseids = substr($tcourseids,0,-1);
$taught_courses = get_records_list('course', 'id', $tcourseids);
}
if (!empty($creator)) {
$cat_courses = get_courses($course->category);
} else {
$cat_courses = array();
}
$options = array();
foreach ($taught_courses as $tcourse) {
if ($tcourse->id != $course->id && $tcourse->id != $site->id){
@@ -54,6 +82,13 @@ optional_variable($filename,0);
}
}
if (empty($options) && empty($creator)) {
error(get_string('courseimportnotaught'),$CFG->wwwroot.'/course/view.php?id='.$course->id);
print_footer();
die();
}
$fm = '<form method="post" action="'.$CFG->wwwroot.'/course/import.php"><input type="hidden" name="id" value="'.$course->id.'" />';
$submit = '<input type="submit" value="'.get_string('usethiscourse').'" /></form>';
@@ -78,11 +113,14 @@ optional_variable($filename,0);
choose_from_menu($options,"fromcourse","","choose","","0",true),
$submit);
}
$table->data[] = array($fm.'<b>'.get_string('searchcourses').'</b>',
'<input type="text" name="fromcoursesearch" />',
'<input type="submit" value="'.get_string('searchcourses').'" />');
if (!empty($fromcoursesearch)) {
if (!empty($creator)) {
$table->data[] = array($fm.'<b>'.get_string('searchcourses').'</b>',
'<input type="text" name="fromcoursesearch" />',
'<input type="submit" value="'.get_string('searchcourses').'" />');
}
if (!empty($fromcoursesearch) && !empty($creator)) {
$totalcount = 0;
$courses = get_courses_search(explode(" ",$fromcoursesearch),"fullname ASC",$page,50,$totalcount);
if (is_array($courses) and count($courses) > 0) {
+2 -2
View File
@@ -27,8 +27,8 @@
redirect("$CFG->wwwroot/course/student.php?id=$course->id");
}
if (!isadmin()) {
error("You must be an admin");
if (!isadmin() || !isteacheredit($course->id)) {
error("You must be an admin or a teacher of this course");
}
+2 -2
View File
@@ -31,7 +31,7 @@
if (!$adminediting) {
$countcategories = count_records("course_categories");
if ($countcategories > 1) {
if ($countcategories > 1 || ($countcategories == 1 && count_records('course') > 200)) {
$strcourses = get_string("courses");
$strcategories = get_string("categories");
print_header("$site->shortname: $strcategories", $strcourses,
@@ -246,7 +246,7 @@
}
/// Find any orphan courses that don't yet have a valid category and set to default
if ($courses = get_courses(NULL,NULL,'c.category,c.id,c.sortorder')) {
if ($courses = get_courses(NULL,NULL,'c.id, c.category, c.sortorder')) {
foreach ($courses as $course) {
if ($course->category and !isset($categories[$course->category])) {
set_field("course", "category", $default, "id", $course->id);
+2 -2
View File
@@ -5,8 +5,8 @@
require_once("../config.php");
require_once("lib.php");
require_variable($id); // Course id
optional_variable($name);
$id = optional_param('id', false, PARAM_INT); // Course id
$name = optional_param('name', false, PARAM_RAW); // Course short name
if (!$id and !$name) {
error("Must specify course id or short name");
+8 -5
View File
@@ -1,18 +1,21 @@
<?php // $Id$
/*
* Jumps to a given URL. Mostly used for accessibility.
* Jumps to a given relative or Moodle absolute URL.
* Mostly used for accessibility.
*
*/
require('../config.php');
$jump = optional_param('jump', '');
$jump = optional_param('jump', '', PARAM_RAW);
if ($jump) {
if (strpos($jump, $CFG->wwwroot) === 0) { // Anything on this site
redirect(urldecode($jump));
} else if (preg_match('/^[a-z]+\.php\?/', $jump)) {
redirect(urldecode($jump));
}
redirect($_SERVER['HTTP_REFERER']);
redirect($_SERVER['HTTP_REFERER']); // Return to sender, just in case
?>
+43 -34
View File
@@ -243,25 +243,6 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today"
$showcourses = 1;
}
if ($course->category) {
if ($selectedgroup) { // If using a group, only get users in that group.
$courseusers = get_group_users($selectedgroup, 'u.lastname ASC', '', 'u.id');
} else {
$courseusers = get_course_users($course->id, '', '', 'u.id');
}
} else {
$courseusers = get_site_users('u.lastaccess DESC', 'u.id');
}
$numusers = count((array)$courseusers);
if ($numusers < COURSE_MAX_USERS_PER_DROPDOWN && !$showusers) {
$showusers = 1;
}
/// Setup for group handling.
$isteacher = isteacher($course->id);
$isteacheredit = isteacheredit($course->id);
@@ -281,17 +262,21 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today"
// Get all the possible users
$users = array();
if ($showusers) {
if ($course->category) {
if ($selectedgroup) { // If using a group, only get users in that group.
$courseusers = get_group_users($selectedgroup, 'u.lastname ASC', '', 'u.id, u.firstname, u.lastname');
} else {
$courseusers = get_course_users($course->id, '', '', 'u.id, u.firstname, u.lastname');
}
if ($course->category) {
if ($selectedgroup) { // If using a group, only get users in that group.
$courseusers = get_group_users($selectedgroup, 'u.lastname ASC', '', 'u.id, u.firstname, u.lastname, u.idnumber');
} else {
$courseusers = get_site_users("u.lastaccess DESC", "u.id, u.firstname, u.lastname");
$courseusers = get_course_users($course->id, '', '', 'u.id, u.firstname, u.lastname, u.idnumber');
}
} else {
$courseusers = get_site_users("u.lastaccess DESC", "u.id, u.firstname, u.lastname, u.idnumber");
}
if (count($courseusers) < COURSE_MAX_USERS_PER_DROPDOWN && !$showusers) {
$showusers = 1;
}
if ($showusers) {
if ($courseusers) {
foreach ($courseusers as $courseuser) {
$users[$courseuser->id] = fullname($courseuser, $isteacher);
@@ -1144,6 +1129,14 @@ function make_categories_list(&$list, &$parents, $category=NULL, $path="") {
/// categories, building up a nice list for display. It also makes
/// an array that list all the parents for each category.
// initialize the arrays if needed
if (!is_array($list)) {
$list = array();
}
if (!is_array($parents)) {
$parents = array();
}
if ($category) {
if ($path) {
$path = $path.' / '.$category->name;
@@ -1231,7 +1224,7 @@ function print_category_info($category, $depth) {
if ($CFG->frontpage == FRONTPAGECOURSELIST) {
$catimage = '<img src="'.$CFG->pixpath.'/i/course.gif" width="16" height="16" border="0" alt="" />';
} else {
$catimage = "&nbsp";
$catimage = "&nbsp;";
}
echo "\n\n".'<table border="0" cellpadding="3" cellspacing="0" width="100%">';
@@ -1440,20 +1433,20 @@ function print_course_search($value="", $return=false, $format="plain") {
if ($format == 'plain') {
$output = '<form name="coursesearch" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<center><p align="center" class="coursesearchbox">';
$output .= '<input type="text" size="30" name="search" alt="'.$strsearchcourses.'" value="'.$value.'" />';
$output .= '<input type="submit" value="'.$strsearchcourses.'" />';
$output .= '<input type="text" size="30" name="search" alt="'.s($strsearchcourses).'" value="'.s($value).'" />';
$output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
$output .= '</p></center></form>';
} else if ($format == 'short') {
$output = '<form name="coursesearch" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<center><p align="center" class="coursesearchbox">';
$output .= '<input type="text" size="12" name="search" alt="'.$strsearchcourses.'" value="'.$value.'" />';
$output .= '<input type="submit" value="'.$strsearchcourses.'" />';
$output .= '<input type="text" size="12" name="search" alt="'.s($strsearchcourses).'" value="'.s($value).'" />';
$output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
$output .= '</p></center></form>';
} else if ($format == 'navbar') {
$output = '<form name="coursesearch" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<table border="0" cellpadding="0" cellspacing="0"><tr><td nowrap="nowrap">';
$output .= '<input type="text" size="20" name="search" alt="'.$strsearchcourses.'" value="'.$value.'" />';
$output .= '<input type="submit" value="'.$strsearchcourses.'" />';
$output .= '<input type="text" size="20" name="search" alt="'.s($strsearchcourses).'" value="'.s($value).'" />';
$output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
$output .= '</td></tr></table>';
$output .= '</form>';
}
@@ -1607,6 +1600,22 @@ function move_section($course, $section, $move) {
if (isset($USER->display[$course->id]) and ($USER->display[$course->id] == $section)) {
course_set_display($course->id, $sectiondest);
}
// Check for duplicates.
// There is a very rare case that some sections in the same course have the same section id.
if (($count_section = count_records('course_sections', 'course', $course->id) - 1) != $course->numsections) {
$sections = get_records_select('course_sections', "course = $course->id AND section > 0", 'section ASC');
$n = 1;
foreach ($sections as $section) {
if (!set_field('course_sections', 'section', $n, 'id', $section->id)) {
return false;
}
$n++;
}
if (!set_field('course', 'numsections', $count_section, 'id', $course->id)) {
return false;
}
}
return true;
}
+2 -3
View File
@@ -77,9 +77,8 @@
$strloginas = get_string("loginas");
$strloggedinas = get_string("loggedinas", "", $student_name);
print_header("$course->fullname: $strloginas $student_name", "$course->fullname",
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ->
$strloginas $student_name");
print_header_simple("$strloginas $student_name", '', "$strloginas $student_name", '', '',
true, '&nbsp;', navmenu($course));
notice($strloggedinas, "$CFG->wwwroot/course/view.php?id=$course->id");
+4 -3
View File
@@ -4,7 +4,8 @@
require_once("../config.php");
require_once("lib.php");
require_variable($id);
$id = required_param('id', PARAM_INT);
$page = optional_param('page', 0, PARAM_INT); // which page to show
require_login();
@@ -28,12 +29,12 @@
$strupdatesevery = get_string("updatesevery", "moodle", COURSE_LIVELOG_REFRESH);
print_header("$strlivelogs ($strupdatesevery)", "$strlivelogs", "", "",
'<meta http-equiv="Refresh" content="'.COURSE_LIVELOG_REFRESH.'; url=loglive.php?id='.$id.'" />');
'<meta http-equiv="Refresh" content="'.COURSE_LIVELOG_REFRESH.'; url=loglive.php?id='.$course->id.'" />');
$user=0;
$date=time() - 3600;
print_log($course, $user, $date, "l.time DESC", 0, 500,
print_log($course, $user, $date, "l.time DESC", $page, 500,
"loglive.php?id=$course->id&amp;user=$user&amp;date=$date");
print_footer($course);
+24 -5
View File
@@ -29,14 +29,29 @@
if (isset($_POST["course"]) and confirm_sesskey()) { // add or update form submitted
if (!$course = get_record("course", "id", $mod->course)) {
error("This course doesn't exist");
if (empty($mod->coursemodule)) { //add
if (! $course = get_record("course", "id", $mod->course)) {
error("This course doesn't exist");
}
$mod->instance = '';
$mod->coursemodule = '';
} else { //delete and update
if (! $cm = get_record("course_modules", "id", $mod->coursemodule)) {
error("This course module doesn't exist");
}
if (! $course = get_record("course", "id", $cm->course)) {
error("This course doesn't exist");
}
$mod->instance = $cm->instance;
$mod->coursemodule = $cm->id;
}
if (!isteacheredit($course->id)) {
error("You can't modify this course!");
}
$mod->course = $course->id;
$mod->modulename = clean_filename($mod->modulename); // For safety
$modlib = "$CFG->dirroot/mod/$mod->modulename/lib.php";
@@ -239,6 +254,10 @@
error("This course module doesn't exist");
}
if (!isteacheredit($cm->course)) {
error("You can't modify this course!");
}
$cm->indent += $_GET['indent'];
if ($cm->indent < 0) {
@@ -603,10 +622,10 @@
$defaultformat = FORMAT_MOODLE;
}
$icon = "<img align=\"middle\" height=\"16\" width=\"16\" src=\"$CFG->modpixpath/$module->name/icon.gif\" alt=\"\" />&nbsp;";
$icon = '<img align="middle" height="16" width="16" src="'.$CFG->modpixpath.'/'.$module->name.'/icon.gif" alt="" style="vertical-align: middle;" />&nbsp;';
print_heading_with_help($pageheading, "mods", $module->name, $icon);
print_simple_box_start("center");
print_simple_box_start('center', '', '', 5, 'generalbox', $module->name);
include_once($modform);
print_simple_box_end();
+1 -1
View File
@@ -8,7 +8,7 @@
require_variable($id);
$user = optional_param('user', '0', PARAM_INT);
$sortby = optional_param('user', 'default');
$sortby = optional_param('sortby', 'default', PARAM_ALPHA);
$selectedgroup = optional_param('selectedgroup', '');
if (! $course = get_record("course", "id", $id) ) {
+9 -8
View File
@@ -5,11 +5,11 @@
require_once("../config.php");
require_once("lib.php");
optional_variable($search, ""); // search words
optional_variable($page, "0"); // which page to show
optional_variable($perpage, "10"); // how many per page
$search = optional_param('search', '', PARAM_RAW); // search words
$page = optional_param('page', 0, PARAM_INT); // which page to show
$perpage = optional_param('perpage', 10, PARAM_INT); // how many per page
$search = trim(strip_tags($search));
$search = trim(strip_tags($search)); // trim & clean raw searched string
if ($search) {
$searchterms = explode(" ", $search); // Search for words independently
@@ -55,7 +55,7 @@
$searchform = print_course_search($search, true, "navbar");
print_header("$site->fullname : $strsearchresults", $site->fullname,
"<a href=\"index.php\">$strcourses</a> -> <a href=\"search.php\">$strsearch</a> -> '$search'", "", "", "", $searchform);
"<a href=\"index.php\">$strcourses</a> -> <a href=\"search.php\">$strsearch</a> -> '".s($search)."'", "", "", "", $searchform);
$lastcategory = -1;
@@ -64,7 +64,8 @@
print_heading("$strsearchresults: $totalcount");
print_paging_bar($totalcount, $page, $perpage, "search.php?search=$search&amp;perpage=$perpage&");
$encodedsearch = urlencode(stripslashes($search));
print_paging_bar($totalcount, $page, $perpage, "search.php?search=$encodedsearch&amp;perpage=$perpage&");
foreach ($courses as $course) {
$course->fullname = highlight("$search", $course->fullname);
@@ -77,10 +78,10 @@
print_spacer(5,5);
}
print_paging_bar($totalcount, $page, $perpage, "search.php?search=$search&amp;perpage=$perpage&");
print_paging_bar($totalcount, $page, $perpage, "search.php?search=$encodedsearch&amp;perpage=$perpage&");
} else {
print_heading(get_string("nocoursesfound", "", $search));
print_heading(get_string("nocoursesfound", "", s($search)));
}
echo "<br /><br />";
+7 -5
View File
@@ -2,7 +2,7 @@
<form name="studentform" id="studentform" method="post" action="student.php">
<input type="hidden" name="previoussearch" value="<?php echo $previoussearch ?>" />
<input type="hidden" name="sesskey" value="<?php echo $sesskey ?>" />
<input type="hidden" name="id" value="<?php echo $id?>" />
<input type="hidden" name="id" value="<?php echo $course->id ?>" />
<table align="center" border="0" cellpadding="5" cellspacing="0">
<tr>
<td valign="top">
@@ -63,16 +63,18 @@
.'<optgroup label="'.get_string('trysearching').'"><option></option></optgroup>'."\n";
}
else {
foreach ($users as $user) {
$fullname = fullname($user, true);
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
if ($usercount > 0) { //fix for bug#4455
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 ?>"
<input type="text" name="searchtext" size="30" value="<?php p($searchtext) ?>"
onFocus ="document.studentform.add.disabled=true;
document.studentform.remove.disabled=true;
document.studentform.removeselect.selectedIndex=-1;
+9 -11
View File
@@ -55,16 +55,6 @@
}
/// Print headers
print_header("$course->shortname: $strassignteachers",
"$course->fullname",
"<a href=\"index.php\">$strcourses</a> -> ".
"<a href=\"view.php?id=$course->id\">$course->shortname</a> -> ".
"$strassignteachers", "");
/// If data submitted, then process and store.
if ($form = data_submitted() and confirm_sesskey()) {
@@ -94,6 +84,14 @@
redirect("teacher.php?id=$course->id", get_string("changessaved"));
}
/// Print headers
print_header("$course->shortname: $strassignteachers",
"$course->fullname",
"<a href=\"index.php\">$strcourses</a> -> ".
"<a href=\"view.php?id=$course->id\">$course->shortname</a> -> ".
"$strassignteachers", "");
/// Add a teacher if one is specified
if (!empty($_GET['add']) and confirm_sesskey()) {
@@ -158,7 +156,7 @@
}
$table->data[] = array ($picture, fullname($teacher, true), $authority,
"<input type=\"text\" name=\"r$teacher->id\" value=\"$teacher->role\" size=\"30\" />",
"<input type=\"text\" name=\"r$teacher->id\" value=\"$teacher->role\" size=\"30\" maxlength=\"40\" />",
$editall, $removelink);
}
$teacherlist = implode(",",$teacherarray);
+1 -1
View File
@@ -24,7 +24,7 @@
error("You must be a teacher with editing rights to do this");
}
if ($user->id == $USER->id and !$CFG->allowunenroll) {
if ($user->id == $USER->id and !$CFG->allowunenroll or $course->metacourse) {
error("You are not allowed to unenroll");
}
+1 -1
View File
@@ -185,7 +185,7 @@ function print_outline_row($mod, $instance, $result) {
}
echo "</td>";
echo "<td>&nbsp;&nbsp;&nbsp;</td>";
if (isset($result->time)) {
if (!empty($result->time)) {
$timeago = format_time(time() - $result->time);
echo "<td valign=\"top\" nowrap=\"nowrap\">".userdate($result->time)." ($timeago)</td>";
}
+2 -2
View File
@@ -11,8 +11,8 @@
$edit = optional_param('edit');
$idnumber = optional_param('idnumber');
if (empty($id) && empty($name)) {
error("Must specify course id or short name");
if (empty($id) && empty($name) && empty($idnumber)) {
error("Must specify course id, short name or idnumber");
}
if (!empty($name)) {
+100 -102
View File
@@ -1,128 +1,126 @@
<?php // $Id$
/************************************************************************
*
* CCVal - Credit Card Validation function.
*
* Copyright (c) 1999, 2003 Holotech Enterprises. All rights reserved.
* You may freely modify and use this function for your own purposes. You
* may freely distribute it, without modification and with this notice
* and entire header intact.
*
* This function accepts a credit card number and, optionally, a code for
* a credit card name. If a Name code is specified, the number is checked
* against card-specific criteria, then validated with the Luhn Mod 10
* formula. Otherwise it is only checked against the formula. Valid name
* codes are:
*
* mcd - Master Card
* vis - Visa
* amx - American Express
* dsc - Discover
* dnc - Diners Club
* jcb - JCB
* swi - Switch
* dlt - Delta
* enr - EnRoute
*
* You can also optionally specify an expiration date in the formay mmyy.
* If the validation fails on the date, the function returns 0. If it
* fails on the number validation, it returns false.
*
* A description of the criteria used in this function can be found at
* http://www.paylib.net/ccval.html. If you have any questions or
* comments, please direct them to ccval@holotech.net
*
* Alan Little
* Holotech Enterprises
* http://www.holotech.net/
* August 2003
*
************************************************************************/
*
* CCVal - Credit Card Validation function.
*
* Copyright (c) 1999, 2003 Holotech Enterprises. All rights reserved.
* You may freely modify and use this function for your own purposes. You
* may freely distribute it, without modification and with this notice
* and entire header intact.
*
* This function accepts a credit card number and, optionally, a code for
* a credit card name. If a Name code is specified, the number is checked
* against card-specific criteria, then validated with the Luhn Mod 10
* formula. Otherwise it is only checked against the formula. Valid name
* codes are:
*
* mcd - Master Card
* vis - Visa
* amx - American Express
* dsc - Discover
* dnc - Diners Club
* jcb - JCB
* swi - Switch
* dlt - Delta
* enr - EnRoute
*
* You can also optionally specify an expiration date in the formay mmyy.
* If the validation fails on the date, the function returns 0. If it
* fails on the number validation, it returns false.
*
* A description of the criteria used in this function can be found at
* http://www.paylib.net/ccval.html. If you have any questions or
* comments, please direct them to ccval@holotech.net
*
* Alan Little
* Holotech Enterprises
* http://www.holotech.net/
* August 2003
*
************************************************************************/
function CCVal($Num, $Name = "n/a", $Exp = "") {
// Check the expiration date first
if (strlen($Exp)) {
$Month = substr($Exp, 0, 2);
$Year = substr($Exp, -2);
$WorkDate = "$Month/01/$Year";
$WorkDate = strtotime($WorkDate);
$LastDay = date("t", $WorkDate);
$Expires = strtotime("$Month/$LastDay/$Year 11:59:59");
if ($Expires < time()) return 0;
function CCVal($Num, $Name = "n/a", $Exp = "")
{
// Check the expiration date first
if (strlen($Exp))
{
$Month = substr($Exp, 0, 2);
$Year = substr($Exp, -2);
$WorkDate = "$Month/01/$Year";
$WorkDate = strtotime($WorkDate);
$LastDay = date("t", $WorkDate);
$Expires = strtotime("$Month/$LastDay/$Year 11:59:59");
if ($Expires < time()) return 0;
}
// Innocent until proven guilty
// Innocent until proven guilty
$GoodCard = true;
// Get rid of any non-digits
// Get rid of any non-digits
$Num = ereg_replace("[^0-9]", "", $Num);
// Perform card-specific checks, if applicable
switch ($Name) {
// Perform card-specific checks, if applicable
switch ($Name)
{
case "mcd" :
$GoodCard = ereg("^5[1-5].{14}$", $Num);
break;
case "mcd" :
$GoodCard = ereg("^5[1-5].{14}$", $Num);
break;
case "vis" :
$GoodCard = ereg("^4.{15}$|^4.{12}$", $Num);
break;
case "vis" :
$GoodCard = ereg("^4.{15}$|^4.{12}$", $Num);
break;
case "amx" :
$GoodCard = ereg("^3[47].{13}$", $Num);
break;
case "amx" :
$GoodCard = ereg("^3[47].{13}$", $Num);
break;
case "dsc" :
$GoodCard = ereg("^6011.{12}$", $Num);
break;
case "dsc" :
$GoodCard = ereg("^6011.{12}$", $Num);
break;
case "dnc" :
$GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num);
break;
case "dnc" :
$GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num);
break;
case "jcb" :
$GoodCard = ereg("^3.{15}$|^2131|1800.{11}$", $Num);
break;
case "jcb" :
$GoodCard = ereg("^3.{15}$|^2131|1800.{11}$", $Num);
break;
case "dlt" :
$GoodCard = ereg("^4.{15}$", $Num);
break;
case "dlt" :
$GoodCard = ereg("^4.{15}$", $Num);
break;
case "swi" :
$GoodCard = ereg("^[456].{15}$|^[456].{17,18}$", $Num);
break;
case "swi" :
$GoodCard = ereg("^[456].{15}$|^[456].{17,18}$", $Num);
break;
case "enr" :
$GoodCard = ereg("^2014.{11}$|^2149.{11}$", $Num);
break;
case "enr" :
$GoodCard = ereg("^2014.{11}$|^2149.{11}$", $Num);
break;
}
// The Luhn formula works right to left, so reverse the number.
// The Luhn formula works right to left, so reverse the number.
$Num = strrev($Num);
$Total = 0;
for ($x=0; $x<strlen($Num); $x++) {
$digit = substr($Num,$x,1);
for ($x=0; $x < strlen($Num); $x++)
{
$digit = substr($Num, $x, 1);
// If it's an odd digit, double it
if ($x/2 != floor($x/2)) {
$digit *= 2;
// If it's an odd digit, double it
if ($x/2 != floor($x/2)) {
$digit *= 2;
// If the result is two digits, add them
if (strlen($digit) == 2)
$digit = substr($digit,0,1) + substr($digit,1,1);
}
// Add the current digit, doubled and added if applicable, to the Total
$Total += $digit;
// If the result is two digits, add them
if (strlen($digit) == 2)
$digit = substr($digit, 0, 1) + substr($digit, 1, 1);
}
// Add the current digit, doubled and added if applicable, to the Total
$Total += $digit;
}
// If it passed (or bypassed) the card-specific check and the Total is
// evenly divisible by 10, it's cool!
if ($GoodCard && $Total % 10 == 0) return true; else return false;
}
?>
// If it passed (or bypassed) the card-specific check and the Total is
// evenly divisible by 10, it's cool!
return ($GoodCard && $Total % 10 == 0);
}
?>
+33 -12
View File
@@ -13,13 +13,34 @@
<tr valign="top">
<td align="right">enrol_currency:</td>
<td>
<?php choose_from_menu ($ancurrencies, "enrol_currency", $frm->enrol_currency, "","", "") ?>
<?php
$ancurrencies = array(
'USD' => 'US Dollars',
'EUR' => 'Euros',
'JPY' => 'Japanese Yen',
'GBP' => 'British Pounds',
'CAD' => 'Canadian Dollars'
);
choose_from_menu ($ancurrencies, "enrol_currency", $frm->enrol_currency, "","", "") ?>
</td>
<td>
<?php print_string("currency") ?>
</td>
</tr>
<tr valign="top">
<td align="right">loginhttps:</td>
<td>
<?php echo (empty($CFG->loginhttps) ? "<font color=\"red\">off</font>" : "<font color=\"green\">on</font>") ?>
</td>
<td>
<?php
$a->url = "$CFG->wwwroot/$CFG->admin/config.php#configsectionsecurity";
print_string("logindesc", "enrol_authorize", $a)
?>
</td>
</tr>
<tr valign="top"><td colspan="3"><hr noshade="noshade" size="1"></td></tr>
<tr valign="top">
@@ -52,7 +73,7 @@
<tr valign="top">
<td align="right">an_password:</td>
<td>
<input type="text" name="an_password" value="<?php p($frm->an_password) ?>" />
<input type="password" name="an_password" value="<?php p($frm->an_password) ?>" />
</td>
<td>
<?php print_string("anpassword", "enrol_authorize") ?>
@@ -69,6 +90,16 @@
</td>
</tr>
<tr valign="top">
<td align="right">an_avs:</td>
<td>
<input type="checkbox" value="1" name="an_avs" <?php if (!empty($frm->an_avs)) echo "checked=\"true\"" ?> />
</td>
<td>
<?php print_string("adminavs", "enrol_authorize") ?>
</td>
</tr>
<tr valign="top">
<td align="right">an_test:</td>
<td>
@@ -111,14 +142,4 @@
</td>
</tr>
<tr valign="top">
<td align="right">enrol_allowinternal:</td>
<td>
<input type="checkbox" value="1" name="enrol_allowinternal" <?php if (!empty($frm->enrol_allowinternal)) echo "checked=\"true\"" ?> />
</td>
<td>
<?php print_string('allowinternal') ?>
</td>
</tr>
</table>
+33 -19
View File
@@ -1,19 +1,33 @@
<?PHP //$Id$
// MySQL commands for upgrading this enrolment module
function authorize_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
if ($oldversion == 0) {
modify_database("$CFG->dirroot/enrol/authorize/db/mysql.sql");
}
return $result;
}
?>
<?PHP //$Id$
// MySQL commands for upgrading this enrolment module
function authorize_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
if ($oldversion == 0 || !in_array($CFG->prefix . 'enrol_authorize', $db->MetaTables('TABLES'))) {
$result = modify_database("$CFG->dirroot/enrol/authorize/db/mysql.sql");
return $result; // SQL file contains all upgrades.
}
if ($oldversion < 2005071601) {
// Be sure, only last 4 digit is inserted.
table_column('enrol_authorize', 'cclastfour', 'cclastfour', 'integer', '4', 'unsigned', '0', 'not null');
table_column('enrol_authorize', 'courseid', 'courseid', 'integer', '10', 'unsigned', '0', 'not null');
table_column('enrol_authorize', 'userid', 'userid', 'integer', '10', 'unsigned', '0', 'not null');
// Add some indexes for speed.
execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX courseid(courseid)", false);
execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX userid(userid)", false);
}
if ($oldversion && $oldversion < 2005071602) {
notify("If you are using the authorize.net enrolment plugin for credit card
handling, please ensure that you have turned loginhttps ON in Admin >> Variables >> Security.");
}
return $result;
}
?>
+14 -12
View File
@@ -1,12 +1,14 @@
CREATE TABLE `prefix_enrol_authorize` (
`id` int(10) unsigned NOT NULL auto_increment,
`cclastfour` int(11) default '0',
`ccexp` varchar(6) default '',
`cvv` varchar(4) default '',
`ccname` varchar(255) default '',
`courseid` int(11) NOT NULL default '0',
`userid` int(11) NOT NULL default '0',
`avscode` char(1) default 'P',
`transid` varchar(255) default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Holds all known information about creditcard transactions';
CREATE TABLE `prefix_enrol_authorize` (
`id` int(10) unsigned NOT NULL auto_increment,
`cclastfour` int(4) unsigned NOT NULL default '0',
`ccexp` varchar(6) default '',
`cvv` varchar(4) default '',
`ccname` varchar(255) NOT NULL default '',
`courseid` int(10) unsigned NOT NULL default '0',
`userid` int(10) unsigned NOT NULL default '0',
`avscode` char(1) default 'P',
`transid` varchar(255) default '',
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`),
KEY `userid` (`userid`)
) TYPE=MyISAM COMMENT='Holds all known information about creditcard transactions';
+9 -18
View File
@@ -7,33 +7,24 @@ function authorize_upgrade($oldversion=0) {
$result = true;
if ($oldversion == 0) {
modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql");
if ($oldversion == 0 || !in_array($CFG->prefix . 'enrol_authorize', $db->MetaTables('TABLES'))) {
$result = modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql");
return $result; // SQL file contains all upgrades.
}
if ($oldversion < 2005080200) {
if ($oldversion < 2005071601) {
// Be sure, only last 4 digit is inserted.
table_column('enrol_authorize', 'cclastfour', 'cclastfour', 'integer', '4', 'unsigned', '0', 'not null');
table_column('enrol_authorize', 'courseid', 'courseid', 'integer', '10', 'unsigned', '0', 'not null');
table_column('enrol_authorize', 'userid', 'userid', 'integer', '10', 'unsigned', '0', 'not null');
// Add some indexes for speed.
modify_database('',"CREATE INDEX prefix_enrol_authorize_courseid_idx ON prefix_enrol_authorize (courseid);");
modify_database('',"CREATE INDEX prefix_enrol_authorize_userid_idx ON prefix_enrol_authorize (userid);");
execute_sql("CREATE INDEX {$CFG->prefix}enrol_authorize_courseid_idx ON {$CFG->prefix}enrol_authorize (courseid);", false);
execute_sql("CREATE INDEX {$CFG->prefix}enrol_authorize_userid_idx ON {$CFG->prefix}enrol_authorize (userid);", false);
}
if ($oldversion < 2005112100) {
include_once("$CFG->dirroot/enrol/authorize/enrol.php");
table_column('enrol_authorize', '', 'authcode', 'varchar', '6', '', '', '', 'avscode'); // CAPTURE_ONLY
table_column('enrol_authorize', '', 'status', 'integer', '10', 'unsigned', '0', 'not null', 'transid');
table_column('enrol_authorize', '', 'timecreated', 'integer', '10', 'unsigned', '0', 'not null', 'status');
table_column('enrol_authorize', '', 'timeupdated', 'integer', '10', 'unsigned', '0', 'not null', 'timecreated');
// status index for speed.
modify_database('',"CREATE INDEX prefix_enrol_authorize_status_idx ON prefix_enrol_authorize (status);");
// defaults.
$timenow = time();
$status = AN_STATUS_AUTH | AN_STATUS_CAPTURE;
execute_sql(" UPDATE {$CFG->prefix}enrol_authorize SET timecreated='$timenow', timeupdated='$timenow', status='$status' ", false);
if ($oldversion && $oldversion < 2005071602) {
notify("If you are using the authorize.net enrolment plugin for credit card
handling, please ensure that you have turned loginhttps ON in Admin >> Variables >> Security.");
}
return $result;
+7 -4
View File
@@ -1,11 +1,14 @@
CREATE TABLE prefix_enrol_authorize (
id SERIAL PRIMARY KEY,
cclastfour integer default '0',
cclastfour integer DEFAULT 0 NOT NULL,
ccexp varchar(6) default '',
cvv varchar(4) default '',
ccname varchar(255) default '',
courseid integer NOT NULL default '0',
userid integer NOT NULL default '0',
courseid integer DEFAULT 0 NOT NULL,
userid integer DEFAULT 0 NOT NULL,
avscode varchar(1) default 'P',
transid varchar(255) default ''
);
);
CREATE INDEX prefix_enrol_authorize_courseid_idx ON prefix_enrol_authorize(courseid);
CREATE INDEX prefix_enrol_authorize_userid_idx ON prefix_enrol_authorize(userid);
+35 -3
View File
@@ -1,4 +1,4 @@
<p align="center"><?php if (! empty($this->errormsg)) {formerr($this->errormsg);} ?></p>
<p align="center"><?php if (! empty($this->ccerrormsg)) {formerr($this->ccerrormsg);} ?></p>
<div align="center">
@@ -24,12 +24,29 @@
for ($i=1; $i<=12; $i++) {
$months[$i] = userdate(gmmktime(12,0,0,$i,1,2000), "%B");
}
choose_from_menu($months, 'ccexpiremm', $form->ccexpiremm, '');
?> <input type="text" name="ccexpireyyyy" size="4" maxlength="4" value="<?php p($form->ccexpireyyyy) ?>" /></td>
choose_from_menu($months, 'ccexpiremm', $form->ccexpiremm);
$nowdate = getdate();
$nowyear = $nowdate["year"]-1;
for ($i=$nowyear; $i<=$nowyear+11; $i++) {
$years[$i] = $i;
}
choose_from_menu($years, 'ccexpireyyyy', $form->ccexpireyyyy);
?></td>
</tr>
<tr>
<td align="right"><?php print_string("cctype", "enrol_authorize") ?>: </td>
<td align="left"><?php
$CCTYPES = array(
'mcd' => 'Master Card',
'vis' => 'Visa',
'amx' => 'American Express',
'dsc' => 'Discover',
'dnc' => 'Diners Club',
'jcb' => 'JCB',
'swi' => 'Switch',
'dlt' => 'Delta',
'enr' => 'EnRoute'
);
choose_from_menu($CCTYPES, 'cctype', $form->cctype);
?>
</td>
@@ -39,6 +56,21 @@
<td align="left"><input type="text" name="cvv" size="4" maxlength="4" value="<?php p($form->cvv) ?>" />
<font size=1><?php print_string("ccvvhelp", "enrol_authorize") ?></font></td>
</tr>
<?php if (!empty($CFG->an_avs)) { /* Address Verification System */ ?>
<tr>
<td align="right"><?php print_string("address") ?>: </td>
<td align="left"><input type="text" name="ccaddress" size="32" value="<?php p($useraddress) ?>" /></td>
</tr>
<tr>
<td align="right"><?php print_string("city") ?> / <?php print_string("state") ?>: </td>
<td align="left"><input type="text" name="cccity" size="16" value="<?php p($usercity) ?>" /> /
<input type="text" name="ccstate" size="2" maxlength="2" value="<?php p($form->ccstate) ?>" /></td>
</tr>
<tr>
<td align="right"><?php print_string("country") ?>: </td>
<td align="left"><?php choose_from_menu(get_list_of_countries(), "cccountry", $usercountry, get_string("selectacountry")."..."); ?></td>
</tr>
<?php } ?>
<tr>
<td align="right"><?php print_string("zipcode", "enrol_authorize") ?>: </td>
<td align="left"><input type="text" name="cczip" size="5" value="<?php p($form->cczip) ?>" /></td>
+409 -416
View File
@@ -14,454 +14,447 @@ require_once("$CFG->dirroot/enrol/enrol.class.php");
class enrolment_plugin extends enrolment_base {
/// Override: print_entry()
function print_entry($course) {
global $CFG, $USER, $form;
var $ccerrormsg;
if ($this->zero_cost($course)) {
if (!empty($CFG->enrol_allowinternal)) {
/// Override: print_entry()
function print_entry($course) {
global $CFG, $USER, $form;
if ($this->zero_cost($course) || isguest()) {
parent::print_entry($course);
} else {
print_header();
notice(get_string("enrolmentnointernal"), $CFG->wwwroot);
return;
}
} else {
// check payment
// check paid?
$this->check_paid();
if ((!empty($CFG->loginhttps)) && (!isset($_SERVER['HTTPS']))) {
$wwwsroot = str_replace('http://','https://', $CFG->wwwroot);
$sdestination = "$wwwsroot/course/enrol.php?id=$course->id";
redirect($sdestination);
exit;
// I want to paid on SSL.
if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') {
if (empty($CFG->loginhttps)) {
error(get_string("httpsrequired", "enrol_authorize"));
} else {
$wwwsroot = str_replace('http://','https://', $CFG->wwwroot);
$sdestination = "$wwwsroot/course/enrol.php?id=$course->id";
redirect($sdestination);
exit;
}
}
$formvars = array('password', 'ccfirstname','cclastname','cc','ccexpiremm','ccexpireyyyy','cctype','cvv',
'ccaddress', 'cccity', 'ccstate', 'cccountry', 'cczip');
foreach ($formvars as $var) {
if (!isset($form->$var)) {
$form->$var = '';
}
}
$teacher = get_teacher($course->id);
$cost = $this->get_course_cost($course);
$strloginto = get_string("loginto", "", $course->shortname);
$strcourses = get_string("courses");
$teacher = get_teacher($course->id);
$userfirstname = empty($form->ccfirstname) ? $USER->firstname : $form->ccfirstname;
$userlastname = empty($form->cclastname) ? $USER->lastname : $form->cclastname;
$useraddress = empty($form->ccaddress) ? $USER->address : $form->ccaddress;
$usercity = empty($form->cccity) ? $USER->city : $form->cccity;
$usercountry = empty($form->cccountry) ? $USER->country : $form->cccountry;
print_header($strloginto, $course->fullname, "<a href=\"$CFG->wwwroot/course/\">$strcourses</a> -> $strloginto");
print_course($course, "80%");
if ($course->password) {
print_simple_box(get_string('choosemethod', 'enrol_authorize'), 'center');
$password = '';
include($CFG->dirroot . '/enrol/internal/enrol.html');
}
print_simple_box_start("center");
include($CFG->dirroot . '/enrol/authorize/enrol.html');
print_simple_box_end();
$coursefullname = $course->fullname;
$courseshortname= $course->shortname;
$userfirstname = $USER->firstname;
$userlastname = $USER->lastname;
$useraddress = $USER->address;
$usercity = $USER->city;
$cost = $this->get_course_cost($course);
print_footer();
}
$CCTYPES = array(
'mcd' => 'Master Card',
'vis' => 'Visa',
'amx' => 'American Express',
'dsc' => 'Discover',
'dnc' => 'Diners Club',
'jcb' => 'JCB',
'swi' => 'Switch',
'dlt' => 'Delta',
'enr' => 'EnRoute'
/// Override: check_entry()
function check_entry($form, $course) {
if ($this->zero_cost($course) || (!empty($form->password)) || isguest()) {
parent::check_entry($form, $course);
} else {
$this->cc_submit($form, $course);
}
}
function cc_submit($form, $course)
{
global $CFG, $USER, $SESSION;
require_once($CFG->dirroot . '/enrol/authorize/ccval.php');
if (empty($form->ccfirstname) || empty($form->cclastname) ||
empty($form->cc) || empty($form->cvv) || empty($form->cctype) ||
empty($form->ccexpiremm) || empty($form->ccexpireyyyy)) {
$this->ccerrormsg = get_string("allfieldsrequired");
return;
}
if (!empty($CFG->an_avs)) {
if (empty($form->ccaddress) || empty($form->cccity) ||
empty($form->cccountry) || empty($form->cczip)) {
$this->ccerrormsg = get_string("allfieldsrequired");
return;
}
}
$exp_date = (($form->ccexpiremm<10) ? strval('0'.$form->ccexpiremm) : strval($form->ccexpiremm)) . ($form->ccexpireyyyy);
$valid_cc = CCVal($form->cc, $form->cctype, $exp_date);
if (!$valid_cc) {
$this->ccerrormsg = get_string((($valid_cc===0) ? 'ccexpired' : 'ccinvalid'), 'enrol_authorize');
return;
}
$this->check_paid();
$order_number = 0; // can be get from db
$cost = $this->get_course_cost($course);
$formdata = array (
'x_version' => '3.1',
'x_delim_data' => 'True',
'x_delim_char' => AN_DELIM,
'x_encap_char' => AN_ENCAP,
'x_relay_response' => 'False',
'x_login' => $CFG->an_login,
'x_test_request' => (!empty($CFG->an_test)) ? 'True' : 'False',
'x_type' => 'AUTH_CAPTURE',
'x_method' => 'CC',
'x_first_name' => $form->ccfirstname,
'x_last_name' => $form->cclastname,
'x_address' => $form->ccaddress,
'x_city' => $form->cccity,
'x_zip' => $form->cczip,
'x_country' => $form->cccountry,
'x_state' => $form->ccstate,
'x_card_num' => $form->cc,
'x_card_code' => $form->cvv,
'x_currency_code' => $CFG->enrol_currency,
'x_amount' => $cost,
'x_exp_date' => $exp_date,
'x_email' => $USER->email,
'x_email_customer' => 'False',
'x_cust_id' => $USER->id,
'x_customer_ip' => $_SERVER["REMOTE_ADDR"],
'x_phone' => '',
'x_fax' => '',
'x_invoice_num' => $order_number,
'x_description' => $course->shortname
);
$formvars = array('ccfirstname','cclastname','cc','ccexpiremm','ccexpireyyyy','cctype','cvv','cczip');
foreach ($formvars as $var) {
if (!isset($form->$var)) {
$form->$var = '';
}
}
include($CFG->dirroot . '/enrol/authorize/enrol.html');
print_simple_box_end();
print_footer();
}
}
/// Override: check_entry()
function check_entry($form, $course) {
global $CFG;
if ($this->zero_cost($course)) {
if (!empty($CFG->enrol_allowinternal)) {
parent::check_entry($form, $course);
// build the post string
$poststring = '';
foreach($formdata as $k => $v) {
$poststring .= $k . "=" . urlencode($v) . "&";
}
} else {
$this->cc_submit($form, $course);
}
}
$poststring .= (!empty($CFG->an_tran_key)) ?
"x_tran_key" . "=" . urlencode($CFG->an_tran_key):
"x_password" . "=" . urlencode($CFG->an_password);
function cc_submit($form, $course)
{
global $CFG, $USER, $SESSION;
require_once($CFG->dirroot . '/enrol/authorize/ccval.php');
if (empty($form->ccfirstname) || empty($form->cclastname) ||
empty($form->cc) || empty($form->cvv) || empty($form->cctype) ||
empty($form->ccexpiremm) || empty($form->ccexpireyyyy)) {
$this->errormsg = get_string("allfieldsrequired");
return;
}
$exp_date = (($form->ccexpiremm<10) ? strval('0'.$form->ccexpiremm) : strval($form->ccexpiremm)) . ($form->ccexpireyyyy);
if (! CCVal($form->cc, $form->cctype, $exp_date)) {
$this->errormsg = get_string("ccinvalid", "enrol_authorize");
return;
}
$this->check_paid();
$order_number = 0; // can be get from db
$formdata = array (
'x_version' => '3.1',
'x_delim_data' => 'True',
'x_delim_char' => AN_DELIM,
'x_encap_char' => AN_ENCAP,
'x_relay_response' => 'False',
'x_login' => $CFG->an_login,
'x_test_request' => (!empty($CFG->an_test)) ? 'True' : 'False',
'x_type' => 'AUTH_CAPTURE',
'x_method' => 'CC',
// user
'x_first_name' => (empty($form->ccfirstname) ? $USER->firstname : $form->ccfirstname),
'x_last_name' => (empty($form->cclastname) ? $USER->lastname : $form->cclastname),
'x_address' => $USER->address,
'x_city' => $USER->city,
'x_state' => '',
'x_zip' => $form->cczip,
'x_country' => $USER->country,
'x_card_num' => $form->cc,
'x_card_code' => $form->cvv,
'x_currency_code' => $CFG->enrol_currency,
'x_amount' => $this->get_course_cost($course),
'x_exp_date' => $exp_date,
'x_email' => $USER->email,
'x_email_customer' => 'False',
'x_cust_id' => $USER->id,
'x_customer_ip' => $_SERVER["REMOTE_ADDR"],
'x_phone' => '',
'x_fax' => '',
'x_invoice_num' => $order_number,
'x_description' => $course->shortname
);
//build the post string
$poststring = '';
if (!empty($CFG->an_tran_key)) {
$poststring .= urlencode("x_tran_key") . "=" . urlencode($CFG->an_tran_key);
} else {
$an_pswd = (isset($CFG->an_password)) ? $CFG->an_password : '';
$poststring .= urlencode("x_password") . "=" . urlencode($an_pswd);
}
foreach($formdata as $key => $val) {
$poststring .= "&" . urlencode($key) . "=" . urlencode($val);
}
//built
$response = array();
$anrefererheader = "";
if (isset($CFG->an_referer) && (!empty($CFG->an_referer)) &&
($CFG->an_referer != "http://") && ($CFG->an_referer != "https://")) {
$anrefererheader = "Referer: " . $CFG->an_referer . "\r\n";
}
$fp = fsockopen("ssl://" . AN_HOST, AN_PORT, $errno, $errstr, 60);
if(!$fp) {
$this->errormsg = "$errstr ($errno)";
return;
} else {
//send the server request
fputs($fp,
"POST " . AN_PATH . " HTTP/1.1\r\n" .
"Host: " . AN_HOST . "\r\n" .
$anrefererheader .
"Content-type: application/x-www-form-urlencoded\r\n" .
"Content-length: " . strlen($poststring) . "\r\n" .
"Connection: close\r\n\r\n" .
$poststring . "\r\n\r\n");
//Get the response header from the server
$str = '';
while(!feof($fp) && !stristr($str, 'content-length')) {
$str = fgets($fp, 4096);
}
// If didnt get content-lenght, something is wrong.
if (!stristr($str, 'content-length')) {
$this->errormsg = "content-length error";
return;
}
// Get length of data to be received.
$length = trim(substr($str,strpos($str,'content-length') + 15));
// Get buffer (blank data before real data)
fgets($fp, 4096);
// Get real data
$data = fgets($fp, $length);
fclose($fp);
$response = explode(AN_ENCAP.AN_DELIM.AN_ENCAP, $data);
if ($response === false)
{
$this->errormsg = "response error";
return;
}
$rcount = count($response) - 1;
if ($response[0]{0} == AN_ENCAP) {
$response[0] = substr($response[0], 1);
}
if (substr($response[$rcount], -1) == AN_ENCAP) {
$response[$rcount] = substr($response[$rcount], 0, -1);
}
}
if ($response[0] != AN_APPROVED) {
$this->errormsg = isset($response[3]) ? $response[3] : 'unknown error';
} else {
$SESSION->ccpaid = 1; // security check: don't duplicate payment
if ($course->enrolperiod) {
$timestart = time();
$timeend = $timestart + $course->enrolperiod;
} else {
$timestart = $timeend = 0;
}
if (!enrol_student($USER->id, $course->id, $timestart, $timeend)) {
$this->email_cc_error_to_admin("Error while trying to enrol ".fullname($USER)." in '$course->fullname'", $response);
} else {
// begin: send email
$teacher = get_teacher($course->id);
if (!empty($CFG->enrol_mailstudents)) {
$a->coursename = "$course->fullname";
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$USER->id";
email_to_user($USER, $teacher, get_string("enrolmentnew", '', $course->shortname),
get_string('welcometocoursetext', '', $a));
}
if (!empty($CFG->enrol_mailteachers)) {
$a->course = "$course->fullname";
$a->user = fullname($USER);
email_to_user($teacher, $USER, get_string("enrolmentnew", '', $course->shortname),
get_string('enrolmentnewuser', '', $a));
}
if (!empty($CFG->enrol_mailadmins)) {
$a->course = "$course->fullname";
$a->user = fullname($USER);
$admins = get_admins();
foreach ($admins as $admin) {
email_to_user($admin, $USER, get_string("enrolmentnew", '', $course->shortname),
get_string('enrolmentnewuser', '', $a));
}
}
// end: send email
// begin: authorize_table
$cclast4 = substr($form->cc, -4);
$datax->cclastfour = ($cclast4 === false) ? '0000' : $cclast4;
$datax->ccexp = $exp_date;
$datax->cvv = $form->cvv;
$datax->ccname = $formdata['x_first_name'] . " " . $formdata['x_last_name'];
$datax->courseid = $course->id;
$datax->userid = $USER->id;
$datax->avscode = strval($response[5]);
$datax->transid = strval($response[6]);
if (!insert_record("enrol_authorize", $datax)) { // Insert a transaction record
$this->email_cc_error_to_admin("Error while trying to insert valid transaction", $datax);
}
} // end if (!enrol_student)
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
redirect($destination);
}
}
function zero_cost($course) {
$cost = $this->get_course_cost($course);
if (abs($cost) < 0.01) { // no cost
return true;
}
return false;
}
function get_course_cost($course) {
global $CFG;
$cost = (float)0;
if (isset($course->cost)) {
if (((float)$course->cost) < 0) {
$cost = (float)$CFG->enrol_cost;
} else {
$cost = (float)$course->cost;
}
}
$cost = format_float($cost, 2);
return $cost;
}
/// Override the get_access_icons() function
function get_access_icons($course) {
global $CFG;
$str = '';
$cost = $this->get_course_cost($course);
if (abs($cost) < 0.01) {
$str = parent::get_access_icons($course);
} else {
$strrequirespayment = get_string("requirespayment");
$strcost = get_string("cost");
if (empty($CFG->enrol_currency)) {
set_config('enrol_currency', 'USD');
}
switch ($CFG->enrol_currency) {
case 'EUR': $currency = '&euro;'; break;
case 'CAD': $currency = '$'; break;
case 'GBP': $currency = '&pound;'; break;
case 'JPY': $currency = '&yen;'; break;
default: $currency = '$'; break;
// referer
$anrefererheader = '';
if (!(empty($CFG->an_referer) || $CFG->an_referer == "http://" || $CFG->an_referer == "https://")) {
$anrefererheader = "Referer: " . $CFG->an_referer . "\r\n";
}
$str .= "<p class=\"coursecost\"><font size=-1>$strcost: " .
"<a title=\"$strrequirespayment\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\"></a>" .
"$currency" . format_float($cost, 2) . '</a></p>';
}
return $str;
}
$response = array();
$fp = fsockopen("ssl://" . AN_HOST, AN_PORT, $errno, $errstr, 60);
if (!$fp) {
$this->ccerrormsg = "$errstr ($errno)";
return;
} else {
//send the server request
fputs($fp,
"POST " . AN_PATH . " HTTP/1.0\r\n" .
"Host: " . AN_HOST . "\r\n" . $anrefererheader .
"Content-type: application/x-www-form-urlencoded\r\n" .
"Connection: close\r\n" .
"Content-length: " . strlen($poststring) . "\r\n\r\n" .
$poststring . "\r\n"
);
//Get the response header from the server
$str = '';
while(!feof($fp) && !stristr($str, 'content-length')) {
$str = fgets($fp, 4096);
}
// If didnt get content-lenght, something is wrong.
if (!stristr($str, 'content-length')) {
$this->ccerrormsg = "content-length error";
@fclose($fp);
return;
}
function config_form($frm) {
global $CFG;
$ancurrencies = array(
'USD' => 'US Dollars',
'EUR' => 'Euros',
'JPY' => 'Japanese Yen',
'GBP' => 'British Pounds',
'CAD' => 'Canadian Dollars'
);
// Get length of data to be received.
$length = trim(substr($str,strpos($str,'content-length') + 15));
// Get buffer (blank data before real data)
fgets($fp, 4096);
// Get real data
$data = fgets($fp, $length);
@fclose($fp);
$response = explode(AN_ENCAP.AN_DELIM.AN_ENCAP, $data);
if ($response === false)
{
$this->ccerrormsg = "response error";
return;
}
$rcount = count($response) - 1;
if ($response[0]{0} == AN_ENCAP) {
$response[0] = substr($response[0], 1);
}
if (substr($response[$rcount], -1) == AN_ENCAP) {
$response[$rcount] = substr($response[$rcount], 0, -1);
}
}
$vars = array('enrol_cost', 'enrol_currency', 'an_login', 'an_tran_key', 'an_password', 'an_referer', 'an_test',
'enrol_mailstudents', 'enrol_mailteachers', 'enrol_mailadmins', 'enrol_allowinternal');
if ($response[0] != AN_APPROVED) {
$this->ccerrormsg = isset($response[3]) ? $response[3] : 'unknown error';
} else {
$SESSION->ccpaid = 1; // security check: don't duplicate payment
if ($course->enrolperiod) {
$timestart = time();
$timeend = $timestart + $course->enrolperiod;
} else {
$timestart = $timeend = 0;
}
foreach ($vars as $var) {
if (!isset($frm->$var)) {
$frm->$var = '';
}
if (!enrol_student($USER->id, $course->id, $timestart, $timeend)) {
$this->email_cc_error_to_admin("Error while trying to enrol ".fullname($USER)." in '$course->fullname'", $response);
} else {
// begin: send email
$teacher = get_teacher($course->id);
if (!empty($CFG->enrol_mailstudents)) {
$a->coursename = "$course->fullname";
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$USER->id";
email_to_user($USER, $teacher, get_string("enrolmentnew", '', $course->shortname),
get_string('welcometocoursetext', '', $a));
}
if (!empty($CFG->enrol_mailteachers)) {
$a->course = "$course->fullname";
$a->user = fullname($USER);
email_to_user($teacher, $USER, get_string("enrolmentnew", '', $course->shortname),
get_string('enrolmentnewuser', '', $a));
}
if (!empty($CFG->enrol_mailadmins)) {
$a->course = "$course->fullname";
$a->user = fullname($USER);
$admins = get_admins();
foreach ($admins as $admin) {
email_to_user($admin, $USER, get_string("enrolmentnew", '', $course->shortname),
get_string('enrolmentnewuser', '', $a));
}
}
// end: send email
// begin: authorize_table
$datax->cclastfour = substr($form->cc, -4);
$datax->ccexp = $exp_date;
$datax->cvv = $form->cvv;
$datax->ccname = $formdata['x_first_name'] . " " . $formdata['x_last_name'];
$datax->courseid = $course->id;
$datax->userid = $USER->id;
$datax->avscode = strval($response[5]);
$datax->transid = strval($response[6]);
if (!insert_record("enrol_authorize", $datax)) { // Insert a transaction record
$this->email_cc_error_to_admin("Error while trying to insert valid transaction", $datax);
}
} // end if (!enrol_student)
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$course->id";
}
redirect($destination);
}
}
if (!$this->check_openssl_loaded()) {
notify('PHP must be compiled with SSL support (--with-openssl)');
function zero_cost($course) { return(abs($this->get_course_cost($course)) < 0.01); }
function get_course_cost($course) {
global $CFG;
$cost = (float)0;
if (isset($course->cost)) {
if (((float)$course->cost) < 0) {
$cost = (float)$CFG->enrol_cost;
} else {
$cost = (float)$course->cost;
}
}
$cost = format_float($cost, 2);
return $cost;
}
if (data_submitted()) { // something POSTed
/// Override the get_access_icons() function
function get_access_icons($course) {
global $CFG;
$str = parent::get_access_icons($course);
$cost = $this->get_course_cost($course);
if (abs($cost) > 0.00) {
$strrequirespayment = get_string("requirespayment");
$strcost = get_string("cost");
if (empty($CFG->enrol_currency)) {
set_config('enrol_currency', 'USD');
}
switch ($CFG->enrol_currency) {
case 'EUR': $currency = '&euro;'; break;
case 'CAD': $currency = '$'; break;
case 'GBP': $currency = '&pound;'; break;
case 'JPY': $currency = '&yen;'; break;
default: $currency = '$'; break;
}
$str .= "<p class=\"coursecost\"><font size=-1>$strcost: " .
"<a title=\"$strrequirespayment\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">" .
"$currency" . format_float($cost, 2) . '</a></font></p>';
}
return $str;
}
function config_form($frm) {
global $CFG;
$vars = array('an_login', 'an_tran_key', 'an_password', 'an_referer', 'an_avs', 'an_test',
'enrol_cost', 'enrol_currency', 'enrol_mailstudents', 'enrol_mailteachers', 'enrol_mailadmins');
foreach ($vars as $var) {
if (!isset($frm->$var)) {
$frm->$var = '';
}
}
if (!$this->check_openssl_loaded()) {
notify('PHP must be compiled with SSL support (--with-openssl)');
}
if (data_submitted()) {
// Some required fields
if (empty($frm->an_login)) {
notify("an_login required");
}
if (empty($frm->an_tran_key) && empty($frm->an_password)) {
notify("an_tran_key or an_password required");
}
if (empty($CFG->loginhttps)) {
notify("\$CFG->loginhttps must be ON");
}
}
include($CFG->dirroot.'/enrol/authorize/config.html');
}
function check_openssl_loaded() {
return extension_loaded('openssl');
}
function process_config($config) {
global $CFG;
if (empty($CFG->loginhttps) || !$this->check_openssl_loaded())
{
return false;
}
$return = true;
if (!isset($config->an_login)) {
$config->an_login = '';
}
set_config('an_login', $config->an_login);
if (!isset($config->an_password)) {
$config->an_password = '';
}
set_config('an_password', $config->an_password);
if (!isset($config->an_tran_key)) {
$config->an_tran_key = '';
}
set_config('an_tran_key', $config->an_tran_key);
// Some required fields
if (empty($frm->an_login)) {
notify("an_login required");
if (empty($config->an_login)) {
$return = false;
}
if (empty($frm->an_tran_key) && empty($frm->an_password)) {
notify("an_tran_key or an_password required");
if (empty($config->an_tran_key) && empty($config->an_password)) {
$return = false;
}
if (empty($config->an_referer)) {
$config->an_referer = 'http://';
}
set_config('an_referer', $config->an_referer);
if (!isset($config->an_avs)) {
$config->an_avs = '';
}
set_config('an_avs', $config->an_avs);
if (!isset($config->an_test)) {
$config->an_test = '';
}
set_config('an_test', $config->an_test);
// --------------------------------------
if (!isset($config->enrol_cost)) {
$config->enrol_cost = '0';
}
set_config('enrol_cost', $config->enrol_cost);
if (!isset($config->enrol_currency)) {
$config->enrol_currency = 'USD';
}
set_config('enrol_currency', $config->enrol_currency);
if (!isset($config->enrol_mailstudents)) {
$config->enrol_mailstudents = '';
}
set_config('enrol_mailstudents', $config->enrol_mailstudents);
if (!isset($config->enrol_mailteachers)) {
$config->enrol_mailteachers = '';
}
set_config('enrol_mailteachers', $config->enrol_mailteachers);
if (!isset($config->enrol_mailadmins)) {
$config->enrol_mailadmins = '';
}
set_config('enrol_mailadmins', $config->enrol_mailadmins);
return $return;
}
function email_cc_error_to_admin($subject, $data) {
$admin = get_admin();
$site = get_site();
$message = "$site->fullname: Transaction failed.\n\n$subject\n\n";
foreach ($data as $key => $value) {
$message .= "$key => $value\n";
}
email_to_user($admin, $admin, "CC ERROR: ".$subject, $message);
}
function check_paid() {
global $CFG, $SESSION;
if (isset($SESSION->ccpaid)) {
unset($SESSION->ccpaid);
redirect($CFG->wwwroot . '/login/logout.php');
exit;
}
}
include($CFG->dirroot.'/enrol/authorize/config.html');
}
function check_openssl_loaded() {
return extension_loaded('openssl');
}
function process_config($config) {
$return = $this->check_openssl_loaded();
if (!isset($config->an_login)) {
$config->an_login = '';
}
set_config('an_login', $config->an_login);
if (!isset($config->an_password)) {
$config->an_password = '';
}
set_config('an_password', $config->an_password);
if (!isset($config->an_tran_key)) {
$config->an_tran_key = '';
}
set_config('an_tran_key', $config->an_tran_key);
// Some required fields
if (empty($config->an_login)) {
$return = false;
}
if (empty($config->an_tran_key) && empty($config->an_password)) {
$return = false;
}
if (empty($config->an_referer)) {
$config->an_referer = 'http://';
}
set_config('an_referer', $config->an_referer);
if (!isset($config->an_test)) {
$config->an_test = '';
}
set_config('an_test', $config->an_test);
// --------------------------------------
if (!isset($config->enrol_cost)) {
$config->enrol_cost = '0';
}
set_config('enrol_cost', $config->enrol_cost);
if (!isset($config->enrol_currency)) {
$config->enrol_currency = 'USD';
}
set_config('enrol_currency', $config->enrol_currency);
if (!isset($config->enrol_mailstudents)) {
$config->enrol_mailstudents = '';
}
set_config('enrol_mailstudents', $config->enrol_mailstudents);
if (!isset($config->enrol_mailteachers)) {
$config->enrol_mailteachers = '';
}
set_config('enrol_mailteachers', $config->enrol_mailteachers);
if (!isset($config->enrol_mailadmins)) {
$config->enrol_mailadmins = '';
}
set_config('enrol_mailadmins', $config->enrol_mailadmins);
if (!isset($config->enrol_allowinternal)) {
$config->enrol_allowinternal = '';
}
set_config('enrol_allowinternal', $config->enrol_allowinternal);
return $return;
}
function email_cc_error_to_admin($subject, $data) {
$admin = get_admin();
$site = get_admin();
$message = "$site->fullname: Transaction failed.\n\n$subject\n\n";
foreach ($data as $key => $value) {
$message .= "$key => $value\n";
}
email_to_user($admin, $admin, "CC ERROR: ".$subject, $message);
}
function check_paid() {
global $CFG, $SESSION;
if (isset($SESSION->ccpaid)) {
unset($SESSION->ccpaid);
redirect($CFG->wwwroot . '/login/logout.php');
exit;
}
}
} // end of class definition
?>
+1 -1
View File
@@ -1,6 +1,6 @@
<?PHP // $Id$
$module->version = 2004081800;
$module->version = 2005071602;
$module->requires = 2004081800;
?>
+15 -8
View File
@@ -21,13 +21,14 @@ function get_student_courses(&$user) {
/// If the database fails we can at least use this
// This is a hack to workaround what seems to be a bug in ADOdb with accessing
// two databases of the same kind ... it seems to get confused when trying to access
// two MySQL databases ... it seems to get confused when trying to access
// the first database again, after having accessed the second.
// The following hack will make the database explicit which keeps it happy
if (strpos($CFG->prefix, $CFG->dbname) === false) {
$oldprefix = $CFG->prefix;
$CFG->prefix = "$CFG->dbname.$CFG->prefix";
if ($CFG->dbtype === 'mysql' && $CFG->enrol_dbtype === 'mysql') {
if (strpos($CFG->prefix, $CFG->dbname) === false) {
$oldprefix = $CFG->prefix;
$CFG->prefix = "`$CFG->dbname`.$CFG->prefix";
}
}
// Try to connect to the external database
@@ -60,7 +61,7 @@ function get_student_courses(&$user) {
if (isset($user->student[$course->id])) { /// We have it already
unset($user->student[$course->id]); /// Remove from old list
} else {
enrol_student($user->id, $course->id); /// Enrol the student
enrol_student($user->id, $course->id, 0, 0, 'database'); /// Enrol the student
}
}
}
@@ -68,8 +69,14 @@ function get_student_courses(&$user) {
if (!empty($user->student)) { /// We have some courses left that we need to unenrol from
foreach ($user->student as $courseid => $value) {
unenrol_student($user->id, $courseid); /// Unenrol the student
unset($user->student[$course->id]); /// Remove from old list
// unenrol only if it's a record pulled from external db
if (get_record('user_students', 'userid', $user->id, 'course', $courseid, 'enrol', 'database')) {
unenrol_student($user->id, $courseid); /// Unenrol the student
unset($user->student[$course->id]); /// Remove from old list
} else {
$newstudent[$courseid] = true;
}
}
}
+2 -2
View File
@@ -145,7 +145,7 @@ function print_entry($course) {
$timestart = $timeend = 0;
}
if (! enrol_student($USER->id, $course->id, $timestart, $timeend)) {
if (! enrol_student($USER->id, $course->id, $timestart, $timeend, 'manual')) {
error("An error occurred while trying to enrol you.");
}
@@ -226,7 +226,7 @@ function check_entry($form, $course) {
$timestart = $timeend = 0;
}
if (! enrol_student($USER->id, $course->id, $timestart, $timeend)) {
if (! enrol_student($USER->id, $course->id, $timestart, $timeend, 'manual')) {
error("An error occurred while trying to enrol you.");
}
+81 -29
View File
@@ -1,39 +1,91 @@
<?php // initialize variables
// general
optional_variable($frm->enrol_ldap_host_url, '');
optional_variable($frm->enrol_ldap_version, '');
optional_variable($frm->enrol_ldap_bind_dn, '');
optional_variable($frm->enrol_ldap_bind_pw, '');
optional_variable($frm->enrol_ldap_search_sub, '0');
if (!isset ($frm->enrol_ldap_host_url)) {
$frm->enrol_ldap_host_url = '';
}
if (!isset ($frm->enrol_ldap_version )) {
$frm->enrol_ldap_version = '';
}
if (!isset ($frm->enrol_ldap_bind_dn)) {
$frm->enrol_ldap_bind_dn = '';
}
if (!isset ($frm->enrol_ldap_bind_pw)) {
$frm->enrol_ldap_bind_pw = '';
}
if (!isset ($frm->enrol_ldap_search_sub)) {
$frm->enrol_ldap_search_sub = '0';
}
// student & teacher enrol
optional_variable($frm->enrol_ldap_student_contexts, '');
optional_variable($frm->enrol_ldap_student_memberattribute, '');
optional_variable($frm->enrol_ldap_teacher_contexts, '');
optional_variable($frm->enrol_ldap_teacher_memberattribute, '');
optional_variable($frm->enrol_ldap_objectclass, '');
optional_variable($frm->enrol_ldap_course_idnumber_updatelocal, '');
if (!isset ($frm->enrol_ldap_student_contexts)) {
$frm->enrol_ldap_student_contexts = '';
}
if (!isset ($frm->enrol_ldap_student_memberattribute)) {
$frm->enrol_ldap_student_memberattribute = '';
}
if (!isset ($frm->enrol_ldap_teacher_contexts)) {
$frm->enrol_ldap_teacher_contexts = '';
}
if (!isset ($frm->enrol_ldap_teacher_memberattribute)) {
$frm->enrol_ldap_teacher_memberattribute = '';
}
if (!isset ($frm->enrol_ldap_objectclass)) {
$frm->enrol_ldap_objectclass = '';
}
if (!isset ($frm->enrol_ldap_course_idnumber_updatelocal)) {
$frm->enrol_ldap_course_idnumber_updatelocal = '';
}
// fields
optional_variable($frm->enrol_ldap_course_idnumber, '');
optional_variable($frm->enrol_ldap_course_idnumber_updatelocal, false);
optional_variable($frm->enrol_ldap_course_idnumber_editlock, false);
optional_variable($frm->enrol_ldap_course_fullname, '');
optional_variable($frm->enrol_ldap_course_fullname_updatelocal, false);
optional_variable($frm->enrol_ldap_course_fullname_editlock, false);
optional_variable($frm->enrol_ldap_course_shortname, '');
optional_variable($frm->enrol_ldap_course_shortname_updatelocal, false);
optional_variable($frm->enrol_ldap_course_shortname_editlock, false);
optional_variable($frm->enrol_ldap_course_summary, '');
optional_variable($frm->enrol_ldap_course_summary_updatelocal, false);
optional_variable($frm->enrol_ldap_course_summary_editlock, false);
if (!isset ($frm->enrol_ldap_course_idnumber)) {
$frm->enrol_ldap_course_idnumber = '';
}
if (!isset ($frm->enrol_ldap_course_idnumber_updatelocal)) {
$frm->enrol_ldap_course_idnumber_updatelocal = false;
}
if (!isset ($frm->enrol_ldap_course_idnumber_editlock)) {
$frm->enrol_ldap_course_idnumber_editlock = false;
}
if (!isset ($frm->enrol_ldap_course_fullname)) {
$frm->enrol_ldap_course_fullname = '';
}
if (!isset ($frm->enrol_ldap_course_fullname_updatelocal)) {
$frm->enrol_ldap_course_fullname_updatelocal = false;
}
if (!isset ($frm->enrol_ldap_course_fullname_editlock)) {
$frm->enrol_ldap_course_fullname_editlock = false;
}
if (!isset ($frm->enrol_ldap_course_shortname)) {
$frm->enrol_ldap_course_shortname = '';
}
if (!isset ($frm->enrol_ldap_course_shortname_updatelocal)) {
$frm->enrol_ldap_course_shortname_updatelocal = false;
}
if (!isset ($frm->enrol_ldap_course_shortname_editlock)) {
$frm->enrol_ldap_course_shortname_editlock = false;
}
if (!isset ($frm->enrol_ldap_course_summary)) {
$frm->enrol_ldap_course_summary = '';
}
if (!isset ($frm->enrol_ldap_course_summary_updatelocal)) {
$frm->enrol_ldap_course_summary_updatelocal = false;
}
if (!isset ($frm->enrol_ldap_course_summary_editlock)) {
$frm->enrol_ldap_course_summary_editlock = false;
}
// autocreate
optional_variable($frm->enrol_ldap_autocreate, false);
optional_variable($frm->enrol_ldap_category, 1);
optional_variable($frm->enrol_ldap_template, '');
if (!isset ($frm->enrol_ldap_autocreate)) {
$frm->enrol_ldap_autocreate = false;
}
if (!isset ($frm->enrol_ldap_category)) {
$frm->enrol_ldap_category = 1;
}
if (!isset ($frm->enrol_ldap_template)) {
$frm->enrol_ldap_template = '';
}
// general options
optional_variable($frm->enrol_allowinternal, false);
if (!isset ($frm->enrol_allowinternal)) {
$frm->enrol_allowinternal = false;
}
?>
<table cellspacing="0" cellpadding="5" border="0" align="center">

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