Compare commits

...

799 Commits

Author SHA1 Message Date
moodler 42f8e247d2 Bump to 1.7.1 2007-01-17 04:11:14 +00:00
moodler ed3ee5e357 Automatic installer.php lang files by installer_builder (20070117) 2007-01-17 03:21:07 +00:00
mchurch 8b4a8f616f Fixing bug where quizzes from 1.4 will lose their answers when upgraded to later versions.
Fixes MDL-8207.
2007-01-16 21:31:14 +00:00
tjhunt f470cf47b7 Fix multiple-choice multiple-answer grading code. 2007-01-16 17:50:18 +00:00
thepurpleblob e43202e7a3 MDL-8100, defaultgrade not imported. Question obect initialisation and value import wrong way round - whoops! 2007-01-16 12:10:40 +00:00
thepurpleblob e70d37080c MDL-8130 Number of improvements to check name length and improve HTML Entity handling. Thanks to Paul Ortman. 2007-01-16 11:19:49 +00:00
moodler 98d6d9288b Automatic installer.php lang files by installer_builder (20070116) 2007-01-16 03:18:51 +00:00
vyshane 1c2ecdd3dd Fix for MDL-8099. 2007-01-16 02:43:12 +00:00
martinlanghoff 1d94add47e enrol/database: fix fields not read from external database MDL-7712 2007-01-15 20:00:01 +00:00
martinlanghoff dd1ac4af5c auth/db: fix fields not read from external database MDL-7712 2007-01-15 19:58:58 +00:00
stronk7 9982cf19c9 Avoiding some itarations. MDL-7902. Thanks Samuli! 2007-01-14 12:10:37 +00:00
moodler 7d72568ba9 Automatic installer.php lang files by installer_builder (20070113) 2007-01-13 10:22:57 +00:00
moodler 2ad6c7b8fe Automatic installer.php lang files by installer_builder (20070113) 2007-01-12 17:49:16 +00:00
moodler c73628d1dc file installer.php was added on branch MOODLE_17_STABLE on 2007-01-12 17:49:16 +0000 2007-01-12 17:43:29 +00:00
vyshane d976a7d9dc Fix for MDL-8146. Clicking on "No" when asked to confirm deletion of a post will now always take the user back to that post in the relevant discussion. 2007-01-12 05:03:57 +00:00
moodler 2683c51739 Automatic installer.php lang files by installer_builder (20070112) 2007-01-12 03:18:54 +00:00
ethem 7262b0c5a9 MDL-7861 xhtml transient fixes for not closed input fields; Backported from HEAD 2007-01-11 10:13:14 +00:00
moodler 26be3a96c4 Very likely fix for MDL-8067 2007-01-09 04:58:46 +00:00
skodak 33ca51fbdf backported fixes for warnings when exporting logs in excel format 2007-01-08 22:24:16 +00:00
skodak 642a7105e5 fixed options array initialisation 2007-01-08 21:55:14 +00:00
skodak 4233e8b7b6 MDL-8115 fixed $$submission typo 2007-01-08 21:42:17 +00:00
stronk7 f7352c8340 Environment checks support mysqli. MDL-8113 2007-01-08 19:53:34 +00:00
stronk7 90b7248055 Minor change to be able to install 1.7 unicode under mysqli
(mysqli is going to be supported only by Moodle 1.8. This is
one exception to be able to have 1.7 working in dev environments)
2007-01-08 18:59:21 +00:00
moodler 3c13c14e59 Automatic installer.php lang files by installer_builder (20070108) 2007-01-08 03:22:26 +00:00
gbateson 0cf15fb3e6 prevent backslashes being inserted before #-sign in HTML entities by converting html-entities to UTF-8 when importing from Hot Potatoes quizzes into Moodle 's standard Quiz module 2007-01-07 12:37:37 +00:00
skodak c966aa2c71 revised adobe XSS protection SC#346 - backported from HEAD 2007-01-06 15:24:14 +00:00
thepurpleblob d367b64be3 MDL-6769 and http://moodle.org/mod/forum/discuss.php?d=60209 the default for shuffleanswers is now set to the configured value. 2007-01-05 11:55:01 +00:00
thepurpleblob 862dd9d01a MDL-7913 Improved category detection (again) to extract all characters. 2007-01-05 10:33:05 +00:00
thepurpleblob 675c2419d1 Added some cleaning to the category path for some safety. 2007-01-05 10:05:27 +00:00
moodler 3453faf411 Automatic installer.php lang files by installer_builder (20070105) 2007-01-05 03:31:39 +00:00
skodak 9fcb7001e6 Adobe Acrobat JavaScript Execution Bug SC#346 2007-01-04 00:05:07 +00:00
moodler 6a9c63b3c4 Strict DOCTYPE 2007-01-03 09:01:03 +00:00
moodler f248698fed Automatic installer.php lang files by installer_builder (20070103) 2007-01-03 03:23:27 +00:00
moodler 5510929c42 Automatic installer.php lang files by installer_builder (20070102) 2007-01-02 03:17:18 +00:00
moodler 8cbaea4f7a Automatic installer.php lang files by installer_builder (20061231) 2006-12-31 03:20:32 +00:00
skodak bb52c312de MDL-7829 zipping with binary zip broken under windows when moodledata on different disk; backported from HEAD 2006-12-29 22:53:35 +00:00
skodak 152fa94009 MDL-7828 Backup with error PCLZIP_ERR_MISSING_FILE (-4) under windows when moodledata on different disk - patch by Yves Roy; backported from HEAD 2006-12-29 22:36:38 +00:00
skodak a59462f1a4 MDL-7837 auth_ldap_bulk_insert() fails when user data contains single quotes - patch by Iñaki Arenaza; backported from HEAD 2006-12-29 21:18:37 +00:00
skodak 8f08bf55d9 MDL-8007 mimetype support for htc files, see http://support.microsoft.com/kb/306231; backported from HEAD 2006-12-29 20:59:36 +00:00
skodak 85c23c24f6 MDL-8021 resource "Link to a file or web site", when created, doesn't open in a new window - fixed recourse typo; backported from HEAD 2006-12-29 20:17:14 +00:00
moodler 174e5dfc05 Automatic installer.php lang files by installer_builder (20061229) 2006-12-29 03:12:45 +00:00
moodler 3ed3433efd Automatic installer.php lang files by installer_builder (20061228) 2006-12-28 03:14:53 +00:00
martinlanghoff 6cb344928f redirect(): fix protocol name in redirection header() 2006-12-27 01:48:22 +00:00
martinlanghoff 2c56bea007 raise_memory_limit() earlier -- resolves OOM on 64-bit platforms
On 64-bit platforms the in-memory footprint of our libraries is quite a bit
larger than usual, and we hit the 8MB default memory limit before we call
raise_memory_limit(). This patch moves raise_memory_limit() and
get_realsize() to setuplib so we can call them earlier, and moves the
call to _before_ we include the libraries.

On AMD64, for MOODLE_17_STABLE the footprint is about 9.5MB. Diet time? :-)
2006-12-26 22:47:36 +00:00
moodler 6ac70d87d4 Automatic installer.php lang files by installer_builder (20061226) 2006-12-26 03:17:04 +00:00
stronk7 e58d9e9f8e Add support for multilang titles in forum->posts 2006-12-20 16:40:12 +00:00
stronk7 80f91aad31 Added one missing format_string() to post->subject 2006-12-20 09:57:08 +00:00
vyshane fa1df4db7b Fixed some warnings with role mappings. 2006-12-19 04:59:42 +00:00
skodak ce499284a0 MDL-7903 Guests can not enter course that allows guests with key 2006-12-18 19:20:14 +00:00
skodak 5359b97581 MDL-7974 Weekend Days Settings Chooses Wrong Day after Saving; backported from HEAD 2006-12-18 18:08:53 +00:00
tjhunt f3f60456ff MDL-7975 - Make import and export of truefalse questions more reliable. Merged from MOODLE_16_STABLE. 2006-12-18 18:06:56 +00:00
tjhunt e0e1d29889 MDL-7972 - improve GIFT import export for truefalse questions.
Also clean up whitespace in question/format/gift/format.php - Merged from MOODLE_16_STABLE.

MDL-7928 - Numerical question type should use * for the match anything answer - GIFT format part.
2006-12-18 16:38:02 +00:00
vyshane 42ce3dfc9f Fix for cases where the resource being removed is the only DOM node in the section's div. 2006-12-18 06:24:53 +00:00
moodler 71338fc369 Automatic installer.php lang files by installer_builder (20061218) 2006-12-18 03:45:21 +00:00
moodler 7aae797ec1 And another bit of MDL-7961 2006-12-18 02:00:38 +00:00
moodler c5749e312f Fixed a backwards logic bug preventing format changes sometimes MDL-7961 2006-12-18 01:58:59 +00:00
skodak 17f32ca725 MDL-7941Installation on Windows makes reference to libgd.dll in php.ini; backported from HEAD 2006-12-17 22:26:36 +00:00
gbateson 7648eae997 Modified the README.TXT to reflect the fact that this version fo the HotPot module, v2.2.x, is only compatible with Moodle 1.7 2006-12-17 02:11:43 +00:00
tjhunt 62a29aa8e0 MDL-7928 - Numerical question type should use * for the match anything answer. 2006-12-15 18:30:14 +00:00
tjhunt 93727c9b8e MDL-7926 - set_field_select function 2006-12-15 18:23:15 +00:00
tjhunt b2681766d7 MDL-7925 - description question types were being created with defaultgrade = 1. It should be zero, so fix the bug, and reset any wrong ones in the database. 2006-12-15 15:41:32 +00:00
moodler afd38cb133 Automatic installer.php lang files by installer_builder (20061215) 2006-12-15 03:19:57 +00:00
mits d3fcae7237 Fixed a missing closing brace }. 2006-12-14 20:12:48 +00:00
tjhunt 6b66913982 Correct comment punctuation. 2006-12-14 11:45:28 +00:00
skodak 68875532e6 SC#341 fixed initilaization of navtail variable; backported from HEAD 2006-12-14 08:15:11 +00:00
vyshane 519c36a6fb Fixes for MDL-7674. 2006-12-14 08:09:29 +00:00
vyshane 93f30556b3 Fix for MDL-7753. Credits to Andrew Walker. 2006-12-14 07:45:44 +00:00
vyshane b3f180f91b Added missing / in link tag 2006-12-14 04:46:32 +00:00
vyshane ac76e8c5bf Fix for MDL-6980. 2006-12-14 03:03:21 +00:00
tjhunt 3c4e7ea962 MDL-7602 - Multianswer question type only works with invalid HTML. 2006-12-12 08:58:25 +00:00
tjhunt 3d83f4255a MDL-7896 - error from random question type in adaptive mode. Merged from MOODLE_16_STABLE. 2006-12-11 23:46:01 +00:00
mark-nielsen 21e5dd9414 Fix for MDL-7477 2006-12-11 18:42:10 +00:00
tjhunt 9b6b1f3afa MDL-7886 - typo in overview report javascript. 2006-12-11 14:03:09 +00:00
toyomoyo 148c0decf6 adding missing helpfile 2006-12-11 06:28:59 +00:00
toyomoyo 0df7a3d616 removed warning 2006-12-11 05:30:25 +00:00
toyomoyo 46385c64bd fix for MDL-7270, fixing warnings 2006-12-11 03:13:07 +00:00
skodak 91b890f705 MDL-7857 uninitialized context in mod/data/index.php; backported from HEAD 2006-12-10 20:21:58 +00:00
skodak 683b038d09 MDL-6668 Database mod search error on Postgres; patch by Lorenzo Nicora; backported from HEAD 2006-12-10 19:28:17 +00:00
skodak a04aa7c7df MDL-6613 Apostrophe in locked field prevents user updating profile - patch by Iñaki Arenaza; backported from HEAD 2006-12-10 17:41:12 +00:00
skodak 8e2958d1a1 MDL-7855 Sanitize field type when importing presents into data mod; backported from HEAD 2006-12-10 17:31:17 +00:00
gbateson 39d860b52d added details of the columns in the hotpot click report table 2006-12-10 05:28:38 +00:00
moodler 7c37e6755c Automatic installer.php lang files by installer_builder (20061210) 2006-12-10 03:06:58 +00:00
skodak d21dbfd55d MDL-7734 fixed warning when $course not defined when printing help button 2006-12-09 13:33:09 +00:00
moodler 723a084744 Automatic installer.php lang files by installer_builder (20061209) 2006-12-09 03:15:45 +00:00
skodak 1ace15420e MDL-6519 Dollar ($) signs in data module text fields not preserved; backported from HEAD 2006-12-08 22:36:42 +00:00
skodak 1df5e775ff MDL-7848 Database presets import breaks non-null restriction on description; backported from HEAD 2006-12-08 22:25:22 +00:00
mark-nielsen b547c1396f Added more information regarding supported file types. Related to MDL-7418 fix 2006-12-08 18:46:38 +00:00
mark-nielsen ffbbe44116 Added lang entry for MDL-7418 fix 2006-12-08 18:45:55 +00:00
mark-nielsen 7a7056e0bb Fixed MDL-7418: added support for images and added a default support which is that the file is available for download 2006-12-08 18:45:08 +00:00
toyomoyo ab505564c9 fix for MDL-7766 calenar not displaying course events 2006-12-08 07:54:27 +00:00
toyomoyo 527bd0664c fix for MDL-7819, admins still in participants list 2006-12-08 04:26:47 +00:00
gbateson 6285e5af65 abandoned attempts are now included in all reports 2006-12-08 04:18:17 +00:00
toyomoyo 792f362b93 fix for MDL-7794, inconsistent field length for city 2006-12-08 03:07:45 +00:00
moodler db69332665 Automatic installer.php lang files by installer_builder (20061208) 2006-12-08 03:06:22 +00:00
gbateson 94a7bfecb0 fix undefined property "cr_timefinish", when viewing click report 2006-12-08 02:42:51 +00:00
toyomoyo 8665733354 fix for MDL-7592, get_course_students() bug 2006-12-08 02:21:32 +00:00
skodak a6abb7fda7 MDL-7839 Fixed use of capabilities in database entry rating; backported from HEAD 2006-12-07 20:12:14 +00:00
toyomoyo 380199a948 implementing moodle/user:viewdetails 2006-12-07 06:08:02 +00:00
toyomoyo 2da1b09809 fix for MDL-7770, prevent users with no capability to view user profile 2006-12-07 05:05:18 +00:00
toyomoyo a75dde8a5c fix for MDL-7696, adding addslash for bulk messaging 2006-12-07 03:01:16 +00:00
toyomoyo 3c98b96d40 fix for MDL-7734, making help links respect course langs 2006-12-07 02:17:11 +00:00
skodak 3bd8388689 MDL-7821 wrong use of cm in data mod and added proper require_login(); backported from HEAD 2006-12-06 20:24:19 +00:00
skodak 5ceee287f3 MDL-7812 warning in sorting form in data module when no fields defined; backported from HEAD 2006-12-06 09:58:43 +00:00
skodak 319e0b4d9a MDL-7806 Login results in fatal PHP error on enrol/database connect failure (patch by Clinton Graham); backported from HEAD 2006-12-06 09:49:55 +00:00
toyomoyo 84bed3d71b avoid the use of deprecated functions 2006-12-06 06:24:20 +00:00
toyomoyo 381b712d96 fix for MDL-7784, reference to user_student tables 2006-12-06 06:07:19 +00:00
moodler 87c9582273 It's now impossible to access the home page if:
- mymoodleredirect is active, and
   - you are logged on, and
   - you don't have site config ability

MDL-7584   MDL-7583
2006-12-06 05:07:11 +00:00
toyomoyo ae9910b3aa multiple assignments should only be counted once 2006-12-06 04:26:50 +00:00
mark-nielsen 91607e97ed Media file link was being squished. Gave it 150px space 2006-12-06 02:25:09 +00:00
moodler 71c7eb7260 Non-editing teachers should NOT have course import rights by default 2006-12-06 02:23:37 +00:00
mark-nielsen 5b6037f3ac Fix for MDL-2006 2006-12-06 01:59:53 +00:00
tjhunt d2ae521e17 MDL-7804 - Essay questions do not backup properly. Merged from MOODLE_16_STABLE. 2006-12-05 18:47:12 +00:00
tjhunt 11f0eb9979 Add $level parameters to each backup method. Merged from MOODLE_16_STABLE. 2006-12-05 18:14:32 +00:00
skodak 4e1af8f1b3 require_login not working properly MDL-7800; backported from HEAD 2006-12-05 09:21:39 +00:00
vyshane a68c438d5c Removed extra ; 2006-12-05 08:14:42 +00:00
vyshane 9a7b7e38b9 Fixed bug: cannot edit post in each user forum type. 2006-12-05 08:12:27 +00:00
moodler 43e57712eb Clear the capability cache when adding roles to current user, just to be sure 2006-12-05 07:12:22 +00:00
moodler 55ebb7277b Fixed last access time for my moodle, MDL-7609. 2006-12-05 06:59:34 +00:00
moodler 0ca2898178 FIx for MDL-7605 where switchroles was not working properly
There were two issues:

1) When switch roles is active we don't want to progress up to parents of the
   course looking for capabilities


2) We need to clear the capability cache after switching roles because the
   cached values may not be accurate (because of the above difference)
2006-12-05 05:39:11 +00:00
moodler d1910944e2 Automatic installer.php lang files by installer_builder (20061205) 2006-12-05 03:22:50 +00:00
tjhunt 257343b354 MDL-7719 - Essay question feedback box too small. 2006-12-04 16:21:31 +00:00
tjhunt 7989c3edc6 Typo in help. Thanks to Ken Wilson. 2006-12-04 16:07:52 +00:00
tjhunt accaf2e9f6 Typo. 2006-12-04 11:54:35 +00:00
skodak 15f93e462f MDL-7767 Guests should not be able to hide course sections - section hiding is not stored in db for guests, only session is used now 2006-12-04 08:53:21 +00:00
vyshane d628dcedd2 Fix for MDL-7760 2006-12-04 08:02:57 +00:00
moodler 8b42d3bbb7 Added new DST timezone changes for Perth, Western Australia
(Yes, we have joined the rest of the world with DST ... :-(   )
2006-12-04 06:59:24 +00:00
moodler c92a464165 Automatic installer.php lang files by installer_builder (20061204) 2006-12-04 03:14:45 +00:00
toyomoyo 08410ed897 stop admins from showing up in participants list 2006-12-04 03:04:04 +00:00
toyomoyo aea1aa849b fixed a bug where admin can't unassign himself from non admin roles at site context 2006-12-04 01:53:43 +00:00
toyomoyo fe2f0270d3 fix for MDL-7773, restore_to options not set for creators 2006-12-04 01:13:35 +00:00
skodak bd6cea2f98 MDL-7783 Non-internal authentication change password URL doesn't work - patch by Iñaki Arenaza; backported from HEAD 2006-12-03 20:08:03 +00:00
skodak b13b2b54a6 MDL-7757 URL check is too restrictive, allow port; backported from HEAD 2006-12-03 10:24:59 +00:00
stronk7 5a16abc079 Dictionary name wasn't being saved, so aspell didn't worked under 1.7
if the setting had been edited. MDL-7762
2006-12-01 17:32:20 +00:00
thepurpleblob 0dd1864b73 Added/improved help re. switching categories in import files. 2006-12-01 16:18:02 +00:00
thepurpleblob c23b03b50c Improved regexp for category switch 2006-12-01 16:04:46 +00:00
skodak c5c150c146 MDL-7234 Smilies don't load in HTML editor for some languages; backported from HEAD 2006-12-01 09:50:44 +00:00
skodak a555df3d69 Forgotten password page does not check secret MDL-7755; backported from HEAD 2006-12-01 09:15:12 +00:00
vyshane 87b270ef6a Added check for guest user in forum_subscribed_users. Guest user should never be subsctibed to a forum. 2006-12-01 05:20:14 +00:00
vyshane 3f8f8601e2 We check for gecko build number when deciding whether ajax should be enabled or not. This is more reliable since the advent of Iceweasel etc. 2006-12-01 03:46:02 +00:00
vyshane ad0957be6d Fix for MDL-7732. Patch by Andrew Walker. 2006-12-01 02:39:15 +00:00
skodak 5bdb86e23b MDL-7749 fixed stripslashes when saving admin configuration values; backported from HEAD 2006-11-30 20:39:35 +00:00
urs_hunkler cb55f92d17 'added clear:left and a little top distance to the htmlarea in adminsettings. If this works in all places a more general rule for all quickforms should be entered' 2006-11-30 12:10:57 +00:00
ethem 9c3d643dad No urlencode 2006-11-30 09:14:15 +00:00
ethem af053ebd3e Brushed up a string. 2006-11-30 08:43:32 +00:00
ethem f241382c56 + More more more security.
* Don't show login name, password and transaction key at the configuration page.
* RC4Encrypt these fields and move to the config_plugins table from the config table.
* Config page is fully https.

Backported from HEAD.
2006-11-30 08:11:22 +00:00
skodak 055d04ad68 MDL-7741 missing ? in start php tag; backported from HEAD 2006-11-29 22:31:36 +00:00
thepurpleblob 02cac21426 Question category can now be specified in Moodle XML format. 2006-11-29 14:26:47 +00:00
thepurpleblob ee031ca12d Added ability to specify destination category within GIFT file.
MDL-4163
2006-11-29 13:33:44 +00:00
thepurpleblob 2332c5b8da Fixed a notice. Tidied up format class call a bit. Added provision
for categories to be specified within import files - MDL-4163.
2006-11-29 13:30:41 +00:00
thepurpleblob a2842bc86c Added function to find or add a path of categories.
For categories specified in import files. MDL-4163
2006-11-29 13:27:40 +00:00
thepurpleblob 8d0db8766b Help information for specifying categories in GIFT file. MDL-4163 2006-11-29 13:22:54 +00:00
thepurpleblob 746be7faee Added strings for selecting category inside import file. MDL-4163 2006-11-29 13:06:10 +00:00
tjhunt 3b117ede45 MDL-7720 - non-unicode-safe case-insensitive string comparison in shortanswer question type. 2006-11-28 18:43:44 +00:00
tjhunt af5f09db42 Put back spaces in code that Martin Dougiamass stripped out of the lang strings without thinking about the consequences. 2006-11-28 18:38:59 +00:00
nfreear 48988ba271 Fix for MDL-6685 (and MDL-7122 "breadcrumb separator missing"). 2006-11-28 15:25:00 +00:00
thepurpleblob 1060c5998e Fix for MDL-7703 - scope problem sorted by moving all functions inside the class
Also fixed a bunch of notices
2006-11-28 15:13:25 +00:00
thepurpleblob 9f5d13105d Examview 'SA' type questions now supported. Maps to Essay questions 2006-11-28 11:49:58 +00:00
thepurpleblob 777816e6c7 Fixed typo and a notice when question type is not supported. 2006-11-28 09:25:52 +00:00
mark-nielsen 0e0fd96278 Fix for MDL-7707. Also had to update index.php to show students the same score as in the gradebook. 2006-11-28 05:45:52 +00:00
mark-nielsen 5aa3fe9c10 Missing help file from MDL-7352 2006-11-28 03:54:34 +00:00
mark-nielsen 882a1343ab [Fixed] MDL-7614 2006-11-28 03:39:52 +00:00
moodler cb48f665eb Automatic installer.php lang files by installer_builder (20061128) 2006-11-28 03:17:33 +00:00
moodler 0a786db090 Better checks when loading datamodel 2006-11-28 03:02:38 +00:00
moodler e9dec637ff the version was blank on a package I tried ... this now gives it some sort of
reasonable default (scorm_12)
2006-11-28 02:50:37 +00:00
skodak 954e74f2dd Broken handling of magic quotes in admin settings and set_config in general MDL-7668; backported from HEAD 2006-11-27 08:48:52 +00:00
vyshane dc3906acce Fix for MDL-7676 2006-11-27 04:48:06 +00:00
ikawhero 4fc9ea71f9 Added missing string 2006-11-27 04:05:40 +00:00
vyshane abe58b4a43 Fix for MDL-7682 2006-11-27 03:21:26 +00:00
moodler 662231384d Automatic installer.php lang files by installer_builder (20061127) 2006-11-27 03:16:41 +00:00
skodak c76465c42b MDL-7631 Incorrect grading when Each attempt builds on the last and questions on more than one page; backported from HEAD 2006-11-26 23:02:06 +00:00
skodak e2a73d8a93 Double quotes breaking short answers in a multianswer/cloze question MDL-6676; backported from HEAD 2006-11-26 21:58:31 +00:00
skodak 7764cd6cc7 incorrect table width in Exercise MDL-7690; backported from HEAD 2006-11-26 21:38:03 +00:00
stronk7 0a870ce21a Typo causing continue button in closed quizzes to fail. MDL-7685 2006-11-25 17:12:06 +00:00
moodler 55be7faa95 Automatic installer.php lang files by installer_builder (20061125) 2006-11-25 03:21:13 +00:00
skodak 60afff1419 Fix course overview graph broken by notices MDL-7680; backported from HEAD 2006-11-24 18:32:38 +00:00
thepurpleblob 1c8d340d1b Added note that : is a control character and can be escaped. 2006-11-24 13:02:07 +00:00
thepurpleblob 31d3c58089 Colon characters in GIFT files can now be escaped.
Resolves MDL-6915
2006-11-24 12:02:08 +00:00
moodler 4a900a1e3b fix for MDL-7448, added enableForm() call to prevent chat lock up. Thanks Kok Chee Kean! 2006-11-24 04:17:15 +00:00
toyomoyo 2564d898d3 fixing a warning 2006-11-24 01:59:48 +00:00
skodak cea03e39c7 Missing s() on current value in admin_setting_configtext class MDL-7666; backported from HEAD 2006-11-23 21:01:23 +00:00
skodak e38e49335c Students cannot enrol with PayPal plugin when using PHP4 MDL-7529; backported from HEAD 2006-11-23 20:17:23 +00:00
ethem 8d137d3be6 We are expecting multiple records! 2006-11-23 16:26:07 +00:00
moodler 766b1926ed Removed two unenecessary lines from a cut-and-paste 2006-11-23 09:09:28 +00:00
vyshane 842721d87f Fixed bug in IE for resources/activities indentation. 2006-11-23 08:35:19 +00:00
moodler 247147c8dd Automatic installer.php lang files by installer_builder (20061123) 2006-11-23 03:12:06 +00:00
urs_hunkler 75108f21ad 'removed overflow:hidden because there are some display issues on some pages. min-width: 0 is enough to trigger IE7 hasLayout to avoid collapsing divs' 2006-11-22 20:37:38 +00:00
urs_hunkler 9fa06fc780 'removed overflow:hidden because there are some display issues on some pages. min-width: 0 is enough to trigger IE7 hasLayout to avoid collapsing divs' 2006-11-22 20:37:14 +00:00
vyshane ed90d891a1 Fix for MDL-7627. Credited to Andrew Walker. 2006-11-22 08:25:24 +00:00
ethem d8f6207bee MDL-7642 2006-11-22 08:18:06 +00:00
vyshane 381fd47442 Added POST connection for left and right indents. 2006-11-22 07:37:59 +00:00
vyshane f868caa529 Added indent left and indent right for resources 2006-11-22 07:35:53 +00:00
vyshane 4378a0456e Code for ajax indentation of activities and resources. 2006-11-22 07:01:16 +00:00
skodak f829d4a446 Social activities block always appears in edit mode to admin without turning editing on MDL-7639 2006-11-21 20:35:04 +00:00
urs_hunkler b49d086945 ajax move icon added 2006-11-21 13:50:45 +00:00
toyomoyo 0aa07c2fa0 adding capability checks 2006-11-21 05:31:03 +00:00
toyomoyo 4d15a1932a fix for MDL-7426, remove teacher.php link 2006-11-21 04:44:35 +00:00
vyshane c2540e76e1 Added class names in the html output for editing mode buttons. These will be used as hooks in the ajax course formats. 2006-11-21 04:22:47 +00:00
vyshane c3c4013f08 Editing mode buttons now check for class names instead of titiles when searching for the buttons to be 'ajaxified'. 2006-11-21 04:20:17 +00:00
vyshane 210deee299 Fixed button spacing. 2006-11-21 04:13:58 +00:00
toyomoyo 9c71a2396b fix for MDL-7540 wrong usage of context levels 2006-11-21 03:22:33 +00:00
moodler 6ba16921db Automatic installer.php lang files by installer_builder (20061121) 2006-11-21 03:19:26 +00:00
toyomoyo 245505f928 removing hardcoded auth method "ldap" 2006-11-21 02:08:13 +00:00
tjhunt d086c991ee Fix column names - backported from head. 2006-11-20 18:04:24 +00:00
skodak c8c625a0be bellow spelling fixed; backported from HEAD 2006-11-20 17:40:45 +00:00
skodak a71dd3f315 Advanced uploading of file interface typo MDL-7628; backported from HEAD 2006-11-20 17:36:26 +00:00
ethem a40fe0a766 Daily echeck order notification 2006-11-20 14:53:17 +00:00
skodak b2a39ba822 fixed problem with apostrophe in role names and description when creating roles during install and restore MDL-7611; backported from HEAD 2006-11-20 14:11:39 +00:00
ethem 845c5d725b Help file: Uploading Authorize.net CSV file 2006-11-20 13:47:53 +00:00
skodak ac12e36125 PARAM_PATH can be used only for relative paths, there is no parameter type for absolute paths that would be compatible with win32 - use PARAM_RAW for now, add file_exists validation later MDL-7617; backported from HEAD 2006-11-20 13:35:36 +00:00
thepurpleblob 08a7bbc9ff Various improvements to Examview input.
Fixes MDL-7087 and MDL-7349. Partial fix for MDL-7184 (Examview part)
2006-11-20 13:00:34 +00:00
ethem 52b0b2684c Reference Transaction ID refers enrol_authorize.transid, not enrol_authorize_refunds.transid 2006-11-20 11:14:08 +00:00
ethem 7c96968699 It is time to refund for echeck (business checking). 2006-11-20 09:54:44 +00:00
ethem c629a2ef7f It is time to refund for echeck (business checking). 2006-11-20 09:54:44 +00:00
vyshane d500edf243 Removed subclass activity_class. The only logic in that class was for handling of groupmode buttons. These are now handled in resource_class.prototype.init_buttons() and resource_class.prototype.toggle_groupmode().
We basially look at whether the button is present in the html output, and if it is, we add it to the ajax frontend. We do not make the distinction that activities should have the button (as opposed to resources). The advantage is that some activities might not have groupmode.

This fixes MDL-6916.
2006-11-20 09:18:33 +00:00
vyshane b666f6f3aa Passing some more language strings to ajax frontend. Part of the fix for MDL-6916. 2006-11-20 09:15:24 +00:00
ethem f66e4015b8 Business checkings can be refunded only for echeck method. Not saving nor checking. 2006-11-20 08:07:42 +00:00
vyshane a84533fee3 Fix for MDL-7620 2006-11-20 02:28:07 +00:00
tjhunt b49beecf63 Fix function arguments. 2006-11-19 21:28:11 +00:00
moodler 74b111bc7f Automatic installer.php lang files by installer_builder (20061119) 2006-11-19 03:13:23 +00:00
stronk7 a8c5a14b7c Prevent some false-positives detecting uses of old user_XXX tables.
See http://moodle.org/mod/forum/discuss.php?d=58976
2006-11-18 20:25:52 +00:00
stronk7 f9ad31d809 PHP generated code must use $result instead of $status. MDL-7533 2006-11-18 19:02:13 +00:00
stronk7 db26bf99f5 PHP generated code must use $result instead of $status. MDL-7533 2006-11-18 18:51:42 +00:00
gbateson e4857c41fb fix sort order of questions in legend, which caused mismatch between question numbers used in Detailed Statistics report and those used in the legend 2006-11-18 08:54:00 +00:00
moodler 37d9720b15 Automatic installer.php lang files by installer_builder (20061118) 2006-11-18 03:14:19 +00:00
ethem 24e6ae8cc6 MDL-7533
Use $result instead of $status
2006-11-17 17:23:00 +00:00
ethem e31d492145 Changed db column(cclastfour) as refundinfo.
Because this field will be used to refund both cc and echeck.
Business checkings can be refunded, too; so mark as 1 this field for business checkings.
That is; refundinfo: is last four digit for credit cards, business checking for echecks.
2006-11-17 15:42:25 +00:00
vyshane e5708be88c Formatting cleanups. 2006-11-17 09:07:30 +00:00
ethem c34713bfca Business checks can be refunded. Point a flag for it. The cclastfour field will be renamed to refundinfo later. 2006-11-17 06:53:36 +00:00
vyshane 364f72aa05 Fix for MDL-7574. 2006-11-17 05:51:37 +00:00
moodler 4e5d63c403 Renamed function name that conflicted with PHP function MDL-7594 2006-11-17 04:02:11 +00:00
moodler 79bad718b6 Automatic installer.php lang files by installer_builder (20061117) 2006-11-17 03:13:25 +00:00
vyshane 01ed826fff Fix for MDL-7563. Added call to removeFromGroup() from block_class.delete_button(). Thanks Andrew Walker for the patch! 2006-11-17 02:56:58 +00:00
moodler d842884534 Removed B) smiley MDL-7589 2006-11-17 02:10:46 +00:00
tjhunt b51bfdd111 Typo in function name. 2006-11-16 16:45:55 +00:00
ethem db47e0ffbb choosemethod is too long for heading, added <br /> 2006-11-16 14:16:20 +00:00
tjhunt ceab443d08 MDL-7576 - review link does not work after attempt is closed. Thanks to Chad Badiyan for the fix. 2006-11-16 12:43:00 +00:00
vyshane 5675d86412 Changed http requests to uppercase: post to POST, delete to DELETE. 2006-11-16 05:29:16 +00:00
toyomoyo ad0d007abd fixed a problem where user is not shown when the user has not visited a course page. changed get_user_roles to take in additional parameter 2006-11-16 05:16:07 +00:00
vyshane 69e5d0ef95 Fix for MDL-7293. Added new function blocks_move_block() to replace blocks_execute_repositioning_atomic(). Reverted blocks_execute_repositioning() to what it was before the changes made whenblocks_execute_repositioning_atomic() was introduced. 2006-11-16 03:23:05 +00:00
vyshane f32f831749 Fix for MDL-7224. Switched from blocks_execute_repositioning_atomic() to blocks_move_block() for moving blocks. 2006-11-16 03:11:05 +00:00
vyshane cdd0bfcc1a MDL-7293. Switching the order of the classes around 2006-11-16 02:21:01 +00:00
skodak 6153b68ff9 Response file not uploading when grading student submission when using secureforms MDL-7566 2006-11-15 20:56:23 +00:00
skodak 716f1ef9f1 Broken next button when grading assignments MDL-7569 2006-11-15 19:38:07 +00:00
tjhunt 101fb762f1 MDL-7428 - Quiz regrade removes student answers from essay questions that have been graded. Merged from MOODLE_16_STABLE. 2006-11-15 17:32:54 +00:00
tjhunt 368cc39e7e MDL-7567 Numerical questions occasionally mix up the order of their answers. Merged from MOODLE_16_STABLE. 2006-11-15 16:56:02 +00:00
tjhunt 806b78fd12 MDL-7309 Add error checking to the Quiz DB upgrade script. This should prevent the mysterious failures that some people are seeing when upgrading quizzes from 1.5.x to 1.6.x. Merged from MOODLE_16_STABLE. 2006-11-15 12:58:00 +00:00
vyshane 6c619b41c8 Doh.. Should be a string 2006-11-15 08:33:24 +00:00
vyshane f02f53f09b Fix for MDL-7192. Added camino check. 2006-11-15 08:10:14 +00:00
vyshane c4acc71042 Added Camino check in check_browser_version() 2006-11-15 08:06:20 +00:00
toyomoyo a5fe571a1c adding missing fields 2006-11-15 06:27:53 +00:00
toyomoyo 9fa998f63b replacing deprecated functions 2006-11-15 06:22:28 +00:00
toyomoyo 4b6776536a fix for MDL-6928, correcting auth_iscreator check 2006-11-15 03:36:07 +00:00
vyshane b7a99c865f Fix for MDL-7293 2006-11-15 03:34:09 +00:00
vyshane 059c9be198 Fix for MDL-7293. We do not block_add() blocks that are pinned - for the ajax course formats. 2006-11-15 03:29:59 +00:00
moodler f132783767 Automatic installer.php lang files by installer_builder (20061115) 2006-11-15 03:17:44 +00:00
vyshane 26ee0fa9cd Small css selector change to accomdate fix for blocks move handle (should not be shown for pinned blocks in ajax course format). Thanks to Andrew Walker for suggested fix. 2006-11-15 02:41:17 +00:00
vyshane d3c653c13f Fix for move handle. The move handle should not be added for pinned blocks. See MDL-7293. Suggested fix by Andew Walker. 2006-11-15 02:39:46 +00:00
skodak 1f6823d18f MDL-7536 add proper slashing to data from paypal callback; backported from HEAD 2006-11-14 21:24:14 +00:00
moodler 4d833069bd Initial commit of gu_utf8 installer file 2006-11-14 19:57:27 +00:00
moodler 03b17f7a0d file installer.php was added on branch MOODLE_17_STABLE on 2006-11-14 19:57:26 +0000 2006-11-14 19:52:55 +00:00
stronk7 5b549b306d while working, it's better to compare with original data (un-slashed) 2006-11-14 16:27:20 +00:00
tjhunt 6c9ac19b6f MDL-7531 Fix SQL that does not work in Oracle. Thanks to Mark Hetherington for the fix. 2006-11-14 15:40:29 +00:00
vyshane 83523cccd6 MDL-7284 2006-11-14 05:33:37 +00:00
vyshane 4846e7e856 Fixed javascript error that occurs during the appending of block buttons. Some code formatting cleanups as well. 2006-11-14 05:03:14 +00:00
vyshane ad9c1a9966 Fix for MDL-7440. Suggested by Andrew Walker. 2006-11-14 03:05:38 +00:00
vyshane 67c80485b9 Fix for MDL-6969. Patch by Andrew Walker. 2006-11-14 02:04:26 +00:00
stronk7 b764301306 Set Assoc mode always after DB connection. Discovered by MDL-7443. 2006-11-13 22:58:59 +00:00
stronk7 993c547bd6 Fetchmode needs to be explicity set to ASSOC. Plus 1 missing library
added. MDL-7443
2006-11-13 22:44:54 +00:00
skodak 558bfc50fe MDL-7389 paypal plugin reports error when student correctly enrolled 2006-11-13 22:25:14 +00:00
exe-cutor dc13c4f8a3 User capabilities are now properly loaded. 2006-11-13 11:52:18 +00:00
ethem d485515725 Align right upload csv button. 2006-11-13 08:39:58 +00:00
ethem f8a7befdd5 New feature: Show my payments only for users who has_capability('enrol/authorize:managepayments') 2006-11-13 07:55:31 +00:00
ethem ad5cbccfd3 New feature: Show my payments only for users who has_capability('enrol/authorize:managepayments') 2006-11-13 07:43:49 +00:00
vyshane f07794ae81 Added error message string 2006-11-13 07:35:49 +00:00
vyshane 9930ae9e6b $SITE is not needed 2006-11-13 07:34:18 +00:00
vyshane 6bcb0ad140 Fix for MDL-7461. Related to MDL-7383. We still show the add discussion button to guests, but only if we are not in the site news. 2006-11-13 07:28:34 +00:00
ikawhero 78066f113a Replacing with working image 2006-11-13 06:29:29 +00:00
vyshane e2e91ea8ce Fixes for MDL-7461. Removed checks for legacy guest capability as well (redundant). 2006-11-13 06:02:49 +00:00
toyomoyo 3b0b90d5c1 fix for MDL-7441 wrong size for roles icon 2006-11-13 05:42:43 +00:00
vyshane ad890b4490 Fix for MDL-7383. Edit and Delete links aren't shown when printing posts if the user should not be able to do these (checks were already done in post.php as well). 2006-11-13 03:14:58 +00:00
stronk7 ea369699c4 This change wan't backported from HEAD and was causing unicode test
to fail always, showing some incorrect info to users. MDL-7475
2006-11-12 19:33:14 +00:00
ethem 87db2759da Merge fix 2006-11-12 13:23:34 +00:00
ethem 6bd4ab8c5e Get course before require_login(); Merged from 16stable. 2006-11-12 13:21:11 +00:00
moodler c887b2c522 Prevent admins from unassigning themselves MDL-7462 2006-11-12 06:10:47 +00:00
moodler 02f54468a8 Automatic installer.php lang files by installer_builder (20061112) 2006-11-12 03:12:32 +00:00
moodler d9316decdd Automatic installer.php lang files by installer_builder (20061111) 2006-11-11 03:17:37 +00:00
urs_hunkler 39cc4b9f1a 'added 11x11 size for roles icon in sideblock commands bar' 2006-11-10 12:33:15 +00:00
urs_hunkler 9cd9700ad6 changed icons 2006-11-10 12:31:29 +00:00
moodler 6c9ceb3c2e Automatic installer.php lang files by installer_builder (20061110) 2006-11-10 09:49:15 +00:00
urs_hunkler d52eafd9ae roles icon added 2006-11-10 09:01:03 +00:00
toyomoyo 14f409f698 fields should be backed up regardless of whether userdata is selected 2006-11-10 04:17:02 +00:00
toyomoyo 762b68827e fields should be restored regardless of user data is selected or not 2006-11-10 04:10:11 +00:00
moodler c4257b0ff9 Automatic installer.php lang files by installer_builder (20061110) 2006-11-10 03:18:38 +00:00
skodak 76e4168089 code improvement in count_courses_notin_metacourse() MDL-7424 - thanks Eloy! backported from HEAD 2006-11-09 23:36:07 +00:00
skodak a58e869ce2 Child courses import list empty MDL-7424; added new count_courses_notin_metacourse() function, the old one was kept for BC; backported from HEAD 2006-11-09 21:14:20 +00:00
moodler 8798f3049f FIxed problem where capability forum:nothrottling was not fully renamed and
was thus left useless.   MDL-7414
2006-11-09 09:26:32 +00:00
toyomoyo 0d163e9ece category page cleaning, MDL-7409 2006-11-09 06:21:06 +00:00
moodler cb7e142c73 Bumping post 1.7 2006-11-08 16:46:44 +00:00
moodler 17e05203ff Patch from Stefano Bagnatica, MDL-7121 (missing header) 2006-11-08 15:29:21 +00:00
moodler 92ac252418 Fix for missing "reply" links for guests doh! MDL-7393 2006-11-08 09:42:41 +00:00
toyomoyo c9dc31afe8 fix upgrading from 1.6 not redirecting problem 2006-11-08 06:23:06 +00:00
toyomoyo 493dd6c934 fix for MDL-6788, reformating blog edit page 2006-11-08 05:14:13 +00:00
toyomoyo a2adf92023 fixing wrong default gradebook role when upgrading from < 1.7 2006-11-08 02:41:58 +00:00
koenr 005072a3ef MDL-7379 typo 2006-11-08 00:03:43 +00:00
watcanz 8bed6c33cd Updated for 1.6/1.7 2006-11-07 13:49:18 +00:00
mudrd8mz 0ac7fcd7da Fixed bug MDL-7361 (creates $CFG->dataroot/lang if it does not exist). 2006-11-07 12:52:13 +00:00
moodler 8aec60b652 Fix for emoticon icon size MDL-7375 2006-11-07 12:49:07 +00:00
moodler d4f4fa2abe Better check for mssql, to cope with ODBTP (thanks, Eloy!) 2006-11-07 12:38:55 +00:00
moodler 7620c403ec Tweaked some strings for Unicode upgrade info 2006-11-07 09:29:06 +00:00
moodler df1a564fa6 Bumped to 1.7 2006-11-07 09:10:54 +00:00
skodak e20fd196ce new unicode environment check for 1.8 and 1.7 MDL-6332 2006-11-07 09:03:37 +00:00
toyomoyo fd10b9422d fixing MDL-6855 4b) changing not null to true for defaultrole 2006-11-07 08:58:53 +00:00
moodler 80f7504f86 New tags 2006-11-07 07:16:50 +00:00
toyomoyo a203cb09be fixing wrong comment 2006-11-07 03:12:33 +00:00
moodler 131015e234 Automatic installer.php lang files by installer_builder (20061107) 2006-11-07 03:12:00 +00:00
moodler 8494b4356c Temporary fix to hide simpletest when unsupported databases are active MDL-7337 2006-11-07 02:52:38 +00:00
mjollnir_ 3b1bd3405b fixed the journal upgrade. renaming a null column to not null is unhappy 2006-11-07 00:09:18 +00:00
skodak d4e2861046 prevent duplicate content in search engines MDL-7299 2006-11-06 21:48:04 +00:00
koenr 008809ad21 MDL-7328 - miner fix on quotes 2006-11-06 21:27:19 +00:00
skodak 89a750dbeb better param handling SC#331 2006-11-06 20:33:54 +00:00
moodler c0db85f0b2 Fix for googlebot detection ($USER was never empty) 2006-11-06 17:53:50 +00:00
stronk7 ef02670d09 Simple bump 2006-11-06 17:43:28 +00:00
stronk7 7764e1afe0 And, finally, IE is able to display IMS packages properly! B-)
One of the worst to solve bugs in my life! MDL-6417
2006-11-06 17:20:11 +00:00
moodler 2c36ba5bb8 Fixed up the URL after posting (too many #hash) 2006-11-06 16:28:20 +00:00
moodler 1f046e1625 Added upgrade_language_pack() for upgrade in non-english MDL-7351 2006-11-06 12:46:17 +00:00
toyomoyo 31a8a7e4e1 taking out warning 2006-11-06 08:26:56 +00:00
toyomoyo 120f722403 fixing capability of block contexts 2006-11-06 06:15:11 +00:00
toyomoyo 2854559b92 taking out extra isteahcer() 2006-11-06 02:32:35 +00:00
skodak 696d638772 MDL-7176 fixed comment 2006-11-05 18:27:03 +00:00
moodler 2e0b0c94f8 Dan's fix from MDL-7263 2006-11-05 12:39:39 +00:00
moodler d6070215b8 Checked in Dan's fix for MDL-7266 ... missing string 2006-11-05 12:25:32 +00:00
stronk7 7ca5f47dcb modify_database() will show the deprecated debugging after 2006101007
(Moodle 1.7 release version) MDL-5919
2006-11-05 09:44:05 +00:00
moodler 008c431636 DOn't show reply links to logged-in users if they can't reply 2006-11-05 09:34:09 +00:00
moodler 17e44aad44 Fix loginas at site level 2006-11-05 06:43:34 +00:00
moodler cad170cba8 Automatic installer.php lang files by installer_builder (20061105) 2006-11-05 03:16:55 +00:00
stronk7 b215544c31 Now GD is checked before displaying course overview graphs. MDL-7204 2006-11-04 23:28:51 +00:00
wildgirl 5d10e3f43d MDL-6474 fix 2006-11-04 22:21:00 +00:00
wildgirl 354cd59314 file langswitchstorage.html was added on branch MOODLE_17_STABLE on 2006-11-04 22:21:00 +0000 2006-11-04 21:56:42 +00:00
stronk7 1ede3a6712 Now all the get_records() functions support only one field
to be specified in the SELECT clause. Not needed anymore to
write double "SELECT id, id..." queries. Results returned
follow exactly the same structure than normal recordsets
(first field = key) MDL-5877
2006-11-04 16:59:52 +00:00
stronk7 8558e34ed5 Deprecating modify_database(). It shows debugging info
if release > 2006101004 (Beta2 +01) MDL-5919
2006-11-04 16:21:30 +00:00
moodler 614b05ec8b Bump release name to Beta 2 2006-11-03 16:32:45 +00:00
sam_marshall ed2bc33154 MDL-7344 Change 'import child course' timeout to 180 seconds per course because role creation takes a while for thousands of users. 2006-11-03 14:37:41 +00:00
ethem 1ab501974f Show site name at top when selecting courses. 2006-11-03 12:39:48 +00:00
ethem 87753e76d1 Get payment managers at COURSE level. 2006-11-03 12:04:57 +00:00
ethem 0b06840128 get_teacher() to get_users_by_capability(). Merged with HEAD. 2006-11-03 11:28:26 +00:00
toyomoyo 9abc42b262 fix for MDL-7300, mssql not null problem 2006-11-03 08:45:44 +00:00
moodler 90080d990a FIxed some problems with blog entries when not logged in (eg rss) 2006-11-03 08:37:46 +00:00
toyomoyo e7fcbec49e fix for MDL-7300, mssql query error on group creation 2006-11-03 08:17:33 +00:00
urs_hunkler 1576c4d233 'CSS update, mainly for MDL-7330' 2006-11-03 07:44:44 +00:00
urs_hunkler 6ac068ae5c 'CSS update, mainly for MDL-7330' 2006-11-03 07:44:17 +00:00
toyomoyo 7074cb559f fix for MDL-7031, removing control tags from add template 2006-11-03 03:26:33 +00:00
moodler 9138c1f9a8 Automatic installer.php lang files by installer_builder (20061103) 2006-11-03 03:06:18 +00:00
stronk7 98ed0ea1af Ending fied/key/index PHP generators. 2006-11-02 23:07:44 +00:00
stronk7 6abfa47012 Enablig rename_table() PHP generator 2006-11-02 22:43:16 +00:00
bobopinna 59b08215b2 removed white spaces 2006-11-02 15:55:56 +00:00
bobopinna c7c1adeb8d Fixed a small problem with whatgrade field 2006-11-02 15:19:40 +00:00
bobopinna 9230c9417b Added a missing variable definition 2006-11-02 15:17:48 +00:00
bobopinna 23f0f6f72d Fixed a storic problem with & in prerequisites definition
Now finally Moodle has a complete aicc_script conformity with SCORM 1.2
2006-11-02 15:15:06 +00:00
bobopinna 7eb1d32847 Fixed several RegExp to fit ADL Test Suite 2006-11-02 15:12:49 +00:00
bobopinna fadb4b239b Removed isadmin() calls 2006-11-02 15:10:20 +00:00
ethem f319b5bf61 Fix for enrolurl(admin/users.php). 2006-11-02 13:22:49 +00:00
toyomoyo 4a373dbaf9 fix for MDL-6721, wiki broken for SPG 2006-11-02 08:49:55 +00:00
moodler c612f884dc Petr's patch for MDL-7327 to modify require_capability login a bit 2006-11-02 08:11:39 +00:00
toyomoyo b543159952 fixing paging bar problem 2006-11-02 05:53:28 +00:00
toyomoyo 667fdd514e fix for MDL-7140, duplicate course name in header 2006-11-02 03:16:50 +00:00
moodler 951f480ab9 Automatic installer.php lang files by installer_builder (20061102) 2006-11-02 03:07:13 +00:00
toyomoyo bcbb41a0fa fix for MDL-7112 select distinct on text fields 2006-11-02 02:16:52 +00:00
toyomoyo ba39176b59 fix for MDL-7112 select distinct on text fields 2006-11-02 02:09:42 +00:00
toyomoyo 4305306220 fix for MDL 7112 select distinct on text field 2006-11-02 02:01:58 +00:00
skodak 8864d0f442 hack for problems with concurrent use of $nomoodlecookie and capabilities in RSS feeds, see MDL-7243 - it should be replaced once we get to codes in urls 2006-11-01 21:02:11 +00:00
ethem 741162fbbe Make authorize.net config page secure.
See: http://moodle.org/mod/forum/discuss.php?d=56728
Merged with HEAD.
2006-11-01 13:02:00 +00:00
ethem f1e4622ccb Make authorize.net config page secure.
See: http://moodle.org/mod/forum/discuss.php?d=56728
Merged with HEAD.
2006-11-01 12:46:19 +00:00
stronk7 4241549aed in/on/at too many ways to say "en" in Spanish. :-P 2006-11-01 11:51:13 +00:00
moodler 9e0d96f36b Tidied up string files 2006-11-01 09:37:06 +00:00
moodler 7e5b0b4e9c Clean up strings 2006-11-01 09:26:54 +00:00
moodler 9be2fc8f19 Cleaned up data.php 2006-11-01 09:24:15 +00:00
moodler f8cbf4713a Cleaned up language file 2006-11-01 09:19:21 +00:00
moodler 1a7d693572 Sorted and cleaned up this file 2006-11-01 09:18:04 +00:00
moodler 31922db550 Sorted and cleaned up language files 2006-11-01 09:15:50 +00:00
moodler 3cf94d16ed Added some strings that had been deleted MDL-6645 2006-11-01 09:14:24 +00:00
moodler ae471b7ab6 An untested patch for MDL-7211 to fix firstclass hole 2006-11-01 06:54:07 +00:00
moodler f00c241f7d Fixed SQL for Oracle (forum searching) MDL-7317 2006-11-01 06:29:08 +00:00
toyomoyo cbd20ae8ba fix for MDL-6928 LDAP course creation capability error 2006-11-01 03:50:21 +00:00
toyomoyo 7bbe252c59 restore fix for supporting pre granular version of moodle backups 2006-11-01 03:31:02 +00:00
skodak a7d6e5b0f7 fixed notice during restore 2006-10-31 22:45:28 +00:00
skodak e4edbb9e0b Fix errors in quiz overview download MDL-7316 2006-10-31 22:17:50 +00:00
skodak 80895066a2 fixed incorrect use of require_capability() in lesson mod MDL-7314 2006-10-31 22:01:24 +00:00
skodak 40385816cd fixed gradebookroles cfg default value MDL-7253 2006-10-31 21:51:20 +00:00
skodak 1be6adbd3e fixed capabilities in chat recent activity, removed broken optimization from message insert, fixed closing of box MDL-7313 2006-10-31 21:05:05 +00:00
stronk7 d416d809a1 Prevent +/- operators (REGEXP) on glossary searches for MSSQL and Oracle. MDL-7312 2006-10-31 20:33:25 +00:00
skodak bf3c381651 fixed group related typo in has_capability() 2006-10-31 20:22:52 +00:00
stronk7 9338d432f9 Prevent +/- operators (REGEXP) on messages search. MDL-7312 2006-10-31 20:21:13 +00:00
stronk7 b2ef8fc07e transform TOKEN searches into STRING searches and trim +- chars. MDL-7312 2006-10-31 20:15:23 +00:00
stronk7 53ff8d79ee Prevent +/- operators (REGEXP) on course searches for MSSQL and Oracle. MDL-7312 2006-10-31 19:53:25 +00:00
skodak ed55a25fd5 Commented out session dump in user profile when in debug mode MDL-7311 2006-10-31 19:31:26 +00:00
ethem c92727ae6b Show notice at bottom. Merged with HEAD. 2006-10-31 19:28:18 +00:00
stronk7 5cc8148eb8 Fixed searches, list of results and simplified SQL logic. All
those while trying to fix one LCASE() use. MDL-7310
2006-10-31 19:15:30 +00:00
danmarsden 92b2d0f2dd MDL-7171 Location of guest form should be above results - where the form for submitting results would appear. 2006-10-31 18:59:38 +00:00
stronk7 ec27637e08 Now wiki supports Unicode searches 2006-10-31 17:47:52 +00:00
tjhunt 319047dfb1 Improved help file as per Ralf Hilgenstock's suggestion: http://moodle.org/mod/forum/discuss.php?d=57400 2006-10-31 15:12:56 +00:00
moodler 67145bac78 Improved display of grades when grades should not be shown MDL-7150 2006-10-31 15:06:02 +00:00
moodler 7675f212ee Fix for MDL-7238 to hide authorize interface when necessary 2006-10-31 14:04:57 +00:00
tjhunt 25e0480339 MDL-5811 - Quiz editing outputs nasty junk before print_header sometimes. Second attempt at fixing. I forgot to mention the bug number in the previous commit to mod/quiz/edit.php. 2006-10-31 12:03:43 +00:00
tjhunt 8a286fda3e Make the close_window function better. 2006-10-31 11:54:14 +00:00
bobopinna 5e73ea768b Fixed a typo 2006-10-31 11:37:40 +00:00
tjhunt fdecc5c6da Fix junk being output before print_header, which happened sometimes. 2006-10-31 10:40:07 +00:00
tjhunt f3e4a7a514 Add return option to notify() 2006-10-31 10:37:38 +00:00
skodak f966e024ef Change name when file name contains more of a point MDL-6897 - patch submitted by Toni Mas 2006-10-31 10:15:23 +00:00
moodler f3410ae74b Fix for MDL-6975 2006-10-31 09:14:43 +00:00
skodak 7e70535f09 adding of user events into calendar and posting of blogs is now enabled by default - MDL-7297 and MDL-7245 2006-10-31 09:08:27 +00:00
moodler 8def180d7a Added information about guest exception 2006-10-31 08:59:41 +00:00
toyomoyo e123a4e191 fix for MDL-7302, tagid lost when turning on/off editting 2006-10-31 08:49:46 +00:00
moodler df5ee47979 Added some styles to make role descriptions a bit smaller MDL-6923 2006-10-31 08:10:29 +00:00
moodler b18207cd3a Added help links to Roles pages MDL-6923 2006-10-31 08:09:29 +00:00
moodler f750f104ca New help files for Roles MDL-6923 2006-10-31 08:04:14 +00:00
toyomoyo cc1b52fddf removing evil semicolon 2006-10-31 07:32:21 +00:00
urs_hunkler e6f1411d72 'changed header.html to the accessibility version as standardwhite' 2006-10-31 07:31:23 +00:00
martinlanghoff 90f08155c5 lib/textlib.class: Cache dir is now created correctly, allowing speed increase (SR# 595)
Previous logic had dir created only when mbstring wasn't used, but the
typo3 lib needs to cache some data regardless, for the specCharsToASCII
function, which uses internal translation tables.


Author: Luke Hudson <luke@catalyst.net.nz>
2006-10-31 05:00:32 +00:00
moodler 24f49eaa7e Killed infinite loop when upgrading teachers! 2006-10-31 04:37:55 +00:00
moodler 086617bac8 DIsplay count for all participants 2006-10-31 01:20:00 +00:00
stronk7 088f9942ef Oracle optimization. Texts under 4000cc can be handled directly as varchar2,
so they don't need the 2-phase (insert/update) handling of LOBs
2006-10-30 23:12:41 +00:00
stronk7 6befbe8050 Fixed one bug on Oracle produced when we were inserting
records with returnid disabled and containing LOBs
2006-10-30 22:58:04 +00:00
skodak 62385afcd3 Adding of calendar events broken MDL-7297 2006-10-30 22:32:27 +00:00
skodak b9f7637ea8 fixed double enableajax in previous commit MDL-7296 2006-10-30 21:03:08 +00:00
skodak 5e435e4635 Disabled global search by default and marked as experimental MDL-7296 and AJAX moved to experimental too 2006-10-30 20:57:08 +00:00
urs_hunkler 362af1586a 'changed header.html to the accessibility version as standardwhite' 2006-10-30 20:02:26 +00:00
urs_hunkler c8305b464f 'added table.navbar {width:100%;} again for themes still using tables in the header.' 2006-10-30 19:56:50 +00:00
stronk7 f5303bd518 Prevent Oracle to fail when inserting records with log->info empty
(will be solved once we got all those NOT NULL fields fixed)
2006-10-30 19:51:44 +00:00
stronk7 d040f940a2 Fixing display of pivots when they are author names 2006-10-30 19:31:33 +00:00
stronk7 c97ab4b00a Fixing some queries with duplicate column names. MDL-7294 2006-10-30 19:01:02 +00:00
stronk7 5e8720e3a3 Now glossary is using the proper sql_substr() function 2006-10-30 18:33:04 +00:00
stronk7 3cef39f10a New function sql_substr() returns the proper substr() function for each DB 2006-10-30 18:28:47 +00:00
stronk7 0e938d8e6c Now lcase() and ucase() are out from glossary 2006-10-30 17:58:56 +00:00
stronk7 6a9781ab1f sql_as() is deprecated. Column aliases ALWAYS must use the AS keyword. 2006-10-30 17:43:40 +00:00
stronk7 18ecdd56aa Deprecating sql_as (now the AS keyword os required in COLUMN aliases) 2006-10-30 17:39:55 +00:00
stronk7 f9452850dd Updating wood to show the nav-bar properly. 2006-10-30 16:51:34 +00:00
tjhunt d2925a9397 Make General feedback more tolerant of whitespace. 2006-10-30 16:35:21 +00:00
thepurpleblob 537cef4fdd Fixed notice 2006-10-30 16:21:16 +00:00
stronk7 8319d93b45 Added enablerecordcache setting to control the get_record() cache.
Note that some parts of Moodle can enable/disable it selectively.
2006-10-30 15:55:48 +00:00
stronk7 41a96d7c4d Added some strings for the enablerecordcache setting. 2006-10-30 15:52:04 +00:00
skodak 1b88c2ef22 Wrong "settings" link in course Administration block on module pages MDL-7286 2006-10-30 14:56:11 +00:00
ethem 0d4057f406 New string: All Pending Orders 2006-10-30 11:22:57 +00:00
ethem 07182b5324 New string: All Pending Orders 2006-10-30 11:12:32 +00:00
skodak 0070770144 Journal Module fixes fro 1.7 MDL-7159 2006-10-30 11:11:34 +00:00
sam_marshall 03240ae37b [MDL-7287] Lesson - tweaked continue.php to include a file via filesystem not HTTP because I couldn't see any reason to do it the latter way and it breaks under our loadbalancing system 2006-10-30 11:00:39 +00:00
ethem 0ee01f0cda Show a link for echeck payments if an user has_capability('enrol/authorize:uploadcsv'). 2006-10-30 10:14:57 +00:00
urs_hunkler 23febf1491 'changed the property to activate the move curser to the new body class drag: body#course-view.drag' 2006-10-30 09:54:25 +00:00
moodler cf299069d4 Added "drag" hook at the page level when dragging is enabled to make sure
the blocks have the right cursor styles.
2006-10-30 09:39:58 +00:00
gbateson b3abd77235 corrected the setting of fixed flag in JMatch quizzes 2006-10-30 08:54:22 +00:00
toyomoyo 45c65f2b7e fixing new gradebookroles settings 2006-10-30 08:43:41 +00:00
ethem 6ef50f6983 Get only courses made transactions. This lessens the course list; Merged from 16stable. 2006-10-30 08:25:41 +00:00
moodler 378d834f44 Made the AJAX setting look a little better when AJAX is off 2006-10-30 08:19:30 +00:00
moodler 9a1e5c1750 FIxed a typo 2006-10-30 07:56:07 +00:00
moodler 6a691a2dba Ooops. how did this get left in? MDL-7281 2006-10-30 07:47:05 +00:00
toyomoyo a44d38fc25 do not delete context information when removing the site course 2006-10-30 06:33:25 +00:00
toyomoyo 826153a73d fixing progress count 2006-10-30 05:39:52 +00:00
toyomoyo 1e76d6529c ignore site level course teacher assignments during upgrade from 1.6 or below 2006-10-30 05:25:53 +00:00
moodler 6dce2448c4 Better default for gradebookroles 2006-10-30 03:56:25 +00:00
toyomoyo 828a4b2350 fix for MDL-6895, adding optional_param, thanks for the patch 2006-10-30 03:45:19 +00:00
toyomoyo 8300665144 fixing keyword pivot by changing into glossarypivot, MDL-7267 2006-10-30 03:36:46 +00:00
moodler 4ccdd406cb Automatic installer.php lang files by installer_builder (20061030) 2006-10-30 03:08:23 +00:00
moodler fc5711d43c Tidied up Metal theme 2006-10-30 02:58:56 +00:00
koenr 1e35150951 MDL-6864 The links 'Language editing' could be more descriptive for 1.7 stable 2006-10-29 22:35:03 +00:00
koenr af6ca730d4 MDL-7042 Missing string on admin/roles/manage.php adding to 1.7 stable 2006-10-29 22:07:54 +00:00
moodler e60154c553 Users not logged in may have capabilities but no id 2006-10-29 15:56:36 +00:00
moodler b2a2b9af0c Slight bump for gradebookroles 2006-10-29 15:06:03 +00:00
moodler a3fcc4d416 Changed gradebook_roles to gradebookroles and fixed storage/defaults for
this setting.   And also better docs.  MDL-7253
2006-10-29 14:59:43 +00:00
moodler 1809c83ef3 Added a string that had been removed - MDL-7258 2006-10-29 13:55:21 +00:00
andreabix 88b5a2a15c Fix bug MDL-7248 2006-10-29 10:07:33 +00:00
moodler ee9534257d Added some help links 2006-10-29 08:13:38 +00:00
moodler 4b612862c7 Merged to stable 2006-10-29 08:09:59 +00:00
moodler 75bf99a13c file permissions.html was added on branch MOODLE_17_STABLE on 2006-10-29 08:09:59 +0000 2006-10-29 08:07:16 +00:00
moodler fd10cafb1a Enable record caching for workshop cron (which is sloow) 2006-10-29 07:22:38 +00:00
moodler 831a8bae99 Extra caching and efficiency in forum_cron 2006-10-29 05:39:26 +00:00
moodler 36b84580e0 Fixed up the appearance of user profiles when access is not allowed 2006-10-29 04:13:32 +00:00
moodler 4bb8788c44 Make regiatration code a bit more unique 2006-10-29 02:32:34 +00:00
stronk7 e8e5f86657 Adding PIVOT as MSSQL reserved word 2006-10-28 23:11:57 +00:00
stronk7 be310ffda8 Now record_cache is controlled by $CFG->enablerecordcache 2006-10-28 19:51:57 +00:00
stronk7 cacc23f041 Moved cache cleaning code near the begin of functions. Sometimes
it wasnt' executed due to function ending. MDL-7196
2006-10-28 17:51:43 +00:00
stronk7 72a4c9a290 Updating backup release to 1.7 final (to avoid forgetting it) 2006-10-28 11:02:09 +00:00
stronk7 5d68b50a62 Improve error output of install_from_xmldb_file(). Part of MDL-7262 2006-10-28 10:36:04 +00:00
moodler 6a1055bf37 Automatic installer.php lang files by installer_builder (20061028) 2006-10-28 03:13:13 +00:00
skodak 67e43279bb fix loginsteps string in moodle.php MDL-7249 2006-10-27 21:47:58 +00:00
skodak 3f4bcbd03a Blog RSS is not being generated MDL-7256 2006-10-27 21:41:36 +00:00
skodak 74acff4411 Finish strings for graderoles MDL-7253 2006-10-27 21:04:44 +00:00
skodak d6a54ada6e Turn AJAX off for now at site level MDL-7254 2006-10-27 20:32:01 +00:00
urs_hunkler d556c2aeaa 'changed top margin for h2 in sideblock content from 0 to 1.5 em' 2006-10-27 17:49:13 +00:00
stronk7 df313f0e94 Counting extra updates performed by Oracle & MSSQL in PERF 2006-10-27 17:48:41 +00:00
urs_hunkler 4d4ef0e0b8 1.7 updates 2006-10-27 17:24:28 +00:00
stronk7 9717970b60 I forgot to globalize $record_cache in delete_record_XXX() functions. 2006-10-27 17:13:36 +00:00
stronk7 4f2ae57c31 Minor improvements to the get_record() cache. Part of MDL-7196
1) Check the cache issset() before unset() it.
2) In the set_field() function, if fieldX = 'id',
   just delete such element from the cache,
   else the whole table
3) Add some more unset() operations against the cache in
   the delete_xxxx() dmllib functions.
2006-10-27 16:51:35 +00:00
sam_marshall 6266a81cf7 MDL-7250 typo ARGH sorry. 2006-10-27 16:26:02 +00:00
sam_marshall d0f6aa914a MDL-7250 update to previous change to do in SQL as suggested 2006-10-27 16:24:26 +00:00
moodler 4c7701a6d9 Made RSS feeds work again for blogs MDL-7251 2006-10-27 16:21:39 +00:00
sam_marshall b1d476b800 MDL-7250 Slight change to load_defaultuser_role so that it doesn't load 0s into $USER->capabilities. 2006-10-27 16:16:35 +00:00
urs_hunkler eae483c5a4 'added min-width: 0; and overflow: hidden; to clearfix to make clearing work in IE7 - better way than previous one.' 2006-10-27 13:30:54 +00:00
skodak 22da58c579 Comments in data print the "by" and then the date but no username MDL-7235 2006-10-27 07:49:25 +00:00
urs_hunkler 9b657e0dec 'corrected the collapsing navbar for IE7. I thought I had corrected that some time ago??? Set the navbar width to 98% and removed those different width settings.' 2006-10-27 07:33:15 +00:00
toyomoyo 8e6f38a406 taking care of a warning 2006-10-27 02:14:20 +00:00
gbateson 537515d8e8 fixed detection and display of fixed JMatch items (in jmt files) 2006-10-27 01:34:08 +00:00
stronk7 3c5f492e9d Deprecating old "upgrade" files. MDL-7214 2006-10-26 22:25:21 +00:00
stronk7 1301de5879 New upgrade.php file added for this module. MDL-7214
Merged from HEAD
2006-10-26 18:18:35 +00:00
stronk7 87698fefb6 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 18:18:36 +0000 2006-10-26 18:12:43 +00:00
stronk7 7fd096aa14 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 18:18:35 +0000 2006-10-26 18:12:42 +00:00
stronk7 78dea37dbc New upgrade.php file added for this module. MDL-7214
Merged from HEAD
2006-10-26 17:43:05 +00:00
stronk7 8117a6dc8a file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:11 +0000 2006-10-26 17:33:45 +00:00
stronk7 866002a1ef file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:09 +0000 2006-10-26 17:33:44 +00:00
stronk7 c4a0e8dab6 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:08 +0000 2006-10-26 17:33:43 +00:00
stronk7 b3f66a5f13 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:07 +0000 2006-10-26 17:33:42 +00:00
stronk7 78fb084d02 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:06 +0000 2006-10-26 17:33:41 +00:00
stronk7 08f1de55d0 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:43:05 +0000 2006-10-26 17:33:40 +00:00
stronk7 29949f0031 New upgrade.php file added for this module. MDL-7214
Merged from HEAD
2006-10-26 17:04:36 +00:00
stronk7 24dea5f76b file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 17:04:36 +0000 2006-10-26 17:02:31 +00:00
stronk7 f5f53ceb7a New upgrade.php file added for this module. MDL-7214
Merged from HEAD
2006-10-26 16:53:08 +00:00
stronk7 3638683cdd file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 16:53:11 +0000 2006-10-26 16:33:59 +00:00
stronk7 ed1061fd15 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 16:53:10 +0000 2006-10-26 16:33:51 +00:00
stronk7 fab77ea872 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 16:53:09 +0000 2006-10-26 16:33:50 +00:00
stronk7 ebb351fa65 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 16:53:08 +0000 2006-10-26 16:33:49 +00:00
stronk7 c8bf751abf New upgrade.php file added for this module. MDL-7214
Merged from MOODLE_17_STABLE
2006-10-26 15:44:50 +00:00
stronk7 fc10786ff1 file upgrade.php was added on branch MOODLE_17_STABLE on 2006-10-26 15:44:50 +0000 2006-10-26 15:38:18 +00:00
moodler 841c716376 Search engines need to have all the capabilities of a guest user MDL-7229 2006-10-26 14:52:17 +00:00
ethem ca36c9581f I found a new function: user_has_role_assignment() 2006-10-26 14:38:22 +00:00
sam_marshall c03b88f607 The 'Activity is currently hidden' check in mod/forum/post.php incorrectly used 'manageactivities' capability instead of 'viewhiddenactivities', fixing. 2006-10-26 14:12:40 +00:00
skodak abf7820411 fixed breadcrums link 2006-10-26 10:32:54 +00:00
moodler 6cdd66e3c5 Added a top-level cache to has_capability() to make it perform better
in cases where it's called a lot with repetitive values (which happens
a lot in things like forum mailouts) with only a small memory cost.
2006-10-26 09:42:58 +00:00
skodak 316e201245 Cron.php workaround for IE & RFC2616 - MDL-7221 2006-10-26 08:53:59 +00:00
ethem 54c9dab53b get_courses() is only getting visible courses. This is a problem when an user wants to view old payments. 2006-10-26 08:47:48 +00:00
moodler c60272d855 Variation of Sam Marshall's patch to cache simple get_record calls MDL-7196 2006-10-26 07:52:00 +00:00
vyshane d7895072ac Turning ajax off because of backend issues found in rest.php 2006-10-26 07:34:58 +00:00
vyshane 3a1d81851f Some refactoring. 2006-10-26 07:34:13 +00:00
martinlanghoff 3e82837cc0 lib/locallib: changed local db upgrades now xmldb friendly (like lib/db)
Author: Jonathan Harker <jonathan@catalyst.net.nz>
2006-10-26 04:12:49 +00:00
toyomoyo 6f0c99c7a8 fixing a bug where context with override and assignments are adding 2006-10-26 03:56:38 +00:00
moodler 7dbf7695da Automatic installer.php lang files by installer_builder (20061026) 2006-10-26 03:23:28 +00:00
stronk7 0c64299b01 First model of new upgrade.php scripts and comments in old ones.
Need validation before extending them everywhere across core. MDL-7214
2006-10-25 23:26:54 +00:00
skodak 70f97a5995 MDL-7190 fixed wrong closing ) in cache md5 calculation, sorry! 2006-10-25 23:16:44 +00:00
skodak a9530ec147 MDL-7137 permission UI improvements merged into role overrides; s() used instead of htmlentities() 2006-10-25 21:17:33 +00:00
skodak fe5cf88b17 editting of permissions enabled when adding new role MDL-7137 2006-10-25 19:19:20 +00:00
moodler 9f79ed8a3c More rogue AS keywords MDL-7207 2006-10-25 09:02:30 +00:00
moodler 868d207889 Removed use of table as xxx MDL-7207 2006-10-25 08:50:25 +00:00
toyomoyo c28941370e added new config variables for what roles to be displayed in gradebooks. It is accessbile from admin->appearance->gradebookroles. 2006-10-25 08:49:54 +00:00
moodler 5c0cd26dbf ALtered new SQL in load_user_capability to make it more friendly with MS SQL 2006-10-25 08:33:40 +00:00
moodler 8e9aa7d060 Just some tidy-ups, removed redundant SITEIDs etc 2006-10-25 08:31:09 +00:00
skodak 49cb76f312 fixed add new blog entry and tag edit in blog block 2006-10-25 08:16:36 +00:00
toyomoyo d91d2fa6d3 use limited fields instead of u.* 2006-10-25 07:19:30 +00:00
martinlanghoff 20dbeadfb3 auth/fc/config.html: cleanup double newlines (leftover from whitespace cleanup) 2006-10-25 06:13:51 +00:00
moodler 8ed24b7dda Fixed CAS login to use new roles ... see MDL-6931 2006-10-25 05:46:12 +00:00
toyomoyo 1ca7a8001b fix for load_user_capability() when 2 contexts in overrides are not related 2006-10-25 03:47:05 +00:00
skodak 5aab521e4d better cleaning of rss feeds SC#328 2006-10-24 22:38:53 +00:00
skodak a1332df845 Strip ##TRUSTTEXT## when not in developer debug mode MDL-7190; minor format_text speedup; changed in md5 text cache calculation 2006-10-24 22:18:19 +00:00
stronk7 eb2d09c49c DeLIMITing Moodle core. Now the new $limitfrom,
$limitnum parameters are used instead. MDL-7168
2006-10-24 21:55:54 +00:00
skodak e2c0f78d63 select_color.php popup should specify charset MDL-7193 2006-10-24 21:37:36 +00:00
skodak d7440e481e Lang file for auth specifies incorrect file path in lang/en_utf8/auth.php MDL-7205 revisited - new patch by Martin Langhoff 2006-10-24 21:28:55 +00:00
skodak 5fd7a8cc89 Lang file for auth specifies incorrect file path in lang/en_utf8/auth.php MDL-7205 - found by Inaki Arenaza 2006-10-24 20:48:32 +00:00
skodak 7429a293b7 fixed When unassigning a role, forum_role_unassign unsubscribes the user even if you have other roles there MDL-7120 2006-10-24 20:20:50 +00:00
stronk7 a31fec1556 Dropping some hardocded "mdl" prefixes. MDL-7202 2006-10-24 18:27:31 +00:00
moodler a8cecdc232 It's OK to be a guest when looking at a discussion :-) 2006-10-24 15:55:52 +00:00
moodler b0d3c33001 Guests should always see two days of recent activity 2006-10-24 14:35:22 +00:00
vyshane b3ede2a6f5 Modified course page print_header function to accept more arguments. Needed for the AJAX course formats. 2006-10-24 09:40:48 +00:00
moodler a804689232 QUick checkin of some roles GUI improvements from Petr which I hacked on 2006-10-24 09:39:36 +00:00
vyshane 62e0242116 AJAX config for course format. 2006-10-24 08:15:09 +00:00
vyshane 0321eb66d0 AJAX config for course format 2006-10-24 08:14:09 +00:00
vyshane 604c996ca6 AJAX fixes. 2006-10-24 08:07:56 +00:00
skodak ba7b72a53d fixed risks associated with capabilitites in modules MDL-7174 2006-10-24 08:04:53 +00:00
skodak 077b7e99c1 fixed risks associated with main capabilitites MDL-7174 2006-10-24 08:00:32 +00:00
moodler 7099595c4d FIxed problem which was unenrolling some assigns at the site level! MDL-7189 2006-10-24 07:06:56 +00:00
toyomoyo e723db1680 fixing capabilities 2006-10-24 04:26:06 +00:00
vyshane 19043b2c61 Changed <noscript> to <div> since document.getElementById() can't seem to be able to access the <noscript> element in safari, and possibly in IE as well. See bug MDL-7057. 2006-10-24 03:25:48 +00:00
moodler 97b0c002ec Make the glossary block deal with trust text 2006-10-24 02:35:29 +00:00
moodler 3c9367fb62 Guests can't enrol. MDL-7182 2006-10-24 02:12:26 +00:00
toyomoyo a064e86c8b blog tag clean up 2006-10-24 02:09:45 +00:00
stronk7 f0cb717a7e Moving deprecated uses of sql_paging_limit() to the new $limitfrom,
$limitnum parameters in all the get_recordXXX() functions. MDL-7167
2006-10-23 22:56:41 +00:00
skodak ed14ae8128 fixed moodle/calendar:manageentries capability in calendar 2006-10-23 22:27:17 +00:00
skodak 05888cfc84 Assignment Reports incomplete MDL-6301 2006-10-23 21:01:41 +00:00
skodak cca1df961b Excel export returns a zero bytes file when system temp not writable MDL-7176 2006-10-23 19:25:13 +00:00
skodak fb4f768789 error message when adding a link in editor MDL-7180 2006-10-23 18:30:13 +00:00
stronk7 1fda1af9d2 Now insert_record() is using $db->GenID() to retrieve
sequence numbers for Oracle. Just wondering if the same
function should be used by PostgreSQL too.
2006-10-23 17:38:47 +00:00
stronk7 6d338ba5f9 Suppress all the uses of LIMIT in the get_field_sql() calls. MDL-7173 2006-10-23 15:55:22 +00:00
moodler 63d4e986d0 This new function called load_all_capabilities() should be used whenever
you want to completely reload the capabilities for the current user.

Basically it will deal nicely with the default site-wide permissions
depending on the current user.

More background in the comments on MDL-6963
2006-10-23 15:14:23 +00:00
moodler 9595f6a388 FIxed some rogue &nbsp characters (thanks, Samuli!) MDL-7179 2006-10-23 13:41:27 +00:00
moodler c50d4d9039 Make sure that guests see the button to add a new discussion (it will
prompt them to enrol later)
2006-10-23 13:19:46 +00:00
skodak 1a5d7ed12e Checkbox value not saved when saving changes from admin search page MDL-7177 + other fixes to make it behave more like settings.php 2006-10-23 12:04:30 +00:00
skodak e18bb176e1 yet another context fix for Roles tab - I hope this one is final 2006-10-23 11:26:12 +00:00
skodak 42fd053ddc glossary tabs (when updating a glossary) is not aligned properly MDL-7172 2006-10-23 11:16:26 +00:00
moodler d873273749 Several little fixes for online users
Guest user appears in local language and no links

sql_paging_limit not used
2006-10-23 07:42:49 +00:00
stronk7 cba3313110 strip "old" harcoded "limit" clauses from the sql passed and
debug about them. MDL-7173
2006-10-23 07:09:51 +00:00
moodler 122ea396cf Tidied up Choice a bit and now you can save choices again ;-) 2006-10-23 07:00:29 +00:00
moodler 1b068b9049 FIxed guest enrolment using course key MDL-6881 2006-10-23 06:37:06 +00:00
moodler 8069349d65 Fix strange zero lines in stats ... I thought the function above was supposed
to do that?   Penny, help!    MDL-7151
2006-10-23 05:17:38 +00:00
moodler 1de8317f92 Better handling for guest in forums MDL-7125 2006-10-23 04:53:56 +00:00
moodler 0ff7b38264 FIxed a bad capability ratepost -> rate 2006-10-23 03:28:53 +00:00
toyomoyo 9fc48040ba replacing studentcanpost with proper capability 2006-10-23 03:22:23 +00:00
moodler 1752044872 Unenrol now does the right thing after you unenrol yourself 2006-10-23 03:09:11 +00:00
moodler 685ecea312 Automatic installer.php lang files by installer_builder (20061023) 2006-10-23 03:03:57 +00:00
moodler ef90bd2c06 Improvements to the logic used when displaying choices and coping with
guests and various permission combinations    MDL-7171
2006-10-23 02:58:21 +00:00
toyomoyo bcf99ba3b9 replacing studentcanpost with capability 2006-10-23 02:48:24 +00:00
toyomoyo 48e385f582 student_can_post should be done properly using capabilities 2006-10-23 02:24:28 +00:00
stronk7 f9baa9c1cc Prevent MSSQL to return from insert_record() before
trying to execute the updating of LOBs.
2006-10-23 00:00:46 +00:00
stronk7 564f9b03e6 Debugging sql_paging_limit() as deprecated and
enforcing get_field_sql() to return 1 record max
2006-10-22 23:20:14 +00:00
stronk7 a270bb477a Killing all sql_paging_limit() uses 2006-10-22 22:57:27 +00:00
stronk7 23f4b83ec6 Killing all sql_paging_limit() uses 2006-10-22 22:47:58 +00:00
stronk7 28c5a47afc Adding limitfrom and limitnum parameters to a bunch of
rarely executed functions...
2006-10-22 22:35:26 +00:00
skodak b52e9a106c fixed incorrect context in user Outline report 2006-10-22 20:02:00 +00:00
skodak 0d2fdd9cd9 fixed $usercontext creation needed for Role tab when viewing user data 2006-10-22 19:58:06 +00:00
skodak 591234f350 fixed sql error when searching only by one letter and two radio buttons selected at the same time (visible in Konqueror) fixed as part of MDL-7160 2006-10-22 19:41:07 +00:00
skodak 1b2f2b82f0 fixed moodle/site:readallmessages MDL-7160 ; commented out unfinished buggy code 2006-10-22 19:17:48 +00:00
moodler 85e21f03a1 FIxed this script to match prtin_recent_activity MDL-7134 2006-10-22 08:29:50 +00:00
moodler 864dbb4ae7 Fixed a missing </span> 2006-10-22 08:25:19 +00:00
moodler 247475fc9f Fixed some HTML errors about & 2006-10-22 08:18:46 +00:00
moodler 2fb18d1cdc FIxed some HTML warnings 2006-10-22 08:12:14 +00:00
moodler 74f65d5ef6 FIxed some HTML warnings & -> &amp; 2006-10-22 08:11:55 +00:00
moodler 3443f0a7b2 Removed a HTML warning & --> &amp; 2006-10-22 07:59:04 +00:00
moodler ab05be1a23 Recent activity now again shows all the activity since your last session in
the course.   MDL-7134
2006-10-22 07:40:51 +00:00
moodler 0aba3fd198 Automatic installer.php lang files by installer_builder (20061022) 2006-10-22 03:11:23 +00:00
skodak 2466ff5d77 Seeing ####TRUSTTEXT#### in RSS feeds MDL-7147 - fixed RSS feeds in glossary 2006-10-21 21:14:30 +00:00
skodak fc0966ba1f Seeing ####TRUSTTEXT#### in RSS feeds MDL-7147 - fixed RSS discussion feed type too 2006-10-21 21:04:29 +00:00
skodak 83e674cd7f fix has_capability() to work when $nomoodlecookie = true; MDL-7156 - needed for RSS file.php that is serving feeds 2006-10-21 20:41:41 +00:00
skodak 9468a32a8e fixed undefined modcontext in forum 2006-10-21 20:29:30 +00:00
stronk7 01cd957389 Deleting some old oci8po files from CVS. 2006-10-21 18:31:00 +00:00
stronk7 d0d30cb9a0 Prevent add_field() to work if we are adding one not null field
to one non-empty table without specifying its default value.
2006-10-21 18:18:24 +00:00
stronk7 3bbc55a650 Added two more tests:
- To check adding numerial fields not null + default = 0
- To test set_field() with TEXT data
2006-10-21 17:22:31 +00:00
stronk7 0f1d2d8c94 Minor typo fixed. 2006-10-21 17:17:44 +00:00
moodler da8b22453c Fix for the My courses list (remove things you might be able to access but
aren't really enrolled as such)
2006-10-21 16:32:10 +00:00
stronk7 d490ba1476 One typo (!==) was preventing defaults to be properly calculated for integers.
Thanks to Nigel McNie for being on that!
2006-10-21 16:31:44 +00:00
moodler 408a5a1b03 Fix for the My courses list (remove things you might be able to access but
aren't really enrolled as such)
2006-10-21 16:30:23 +00:00
moodler 0ec5eaa5ca LAMS is now disabled by default so it doesn't confuse the heck out of
everyone.
2006-10-21 16:10:07 +00:00
moodler e4173bf72a Fixed a notice (not important) 2006-10-21 15:59:23 +00:00
moodler 55a96b2f3e Please please please be defensive about values returned from the database. Always.
In this case moodle.org had some bad data that caused this code to crash.

MDLSITE-55
2006-10-21 14:51:56 +00:00
moodler 1a42831794 Strip trusttext markers from text ... MDL-7147
Petr, can you review the whole thing?
2006-10-21 14:11:33 +00:00
moodler 571acdabaa Automatic installer.php lang files by installer_builder (20061021) 2006-10-21 03:03:54 +00:00
moodler f7396c7867 WHen a guest hits reply, they now get told they have to enrol and
get sent there.   In manual enrolment they are returned to the post
(eventually all the plugins should do that).
2006-10-20 17:48:59 +00:00
moodler c1bfa6076c Enrol/unenrol buttons in courses 2006-10-20 17:47:14 +00:00
moodler f9e8f1118d Exclude admins from the participant listing (site-wide doanything people)
(related to MDL-7117)
2006-10-20 08:25:39 +00:00
toyomoyo 8d1ea9fbed fix for MDL-7119, users with no role assign capability should not see roles tab 2006-10-20 08:09:09 +00:00
moodler 9197f258b9 Added Javascript, CSS etc on edit page for database. MDL-7100 2006-10-20 07:34:14 +00:00
toyomoyo bbaae076fa fix for MDL-7106, glossary capability check 2006-10-20 07:00:49 +00:00
moodler 7ba21c9f41 CHanged default capability for database to allow guests to view by default
MDL-7118
2006-10-20 06:58:28 +00:00
moodler 8f211852b7 New automatic installer lang file added (from HEAD) 2006-10-20 06:55:03 +00:00
moodler 0a1dc0b126 file installer.php was added on branch MOODLE_17_STABLE on 2006-10-20 06:55:03 +0000 2006-10-20 06:52:11 +00:00
moodler 104b23ff7f I've fixed how the forums look when guest is logged in, so that they
see the Reply link and if they press it get asked to log in properly.
2006-10-20 06:07:33 +00:00
toyomoyo d7355da165 fix for MDL-7115, teacher page replaced by generic role assign page 2006-10-20 05:47:49 +00:00
moodler 64a985181b Link to roles interface needs site context, not site id 2006-10-20 05:17:39 +00:00
moodler 9fb2199303 Don't let people message the user account 2006-10-20 05:14:12 +00:00
toyomoyo 0e4429dfec fixed an infinite loop 2006-10-20 05:08:42 +00:00
moodler 09a47d4232 Slight tidy-up for forum search form 2006-10-20 03:33:18 +00:00
vyshane f39c91312f Formatting fixes. 2006-10-20 03:16:40 +00:00
toyomoyo f0769c5367 fix for MDL-7107, missing capability check for assignroles link 2006-10-20 03:14:49 +00:00
moodler 68199074d8 Automatic installer.php lang files by installer_builder (20061020) 2006-10-20 03:05:31 +00:00
toyomoyo 8807ea9497 fix for MDL-7113, removing DISTINCT on TEXT fields 2006-10-20 02:43:32 +00:00
toyomoyo 60061f9d34 setting $CFG->unicodedb after successful db conversion, chaning order of if clause to save sqls executed 2006-10-20 02:07:00 +00:00
skodak 4cbb779866 temporary patch for the forum trouble that is breaking installs MDL-7114 2006-10-19 22:42:44 +00:00
skodak 7add89d356 fixed rolesactive notice during installation 2006-10-19 22:17:12 +00:00
skodak a3faf996f5 Internal zipping broken on win32 MDL-7105 ; we are now using the new method to specify file names in zip archive because the old PCLZIP_OPT_REMOVE_PATH option is broken on win32 platforms ; backported from HEAD 2006-10-19 22:14:42 +00:00
stronk7 1dd6d5a8a2 Adding support for the new mssql_n driver 2006-10-19 22:12:55 +00:00
stronk7 c4020445c4 Adding support for the new mssql_n driver 2006-10-19 22:01:56 +00:00
stronk7 3b455ec7d2 New ADOdb driver that extends the standard mssql one. All it does is
to prepend the 'N' char before any SQL literal sent to DB, mainly
because nobody (ODBTP, FreeTDS, ODBC, SQL*Server) seems to be doing
this task, and it prevents, in an high degree true cross-db compatibility.

Once we've moved to prepared statements and some of the developers for
any of the products above (hopefully MS, at server level) will avoid
the 'N', we'll be able to go back to another mssql drivers.

More info at:
  - http://docs.moodle.org/en/XMLDB_Problems (point 8)
  - http://tracker.moodle.org/browse/MDL-6877

Merged from HEAD
2006-10-19 21:58:54 +00:00
stronk7 760f271b07 file adodb-mssql_n.inc.php was added on branch MOODLE_17_STABLE on 2006-10-19 21:58:54 +0000 2006-10-19 21:57:23 +00:00
stronk7 bf28e6d08a Adding support for the new mssql_n driver
Two new strings added: mssql_n, databasesettingssub_mssql_n
One string modified: databasesettingssub_mssql
2006-10-19 18:55:39 +00:00
stronk7 13f366f87b Adding support for the new mssql_n driver 2006-10-19 18:44:07 +00:00
stronk7 c9c2c6df00 Adding support for the new mssql_n driver 2006-10-19 18:28:05 +00:00
stronk7 ba1fa71220 Addding support for the new mssql_n ADOdb driver that,
transparently, prepends the N char for all the string
literals being set to MSSQL (until MS Unicode - standard-
support will arrive).
2006-10-19 17:26:09 +00:00
thepurpleblob 08afbd8644 Focus is now loaded into Name edit box 2006-10-19 13:05:09 +00:00
tjhunt 3e1a16bbbc Fix problem with multichoice question grading. 2006-10-19 11:54:05 +00:00
tjhunt 2620831e61 Missing addslashes. 2006-10-19 10:22:38 +00:00
toyomoyo 040c22892d fix for MDL-6549, wrong publish to menu problem 2006-10-19 06:41:04 +00:00
toyomoyo 43059890b7 making the site context same as the site course context 2006-10-19 06:15:42 +00:00
vyshane 03796898f6 Fix for MDL-7086.
Some versions of IE choke if the second argument of insertBefore() is null. The code in section_class.prototype.insert_resource() wrongly assumed that the value of targetel would be null if that parameter was not passed to the function. The value is actually 'undefined' in this case. The checks that relied on comparison with null were therefore failing in IE (but worked fine in other browsers anyway). Two problems - wrong assumption in code, and IE being stupid.
2006-10-19 04:29:55 +00:00
moodler ecaa25ff09 Automatic installer.php lang files by installer_builder (20061019) 2006-10-19 03:03:48 +00:00
toyomoyo 9a055d09c9 adding check to change_db_encoding to make sure the db is not already in unicode. attempts to configure correct set names upon successful conversion 2006-10-19 02:13:32 +00:00
skodak c95fff4fa9 Delete user fails if apostrophe in email address MDL-4762 ; found and solution provided by Inaki Arenaza 2006-10-18 21:45:10 +00:00
skodak 324480d4b2 fixed access check when editting notes in advanced upload assignment type 2006-10-18 21:32:50 +00:00
skodak 4d4a11fd68 fixed Notices after assignment deletion in Recent Activity MDL-7089 2006-10-18 21:01:25 +00:00
skodak 89a8bdc8cc improved validation when deleting comments from glossary SC#325 2006-10-18 20:20:18 +00:00
skodak 8a2bccf264 Notice when creating one forum... MDL-7063 2006-10-18 19:58:13 +00:00
skodak f697f01e35 changed email obfuscation character to * MDL-6935 2006-10-18 19:40:27 +00:00
thepurpleblob 976fe7c655 Put cursor in edit box rather than do nothing for labels. 2006-10-18 13:02:53 +00:00
ethem e6ecbb498b Show results and send email to admin. 2006-10-18 12:38:44 +00:00
skodak 37e6138a3c Deleting uploaded files when deleting an assignment instance + fixed quoting style + trailing whitespace MDL-6387 2006-10-18 11:13:32 +00:00
skodak e7514ae3f1 Deleting uploaded files when deleting an assignment instance + fixed quoting style MDL-6387 2006-10-18 11:12:49 +00:00
skodak 81f9b42660 Deleting uploaded files when deleting an assignment instance MDL-6387 2006-10-18 11:11:53 +00:00
vyshane 7c5bebadf1 More IE timing issues 2006-10-18 09:43:12 +00:00
skodak d1a0531ca4 fix course reset unenrollment in to work with roles MDL-7069 2006-10-18 09:18:36 +00:00
vyshane 5f536e23ed Because IE is stupid. 2006-10-18 08:39:34 +00:00
toyomoyo 16d42c3776 fix for MDL-7067, proper capability for forum attachments 2006-10-18 08:00:00 +00:00
toyomoyo ca108ade8d fix for MDL-7066, users with replypost set to prohibit can not edit own post 2006-10-18 07:49:13 +00:00
vyshane 8997698305 Logger has issues with IE. Turning off first until new version of YUI has been tested. 2006-10-18 07:41:32 +00:00
toyomoyo 9cb996a977 added code to force chaging of mysql db to utf8 before fresh installation 2006-10-18 07:24:49 +00:00
vyshane 6f7fcae9f2 Removed YUI debug since this is handled in lib/ajaxlib.php 2006-10-18 07:09:54 +00:00
vyshane 44089f2cb4 Removed YUI debug since this is handled in lib/ajaxlib 2006-10-18 07:09:22 +00:00
vyshane 5140419a14 Added YUI logger console if debugging level is DEBUG_DEVELOPER. 2006-10-18 07:06:39 +00:00
vyshane d0bc1c59ae .error class is defined in Moodle as red colour. We want it to be black here because the yui error class has a red backgroun. 2006-10-18 07:02:58 +00:00
toyomoyo f3726ba3b2 fix for MDL-7055 - prohibts at site level not working 2006-10-18 06:44:45 +00:00
toyomoyo e1079fc4f1 fix for MDL-7065 adding translation string for breadcrumb 2006-10-18 05:40:39 +00:00
moodler a8500a96f8 Automatic installer.php lang files by installer_builder (20061018) 2006-10-18 03:04:33 +00:00
stronk7 325bbaaa17 Now insert/update/set of BINATY fields is supported by MSSQL
(and easier to add new DB in the furure) MDL-7062
2006-10-17 23:34:52 +00:00
stronk7 12961dfd4d Added 4 more tests to check CLOB/BLOB handling across all DBs. MDL-7062 2006-10-17 23:28:08 +00:00
tjhunt c646026617 MDL-6315 - Manually grading a question 0 marks was not being registered. I took the opportunity to clean up the logic in this function a bit. Merged from MOODLE_16_STABLE. 2006-10-17 23:21:24 +00:00
tjhunt 6dfa18dff6 MDL-6848 - Display problem with < > characters in shortanswer when outputting the correct answer. Merged from MOODLE_16_STABLE. 2006-10-17 22:17:05 +00:00
tjhunt 269a213980 MDL-6386 - stripslashes missing in multianswer qustions. Thank to Joseph Rezeau. Merged from MOODLE_16_STABLE. 2006-10-17 22:01:13 +00:00
tjhunt 311a061ce1 MDL-7054 - Prevent creation of question categories with blank names. Merged from MOODLE_16_STABLE. 2006-10-17 21:42:50 +00:00
skodak f152f333d0 fixed role_capabilities table name typo 2006-10-17 21:39:59 +00:00
skodak 24ec651269 Fix forum reset - remove "DELETE .. USING ... " mysqlisms MDL-7053 2006-10-17 21:05:34 +00:00
skodak 8abe956ca8 Automatic deletion of users when deleteunconfirmed is setted to 'never' MDL-6726 2006-10-17 20:42:49 +00:00
skodak 8e1ae566f2 Activitynames filter case insensitive again for non-ascii languages MDL-6054 - I hope it will not be choking on invalid UTF-8 data 2006-10-17 19:45:34 +00:00
skodak b0b359cd73 Broken longtimenosee option - PHP notice errors during cron MDL-7058; found and solution submitted by Jenny Gray 2006-10-17 19:15:38 +00:00
skodak 1ad395e023 moodle.php strings for log file restore needs some fix - xhtml compliance and removed \n - MDL-7056 again :-( 2006-10-17 18:52:19 +00:00
skodak b1e07b8879 moodle.php strings for log file restore needs some fix - xhtml compliance and removed \n - MDL-7056 2006-10-17 18:50:20 +00:00
stronk7 4d78c38a37 Fixed typo that was preventing correct BLOB storage under Oracle. 2006-10-17 18:29:35 +00:00
tjhunt bb9cae5afc MDL-6760 - cannot insert the string 'null' into the database. You can now. 2006-10-17 15:58:00 +00:00
tjhunt 9051e08619 Fix bug with numerical questions with multiple answers. 2006-10-17 15:56:40 +00:00
thepurpleblob cec1b35f86 fix for bug MDL-7070. Form focus not defined 2006-10-17 12:40:26 +00:00
tjhunt 2fe45c4a0a Fix bugs with GIFT import. 2006-10-17 10:51:44 +00:00
moodler b40e18c325 Cleaned up some navigation when posting 2006-10-17 09:07:26 +00:00
moodler d72975122f Fixed slashes problem on re-editing new post MDL-7052 2006-10-17 08:58:00 +00:00
vyshane 7508d0918f Merged from 1.6. Fixes for MDL-6363 2006-10-17 07:19:19 +00:00
skodak a91a3c5c79 RSS update and caching broken for some feeds MDL-7045 2006-10-17 07:07:37 +00:00
skodak a30e48bc6a Typo improvement in assignment.php string MDL-7046 2006-10-17 06:28:00 +00:00
toyomoyo 6cb0f10970 fix for MDL-6884 2006-10-17 06:24:54 +00:00
vyshane a0de778c07 Added browser check for AJAX 2006-10-17 05:31:36 +00:00
toyomoyo b866247504 fix for MDL-6968 2006-10-17 05:18:02 +00:00
toyomoyo 33dc359ccc proper fix for MDL-6926 2006-10-17 04:45:21 +00:00
toyomoyo 9b6c468b16 fix for MDL-6926 2006-10-17 04:37:18 +00:00
vyshane de028f7715 Added marker that shows the new position of a resource/activity being moved. Part of the fix for MDL-6991. 2006-10-17 03:57:42 +00:00
moodler 4be0a0c1b5 Automatic installer.php lang files by installer_builder (20061017) 2006-10-17 03:06:23 +00:00
stronk7 7873f331ea Added one more XMLDB test for find_sequence_name() 2006-10-16 17:56:30 +00:00
stronk7 f8961f9bc0 Added support for getSequenceFromDB() to PG. 2006-10-16 17:33:24 +00:00
tjhunt d0949f39e9 Changes to dmllib seem to have broken quiz backup. This makes it work again. 2006-10-16 14:53:34 +00:00
tjhunt 042699bf23 Related to MDL-6249 - unit tests for address_in_subnet. 2006-10-16 13:40:19 +00:00
tjhunt 49163d4fb6 MDL-6249 - easier way for human beings (as opposed to network engineers) to specify IP ranges. 2006-10-16 13:35:51 +00:00
urs_hunkler 6ad9639961 'changed the body border due to a YUI bug and added Bitstream Vera Serif for better display in Linux browsers. It looks better than Georgia on Windows ;-)' 2006-10-16 12:24:44 +00:00
urs_hunkler 694c70e8e6 'changed the body border due to a YUI bug and added Bitstream Vera Serif for better display in Linux browsers. It looks better than Georgia on Windows ;-)' 2006-10-16 12:16:42 +00:00
tjhunt 4398b01077 MDL-6650 - Previewing individual random questions from the quiz editing screen was not working, and anyway, I'm not sure it makes any sense, so I removed that preview link. 2006-10-16 11:04:18 +00:00
thompson697 95df21e3ae Apply modularity to the creation of the log file during restore to a new course.
Remove the responsibility for loging the application of the course start date offset,
from activity modules to the backup module.
2006-10-16 10:40:48 +00:00
tjhunt 6fe671e94a MDL-6984 - Problem with Blackboard 5 import in PHP5. Fix based on a suggestion from Arthur Manning. Merged from MOODLE_16_STABLE. 2006-10-16 10:13:38 +00:00
ethem 92fa909b5e + New consts for authorize_action() function:
* AN_RETURNZERO: No connection was made on authorize.net.
  * AN_APPROVED: The transaction was accepted.
  * AN_DECLINED: The transaction was declined.
  * AN_REVIEW: The transaction was held for review.

+ Fix: Speacial handling for echecks: REVIEW; 'Under Review', 'Approved Review', 'Review Failed'
+ New feature: Upload a CSV file for echecks (capability: enrol/authorize:uploadcsv level: user)
+ New feature: Search payments by orderid and transid
+ New function: send_welcome_messages()

merged from 17stable.
2006-10-16 09:43:15 +00:00
ethem 7b23572651 + New consts for authorize_action() function:
* AN_RETURNZERO: No connection was made on authorize.net.
  * AN_APPROVED: The transaction was accepted.
  * AN_DECLINED: The transaction was declined.
  * AN_REVIEW: The transaction was held for review.

+ Fix: Speacial handling for echecks: REVIEW; 'Under Review', 'Approved Review', 'Review Failed'
+ New feature: Upload a CSV file for echecks (capability: enrol/authorize:uploadcsv level: user)
+ New feature: Search payments by orderid and transid
+ New function: send_welcome_messages()
2006-10-16 09:26:04 +00:00
ethem e9369e5282 + New consts for authorize_action() function:
* AN_RETURNZERO: No connection was made on authorize.net.
  * AN_APPROVED: The transaction was accepted.
  * AN_DECLINED: The transaction was declined.
  * AN_REVIEW: The transaction was held for review.

+ Fix: Speacial handling for echecks: REVIEW; 'Under Review', 'Approved Review', 'Review Failed'
+ New feature: Upload a CSV file for echecks (capability: enrol/authorize:uploadcsv level: user)
+ New feature: Search payments by orderid and transid
+ New function: send_welcome_messages()
2006-10-16 09:09:14 +00:00
skodak 74b0c7ac01 MDL-6444 Typo in Course/Report/Participation/index.php, patch by Stephen Bourget 2006-10-16 09:05:48 +00:00
skodak e01a96ef15 reverting moved $SITE reinitialisation into setting method, it was not a good idea after all 2006-10-16 08:52:52 +00:00
skodak 00d69809d4 backported new adodb 4.93 from HEAD 2006-10-16 08:42:51 +00:00
skodak 02d7853dab MDL-6985 Role Short name cannot be modified 2006-10-16 08:33:45 +00:00
skodak 7f5f0ae62b fixed error message when empty site full or short name - moved $SITE reinitialisation into setting method 2006-10-16 07:52:52 +00:00
skodak b5a814308a PARAM_MULTILANG is now alias of PARAM_TEXT 2006-10-16 07:45:32 +00:00
skodak f22675fed9 fixed error message when empty site full or short name 2006-10-16 07:35:12 +00:00
skodak 1f45359727 moved header after the redirects and require_logout 2006-10-16 06:51:08 +00:00
moodler 7fe0a5d596 Automatic installer.php lang files by installer_builder (20061016) 2006-10-16 03:06:22 +00:00
vyshane e83bdb2c03 Removed 'student' from lang string for module visibility. 2006-10-16 02:52:15 +00:00
vyshane 3b253287d7 Removed 'student' from lang string for module visibility 2006-10-16 02:51:38 +00:00
vyshane bf252c1d4a Added rebuild_course_cache() call when a resource is deleted. Related to MDL-6912. 2006-10-16 02:42:59 +00:00
danmarsden cf0d9e996b Fix for MDL-6550 - patch from Graeme Byrne thanks! :-) 2006-10-15 23:59:18 +00:00
stronk7 670eea76db New block upgrade functions must be called:
xmldb_block_BLOCKNAME_upgrade()

Part of MDL-6786, just for consistency.
2006-10-15 23:02:07 +00:00
stronk7 59359cde79 Now set_field() supports Oracle LOBs. Better error handling of oracle_update_lobs() 2006-10-15 20:11:14 +00:00
stronk7 2794229c55 Now update_record() supports LOBs under Oracle. Plus prevent empty objects to be updated. 2006-10-15 19:37:58 +00:00
stronk7 626caefd89 Minor changes + debug info in UpdateXlob() 2006-10-15 18:34:38 +00:00
stronk7 6880e3bb16 - Introducing the first version of the new mssql_n adodb driver (not finished, just for experimenting).
- Now insert_record() is handling Oracle CLOBS and BLOBS properly (really annoying the number of hacks needed).
- Creating one new global object to cache $db->MetaColumns() calls per request, because it's being used
in a lot of places inside dmllib.
TODO: hack update_record() and set_field() to allow Oracle LOBs
      enclose all the Oracle function calls into one db transaction
2006-10-15 16:38:22 +00:00
moodler ed0dd58cf2 Automatic installer.php lang files by installer_builder (20061015) 2006-10-15 03:03:20 +00:00
moodler 1c52f98506 Removed fucks 2006-10-14 07:27:30 +00:00
moodler 5aac129459 Automatic installer.php lang files by installer_builder (20061014) 2006-10-14 03:05:28 +00:00
stronk7 43efbf3deb Now admin/index.php checks for proper prefixes (MDL-6230) 2006-10-13 23:47:19 +00:00
gustav_delius 408964a73b When javascript was turned off the group menu did not work because the Go button linked to course/view.php rather than mod/forum/view.php 2006-10-13 23:28:09 +00:00
stronk7 b0c015e156 Now installer:(MDL-6823)
- performs Oracle charset checks (both client and server)
- prefix checks
- shows differnt information foreach DB flavour
- provide one link to Moodle Docs for MSSQL and Oracle
- the ODBC connector has been marked as experimental due
  to confirmed problems by MS
2006-10-13 18:18:44 +00:00
stronk7 b47138f834 Some more strings added to the installer to make it more resposible. 2006-10-13 17:22:14 +00:00
stronk7 40652b156b Added new strings for DB select/configure. 2006-10-13 11:32:42 +00:00
nfreear afa39a8fa8 Fixes bug MDL-6896, "Global search block - relative form URL broken". Merged from MOODLE_17_STABLE branch. 2006-10-13 09:15:24 +00:00
moodler c52128df17 Automatic installer.php lang files by installer_builder (20061013) 2006-10-13 03:06:54 +00:00
toyomoyo c0234d300b fix warnings during restore 2006-10-13 02:53:03 +00:00
stronk7 ddc35e5bd5 First cut of the modified installer. TODO:
- Create the new databasesettingssub_XXXX strings with info foreach db.
- Check prefix rules (mandatory to everybody but MySQL and no longer than 2cc for Oracle
- Ignore "database" for odbc_mssql driver
- Check "oci8po" DB character set
- Beautify the strings showed in the popupmenu (Oracle, SQL*Server....) instead of
  showing the driver name
2006-10-12 17:42:42 +00:00
moodler fb904d1889 Automatic installer.php lang files by installer_builder (20061012) 2006-10-12 12:36:10 +00:00
stronk7 5d7850d42e Small change in rename_field() so objects won't become modified at all
in the process.
2006-10-12 12:25:03 +00:00
toyomoyo 52657c4298 fixing warnings 2006-10-12 08:32:16 +00:00
toyomoyo bd2930f2b1 fixing warnings 2006-10-12 08:25:46 +00:00
toyomoyo 6cebd028b9 fixing warnings during restore 2006-10-12 08:01:27 +00:00
toyomoyo 1e006c3d5f removing warnings during restore 2006-10-12 07:32:29 +00:00
moodler d5ebb85dce Made the page a lot friendlier when you access a course in a switched Guest role.
MDL-6885 has details
2006-10-12 07:27:18 +00:00
vyshane be653a00cc Some cleanups (mostly formatting). 2006-10-12 07:08:16 +00:00
moodler a1dfc10135 Documentation for stable branch numbering 2006-10-12 07:05:49 +00:00
toyomoyo e67dfebaca fixing notices 2006-10-12 06:57:39 +00:00
toyomoyo 33a9f3495e fixing warnings during restore 2006-10-12 06:12:00 +00:00
moodler e1f8632d26 Added some tooltips to the role buttons to help when you down the bottom of
the list and can't see the headings.   MDL-6886
2006-10-12 03:54:48 +00:00
toyomoyo 82192c1bd8 fix warnings during restore 2006-10-12 03:36:13 +00:00
toyomoyo b59efda13c fixing warnings during restore 2006-10-12 03:30:00 +00:00
moodler 044f9df97e Saving settings is now faster (no redirect), and you get better feedback on errors. 2006-10-12 03:24:49 +00:00
toyomoyo 3743bfe506 fixing warnings during restore 2006-10-12 02:48:47 +00:00
toyomoyo 90beaec2eb fixing warnings during restore 2006-10-12 02:39:17 +00:00
toyomoyo f758baa9ac fixing warnings during restore 2006-10-12 02:30:38 +00:00
toyomoyo 42a5861017 getting rid of wawrnings 2006-10-12 02:13:06 +00:00
tjhunt c9ddd414c7 Take out 8) smiliey that interfeers with ligitimate content like (1998). 2006-10-11 16:29:54 +00:00
moodler 6b0ee8e3d7 Merged version from MOODLE_16_STABLE which never got into HEAD 2006-10-11 09:21:30 +00:00
toyomoyo e4db399ca5 fix for MDL-6900 2006-10-11 07:38:14 +00:00
vyshane 43b3cb4230 Fix for MDL-6674. <ul> was being added before the wrong node when sections are initialised on page load. 2006-10-11 06:56:55 +00:00
toyomoyo 8bf4dbe31c just in case you don't have roles assignable 2006-10-11 06:34:22 +00:00
moodler 471a2de79c Non-editing teachers can't manage activities! MDL-6910 2006-10-11 06:24:10 +00:00
moodler a0ba79ded7 All the PREVENTS from the legacy roles have been removed
(and thus are treated as INHERIT by default).

See MDL-6907 for details.
2006-10-11 06:16:16 +00:00
moodler 252b76e7aa Switch roles now works properly for admins at module level! 2006-10-11 05:47:36 +00:00
vyshane fe6ed5c2c2 Fix for MDL-6912. The script was not deleting module instances properly. We need to call the module cleanup function <modname>_delete_instance() whenever we delete a module instance. 2006-10-11 05:41:41 +00:00
jamiesensei ea95720fe5 *** empty log message *** 2006-10-11 05:32:35 +00:00
toyomoyo 916ad6bf7e fix for MDL-6882 context check broken for calendar 2006-10-11 05:23:14 +00:00
toyomoyo ef10c059ef fixed wrong capability checks 2006-10-11 03:47:14 +00:00
toyomoyo 770f2e2ab1 fixed assign_capability() function so that it's no longer writing '0's into db 2006-10-11 02:13:46 +00:00
sam_marshall e364a5368d Wiki: fixed issue if you tried to set a page content to completely blank (you need to switch the html editor into text mode to get this, otherwise it puts in <br/>, but one of our QA people managed to find it anyway).
Also corrected whitespace on some of the lock stuff (weird - how did those tabs get in there? hrm)
2006-10-10 17:15:40 +00:00
775 changed files with 16876 additions and 10176 deletions
+30 -14
View File
@@ -53,7 +53,14 @@
moodle_setlocale();
/// send mime type and encoding
@header('Content-Type: text/plain; charset='.current_charset());
if (check_browser_version('MSIE')) {
//ugly IE hack to work around downloading instead of viewing
@header('Content-Type: text/html; charset='.current_charset());
echo "<xmp>"; //<pre> is not good enough for us here
} else {
//send proper plaintext header
@header('Content-Type: text/plain; charset='.current_charset());
}
/// Start output log
@@ -132,8 +139,8 @@
if ($assigns = get_users_longtimenosee($longtime)) {
foreach ($assigns as $assign) {
if ($context = get_context_instance(CONTEXT_COURSE, $assign->courseid)) {
if (role_unassign(0, $assign->userid, 0, $context->id)) {
mtrace("Deleted student enrolment for user $assign->userid from course $assign->courseid");
if (role_unassign(0, $assign->id, 0, $context->id)) {
mtrace("Deleted student enrolment for user $assign->id from course $assign->courseid");
}
}
}
@@ -143,11 +150,13 @@
/// Delete users who haven't confirmed within required period
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
if ($users = get_users_unconfirmed($oneweek)) {
foreach ($users as $user) {
if (delete_records('user', 'id', $user->id)) {
mtrace("Deleted unconfirmed user for ".fullname($user, true)." ($user->id)");
if (!empty($CFG->deleteunconfirmed)) {
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
if ($users = get_users_unconfirmed($oneweek)) {
foreach ($users as $user) {
if (delete_records('user', 'id', $user->id)) {
mtrace("Deleted unconfirmed user for ".fullname($user, true)." ($user->id)");
}
}
}
}
@@ -157,11 +166,13 @@
/// Delete users who haven't completed profile within required period
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
if ($users = get_users_not_fully_set_up($oneweek)) {
foreach ($users as $user) {
if (delete_records('user', 'id', $user->id)) {
mtrace("Deleted not fully setup user $user->username ($user->id)");
if (!empty($CFG->deleteunconfirmed)) {
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
if ($users = get_users_not_fully_set_up($oneweek)) {
foreach ($users as $user) {
if (delete_records('user', 'id', $user->id)) {
mtrace("Deleted not fully setup user $user->username ($user->id)");
}
}
}
}
@@ -287,7 +298,7 @@
if (!empty($CFG->statsmaxruntime)) {
$time = $CFG->statsmaxruntime+(60*30); // add on half an hour just to make sure (it could take that long to break out of the loop)
}
if (!get_field_sql('SELECT id FROM '.$CFG->prefix.'stats_daily LIMIT 1')) {
if (!get_field_sql('SELECT id FROM '.$CFG->prefix.'stats_daily')) {
// first run, set another lock. we'll check for this in subsequent runs to set the timeout to later for the normal lock.
set_cron_lock('statsfirstrunlock',true,$time,true);
$firsttime = true;
@@ -330,4 +341,9 @@
$difftime = microtime_diff($starttime, microtime());
mtrace("Execution took ".$difftime." seconds");
/// finishe the IE hack
if (check_browser_version('MSIE')) {
echo "</xmp>";
}
?>
+41
View File
@@ -35,6 +35,11 @@
</PHP_EXTENSIONS>
</MOODLE>
<MOODLE version="1.7">
<UNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="unicoderecommended" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="4.1.16">
<FEEDBACK>
@@ -45,6 +50,42 @@
<VENDOR name="postgres" version="7.4" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="9.0" />
</DATABASE>
<PHP version="4.3.0" level="required">
<RESTRICT function="restrict_php50_version" message="php50restricted" />
</PHP>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="optional">
<FEEDBACK>
<ON_CHECK message="iconvrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
</PHP_EXTENSIONS>
</MOODLE>
<MOODLE version="1.8">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="4.1.16">
<FEEDBACK>
<ON_ERROR message="mysql416required" />
</FEEDBACK>
<BYPASS function="bypass_mysql416_reqs" message="mysql416bypassed" />
</VENDOR>
<VENDOR name="postgres" version="7.4" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="odbc_mssql" version="9.0" />
<VENDOR name="mssql_n" version="9.0" />
<VENDOR name="oracle" version="9.0" />
</DATABASE>
<PHP version="4.3.0" level="required">
+17
View File
@@ -52,6 +52,13 @@
error("The PHP server variable 'file_uploads' is not turned On - $documentationlink");
}
if (empty($CFG->prefix) && $CFG->dbtype != 'mysql') { //Enforce prefixes for everybody but mysql
error('$CFG->prefix can\'t be empty for your target DB (' . $CFG->dbtype . ')');
}
if ($CFG->dbtype == 'oci8po' && strlen($CFG->prefix) > 2) { //Max prefix length for Oracle is 2cc
error('$CFG->prefix maximum allowed length for Oracle DBs is 2cc.');
}
/// Check that config.php has been edited
@@ -133,6 +140,8 @@
/// Both old .sql files and new install.xml are supported
/// But we prioritise install.xml (XMLDB) if present
change_db_encoding(); // first try to change db encoding to utf8
$status = false;
if (file_exists("$CFG->libdir/db/install.xml")) {
$status = install_from_xmldb_file("$CFG->libdir/db/install.xml"); //New method
@@ -214,8 +223,11 @@
}
if (empty($confirmupgrade)) {
print_header($strdatabasechecking, $stradministration, $strdatabasechecking,
"", "", false, "&nbsp;", "&nbsp;");
notice_yesno(get_string('upgradesure', 'admin', $a->newversion), 'index.php?confirmupgrade=yes', 'index.php');
exit;
@@ -223,10 +235,15 @@
$strdatabasesuccess = get_string("databasesuccess");
print_header($strdatabasechecking, $stradministration, $strdatabasechecking,
"", $linktoscrolltoerrors, false, "&nbsp;", "&nbsp;");
/// return to original debugging level
$CFG->debug = $origdebug;
error_reporting($CFG->debug);
upgrade_log_start();
/// Upgrade current language pack if we can
upgrade_language_pack();
print_heading($strdatabasechecking);
$db->debug=true;
/// Launch the old main upgrade (if exists)
+15 -3
View File
@@ -4,6 +4,9 @@
*
* CHANGES
*
* 2006/11/07 mudrd8mz
* Fixed bug MDL-7361. Thanks to Dan Poltawski for the patch proposal.
*
* 2006/06/08 mudrd8mz
* 1) Fixed bug 5745 reported by Harry Smith so now can edit en_utf8_local pack
* 2) More notification messages included
@@ -133,13 +136,14 @@
// Get a list of all the root files in the English directory
$langbase = $CFG->dataroot . '/lang';
$enlangdir = "$CFG->dirroot/lang/en_utf8";
if ($currentlang == 'en_utf8') {
$langdir = $enlangdir;
} else {
$langdir = "$CFG->dataroot/lang/$currentlang";
$langdir = "$langbase/$currentlang";
}
$locallangdir = "$CFG->dataroot/lang/{$currentlang}_local";
$locallangdir = "$langbase/{$currentlang}_local";
if (! $stringfiles = get_directory_list($enlangdir, "", false)) {
error("Could not find English language pack!");
@@ -256,6 +260,14 @@
} else if ($mode == "compare") {
if (!file_exists($langbase) ){
if (!lang_make_directory($langbase) ){
error('ERROR: Could not create base lang directory ' . $langbase);
} else {
echo '<div class="notifysuccess" align="center">Created directory '.
$langbase .'</div>'."<br />\n";
}
}
if (!$uselocal && !file_exists($langdir)) {
if (!lang_make_directory($langdir)) {
error('ERROR: Could not create directory '.$langdir);
@@ -573,7 +585,7 @@ function lang_fix_value_from_file($value='') {
* Try and create a new language directory.
*
* @uses $CFG
* @param string $directory directory name under $CFG->dataroot/lang eg cs_utf8_local
* @param string $directory full path to the directory under $langbase
* @return string|false Returns full path to directory if successful, false if not
*/
function lang_make_directory($dir, $shownotices=true) {
+1 -1
View File
@@ -24,7 +24,7 @@
}
if (empty($CFG->siteidentifier)) { // Unique site identification code
set_config('siteidentifier', random_string(32));
set_config('siteidentifier', random_string(32).$_SERVER['HTTP_HOST']);
}
+11 -8
View File
@@ -31,9 +31,9 @@
$tableprefix = $CFG->prefix.'stats_';
$earliestday = get_field_sql('SELECT timeend FROM '.$tableprefix.'daily ORDER BY timeend LIMIT 1');
$earliestweek = get_field_sql('SELECT timeend FROM '.$tableprefix.'weekly ORDER BY timeend LIMIT 1');
$earliestmonth = get_field_sql('SELECT timeend FROM '.$tableprefix.'monthly ORDER BY timeend LIMIT 1');
$earliestday = get_field_sql('SELECT timeend FROM '.$tableprefix.'daily ORDER BY timeend');
$earliestweek = get_field_sql('SELECT timeend FROM '.$tableprefix.'weekly ORDER BY timeend');
$earliestmonth = get_field_sql('SELECT timeend FROM '.$tableprefix.'monthly ORDER BY timeend');
if (empty($earliestday)) $earliestday = time();
if (empty($earliestweek)) $earliestweek = time();
@@ -66,24 +66,27 @@
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
if (!empty($param->sql)) {
$sql = $param->sql ." LIMIT ".$numcourses;
$sql = $param->sql;
} else {
$sql = "SELECT courseid,".$param->fields." FROM ".$CFG->prefix.'stats_'.$param->table
." WHERE timeend >= ".$param->timeafter.' AND stattype = \'activity\''
." GROUP BY courseid "
.$param->extras
." ORDER BY ".$param->orderby
." LIMIT ".$numcourses;
." ORDER BY ".$param->orderby;
}
error_log($sql);
$courses = get_records_sql($sql);
$courses = get_records_sql($sql, 0, $numcourses);
if (empty($courses)) {
notify(get_string('statsnodata'));
} else {
echo '<div align="center"><img src="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></div>';
if (empty($CFG->gdversion)) {
echo '<div align="center">(' . get_string("gdneed") .')</div>';
} else {
echo '<div align="center"><img src="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></div>';
}
$table = new StdClass;
$table->align = array('left','center','center','center');
+5 -4
View File
@@ -17,17 +17,16 @@
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
if (!empty($param->sql)) {
$sql = $param->sql ." LIMIT ".$numcourses;
$sql = $param->sql;
} else {
$sql = "SELECT courseid,".$param->fields." FROM ".$CFG->prefix.'stats_'.$param->table
." WHERE timeend >= ".$param->timeafter.' AND stattype = \'activity\''
." GROUP BY courseid "
.$param->extras
." ORDER BY ".$param->orderby
." LIMIT ".$numcourses;
." ORDER BY ".$param->orderby;
}
$courses = get_records_sql($sql);
$courses = get_records_sql($sql, 0, $numcourses);
if (empty($courses)) {
error(get_string('statsnodata'),$CFG->wwwroot.'/'.$CFG->admin.'/report/course/index.php');
@@ -40,6 +39,8 @@
$graph->parameter['legend_size'] = 10;
$graph->parameter['x_axis_angle'] = 90;
$graph->parameter['title'] = false; // moodle will do a nicer job.
$graph->y_tick_labels = null;
$graph->offset_relation = null;
if ($report != STATS_REPORT_ACTIVE_COURSES) {
$graph->parameter['y_decimal_left'] = 2;
}
+1 -1
View File
@@ -67,7 +67,7 @@
// $strstats";
// print_header("$course->shortname: $strstats", "$course->fullname",
// $crumb, '', '', true, '&nbsp', $menu);
// $crumb, '', '', true, '&nbsp;', $menu);
require_once($CFG->dirroot.'/course/report/stats/report.php');
+26 -6
View File
@@ -116,7 +116,6 @@
$adminroot = admin_get_root();
admin_externalpage_setup('assignroles', $adminroot);
admin_externalpage_print_header($adminroot);
print_heading($straction);
} else {
$currenttab = '';
$tabsmode = 'assign';
@@ -158,8 +157,25 @@
} else if ($remove and !empty($frm->removeselect) and confirm_sesskey()) {
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$topleveladmin = false;
// we only worry about this if the role has doanything capability at site level
if ($adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext)) {
foreach ($adminroles as $adminrole) {
if ($adminrole->id == $roleid) {
$topleveladmin = true;
}
}
}
foreach ($frm->removeselect as $removeuser) {
$removeuser = clean_param($removeuser, PARAM_INT);
if ($topleveladmin && ($removeuser == $USER->id)) { // Prevent unassigning oneself from being admin
continue;
}
if (! role_unassign($roleid, $removeuser, 0, $context->id)) {
$errors[] = "Could not remove user with id $removeuser from this role!";
} else if ($inmeta) {
@@ -179,6 +195,9 @@
}
}
print_heading_with_help(get_string('assignroles', 'role'), 'assignroles');
if ($roleid) { /// prints a form to swap roles
/// Get all existing participants in this context.
@@ -243,14 +262,15 @@
$table->tablealign = 'center';
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '20%';
$table->head = array(get_string('roles', 'role'), get_string('users'));
$table->wrap = array('nowrap', 'nowrap');
$table->align = array('right', 'center');
$table->width = '60%';
$table->head = array(get_string('roles', 'role'), get_string('description'), get_string('users'));
$table->wrap = array('nowrap', '', 'nowrap');
$table->align = array('right', 'left', 'center');
foreach ($assignableroles as $roleid => $rolename) {
$countusers = count_role_users($roleid, $context);
$table->data[] = array('<a href="'.$baseurl.'&amp;roleid='.$roleid.'">'.$rolename.'</a>', $countusers);
$description = format_string(get_field('role', 'description', 'id', $roleid));
$table->data[] = array('<a href="'.$baseurl.'&amp;roleid='.$roleid.'">'.$rolename.'</a>',$description, $countusers);
}
print_table($table);
+37 -22
View File
@@ -52,17 +52,24 @@
</tr>
</table>
<?php print_heading(get_string('permissions','role')) ?>
<?php
print_heading_with_help(get_string('permissions','role'), 'permissions');
$strinherit = get_string('inherit','role');
$strallow = get_string('allow','role');
$strprevent = get_string('prevent','role');
$strprohibit = get_string('prohibit','role');
?>
<table class="rolecap" align="center">
<tr>
<th class="name" align="left"><?php print_string('capability','role') ?></th>
<th class="inherit"><?php print_string('inherit','role') ?></th>
<th class="allow"><?php print_string('allow','role') ?></th>
<th class="prevent"><?php print_string('prevent','role') ?></th>
<th class="prohibit"><?php print_string('prohibit','role') ?></th>
<th class="risk"><?php print_string('risks','role') ?></th>
<th class="inherit"><?php p($strinherit); ?></th>
<th class="allow"><?php p($strallow); ?></th>
<th class="prevent"><?php p($strprevent); ?></th>
<th class="prohibit"><?php p($strprohibit); ?></th>
<th class="risk" colspan="5"><?php print_string('risks','role') ?></th>
</tr>
<?php
@@ -71,10 +78,13 @@
$contextlevel = 0;
$component = '';
$strrisks = s(get_string('risks', 'role'));
$strcapabilities = s(get_string('capabilities', 'role'));
foreach ($capabilities as $capability) {
// prints a breaker if component or name or context level
if ($capability->component != $component or $capability->contextlevel != $contextlevel) {
echo ('<tr class="rolecapheading header"><td colspan="6" class="header"><strong>'.
echo ('<tr class="rolecapheading header"><td colspan="10" class="header"><strong>'.
get_component_string($capability->component, $capability->contextlevel).'</strong></td></tr>');
}
@@ -91,42 +101,47 @@ foreach ($capabilities as $capability) {
$localoverride->permission = $role->{$capability->name};
}
$disabled = ($action != 'edit') ? ' disabled="disabled" ' : '';
$disabled = ($action != 'edit' and $action != 'add') ? ' disabled="disabled" ' : '';
$riskinfo = '';
$riskinfo = '<td class="risk managetrust">';
$rowclasses = '';
if (RISK_MANAGETRUST & (int)$capability->riskbitmask) {
$riskinfo .= '<a title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">T</a>';
$riskinfo .= '<a target="docspopup" title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">T</a>';
$rowclasses .= ' riskmanagetrust';
}
$riskinfo .= '</td><td class="risk config">';
if (RISK_CONFIG & (int)$capability->riskbitmask) {
$riskinfo .= '<a title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">C</a>';
$riskinfo .= '<a target="docspopup" title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">C</a>';
$rowclasses .= ' riskconfig';
}
$riskinfo .= '</td><td class="risk xss">';
if (RISK_XSS & (int)$capability->riskbitmask) {
$riskinfo .= '<a title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">X</a>';
$riskinfo .= '<a target="docspopup" title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">X</a>';
$rowclasses .= ' riskxss';
}
$riskinfo .= '</td><td class="risk personal">';
if (RISK_PERSONAL & (int)$capability->riskbitmask) {
$riskinfo .= '<a title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">P</a>';
$riskinfo .= '<a target="docspopup" title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">P</a>';
$rowclasses .= ' riskpersonal';
}
$riskinfo .= '</td><td class="risk spam">';
if (RISK_SPAM & (int)$capability->riskbitmask) {
$riskinfo .= '<a title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">S</a>';
$riskinfo .= '<a target="docspopup" title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">S</a>';
$rowclasses .= ' riskspam';
}
$riskinfo .= '</td>';
?>
<tr class="rolecap <?php echo $rowclasses; ?>">
<td class="name"><span title="<?php echo $capability->name ?>"><?php echo get_capability_string($capability->name); ?></span></td>
<td class="inherit"><input type="radio" name="<?php echo $capability->name; ?>" value="<?php echo CAP_INHERIT ?>" <?php if (!isset($localoverride->permission) || $localoverride->permission==CAP_INHERIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<td class="allow"><input type="radio" name="<?php echo $capability->name; ?>" value="<?php echo CAP_ALLOW ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_ALLOW){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<td class="prevent" ><input type="radio" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PREVENT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PREVENT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<td class="prohibit" ><input type="radio" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PROHIBIT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PROHIBIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<td class="risk"><?php
echo $riskinfo;
?></td>
<td class="name"><span class="cap-desc"><a target="docspopup" href="<?php echo $CFG->docroot.'/'.$lang.'/'.$strcapabilities.'/'.$capability->name ?>"><?php echo get_capability_string($capability->name); ?></a><span class="cap-name"><?php echo $capability->name ?></span></label></td>
<td class="inherit"><input type="radio" title="<?php p($strinherit); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_INHERIT ?>" <?php if (!isset($localoverride->permission) || $localoverride->permission==CAP_INHERIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<td class="allow"><input type="radio" title="<?php p($strallow); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_ALLOW ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_ALLOW){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<td class="prevent" ><input type="radio" title="<?php p($strprevent); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PREVENT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PREVENT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<td class="prohibit" ><input type="radio" title="<?php p($strprohibit); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PROHIBIT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PROHIBIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
<?php echo $riskinfo; ?>
</tr>
<?php } ?>
+8 -5
View File
@@ -171,6 +171,7 @@
// update normal role settings
$role->id = $roleid;
$role->name = $name;
$role->shortname = $shortname;
$role->description = $description;
if (!update_record('role', $role)) {
@@ -223,9 +224,9 @@
if (array_key_exists($roleid, $roles) and confirm_sesskey()) {
$role = $roles[$roleid];
if ($role->sortorder + 1 < $rolescount) {
$bellow = $roles[$rolesort[$role->sortorder + 1]];
$below = $roles[$rolesort[$role->sortorder + 1]];
if (!switch_roles($role, $bellow)) {
if (!switch_roles($role, $below)) {
error("Cannot move role with ID $roleid");
}
}
@@ -280,13 +281,13 @@
switch ($action) {
case 'add':
print_heading(get_string('addrole', 'role'));
print_heading_with_help(get_string('addrole', 'role'), 'roles');
break;
case 'view':
print_heading(get_string('viewrole', 'role'));
print_heading_with_help(get_string('viewrole', 'role'), 'roles');
break;
case 'edit':
print_heading(get_string('editrole', 'role'));
print_heading_with_help(get_string('editrole', 'role'), 'roles');
break;
}
@@ -317,6 +318,8 @@
} else {
print_heading_with_help(get_string('roles', 'role'), 'roles');
$table = new object;
$table->tablealign = 'center';
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
// this page deals with the 2 tabs for manage.php and grant.php
$toprow[] = new tabobject('manage', $CFG->wwwroot.'/'.$CFG->admin.'/roles/manage.php', get_string('manageroles', 'role'));
$toprow[] = new tabobject('manage', $CFG->wwwroot.'/'.$CFG->admin.'/roles/manage.php', get_string('manageroles', 'role'),'', true);
$toprow[] = new tabobject('allowassign', $CFG->wwwroot.'/'.$CFG->admin.'/roles/allowassign.php', get_string('allowassign', 'role'));
+34 -19
View File
@@ -1,3 +1,10 @@
<?php
$strinherit = get_string('inherit','role');
$strallow = get_string('allow','role');
$strprevent = get_string('prevent','role');
$strprohibit = get_string('prohibit','role');
?>
<form name="overrideform" action="override.php" method="post">
<input type="hidden" name="contextid" value="<?php p($contextid) ?>">
<input type="hidden" name="roleid" value="<?php p($roleid) ?>">
@@ -8,11 +15,11 @@
<table class="rolecap">
<tr>
<th class="name" align="left"><?php print_string('capability','role') ?></th>
<th class="inherit"><?php print_string('inherit','role') ?></th>
<th class="allow"><?php print_string('allow','role') ?></th>
<th class="prevent"><?php print_string('prevent','role') ?></th>
<th class="prohibit"><?php print_string('prohibit','role') ?></th>
<th class="risk"><?php print_string('risks','role') ?></th>
<th class="inherit"><?php p($strinherit); ?></th>
<th class="allow"><?php p($strallow); ?></th>
<th class="prevent"><?php p($strprevent); ?></th>
<th class="prohibit"><?php p($strprohibit); ?></th>
<th class="risk" colspan="5"><?php print_string('risks','role') ?></th>
</tr>
<?php
@@ -20,10 +27,13 @@
$contextlevel = 0;
$component = '';
$strrisks = s(get_string('risks', 'role'));
$strcapabilities = s(get_string('capabilities', 'role'));
foreach ($capabilities as $capability) {
// prints a breaker if component or name or context level
if ($capability->component != $component or $capability->contextlevel != $contextlevel) {
echo ('<tr class="rolecapheading header"><td colspan="6" class="header"><strong>'.get_component_string($capability->component, $capability->contextlevel).'</strong></td></tr>');
echo ('<tr class="rolecapheading header"><td colspan="10" class="header"><strong>'.get_component_string($capability->component, $capability->contextlevel).'</strong></td></tr>');
}
// these 2 are used to see to group same mod/core capabilities together
@@ -49,63 +59,68 @@
$isdisabled = $isprohibit || islegacy($capability->name);
$riskinfo = '';
$riskinfo = '<td class="risk managetrust">';
$rowclasses = '';
if (RISK_MANAGETRUST & (int)$capability->riskbitmask) {
$riskinfo .= '<a title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">T</a>';
$riskinfo .= '<a target="docspopup" title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">T</a>';
$rowclasses .= ' riskmanagetrust';
}
$riskinfo .= '</td><td class="risk config">';
if (RISK_CONFIG & (int)$capability->riskbitmask) {
$riskinfo .= '<a title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">C</a>';
$riskinfo .= '<a target="docspopup" title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">C</a>';
$rowclasses .= ' riskconfig';
}
$riskinfo .= '</td><td class="risk xss">';
if (RISK_XSS & (int)$capability->riskbitmask) {
$riskinfo .= '<a title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">X</a>';
$riskinfo .= '<a target="docspopup" title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">X</a>';
$rowclasses .= ' riskxss';
}
$riskinfo .= '</td><td class="risk personal">';
if (RISK_PERSONAL & (int)$capability->riskbitmask) {
$riskinfo .= '<a title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">P</a>';
$riskinfo .= '<a target="docspopup" title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">P</a>';
$rowclasses .= ' riskpersonal';
}
$riskinfo .= '</td><td class="risk spam">';
if (RISK_SPAM & (int)$capability->riskbitmask) {
$riskinfo .= '<a title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">S</a>';
$riskinfo .= '<a target="docspopup" title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">S</a>';
$rowclasses .= ' riskspam';
}
$riskinfo .= '</td>';
?>
<tr class="rolecap <?php echo $rowclasses; ?>">
<td class="name"><?php echo get_capability_string($capability->name); ?></td>
<td class="name"><span class="cap-desc"><a target="docspopup" href="<?php echo $CFG->docroot.'/'.$lang.'/'.$strcapabilities.'/'.$capability->name ?>"><?php echo get_capability_string($capability->name); ?></a><span class="cap-name"><?php echo $capability->name ?></span></label></td>
<td class="inherit">
<input type="radio" name="<?php echo $capability->name; ?>" value="0"
<input type="radio" title="<?php p($strinherit); ?>" name="<?php echo $capability->name; ?>" value="0"
<?php
if ($localpermission == CAP_INHERIT) {echo 'checked="checked"';}
if ($isdisabled) {echo 'disabled="disabled"';}?> />
</td>
<td class="inherit <?php if ($isallow) {echo ' capcurrent';} ?>">
<input type="radio" name="<?php echo $capability->name; ?>"
<td class="allow <?php if ($isallow) {echo ' capcurrent';} ?>">
<input type="radio" title="<?php p($strallow); ?>" name="<?php echo $capability->name; ?>"
<?php echo ' value="'.CAP_ALLOW.'"';
if ($localpermission == CAP_ALLOW) {echo ' checked="checked"';}
if ($isdisabled) {echo ' disabled="disabled"';}?> />
</td>
<td class="prevent <?php if ($isprevent) {echo ' capcurrent';} ?>">
<input type="radio" name="<?php echo $capability->name; ?>"
<input type="radio" title="<?php p($strprevent); ?>" name="<?php echo $capability->name; ?>"
<?php echo ' value="'.CAP_PREVENT.'"';
if ($localpermission == CAP_PREVENT) {echo ' checked="checked"';}
if ($isdisabled) {echo ' disabled="disabled"';}?> />
</td>
<td class="prohibit <?php if ($isprohibit) {echo ' capcurrent';} ?>">
<input type="radio" name="<?php echo $capability->name; ?>"
<input type="radio" title="<?php p($strprohibit); ?>" name="<?php echo $capability->name; ?>"
<?php echo ' value="'.CAP_PROHIBIT.'"';
if ($localpermission == CAP_PROHIBIT) {echo ' checked="checked"';}
if ($isdisabled) {echo ' disabled="disabled"';}?> />
</td>
<td class="risk"><?php echo $riskinfo; ?></td>
<?php echo $riskinfo; ?>
</tr>
<?php } ?>
+7 -5
View File
@@ -141,6 +141,7 @@
include_once('tabs.php');
}
print_heading_with_help(get_string('overrides', 'role'), 'overrides');
$overridableroles = get_overridable_roles($context);
@@ -188,15 +189,16 @@
$table->tablealign = 'center';
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '20%';
$table->head = array(get_string('roles', 'role'), get_string('overrides', 'role'));
$table->wrap = array('nowrap', 'nowrap');
$table->align = array('right', 'center');
$table->width = '60%';
$table->head = array(get_string('roles', 'role'), get_string('description'), get_string('overrides', 'role'));
$table->wrap = array('nowrap', '', 'nowrap');
$table->align = array('right', 'left', 'center');
foreach ($overridableroles as $roleid => $rolename) {
$countusers = 0;
$overridecount = count_records_select('role_capabilities', "roleid = $roleid AND contextid = $context->id");
$table->data[] = array('<a href="'.$baseurl.'&amp;roleid='.$roleid.'">'.$rolename.'</a>', $overridecount);
$description = format_string(get_field('role', 'description', 'id', $roleid));
$table->data[] = array('<a href="'.$baseurl.'&amp;roleid='.$roleid.'">'.$rolename.'</a>', $description, $overridecount);
}
print_table($table);
+23 -15
View File
@@ -13,43 +13,50 @@ admin_externalpage_setup('search', $adminroot); // now hidden page
$CFG->adminsearchquery = $query; // So we can reference it in search boxes later in this invocation
$resultshtml = search_settings_html(admin_get_root(), $query);
// now we'll deal with the case that the admin has submitted the form with changed settings
$statusmsg = '';
if ($data = data_submitted()) {
$data = (array)$data;
$unslashed = (array)stripslashes_recursive($data);
if (confirm_sesskey()) {
$olddbsessions = !empty($CFG->dbsessions);
$changedsettings = search_settings(admin_get_root(), $query);
$errors = '';
foreach($changedsettings as $changedsetting) {
if (isset($data['s_' . $changedsetting->name])) {
$errors .= $changedsetting->write_setting($data['s_' . $changedsetting->name]);
} else {
$errors .= $changedsetting->write_setting($changedsetting->defaultsetting);
if (!isset($unslashed['s_' . $changedsetting->name])) {
$unslashed['s_' . $changedsetting->name] = ''; // needed for checkboxes
}
$errors .= $changedsetting->write_setting($unslashed['s_' . $changedsetting->name]);
}
if ($olddbsessions != !empty($CFG->dbsessions)) {
require_logout();
}
if (empty($errors)) {
// there must be either redirect without message or continue button or else upgrade would be sometimes broken
redirect($CFG->wwwroot . '/' . $CFG->admin . '/search.php?query=' . $query);
die;
$statusmsg = get_string('changessaved');
} else {
error(get_string('errorwithsettings', 'admin') . ' <br />' . $errors);
die;
$statusmsg = get_string('errorwithsettings', 'admin') . ' <br />' . $errors;
}
} else {
error(get_string('confirmsesskeybad', 'error'));
die;
}
// now update $SITE - it might have been changed
$SITE = get_record('course', 'id', $SITE->id);
$COURSE = clone($SITE);
}
// and finally, if we get here, then there are matching settings and we have to print a form
// to modify them
admin_externalpage_print_header($adminroot);
// print_simple_box(get_string('upgradesettingsintro','admin'),'','100%','',5,'generalbox','');
if ($statusmsg != '') {
notify ($statusmsg);
}
$resultshtml = search_settings_html(admin_get_root(), $query);
echo '<form action="search.php" method="post" name="adminsettings" id="adminsettings">';
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
@@ -62,6 +69,7 @@ if ($resultshtml != '') {
} else {
echo get_string('noresults','admin');
}
echo '</fieldset>';
echo '</form>';
admin_externalpage_print_footer($adminroot);
+20 -10
View File
@@ -49,12 +49,17 @@ if (!($root->check_access())) {
$CFG->pagepath = 'admin/setting/'.$section;
// WRITING SUBMITTED DATA (IF ANY) -------------------------------------------------------------------------------
/// WRITING SUBMITTED DATA (IF ANY) -------------------------------------------------------------------------------
$statusmsg = '';
if ($data = data_submitted()) {
if (confirm_sesskey()) {
$olddbsessions = !empty($CFG->dbsessions);
$errors = $root->write_settings((array)$data);
$unslashed = (array)stripslashes_recursive($data);
$errors = $root->write_settings($unslashed);
//force logout if dbsession setting changes
if ($olddbsessions != !empty($CFG->dbsessions)) {
require_logout();
@@ -66,22 +71,22 @@ if ($data = data_submitted()) {
case 'admin':
redirect("$CFG->wwwroot/$CFG->admin/");
default:
// following redirect should display confirmation message because it redirects
// to the same page, user might not know if save button worked
redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=" . $PAGE->section, get_string('changessaved'),2);
$statusmsg = get_string('changessaved');
}
} else {
error(get_string('errorwithsettings', 'admin') . ' <br />' . $errors);
$statusmsg = get_string('errorwithsettings', 'admin') . ' <br />' . $errors;
}
} else {
error(get_string('confirmsesskeybad', 'error'));
die;
}
// now update $SITE - it might have been changed
$SITE = get_record('course', 'id', $SITE->id);
$COURSE = clone($SITE);
}
// ---------------------------------------------------------------------------------------------------------------
/// print header stuff ------------------------------------------------------------
// header must be printed after the redirects and require_logout
if (!empty($SITE->fullname)) {
$pageblocks = blocks_setup($PAGE);
@@ -90,7 +95,6 @@ if (!empty($SITE->fullname)) {
$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
BLOCK_R_MAX_WIDTH);
// print header stuff
$PAGE->print_header();
echo '<table id="layout-table"><tr>';
@@ -105,6 +109,12 @@ if (!empty($SITE->fullname)) {
}
if ($statusmsg != '') {
notify ($statusmsg);
}
// ---------------------------------------------------------------------------------------------------------------
echo '<form action="settings.php" method="post" name="adminsettings" id="adminsettings">';
echo '<input type="hidden" name="section" value="' . $PAGE->section . '" />';
echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
+8 -2
View File
@@ -17,8 +17,8 @@ $ADMIN->add('themes', new admin_externalpage('themeselector', get_string('themes
// "frontpage" settingpage
$temp = new admin_settingpage('frontpage', get_string('frontpage','admin'));
$temp->add(new admin_setting_sitesettext('fullname', get_string('fullsitename'), '', '', PARAM_NOTAGS));
$temp->add(new admin_setting_sitesettext('shortname', get_string('shortsitename'), '', PARAM_NOTAGS));
$temp->add(new admin_setting_sitesettext('fullname', get_string('fullsitename'), '', ''));
$temp->add(new admin_setting_sitesettext('shortname', get_string('shortsitename'), '', ''));
$temp->add(new admin_setting_special_frontpagedesc());
$temp->add(new admin_setting_courselist_frontpage(false)); // non-loggedin version of the setting (that's what the parameter is for :) )
$temp->add(new admin_setting_courselist_frontpage(true)); // loggedin version of the setting
@@ -118,6 +118,12 @@ $temp = new admin_settingpage('mymoodle', get_string('mymoodle', 'admin'));
$temp->add(new admin_setting_configcheckbox('mymoodleredirect', get_string('mymoodleredirect', 'admin'), get_string('configmymoodleredirect', 'admin'), 0));
$ADMIN->add('appearance', $temp);
// new CFG variable for gradebook (what roles to display)
$temp = new admin_settingpage('gradebook', get_string('gradebook', 'admin'));
$temp->add(new admin_setting_special_gradebookroles());
$ADMIN->add('appearance', $temp);
$ADMIN->add('appearance', new admin_externalpage('stickyblocks', get_string('stickyblocks', 'admin'), "$CFG->wwwroot/$CFG->admin/stickyblocks.php"));
?>
+9 -1
View File
@@ -1,9 +1,17 @@
<?php // $Id$
// * Miscellaneous settings (still to be sorted)
// * Miscellaneous settings
// Experimental settings page
$temp = new admin_settingpage('experimental', get_string('experimental', 'admin'));
$temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('enableglobalsearch', get_string('enableglobalsearch', 'admin'), get_string('configenableglobalsearch', 'admin'), 0));
$ADMIN->add('misc', $temp);
// XMLDB editor
$ADMIN->add('misc', new admin_externalpage('xmldbeditor', get_string('xmldbeditor'), "$CFG->wwwroot/$CFG->admin/xmldb/"));
// hidden scripts linked from elsewhere
$ADMIN->add('misc', new admin_externalpage('oacleanup', 'Online Assignment Cleanup', $CFG->wwwroot.'/'.$CFG->admin.'/oacleanup.php', 'moodle/site:config', true));
$ADMIN->add('misc', new admin_externalpage('upgradeforumread', 'Upgrade forum', $CFG->wwwroot.'/'.$CFG->admin.'/upgradeforumread.php', 'moodle/site:config', true));
+2 -2
View File
@@ -87,8 +87,8 @@ $ADMIN->add('security', $temp);
// "antivirus" settingpage
$temp = new admin_settingpage('antivirus', get_string('antivirus', 'admin'));
$temp->add(new admin_setting_configcheckbox('runclamonupload', get_string('runclamavonupload', 'admin'), get_string('configrunclamavonupload', 'admin'), 0));
$temp->add(new admin_setting_configtext('pathtoclam', get_string('pathtoclam', 'admin'), get_string('configpathtoclam', 'admin'), '', PARAM_PATH));
$temp->add(new admin_setting_configtext('quarantinedir', get_string('quarantinedir', 'admin'), get_string('configquarantinedir', 'admin'), '', PARAM_PATH));
$temp->add(new admin_setting_configtext('pathtoclam', get_string('pathtoclam', 'admin'), get_string('configpathtoclam', 'admin'), '', PARAM_RAW)); // TODO: add path validation
$temp->add(new admin_setting_configtext('quarantinedir', get_string('quarantinedir', 'admin'), get_string('configquarantinedir', 'admin'), '', PARAM_RAW)); // TODO: add path validation
$temp->add(new admin_setting_configselect('clamfailureonupload', get_string('clamfailureonupload', 'admin'), get_string('configclamfailureonupload', 'admin'), 'donothing', array('donothing' => get_string('configclamdonothing', 'admin'),
'actlikevirus' => get_string('configclamactlikevirus', 'admin'))));
$ADMIN->add('security', $temp);
+9 -4
View File
@@ -7,10 +7,10 @@ $temp = new admin_settingpage('systempaths', get_string('systempaths','admin'));
$temp->add(new admin_setting_configselect('gdversion', get_string('gdversion','admin'), get_string('configgdversion', 'admin'), check_gd_version(), array('0' => get_string('gdnot'),
'1' => get_string('gd1'),
'2' => get_string('gd2'))));
$temp->add(new admin_setting_configtext('zip', get_string('pathtozip','admin'), get_string('configzip', 'admin'), '', PARAM_PATH));
$temp->add(new admin_setting_configtext('unzip', get_string('pathtounzip','admin'), get_string('configunzip', 'admin'), '', PARAM_PATH));
$temp->add(new admin_setting_configtext('pathtodu', get_string('pathtodu', 'admin'), get_string('configpathtodu', 'admin'), '', PARAM_PATH));
$temp->add(new admin_setting_configtext('aspellpath', get_string('aspellpath', 'admin'), get_string('edhelpaspellpath'), '', PARAM_PATH));
$temp->add(new admin_setting_configtext('zip', get_string('pathtozip','admin'), get_string('configzip', 'admin'), '', PARAM_RAW)); // TODO: add path validation
$temp->add(new admin_setting_configtext('unzip', get_string('pathtounzip','admin'), get_string('configunzip', 'admin'), '', PARAM_RAW)); // TODO: add path validation
$temp->add(new admin_setting_configtext('pathtodu', get_string('pathtodu', 'admin'), get_string('configpathtodu', 'admin'), '', PARAM_RAW)); // TODO: add path validation
$temp->add(new admin_setting_configtext('aspellpath', get_string('aspellpath', 'admin'), get_string('edhelpaspellpath'), '', PARAM_RAW)); // TODO: add path validation
$ADMIN->add('server', $temp, 0);
@@ -175,6 +175,11 @@ $ADMIN->add('server', new admin_externalpage('environment', get_string('environm
$ADMIN->add('server', new admin_externalpage('phpinfo', get_string('phpinfo'), "$CFG->wwwroot/$CFG->admin/phpinfo.php"));
// "performance" settingpage
$temp = new admin_settingpage('performance', get_string('performance', 'admin'));
$temp->add(new admin_setting_configcheckbox('enablerecordcache', get_string('enablerecordcache', 'admin'), get_string('configenablerecordcache', 'admin'), 1));
$ADMIN->add('server', $temp);
if (file_exists("$CFG->dirroot/$CFG->admin/mysql/frame.php")) {
$ADMIN->add('server', new admin_externalpage('database', get_string('managedatabase'), "$CFG->wwwroot/$CFG->admin/mysql/frame.php"));
}
+6 -1
View File
@@ -28,7 +28,12 @@ $ADMIN->add('root', new admin_category('appearance', get_string('appearance','ad
$ADMIN->add('root', new admin_category('server', get_string('server','admin')));
$ADMIN->add('root', new admin_category('reports', get_string('reports')));
foreach(get_list_of_plugins('admin/report') as $plugin) {
foreach (get_list_of_plugins('admin/report') as $plugin) {
/// This snippet is temporary until simpletest can be fixed to use xmldb. See MDL-7377 XXX TODO
if ($plugin == 'simpletest' && $CFG->dbtype != 'mysql' && $CFG->dbtype != 'postgres7') {
continue;
}
/// End of removable snippet
$ADMIN->add('reports', new admin_externalpage('report'.$plugin, get_string($plugin, 'admin'), "$CFG->wwwroot/$CFG->admin/report/$plugin/index.php"));
}
+2 -1
View File
@@ -16,7 +16,8 @@ $ADMIN->add('accounts', new admin_externalpage('uploadusers', get_string('upload
// stuff under the "roles" subcategory
$ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
$ADMIN->add('roles', new admin_externalpage('defineroles', get_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php"));
$ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . SITEID));
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $sitecontext->id));
// "userpolicies" settingpage
+3 -3
View File
@@ -24,14 +24,14 @@ if ($newsettingshtml == '') {
// now we'll deal with the case that the admin has submitted the form with new settings
if ($data = data_submitted()) {
$data = (array)$data;
$unslashed = (array)stripslashes_recursive($data);
if (confirm_sesskey()) {
$newsettings = find_new_settings(admin_get_root());
$errors = '';
foreach($newsettings as $newsetting) {
if (isset($data['s_' . $newsetting->name])) {
$errors .= $newsetting->write_setting($data['s_' . $newsetting->name]);
if (isset($unslashed['s_' . $newsetting->name])) {
$errors .= $newsetting->write_setting($unslashed['s_' . $newsetting->name]);
} else {
$errors .= $newsetting->write_setting($newsetting->defaultsetting);
}
+3 -3
View File
@@ -19,7 +19,7 @@
redirect('index.php');
}
if (!$CFG->rolesactive) { // No admin user yet.
if (empty($CFG->rolesactive)) { // No admin user yet.
$user = new object();
$user->firstname = get_string('admin');
@@ -65,7 +65,7 @@
sesskey(); // For added security, used to check script parameters
load_user_capability();
load_all_capabilities();
redirect("$CFG->wwwroot/user/edit.php?id=$user->id&amp;course=$site->id"); // Edit thyself
exit;
@@ -169,7 +169,7 @@
$updateuser = new object();
$updateuser->id = $user->id;
$updateuser->deleted = 1;
$updateuser->username = "$user->email.".time(); // Remember it just in case
$updateuser->username = addslashes("$user->email.".time()); // Remember it just in case
$updateuser->email = ''; // Clear this field to free it up
$updateuser->idnumber = ''; // Clear this field to free it up
$updateuser->timemodified = time();
+2 -2
View File
@@ -594,8 +594,8 @@ function db_migrate2utf8(){ //Eloy: Perhaps some type of limit parameter here
* converting each record *
**************************/
while(($counter < $totalrecords) and ($fieldname !='dummy') and ($method!='NO_CONV')) { //while there is still something
$SQL = 'SELECT * FROM '.$prefix.$dbtablename.' ORDER BY id ASC '.sql_paging_limit($counter, $recordsetsize);
if ($records = get_records_sql($SQL)) {
$SQL = 'SELECT * FROM '.$prefix.$dbtablename.' ORDER BY id ASC';
if ($records = get_records_sql($SQL, $counter, $recordsetsize)) {
foreach ($records as $record) {
//if we are up this far, either no crash, or crash with same table, field name.
+239 -41
View File
@@ -93,7 +93,7 @@ class test extends XMLDBAction {
$table->addFieldInfo('type', XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL, null, XMLDB_ENUM, array('single', 'news', 'general', 'social', 'eachuser', 'teacher', 'qanda'), 'general');
$table->addFieldInfo('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, '');
$table->addFieldInfo('intro', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, null, '');
$table->addFieldInfo('logo', XMLDB_TYPE_BINARY, 'big', null, XMLDB_NOTNULL, null, null, null, '');
$table->addFieldInfo('logo', XMLDB_TYPE_BINARY, 'big', null, XMLDB_NOTNULL, null, null, null);
$table->addFieldInfo('assessed', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
$table->addFieldInfo('assesstimestart', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
$table->addFieldInfo('assesstimefinish', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
@@ -142,8 +142,9 @@ class test extends XMLDBAction {
$table->addFieldInfo('course', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
$table->addFieldInfo('name', XMLDB_TYPE_CHAR, '30', null, null, null, null, null, 'Moodle');
$table->addFieldInfo('secondname', XMLDB_TYPE_CHAR, '30', null, XMLDB_NOTNULL, null, null, null, null);
$table->addFieldInfo('intro', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, null, null);
$table->addFieldInfo('grade', XMLDB_TYPE_NUMBER, '20,10', null, null, null, null, null, '');
$table->addFieldInfo('intro', XMLDB_TYPE_TEXT, 'medium', null, XMLDB_NOTNULL, null, null, null, null);
$table->addFieldInfo('avatar', XMLDB_TYPE_BINARY, 'medium', null, null, null, null, null, null);
$table->addFieldInfo('grade', XMLDB_TYPE_NUMBER, '20,10', null, null, null, null, null);
$table->addKeyInfo('primary', XMLDB_KEY_PRIMARY, array('id'));
/// Get SQL code and execute it
$test = new stdClass;
@@ -181,7 +182,7 @@ class test extends XMLDBAction {
if (!$test->status) {
$test->error = $db->ErrorMsg();
}
$tests['add field'] = $test;
$tests['add enum field'] = $test;
}
/// 5th test. Dropping one complex enum field
@@ -193,7 +194,7 @@ class test extends XMLDBAction {
if (!$test->status) {
$test->error = $db->ErrorMsg();
}
$tests['drop field'] = $test;
$tests['drop enum field'] = $test;
}
/// 6th test. Adding one complex enum field
@@ -208,22 +209,38 @@ class test extends XMLDBAction {
if (!$test->status) {
$test->error = $db->ErrorMsg();
}
$tests['add field again'] = $test;
$tests['add enum field again'] = $test;
}
/// 7th test. Dropping one complex enum field
/// 7th test. Adding one numeric field
if ($test->status) {
/// Create a new field (numeric)
$field = new XMLDBField('onenumber');
$field->setAttributes(XMLDB_TYPE_INTEGER, '6', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, 0, 'type');
/// Get SQL code and execute it
$test = new stdClass;
$test->sql = $table->getAddFieldSQL($CFG->dbtype, $CFG->prefix, $field, true);
$test->status = add_field($table, $field, false, false);
if (!$test->status) {
$test->error = $db->ErrorMsg();
}
$tests['add numeric field'] = $test;
}
/// 8th test. Dropping one complex enum field
if ($test->status) {
/// Create a new field with complex specs (enums are good candidates)
$field = new XMLDBField('type');
$test = new stdClass;
$test->sql = $table->getDropFieldSQL($CFG->dbtype, $CFG->prefix, $field, true);
$test->status = drop_field($table, $field, false, false);
if (!$test->status) {
$test->error = $db->ErrorMsg();
}
$tests['drop field again'] = $test;
$tests['drop enum field again'] = $test;
}
/// 8th test. Change the type of one column from integer to varchar
/// 9th test. Change the type of one column from integer to varchar
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -238,7 +255,7 @@ class test extends XMLDBAction {
$tests['change field type (int2char)'] = $test;
}
/// 9th test. Change the type of one column from varchar to integer
/// 10th test. Change the type of one column from varchar to integer
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -253,7 +270,7 @@ class test extends XMLDBAction {
$tests['change field type (char2int)'] = $test;
}
/// 10th test. Change the type of one column from number to varchar
/// 11th test. Change the type of one column from number to varchar
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -268,7 +285,7 @@ class test extends XMLDBAction {
$tests['change field type (number2char)'] = $test;
}
/// 11th test. Change the type of one column from varchar to float
/// 12th test. Change the type of one column from varchar to float
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -283,7 +300,7 @@ class test extends XMLDBAction {
$tests['change field type (char2float)'] = $test;
}
/// 12th test. Change the type of one column from float to char
/// 13th test. Change the type of one column from float to char
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -298,7 +315,7 @@ class test extends XMLDBAction {
$tests['change field type (float2char)'] = $test;
}
/// 13th test. Change the type of one column from char to number
/// 14th test. Change the type of one column from char to number
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -314,7 +331,7 @@ class test extends XMLDBAction {
}
/// 14th test. Change the precision of one text field
/// 15th test. Change the precision of one text field
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -329,7 +346,7 @@ class test extends XMLDBAction {
$tests['change field precision (text)'] = $test;
}
/// 15th test. Change the precision of one char field
/// 16th test. Change the precision of one char field
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -344,7 +361,7 @@ class test extends XMLDBAction {
$tests['change field precision (char)'] = $test;
}
/// 16th test. Change the precision of one numeric field
/// 17th test. Change the precision of one numeric field
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -359,7 +376,7 @@ class test extends XMLDBAction {
$tests['change field precision (number)'] = $test;
}
/// 17th test. Change the sign of one numeric field to unsigned
/// 18th test. Change the sign of one numeric field to unsigned
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -374,7 +391,7 @@ class test extends XMLDBAction {
$tests['change field sign (unsigned)'] = $test;
}
/// 18th test. Change the sign of one numeric field to signed
/// 19th test. Change the sign of one numeric field to signed
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -389,7 +406,7 @@ class test extends XMLDBAction {
$tests['change field sign (signed)'] = $test;
}
/// 19th test. Change the nullability of one char field to not null
/// 20th test. Change the nullability of one char field to not null
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -404,7 +421,7 @@ class test extends XMLDBAction {
$tests['change field nullability (not null)'] = $test;
}
/// 20th test. Change the nullability of one char field to null
/// 21th test. Change the nullability of one char field to null
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -419,7 +436,7 @@ class test extends XMLDBAction {
$tests['change field nullability (null)'] = $test;
}
/// 21th test. Dropping the default of one field
/// 22th test. Dropping the default of one field
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -434,7 +451,7 @@ class test extends XMLDBAction {
$tests['drop field default of NULL field'] = $test;
}
/// 22th test. Creating the default for one field
/// 23th test. Creating the default for one field
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -449,7 +466,7 @@ class test extends XMLDBAction {
$tests['add field default of NULL field'] = $test;
}
/// 23th test. Creating the default for one field
/// 24th test. Creating the default for one field
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -465,7 +482,7 @@ class test extends XMLDBAction {
}
/// 24th test. Dropping the default of one NOT NULL field
/// 25th test. Dropping the default of one NOT NULL field
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -480,7 +497,7 @@ class test extends XMLDBAction {
$tests['drop field default of NOT NULL field'] = $test;
}
/// 25th test. Adding one unique index to the table
/// 26th test. Adding one unique index to the table
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -495,7 +512,7 @@ class test extends XMLDBAction {
$tests['add unique index'] = $test;
}
/// 26th test. Adding one not unique index to the table
/// 27th test. Adding one not unique index to the table
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -510,7 +527,7 @@ class test extends XMLDBAction {
$tests['add not unique index'] = $test;
}
/// 27th test. Re-add the same index than previous test. Check find_index_name() works.
/// 28th test. Re-add the same index than previous test. Check find_index_name() works.
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -529,7 +546,7 @@ class test extends XMLDBAction {
$tests['check find_index_name()'] = $test;
}
/// 28th test. Dropping one index from the table
/// 29th test. Dropping one index from the table
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -544,7 +561,7 @@ class test extends XMLDBAction {
$tests['drop index'] = $test;
}
/// 29th test. Adding one unique key to the table
/// 30th test. Adding one unique key to the table
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -559,7 +576,7 @@ class test extends XMLDBAction {
$tests['add unique key'] = $test;
}
/// 30th test. Adding one foreign+unique key to the table
/// 31th test. Adding one foreign+unique key to the table
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -574,7 +591,7 @@ class test extends XMLDBAction {
$tests['add foreign+unique key'] = $test;
}
/// 31th test. Drop one key
/// 32th test. Drop one key
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -589,7 +606,7 @@ class test extends XMLDBAction {
$tests['drop foreign+unique key'] = $test;
}
/// 32th test. Adding one foreign key to the table
/// 33th test. Adding one foreign key to the table
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -604,7 +621,7 @@ class test extends XMLDBAction {
$tests['add foreign key'] = $test;
}
/// 33th test. Drop one foreign key
/// 34th test. Drop one foreign key
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -619,7 +636,7 @@ class test extends XMLDBAction {
$tests['drop foreign key'] = $test;
}
/// 34th test. Adding one complex enum field
/// 35th test. Adding one complex enum field
if ($test->status) {
/// Create a new field with complex specs (enums are good candidates)
$field = new XMLDBField('type');
@@ -634,7 +651,7 @@ class test extends XMLDBAction {
$tests['add field with enum'] = $test;
}
/// 35th test. Dropping the enum of one field
/// 36th test. Dropping the enum of one field
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -649,7 +666,7 @@ class test extends XMLDBAction {
$tests['delete enumlist from one field'] = $test;
}
/// 36th test. Creating the enum for one field
/// 37th test. Creating the enum for one field
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -663,7 +680,7 @@ class test extends XMLDBAction {
$tests['add enumlist to one field'] = $test;
}
/// 37th test. Renaming one index
/// 38th test. Renaming one index
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -678,7 +695,7 @@ class test extends XMLDBAction {
$tests['rename index (experimental. DO NOT USE IT)'] = $test;
}
/// 38th test. Renaming one key
/// 39th test. Renaming one key
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -693,7 +710,7 @@ class test extends XMLDBAction {
$tests['rename key (experimental. DO NOT USE IT)'] = $test;
}
/// 39th test. Renaming one field
/// 40th test. Renaming one field
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -708,7 +725,7 @@ class test extends XMLDBAction {
$tests['rename field'] = $test;
}
/// 40th test. Renaming one table
/// 41th test. Renaming one table
if ($test->status) {
/// Get SQL code and execute it
$test = new stdClass;
@@ -721,7 +738,188 @@ class test extends XMLDBAction {
$tests['rename table'] = $test;
}
/// 42th test. Getting the PK sequence name for one table
if ($test->status) {
$test = new stdClass;
$table->setName('newnameforthetable');
$test->sql = array(find_sequence_name($table));
$test->status = find_sequence_name($table);
if (!$test->status) {
if (!$test->error = $db->ErrorMsg()) { //If no db errors, result is ok. Just the driver doesn't support this
$test->sql = array('not needed for this DB');
$test->status = true;
}
}
$tests['find sequence name'] = $test;
}
/// 43th test. Inserting TEXT contents
$textlib = textlib_get_instance();
if ($test->status) {
$test = new stdClass;
$test->status = false;
$test->sql = array();
$basetext = '日本語 • Русский • Deutsch • English • Español • Français • Italiano • Nederlands • Polski • Português • Svenska • العربية • فارسی 한국어 • עברית • ไทย中文 Ελληνικά • Български • Српски • Українська • Bosanski • Català • Česky • Dansk • Eesti • Simple English • Esperanto • Euskara • Galego • Hrvatski • Ido • Bahasa Indonesia • Íslenska • Lëtzebuergesch • Lietuvių • Magyar • Bahasa Melayu اردو • ئۇيغۇرچه • हिन्दी • नेपाल भाषा मराठी • தமிழ் Հայերեն • Беларуская • Чăваш • Ирон æвзаг • Македонски • Сибирской говор • Afrikaans • Aragonés • Arpitan • Asturianu • Kreyòl Ayisyen • Azərbaycan • Bân-lâm-gú • Basa Banyumasan • Brezhoneg • Corsu • Cymraeg • Deitsch • Føroyskt • Frysk • Furlan • Gaeilge • Gàidhlig • Ilokano • Interlingua • Basa Jawa • Kapampangan • Kernewek • Kurdî كوردی • Ladino לאדינו • Latina • Latviešu • Limburgs • Lumbaart • Nedersaksisch • Nouormand • Occitan • Ozbek • Piemontèis • Plattdüütsch • Ripoarisch • Sámegiella • Scots • Shqip • Sicilianu • Sinugboanon • Srpskohrvatski / Српскохрватски • Basa Sunda • Kiswahili • Tagalog • Tatarça • Walon • Winaray Авар • Башҡорт • Кыргызча Монгол • Қазақша • Тоҷикӣ • Удмурт • Armãneashce • Bamanankan • Eald Englisc • Gaelg • Interlingue • Kaszëbsczi • Kongo • Ligure • Lingála • lojban • Malagasy • Malti • Māori • Nāhuatl • Ekakairũ Naoero • Novial • Pangasinán • Tok Pisin • Romani / रोमानी • Rumantsch • Runa Simi • Sardu • Tetun • Türkmen / تركمن / Туркмен • Vèneto • Volapük • Võro • West-Vlaoms • Wollof • Zazaki • Žemaitėška';
/// Create one big text (1.500.000 chars)
$fulltext = '';
for ($i=0; $i<1000; $i++) { //1500 * 1000 chars
$fulltext .= $basetext;
}
/// Build the record to insert
$rec->intro = addslashes($fulltext);
$rec->name = 'texttest';
/// Calculate its length
$textlen = $textlib->strlen($fulltext, current_charset());
if ($rec->id = insert_record('newnameforthetable', $rec)) {
if ($new = get_record('newnameforthetable', 'id', $rec->id)) {
delete_records('newnameforthetable', 'id', $new->id);
$newtextlen = $textlib->strlen($new->intro, current_charset());
if ($fulltext === $new->intro) {
$test->sql = array($newtextlen . ' cc. (text) sent and received ok');
$test->status = true;
} else {
$test->error = $db->ErrorMsg();
$test->sql = array($newtextlen . ' cc. (text) transfer failed. Data changed!');
$test->status = false;
}
} else {
$test->error = $db->ErrorMsg();
}
} else {
$test->error = $db->ErrorMsg();
}
$tests['insert record '. $textlen . ' cc. (text)'] = $test;
}
/// 44th test. Inserting BINARY contents
if ($test->status) {
$test = new stdClass;
$test->status = false;
/// Build the record to insert
$rec->avatar = addslashes($fulltext);
$rec->name = 'binarytest';
/// Calculate its length
$textlen = strlen($fulltext);
if ($rec->id = insert_record('newnameforthetable', $rec)) {
if ($new = get_record('newnameforthetable', 'id', $rec->id)) {
$newtextlen = strlen($new->avatar);
if ($fulltext === $new->avatar) {
$test->sql = array($newtextlen . ' bytes (binary) sent and received ok');
$test->status = true;
} else {
$test->error = $db->ErrorMsg();
$test->sql = array($newtextlen . ' bytes (binary) transfer failed. Data changed!');
$test->status = false;
}
} else {
$test->error = $db->ErrorMsg();
}
} else {
$test->error = $db->ErrorMsg();
}
$tests['insert record '. $textlen . ' bytes (binary)'] = $test;
}
/// 45th test. update_record with TEXT and BINARY contents
if ($test->status) {
$test = new stdClass;
$test->status = false;
$test->sql = array();
/// Build the record to insert
$rec->intro = addslashes($basetext);
$rec->avatar = addslashes($basetext);
$rec->name = 'updatelobs';
/// Calculate its length
$textlen = $textlib->strlen($basetext, current_charset());
$imglen = strlen($basetext);
if (update_record('newnameforthetable', $rec)) {
if ($new = get_record('newnameforthetable', 'id', $rec->id)) {
$newtextlen = $textlib->strlen($new->intro, current_charset());
$newimglen = strlen($new->avatar);
if ($basetext === $new->avatar && $basetext === $new->intro) {
$test->sql = array($newtextlen . ' cc. (text) sent and received ok',
$newimglen . ' bytes (binary) sent and received ok');
$test->status = true;
} else {
if ($rec->avatar !== $new->avatar) {
$test->error = $db->ErrorMsg();
$test->sql = array($newimglen . ' bytes (binary) transfer failed. Data changed!');
$test->status = false;
} else {
$test->error = $db->ErrorMsg();
$test->sql = array($newtextlen . ' cc. (text) transfer failed. Data changed!');
$test->status = false;
}
}
} else {
$test->error = $db->ErrorMsg();
}
} else {
$test->error = $db->ErrorMsg();
}
$tests['update record '. $textlen . ' cc. (text) and ' . $imglen . ' bytes (binary)'] = $test;
}
/// 46th test. set_field with TEXT contents
if ($test->status) {
$test = new stdClass;
$test->status = false;
$test->sql = array();
/// Build the record to insert
$rec->intro = addslashes($fulltext);
$rec->name = 'updatelobs';
/// Calculate its length
$textlen = $textlib->strlen($fulltext, current_charset());
if (set_field('newnameforthetable', 'intro', $rec->intro, 'name', $rec->name)) {
if ($new = get_record('newnameforthetable', 'id', $rec->id)) {
$newtextlen = $textlib->strlen($new->intro);
if ($fulltext === $new->intro) {
$test->sql = array($newtextlen . ' cc. (text) sent and received ok');
$test->status = true;
} else {
$test->error = $db->ErrorMsg();
$test->sql = array($newtextlen . ' cc. (text) transfer failed. Data changed!');
$test->status = false;
}
} else {
$test->error = $db->ErrorMsg();
}
} else {
$test->error = $db->ErrorMsg();
}
$tests['set field '. $textlen . ' cc. (text)'] = $test;
}
/// 47th test. set_field with BINARY contents
if ($test->status) {
$test = new stdClass;
$test->status = false;
$test->sql = array();
/// Build the record to insert
$rec->avatar = addslashes($fulltext);
$rec->name = 'updatelobs';
/// Calculate its length
$textlen = strlen($fulltext);
if (set_field('newnameforthetable', 'avatar', $rec->avatar, 'name', $rec->name)) {
if ($new = get_record('newnameforthetable', 'id', $rec->id)) {
$newtextlen = strlen($new->avatar);
if ($fulltext === $new->avatar) {
$test->sql = array($newtextlen . ' bytes (binary) sent and received ok');
$test->status = true;
} else {
$test->error = $db->ErrorMsg();
$test->sql = array($newtextlen . ' bytes (binary) transfer failed. Data changed!');
$test->status = false;
}
} else {
$test->error = $db->ErrorMsg();
}
} else {
$test->error = $db->ErrorMsg();
}
$tests['set field '. $textlen . ' bytes (binary)'] = $test;
}
/// TODO: Check here values of the inserted records to see that everything ha the correct value
@@ -99,7 +99,7 @@ class view_structure_php extends XMLDBAction {
/// Calculate the popup of commands
$commands = array('create_table',
'drop_table',
'rename_table (not imp!)');
'rename_table');
foreach ($commands as $command) {
$popcommands[$command] = str_replace('_', ' ', $command);
}
@@ -211,7 +211,7 @@ class view_structure_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch create table for ' . $table->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && create_table($table);' . XMLDB_LINEFEED;
$result .= ' $result = $result && create_table($table);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -249,7 +249,7 @@ class view_structure_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch drop table for ' . $table->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && drop_table($table);' . XMLDB_LINEFEED;
$result .= ' $result = $result && drop_table($table);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -287,7 +287,7 @@ class view_structure_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch rename table for ' . $table->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && rename_table($table, ' . "'NEWNAMEGOESHERE'" . ');' . XMLDB_LINEFEED;
$result .= ' $result = $result && rename_table($table, ' . "'NEWNAMEGOESHERE'" . ');' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -119,13 +119,12 @@ class view_table_php extends XMLDBAction {
$commands = array('Fields',
$optionspacer . 'add_field',
$optionspacer . 'drop_field',
$optionspacer . 'rename_field (not imp!)',
$optionspacer . 'rename_field',
$optionspacer . 'change_field_type',
$optionspacer . 'change_field_precision',
$optionspacer . 'change_field_unsigned',
$optionspacer . 'change_field_notnull',
$optionspacer . 'change_field_sequence (not imp!)',
$optionspacer . 'change_field_enum (not imp!)',
$optionspacer . 'change_field_enum',
$optionspacer . 'change_field_default',
'Keys',
$optionspacer . 'add_key',
@@ -229,6 +228,13 @@ class view_table_php extends XMLDBAction {
$o.= $this->str['mustselectonefield'];
}
break;
case 'change_field_enum':
if ($fieldkeyindexinitial == 'f') { //Only if we have got one field
$o.= s($this->change_field_enum_php($structure, $tableparam, $fieldkeyindexparam));
} else {
$o.= $this->str['mustselectonefield'];
}
break;
case 'change_field_default':
if ($fieldkeyindexinitial == 'f') { //Only if we have got one field
$o.= s($this->change_field_default_php($structure, $tableparam, $fieldkeyindexparam));
@@ -330,7 +336,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch add field ' . $field->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && add_field($table, $field);' . XMLDB_LINEFEED;
$result .= ' $result = $result && add_field($table, $field);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -373,7 +379,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch drop field ' . $field->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && drop_field($table, $field);' . XMLDB_LINEFEED;
$result .= ' $result = $result && drop_field($table, $field);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -416,7 +422,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch rename field ' . $field->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && rename_field($table, $field, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
$result .= ' $result = $result && rename_field($table, $field, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -469,7 +475,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch change of type for field ' . $field->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && change_field_type($table, $field);' . XMLDB_LINEFEED;
$result .= ' $result = $result && change_field_type($table, $field);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -519,7 +525,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch change of precision for field ' . $field->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && change_field_precision($table, $field);' . XMLDB_LINEFEED;
$result .= ' $result = $result && change_field_precision($table, $field);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -565,7 +571,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch change of sign for field ' . $field->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && change_field_unsigned($table, $field);' . XMLDB_LINEFEED;
$result .= ' $result = $result && change_field_unsigned($table, $field);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -611,7 +617,54 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch change of nullability for field ' . $field->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && change_field_notnull($table, $field);' . XMLDB_LINEFEED;
$result .= ' $result = $result && change_field_notnull($table, $field);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
return $result;
}
/**
* This function will generate all the PHP code needed to
* change the enum values (check constraint) of one field
* using XMLDB objects and functions
*
* @param XMLDBStructure structure object containing all the info
* @param string table table name
* @param string field field name to change its enum
*/
function change_field_enum_php($structure, $table, $field) {
$result = '';
/// Validate if we can do it
if (!$table = $structure->getTable($table)) {
return false;
}
if (!$field = $table->getField($field)) {
return false;
}
if ($table->getAllErrors()) {
return false;
}
/// Calculate the enum tip text
$enum = $field->getEnum() ? implode(', ', $field->getEnumValues()) : 'none';
/// Add the standard PHP header
$result .= XMLDB_PHP_HEADER;
/// Add contents
$result .= XMLDB_LINEFEED;
$result .= ' /// Changing list of values (enum) of field ' . $field->getName() . ' on table ' . $table->getName() . ' to ' . $enum . XMLDB_LINEFEED;
$result .= ' $table = new XMLDBTable(' . "'" . $table->getName() . "'" . ');' . XMLDB_LINEFEED;
$result .= ' $field = new XMLDBField(' . "'" . $field->getName() . "'" . ');' . XMLDB_LINEFEED;
$result .= ' $field->setAttributes(' . $field->getPHP(true) . ');' . XMLDB_LINEFEED;
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch change of list of values for field ' . $field->getName() . XMLDB_LINEFEED;
$result .= ' $result = $result && change_field_enum($table, $field);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -657,7 +710,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch change of default for field ' . $field->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && change_field_default($table, $field);' . XMLDB_LINEFEED;
$result .= ' $result = $result && change_field_default($table, $field);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -701,7 +754,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch add key ' . $key->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && add_key($table, $key);' . XMLDB_LINEFEED;
$result .= ' $result = $result && add_key($table, $key);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -745,7 +798,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch drop key ' . $key->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && drop_key($table, $key);' . XMLDB_LINEFEED;
$result .= ' $result = $result && drop_key($table, $key);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -776,6 +829,9 @@ class view_table_php extends XMLDBAction {
return false;
}
/// Prepend warning. This function isn't usable!
$result .= 'DON\'T USE THIS FUNCTION (IT\'S ONLY EXPERIMENTAL). SOME DBs DON\'T SUPPORT IT!' . XMLDB_LINEFEED . XMLDB_LINEFEED;
/// Add the standard PHP header
$result .= XMLDB_PHP_HEADER;
@@ -789,7 +845,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch rename key ' . $key->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && rename_key($table, $key, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
$result .= ' $result = $result && rename_key($table, $key, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -833,7 +889,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch add index ' . $index->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && add_index($table, $index);' . XMLDB_LINEFEED;
$result .= ' $result = $result && add_index($table, $index);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -877,7 +933,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch drop index ' . $index->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && drop_index($table, $index);' . XMLDB_LINEFEED;
$result .= ' $result = $result && drop_index($table, $index);' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
@@ -908,6 +964,9 @@ class view_table_php extends XMLDBAction {
return false;
}
/// Prepend warning. This function isn't usable!
$result .= 'DON\'T USE THIS FUNCTION (IT\'S ONLY EXPERIMENTAL). SOME DBs DON\'T SUPPORT IT!' . XMLDB_LINEFEED . XMLDB_LINEFEED;
/// Add the standard PHP header
$result .= XMLDB_PHP_HEADER;
@@ -921,7 +980,7 @@ class view_table_php extends XMLDBAction {
/// Launch the proper DDL
$result .= XMLDB_LINEFEED;
$result .= ' /// Launch rename index ' . $index->getName() . XMLDB_LINEFEED;
$result .= ' $status = $status && rename_index($table, $index, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
$result .= ' $result = $result && rename_index($table, $index, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
/// Add standard PHP footer
$result .= XMLDB_PHP_FOOTER;
+4
View File
@@ -159,6 +159,8 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
reset_login_count();
load_all_capabilities(); /// This is what lets the user do anything on the site :-)
redirect($urltogo);
exit;
@@ -266,6 +268,8 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
reset_login_count();
load_all_capabilities(); /// This is what lets the user do anything on the site :-)
redirect($urltogo);
exit;
+1 -1
View File
@@ -44,7 +44,7 @@
<tr valign="top" class="required">
<td align="right">auth_dbtype:</td>
<td>
<?php $dbtypes = array("access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mysql", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp");
<?php $dbtypes = array("access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mssql_n", "mysql", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp");
foreach ($dbtypes as $dbtype) {
$dboptions[$dbtype] = $dbtype;
}
+9 -5
View File
@@ -22,7 +22,8 @@ function auth_user_login ($username, $password) {
// Connect to the external database
$authdb = &ADONewConnection($CFG->auth_dbtype);
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
$authdb->SetFetchMode(ADODB_FETCH_ASSOC); ///Set Assoc mode always after DB connection
if ($CFG->auth_dbpasstype === 'internal') {
// lookup username externally, but resolve
@@ -92,6 +93,7 @@ function auth_get_userinfo($username){
ADOLoadCode($CFG->auth_dbtype);
$authdb = &ADONewConnection();
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
$authdb->SetFetchMode(ADODB_FETCH_ASSOC); ///Set Assoc mode always after DB connection
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
"department", "address", "city", "country", "description",
@@ -101,13 +103,13 @@ function auth_get_userinfo($username){
foreach ($fields as $field) {
if ($pcfg["field_map_$field"]) {
if ($rs = $authdb->Execute("SELECT ".$pcfg["field_map_$field"]." FROM $CFG->auth_dbtable
if ($rs = $authdb->Execute("SELECT ".$pcfg["field_map_$field"]." as myfield FROM $CFG->auth_dbtable
WHERE $CFG->auth_dbfielduser = '$username'")) {
if ( $rs->RecordCount() == 1 ) {
if (!empty($CFG->unicodedb)) {
$result["$field"] = addslashes(stripslashes($rs->fields[0]));
$result["$field"] = addslashes(stripslashes($rs->fields['myfield']));
} else {
$result["$field"] = addslashes(stripslashes(utf8_decode($rs->fields[0])));
$result["$field"] = addslashes(stripslashes(utf8_decode($rs->fields['myfield'])));
}
}
}
@@ -302,6 +304,7 @@ function auth_user_exists ($username) {
global $CFG;
$authdb = &ADONewConnection($CFG->auth_dbtype);
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
$authdb->SetFetchMode(ADODB_FETCH_ASSOC); ///Set Assoc mode always after DB connection
$rs = $authdb->Execute("SELECT * FROM $CFG->auth_dbtable
WHERE $CFG->auth_dbfielduser = '$username' ");
@@ -334,6 +337,7 @@ function auth_get_userlist() {
// Connect to the external database
$authdb = &ADONewConnection($CFG->auth_dbtype);
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
$authdb->SetFetchMode(ADODB_FETCH_ASSOC); ///Set Assoc mode always after DB connection
// fetch userlist
$rs = $authdb->Execute("SELECT $CFG->auth_dbfielduser AS username
@@ -459,4 +463,4 @@ function auth_validate_form(&$form, &$err) {
return true;
}
?>
?>
-84
View File
@@ -1,169 +1,85 @@
<?php
if (!isset($config->auth_fchost)) {
$config->auth_fchost = "127.0.0.1";
}
if (!isset($config->auth_fcfppport)) {
$config->auth_fcfppport = "3333";
}
if (!isset($config->auth_fcuserid)) {
$config->auth_fcuserid = "fcMoodle";
}
if (!isset($config->auth_fcpasswd)) {
$config->auth_fcpasswd = "";
}
if (!isset($config->auth_fccreators)) {
$config->auth_fccreators = "";
}
?>
<tr valign="top" class="required">
<td align="right">auth_fchost:</td>
<td>
<input name="auth_fchost" type="text" size="30" value="<?php echo $config->auth_fchost?>" />
<?php if (isset($err["auth_fchost"])) formerr($err["auth_fchost"]); ?>
</td>
<td>
<?php print_string("auth_fchost","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">auth_fcfppport:</td>
<td>
<input name="auth_fcfppport" type="text" size="30" value="<?php echo $config->auth_fcfppport?>" />
<?php if (isset($err["auth_fcfppport"])) formerr($err["auth_fchost"]); ?>
</td>
<td>
<?php print_string("auth_fcfppport","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">auth_fcuserid:</td>
<td>
<input name="auth_fcuserid" type="text" size="30" maxlength="15" value="<?php echo $config->auth_fcuserid?>" />
<?php if (isset($err["auth_fcuserid"])) formerr($err["auth_fcuserid"]); ?>
</td>
<td>
<?php print_string("auth_fcuserid","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">auth_fcpasswd:</td>
<td>
<input name="auth_fcpasswd" type="password" size="30" maxlength="12" value="<?php echo $config->auth_fcpasswd?>" />
<?php if (isset($err["auth_fcpasswd"])) formerr($err["auth_fcpasswd"]); ?>
</td>
<td>
<?php print_string("auth_fcpasswd","auth") ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">auth_fccreators:</td>
<td>
<input name="auth_fccreators" type="text" size="30" value="<?php echo $config->auth_fccreators?>" />
<?php if (isset($err["auth_fccreators"])) formerr($err["auth_fccreators"]); ?>
</td>
<td>
<?php print_string("auth_fccreators","auth") ?>
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("instructions", "auth") ?>:</td>
<td>
<textarea name="auth_instructions" cols="30" rows="10" wrap="virtual"><?php p($config->auth_instructions) ?></textarea>
</td>
<td>
<?php print_string("authinstructions","auth") ?>
<?php helpbutton("text", get_string("helptext")) ?>
</td>
</tr>
<?php print_auth_lock_options($auth, $user_fields, get_string('auth_fieldlocks_help', 'auth'), false, false); ?>
+7 -6
View File
@@ -108,13 +108,14 @@ class fcFPP
if($this->_debug) echo $line;
if (preg_match ("/^\+0/", $line)) { //+0, user with subadmin privileges
$this->_user = $userid;
$this->_pwd = $passwd;
return TRUE;
} elseif (preg_match ("/^\Sorry/",$line)){ //Denied access but a valid user and password
$this->_user = $userid;
$this->_pwd = $passwd;
return TRUE;
} elseif (strpos($line, 'You are not allowed')){ // Denied access but a valid user and password
// "Sorry. You are not allowed to login with the FPP interface"
return TRUE;
} else { //Invalid user or password
return FALSE;
return FALSE;
}
@@ -215,4 +216,4 @@ class fcFPP
}
?>
?>
+2 -2
View File
@@ -551,7 +551,7 @@ function auth_sync_users ($bulk_insert_records = 1000, $do_updates=1) {
}
if ( $do_updates && !(empty($updatekeys)) ) { // run updates only if relevant
$users = get_records_sql('SELECT u.username, u.id FROM ' . $CFG->prefix . 'user AS u WHERE u.deleted=0 and u.auth=\'' . AUTH_LDAP_NAME . '\'' );
$users = get_records_sql('SELECT u.username, u.id FROM ' . $CFG->prefix . 'user u WHERE u.deleted=0 and u.auth=\'' . AUTH_LDAP_NAME . '\'' );
if (!empty($users)) {
print "User entries to update: ". count($users). "\n";
@@ -713,7 +713,7 @@ function auth_ldap_bulk_insert($users){
// bulk insert -- superfast with $bulk_insert_records
$sql = 'INSERT INTO '.$CFG->prefix.'extuser (idnumber) VALUES ';
// make those values safe
array_map('addslashes', $users);
$users = array_map('addslashes', $users);
// join and quote the whole lot
$sql = $sql . '(\'' . join('\'),(\'', $users) . '\')';
print "+ " . count($users) . " users\n";
+1 -6
View File
@@ -14,7 +14,7 @@ Changes:
- 10. 2005: Added better error messages and moved text to language directories
- 02. 2006: Simplified authentication so that authorization works properly
Added instructions for IIS
- 11. 2006: User capabilities are now loaded properly as of Moodle 1.7+
Moodle Configuration with Dual login
@@ -164,11 +164,6 @@ Example file:
?>
--
Bugs
--------------------------------------------------------------------------------
Please send bug reports concerning the Shibboleth part to
Lukas Haemmerle <haemmerle@switch.ch>
--------------------------------------------------------------------------------
In case of problems and questions with Shibboleth authentication, contact
Lukas Haemmerle <haemmerle@switch.ch> or Markus Hagman <hagman@hytti.uku.fi>
+9
View File
@@ -56,6 +56,15 @@
$urltogo = $CFG->wwwroot.'/'; /// Go to the standard home page
unset($SESSION->wantsurl); /// Just in case
}
/// Go to my-moodle page instead of homepage if mymoodleredirect enabled
if (!has_capability('moodle/site:config',get_context_instance(CONTEXT_SYSTEM, SITEID)) and !empty($CFG->mymoodleredirect) and !isguest()) {
if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') {
$urltogo = $CFG->wwwroot.'/my/';
}
}
load_all_capabilities(); /// This is what lets the user do anything on the site :-)
redirect($urltogo);
}
+3 -18
View File
@@ -170,25 +170,10 @@
return get_users_by_capability(get_context_instance(CONTEXT_COURSE, $courseid), 'moodle/course:view');
}
//Returns all users (every record in users table)
//Returns all users ids (every record in users table)
function backup_get_all_users() {
global $CFG;
$result = false;
//Get users
$users = get_records_sql("SELECT DISTINCT id,id
FROM {$CFG->prefix}user");
//Add users
if ($users) {
foreach ($users as $user) {
$result[$user->id]->id = $user->id;
}
}
return $result;
return get_records('user', '', '', '', 'id, id');
}
//Calculate the number of log entries to backup
@@ -2222,4 +2207,4 @@
}
fwrite ($bf, end_tag("ROLES_ASSIGNMENTS", $startlevel, true));
}
?>
?>
+5 -15
View File
@@ -1,20 +1,9 @@
<?php //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// backup/restore utility.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -164,6 +153,7 @@ function backup_upgrade($oldversion=0) {
table_column('backup_ids','info','info','mediumtext','','','','not null');
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
-130
View File
@@ -1,130 +0,0 @@
rem
rem Table structure for table prefix_backup_files
rem
drop table prefix_backup_files;
CREATE TABLE prefix_backup_files (
backup_code number(10) default '0' NOT NULL,
file_type varchar2(10) default '' NOT NULL,
path varchar2(255) default '' NOT NULL,
old_id number(10) default NULL,
new_id number(10) default NULL
);
ALTER TABLE prefix_backup_files
ADD CONSTRAINT pbf_pk
PRIMARY KEY (backup_code,file_type,path);
COMMENT on table prefix_backup_files is 'To store and recode ids to user and course files.';
rem --------------------------------------------------------
rem
rem Table structure for table prefix_backup_ids
rem
drop table prefix_backup_ids;
CREATE TABLE prefix_backup_ids (
backup_code number(12) default '0' NOT NULL,
table_name varchar2(30) default '' NOT NULL,
old_id number(10) default '0' NOT NULL,
new_id number(10) default NULL,
info varchar2(20)
);
ALTER TABLE prefix_backup_ids
ADD CONSTRAINT pbi_pk
PRIMARY KEY (backup_code,table_name,old_id);
COMMENT on table prefix_backup_ids is 'To store and convert ids in backup/restore';
rem --------------------------------------------------------
rem
rem Table structure for table prefix_backup_config
rem
drop TABLE prefix_backup_config;
CREATE TABLE prefix_backup_config (
id number(10) default '0' not null,
name varchar2(255) default '' not null,
value varchar2(255) default '' not null,
constraint pk_baco primary key (id),
constraint uk_baco_name unique (name)
);
COMMENT on table prefix_backup_config is 'To store backup configuration variables';
drop sequence p_backup_config_seq;
create sequence p_backup_config_seq;
create or replace trigger p_backup_config_trig
before insert on prefix_backup_config
referencing new as new_row
for each row
begin
select p_backup_config_seq.nextval into :new_row.id from dual;
end;
rem --------------------------------------------------------
rem
rem Table structure for table prefix_backup_courses
rem
drop TABLE prefix_backup_courses;
CREATE TABLE prefix_backup_courses (
id number(10) default '0' NOT NULL,
courseid number(10) default '0' NOT NULL,
laststarttime number(10) default '0' NOT NULL,
lastendtime number(10) default '0' NOT NULL,
laststatus varchar2(1) default '0' NOT NULL,
nextstarttime number(10) default '0' NOT NULL,
constraint pk_bacu primary key (id),
constraint uk_bacu_courseid unique (courseid)
);
COMMENT on table prefix_backup_courses is 'To store every course backup status';
drop sequence p_backup_courses_seq;
create sequence p_backup_courses_seq;
create or replace trigger p_backup_courses_trig
before insert on prefix_backup_courses
referencing new as new_row
for each row
begin
select p_backup_courses_seq.nextval into :new_row.id from dual;
end;
rem --------------------------------------------------------
rem
rem Table structure for table prefix_backup_log
rem
drop TABLE prefix_backup_log;
CREATE TABLE prefix_backup_log (
id number(10) default '0' NOT NULL,
courseid number(10) default '0' NOT NULL,
time number(10) default '0' NOT NULL,
laststarttime number(10) default '0' NOT NULL,
info varchar2(255) default '0' NOT NULL,
constraint pk_balo primary key (id)
);
COMMENT on table prefix_backup_log is 'To store every course backup log info';
drop sequence p_backup_log_seq;
create sequence p_backup_log_seq;
create or replace trigger p_backup_log_trig
before insert on prefix_backup_log
referencing new as new_row
for each row
begin
select p_backup_log_seq.nextval into :new_row.id from dual;
end;
/
+6 -16
View File
@@ -1,21 +1,9 @@
<?php //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// backup/restore utility.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
//
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
function backup_upgrade($oldversion=0) {
@@ -61,6 +49,8 @@ function backup_upgrade($oldversion=0) {
table_column('backup_courses', 'nextstarttime', 'nextstarttime', 'integer', '', '', '0');
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the backup system
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_backup_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+1 -1
View File
@@ -17,7 +17,7 @@
//Detect if we are coming from the restore form
$fromform = optional_param ('fromform', 0, PARAM_INT);
if ($form1 = data_submitted()); {
if ($form1 = data_submitted()) {
$currentcourseshortname = $course_header->course_shortname; //"store_ShortName";
$course_header->course_shortname = $form1->shortname; //"update_ShortName";
$course_header->course_fullname = $form1->fullname; //"update_FullName";
+16 -9
View File
@@ -169,15 +169,16 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
echo "<td align=\"right\"><b>";
echo get_string("restoreto").":</b>";
echo "</td><td colspan=\"3\">";
if (!has_capability('moodle/course:create', get_context_instance(CONTEXT_COURSE, $id))) {
$restore_restoreto_options[0] = get_string("currentcoursedeleting");
$restore_restoreto_options[1] = get_string("currentcourseadding");
}
if (has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
$restore_restoreto_options[0] = get_string("existingcoursedeleting");
$restore_restoreto_options[1] = get_string("existingcourseadding");
$restore_restoreto_options[2] = get_string("newcourse");
} else { // fix for MDL-7773
$restore_restoreto_options[0] = get_string("currentcoursedeleting");
$restore_restoreto_options[1] = get_string("currentcourseadding");
}
choose_from_menu($restore_restoreto_options, "restore_restoreto", $restore_restoreto, "");
echo "</td></tr>";
if (iscreator()) { //display these fields conditionally
@@ -266,7 +267,9 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\" />";
}
echo "</td></tr>";
$instances = $info->mods[$modname]->instances;
if (isset($info->mods[$modname]->instances)) {
$instances = $info->mods[$modname]->instances;
}
if (!empty($instances) && is_array($instances)) {
echo '<tr><td></td><td colspan="3"><table class="restore-form-instances">';
foreach ($instances as $instance) {
@@ -422,7 +425,11 @@ $xml_file = $CFG->dataroot."/temp/backup/".$backup_unique_code."/moodle.xml";
$info = restore_read_xml_info($xml_file);
$siterolesarray = get_assignable_roles (get_context_instance(CONTEXT_COURSE, $course->id), "shortname");
if ($course->id == SITEID) {
$siterolesarray = get_assignable_roles (get_context_instance(CONTEXT_SYSTEM, SITEID), "shortname");
} else {
$siterolesarray = get_assignable_roles (get_context_instance(CONTEXT_COURSE, $course->id), "shortname");
}
echo ('<table width="100%" class="restore-form-instances">');
echo ('<tr><td align="right"><b>'.get_string('sourcerole').'</b></td><td align="left"><b>'.get_string('targetrole').'</b></td></tr>');
@@ -439,7 +446,7 @@ if ($info->backup_moodle_version < 2006092801) {
$roles = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM, SITEID));
$editteacher = array_shift($roles);
choose_from_menu ($siterolesarray, "defaultteacheredit", $editteacher->id);
choose_from_menu ($siterolesarray, "defaultteacheredit", $editteacher->id, 'new role', '', '0');
echo ('</td></tr>');
/// Non-editting teacher
@@ -451,7 +458,7 @@ if ($info->backup_moodle_version < 2006092801) {
$roles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM, SITEID));
$teacher = array_shift($roles);
choose_from_menu ($siterolesarray, "defaultteacher", $teacher->id);
choose_from_menu ($siterolesarray, "defaultteacher", $teacher->id, 'new role', '', '0');
echo ('</td></tr>');
@@ -464,7 +471,7 @@ if ($info->backup_moodle_version < 2006092801) {
$roles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM, SITEID));
$studentrole = array_shift($roles);
choose_from_menu ($siterolesarray, "defaultstudent", $studentrole->id);
choose_from_menu ($siterolesarray, "defaultstudent", $studentrole->id, 'new role', '', '0');
echo ('</td></tr>');
} else {
+85 -29
View File
@@ -45,7 +45,7 @@
//Iterate
foreach($modules as $name => $module) {
//Only if the module is being restored
if ($module->restore == 1) {
if (isset($module->restore) && $module->restore == 1) {
//Include module library
include_once("$CFG->dirroot/mod/$name/lib.php");
//If module_refresh_events exists
@@ -72,7 +72,7 @@
}
foreach ($restore->mods as $name => $info) {
//If the module is being restored
if ($info->restore == 1) {
if (isset($info->restore) && $info->restore == 1) {
//Check if the xxxx_decode_content_links_caller exists
include_once("$CFG->dirroot/mod/$name/restorelib.php");
$function_name = $name."_decode_content_links_caller";
@@ -365,7 +365,7 @@
} else {
$tab[$elem][1] = get_string("included")." ".get_string("withoutuserdata");
}
if (is_array($mod->instances) && count($mod->instances)) {
if (isset($mod->instances) && is_array($mod->instances) && count($mod->instances)) {
foreach ($mod->instances as $instance) {
if ($instance->backup) {
$elem++;
@@ -565,7 +565,7 @@
$course->lang = addslashes($course_header->course_lang);
$course->theme = addslashes($course_header->course_theme);
$course->cost = addslashes($course_header->course_cost);
$course->currency = addslashes($course_header->course_currency);
$course->currency = isset($course_header->course_currency)?addslashes($course_header->course_currency):'';
$course->marker = addslashes($course_header->course_marker);
$course->visible = addslashes($course_header->course_visible);
$course->hiddensections = addslashes($course_header->course_hiddensections);
@@ -901,7 +901,7 @@
// Yu: This part is called repeatedly for every instance,
// so it is necessary to set the granular flag and check isset()
// when the first instance of this type of mod is processed.
if (!isset($restore->mods[$mod->type]->granular) && is_array($restore->mods[$mod->type]->instances)) {
if (!isset($restore->mods[$mod->type]->granular) && isset($restore->mods[$mod->type]->instances) && is_array($restore->mods[$mod->type]->instances)) {
// This defines whether we want to restore specific
// instances of the modules (granular restore), or
// whether we don't care and just want to restore
@@ -912,7 +912,7 @@
}
//Check if we've to restore this module (and instance)
if ($restore->mods[$mod->type]->restore) {
if (!empty($restore->mods[$mod->type]->restore)) {
if (empty($restore->mods[$mod->type]->granular) // we don't care about per instance
|| (array_key_exists($mod->instance,$restore->mods[$mod->type]->instances)
&& !empty($restore->mods[$mod->type]->instances[$mod->instance]->restore))) {
@@ -1932,15 +1932,14 @@
if ($categories) {
foreach ($categories as $category) {
$restoredcategory = get_record('question_categories','id',$category->new_id);
$restoredcategory = addslashes_object($restoredcategory);
if ($restoredcategory->parent != 0) {
//echo 'Parent '.$restoredcategory->parent.' is '; //Debug
$idcat = backup_getid($restore->backup_unique_code,'question_categories',$restoredcategory->parent);
if ($idcat->new_id) {
$restoredcategory->parent = $idcat->new_id;
} else {
$restoredcategory->parent = 0;
}
//echo $restoredcategory->parent.' now<br />'; //Debug
update_record('question_categories', $restoredcategory);
}
}
@@ -2205,10 +2204,7 @@
//Get admin->id for later use
$admin = get_admin();
$adminid = $admin->id;
//First, we check the course_id backup data folder exists
$dest_dir = $CFG->dataroot."/".$restore->course_id."/backupdata";
check_dir_exists($dest_dir,true);
$restorelog_file = fopen("$dest_dir/restorelog.html","a");
//Now, if we have anything in events, we have to restore that
//events
if ($events) {
@@ -2227,6 +2223,11 @@
//print_object ($GLOBALS['traverse_array']); //Debug
//$GLOBALS['traverse_array']=""; //Debug
//if necessary, write to restorelog and adjust date/time fields
if ($restore->course_startdateoffset) {
restore_log_date_changes('Events', $restore, $info['EVENT']['#'], array('TIMESTART'));
}
//Now build the EVENT record structure
$eve->name = backup_todb($info['EVENT']['#']['NAME']['0']['#']);
$eve->description = backup_todb($info['EVENT']['#']['DESCRIPTION']['0']['#']);
@@ -2239,11 +2240,6 @@
$eve->instance = 0;
$eve->eventtype = backup_todb($info['EVENT']['#']['EVENTTYPE']['0']['#']);
$eve->timestart = backup_todb($info['EVENT']['#']['TIMESTART']['0']['#']);
$date = usergetdate($eve->timestart);
fwrite ($restorelog_file,"The Event - ".$eve->name. " - TIMESTART was " .$date['weekday'].", ".$date['mday']." ".$date['month']." ".$date['year']."");
$eve->timestart += $restore->course_startdateoffset;
$date = usergetdate($eve->timestart);
fwrite ($restorelog_file,"&nbsp;&nbsp;&nbsp;the Event TIMESTART is now " .$date['weekday'].", ".$date['mday']." ".$date['month']." ".$date['year']."<br>");
$eve->timeduration = backup_todb($info['EVENT']['#']['TIMEDURATION']['0']['#']);
$eve->visible = backup_todb($info['EVENT']['#']['VISIBLE']['0']['#']);
$eve->timemodified = backup_todb($info['EVENT']['#']['TIMEMODIFIED']['0']['#']);
@@ -4901,7 +4897,7 @@
$mod_id = $data["MOD"]["#"]["ID"]["0"]["#"];
$mod_type = $data["MOD"]["#"]["MODTYPE"]["0"]["#"];
//Only if we've selected to restore it
if ($this->preferences->mods[$mod_type]->restore) {
if (!empty($this->preferences->mods[$mod_type]->restore)) {
//Save to db
$status = backup_putid($this->preferences->backup_unique_code,$mod_type,$mod_id,
null,$data);
@@ -5350,7 +5346,7 @@
*/
function restore_userdata_selected($restore,$modname,$modid) {
// check first for per instance array
if (!empty($restore->mods[$modname]->instances)) { // supports per instance
if (!empty($restore->mods[$modname]->granular)) { // supports per instance
return array_key_exists($modid,$restore->mods[$modname]->instances)
&& !empty($restore->mods[$modname]->instances[$modid]->userinfo);
}
@@ -5878,7 +5874,7 @@
// would have loaded it anyway, if there is any assignments.
// fix for MDL-6831
$newcontext = get_context_instance(CONTEXT_COURSE, $restore->course_id);
if (!has_capability('course:manageactivities', $newcontext)) {
if (!has_capability('moodle/course:manageactivities', $newcontext)) {
if ($legacyteachers = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if ($legacyteacher = array_shift($legacyteachers)) {
role_assign($legacyteacher->id, $USER->id, 0, $newcontext->id);
@@ -6016,9 +6012,12 @@
// the following code creates new roles
// but we could use more intelligent detection, and role mapping
// get role mapping info from $restore
$rolemappings = array();
$rolemappings = $restore->rolesmapping; // an array
if ($info->roles) {
if (!empty($restore->rolesmapping)) {
$rolemappings = $restore->rolesmapping;
}
if (isset($info->roles) && $info->roles) {
foreach ($info->roles as $oldroleid=>$roledata) {
/// first we check if the roles are in the mappings
@@ -6057,7 +6056,7 @@
// done finding a unique name
$newroleid = create_role($roledata->name,$roledata->shortname,'');
$newroleid = create_role(addslashes($roledata->name),addslashes($roledata->shortname),'');
$status = backup_putid($restore->backup_unique_code,"role",$oldroleid,
$newroleid); // adding a new id
foreach ($roledata->capabilities as $capability) {
@@ -6073,7 +6072,6 @@
}
}
}
return true;
}
@@ -6106,12 +6104,10 @@
if (!empty($course->roleoverrides)) {
$courseoverrides = $course->roleoverrides;
$rolemappings = $restore->rolesmapping;
foreach ($courseoverrides as $oldroleid => $courseoverride) {
// if not importing into exiting course, or creating new role, we are ok
// local course overrides to be respected (i.e. restored course overrides ignored)
if ($restore->restoreto != 1 || empty($rolemappings[$oldroleid])) {
if ($restore->restoreto != 1 || empty($restore->rolesmapping[$oldroleid])) {
restore_write_roleoverrides($restore, $courseoverride->overrides, "course", CONTEXT_COURSE, $course->course_id, $oldroleid);
}
}
@@ -6212,7 +6208,7 @@
}
$assignment->userid = $olduser->new_id; // new userid here
$oldmodifier = backup_getid($restore->backup_unique_code,"user",$assignment->modifierid);
$assignment->modifierid = $oldmodifier->new_id?$oldmodifier->new_id:0; // new modifier id here
$assignment->modifierid = !empty($oldmodifier->new_id) ? $oldmodifier->new_id : 0; // new modifier id here
$assignment->roleid = $role->new_id; // restored new role id
// hack to make the correct contextid for course level imports
@@ -6259,5 +6255,65 @@
insert_record('role_capabilities', $override);
}
}
}
}
//write activity date changes to the html log file, and update date values in the the xml array
function restore_log_date_changes($recordtype, &$restore, &$xml, $TAGS, $NAMETAG='NAME') {
global $CFG;
$openlog = false;
// loop through time fields in $TAGS
foreach ($TAGS as $TAG) {
// check $TAG has a sensible value
if (!empty($xml[$TAG][0]['#']) && is_string($xml[$TAG][0]['#']) && is_numeric($xml[$TAG][0]['#'])) {
if ($openlog==false) {
$openlog = true; // only come through here once
// open file for writing
$course_dir = "$CFG->dataroot/$restore->course_id/backupdata";
check_dir_exists($course_dir, true);
$restorelog = fopen("$course_dir/restorelog.html", "a");
// start output for this record
$msg = new stdClass();
$msg->recordtype = $recordtype;
$msg->recordname = $xml[$NAMETAG][0]['#'];
fwrite ($restorelog, get_string("backupdaterecordtype", "moodle", $msg));
}
// write old date to $restorelog
$value = $xml[$TAG][0]['#'];
$date = usergetdate($value);
$msg = new stdClass();
$msg->TAG = $TAG;
$msg->weekday = $date['weekday'];
$msg->mday = $date['mday'];
$msg->month = $date['month'];
$msg->year = $date['year'];
fwrite ($restorelog, get_string("backupdateold", "moodle", $msg));
// write new date to $restorelog
$value += $restore->course_startdateoffset;
$date = usergetdate($value);
$msg = new stdClass();
$msg->TAG = $TAG;
$msg->weekday = $date['weekday'];
$msg->mday = $date['mday'];
$msg->month = $date['month'];
$msg->year = $date['year'];
fwrite ($restorelog, get_string("backupdatenew", "moodle", $msg));
// update $value in $xml tree for calling module
$xml[$TAG][0]['#'] = "$value";
}
}
// close the restore log, if it was opened
if ($openlog) {
fclose($restorelog);
}
}
?>
+2 -2
View File
@@ -6,7 +6,7 @@
/// database (backup_version) to determine whether upgrades should
/// be performed (see db/backup_*.php)
$backup_version = 2006082301; // The current version is a date (YYYYMMDDXX)
$backup_release = "1.7dev"; // User-friendly version number
$backup_version = 2006082304; // The current version is a date (YYYYMMDDXX)
$backup_release = "1.7"; // User-friendly version number
?>
+5 -15
View File
@@ -1,20 +1,8 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +16,8 @@ function activity_modules_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function activity_modules_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the activity_modules block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_activity_modules_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+15 -13
View File
@@ -57,7 +57,7 @@ class block_admin extends block_list {
$this->content->items[]='<a href="view.php?id='.$this->instance->pageid.'&amp;edit=on&amp;sesskey='.sesskey().'">'.get_string('turneditingon').'</a>';
}
$this->content->items[]='<a href="edit.php?id='.$this->instance->pageid.'">'.get_string('settings').'</a>';
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/edit.php?id='.$this->instance->pageid.'">'.get_string('settings').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/settings.gif" alt="" />';
}
@@ -143,16 +143,16 @@ class block_admin extends block_list {
}
/// Authorize hooks
if (has_capability('enrol/authorize:managepayments', $context)) {
if ($course->enrol == 'authorize' || (empty($course->enrol) && $CFG->enrol == 'authorize')) {
require_once($CFG->dirroot.'/enrol/authorize/const.php');
$paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?course='.$course->id.'">'.get_string('payments').'</a> ';
if ($course->enrol == 'authorize' || (empty($course->enrol) && $CFG->enrol == 'authorize')) {
require_once($CFG->dirroot.'/enrol/authorize/const.php');
$paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?course='.$course->id.'">'.get_string('payments').'</a> ';
if (has_capability('enrol/authorize:managepayments', $context)) {
if ($cnt = count_records('enrol_authorize', 'status', AN_STATUS_AUTH, 'courseid', $course->id)) {
$paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'&amp;course='.$course->id.'">'.get_string('paymentpending', 'moodle', $cnt).'</a>';
}
$this->content->items[] = $paymenturl;
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" alt="" />';
}
$this->content->items[] = $paymenturl;
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" alt="" />';
}
/// View course grades (or just your own grades, same link)
@@ -162,14 +162,16 @@ class block_admin extends block_list {
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/grades.gif" alt="" />';
}
/// Person can unenrol themselves from this course
if (has_capability('moodle/role:unassignself', $context, NULL, false) and empty($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" alt="" />';
if (empty($course->metacourse)) {
if (has_capability('moodle/legacy:guest', $context, NULL, false)) { // Are a guest now
$this->content->items[]='<a href="enrol.php?id='.$this->instance->pageid.'">'.get_string('enrolme', '', $course->shortname).'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
} else if (has_capability('moodle/role:unassignself', $context, NULL, false)) { // Have some role
$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" alt="" />';
}
}
/// Should the following two be in this block?
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +17,8 @@ function admin_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function admin_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the admin block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_admin_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+5 -5
View File
@@ -88,8 +88,8 @@ class block_blog_menu extends block_base {
&& (!$blogmodon || ($blogmodon && $coursearg != ''))
&& $CFG->bloglevel >= BLOG_USER_LEVEL ) {
// show Add entry link - moderation is off, or moderation is on and the user is viewing the block within the context of a course
if (has_capability('moodle/blog:create', $curcontext)) {
// show Add entry link
if (has_capability('moodle/blog:create', $sitecontext)) {
$addentrylink = '<li><a href="'. $CFG->wwwroot. '/blog/edit.php?action=add'
.$coursearg.'">'.get_string('addnewentry', 'blog') ."</a></li>\n";
}
@@ -113,9 +113,9 @@ class block_blog_menu extends block_base {
$output .= get_string('viewsiteentries', 'blog')."</a></li>\n";
}
if (isloggedin() && !isguest()
&& (has_capability('moodle/blog:manageofficialtags', $sitecontext)
|| has_capability('moodle/blog:managepersonaltags', $curcontext))) {
if (has_capability('moodle/blog:manageofficialtags', $sitecontext)
or has_capability('moodle/blog:managepersonaltags', $sitecontext)
or has_capability('moodle/blog:create', $sitecontext)) {
$output .= '<li>'. link_to_popup_window("/blog/tags.php",'popup',get_string('tagmanagement'), 400, 500, 'Popup window', 'none', true) ."</li>\n";
}
+3 -4
View File
@@ -77,16 +77,15 @@ class block_blog_tags extends block_base {
$timewithin = $this->config->timewithin * 24 * 60 * 60; /// convert to seconds
$sql = 'SELECT t.id, t.type, t.text, COUNT(DISTINCT bt.id) as ct ';
$sql .= "FROM {$CFG->prefix}tags as t, {$CFG->prefix}blog_tag_instance as bt, {$CFG->prefix}post as p ";
$sql .= "FROM {$CFG->prefix}tags t, {$CFG->prefix}blog_tag_instance bt, {$CFG->prefix}post p ";
$sql .= 'WHERE t.id = bt.tagid ';
$sql .= 'AND p.id = bt.entryid ';
$sql .= 'AND (p.publishstate = \'site\' or p.publishstate=\'public\') ';
$sql .= "AND bt.timemodified > {$timewithin} ";
$sql .= 'GROUP BY t.id, t.type, t.text ';
$sql .= 'ORDER BY ct DESC, t.text ASC ';
$sql .= "LIMIT {$this->config->numberoftags} ";
$sql .= 'ORDER BY ct DESC, t.text ASC';
if ($tags = get_records_sql($sql)) {
if ($tags = get_records_sql($sql, 0, $this->config->numberoftags)) {
/// There are 2 things to do:
/// 1. tags with the same count should have the same size class
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +17,8 @@ function calendar_month_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function calendar_month_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the calendar_month block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_calendar_month_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +17,8 @@ function calendar_upcoming_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function calendar_upcoming_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the calendar_upcoming block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_calendar_upcoming_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+1 -1
View File
@@ -36,7 +36,7 @@ class block_course_list extends block_list {
if (empty($CFG->disablemycourses) and
!empty($USER->id) and
!(has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM, SITEID)) and $adminseesall)and
!(has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM)) and $adminseesall) and
!isguest()) { // Just print My Courses
if ($courses = get_my_courses($USER->id)) {
foreach ($courses as $course) {
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +17,8 @@ function course_list_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function course_list_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the course_list block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_course_list_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +17,8 @@ function course_summary_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function course_summary_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the course_summary block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_course_summary_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -161,6 +150,8 @@ global $CFG;
modify_database('','ALTER TABLE prefix_block_pinned ADD INDEX pagetype (pagetype);');
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -163,6 +152,8 @@ global $CFG;
modify_database('','CREATE INDEX prefix_block_pinned_pagetype_idx ON prefix_block_pinned (pagetype);');
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the blocks system
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_blocks_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
@@ -41,11 +41,14 @@ class block_glossary_random extends block_base {
$this->instance_config_commit();
}
$limitfrom = 0;
$limitnum = 1;
switch ($this->config->type) {
case BGR_RANDOMLY:
$i = rand(1,$numberofentries);
$LIMIT = sql_paging_limit($i-1, 1);
$limitfrom = $i-1;
$SORT = 'ASC';
break;
@@ -58,13 +61,13 @@ class block_glossary_random extends block_base {
if ($i > $numberofentries) { // Loop back to beginning
$i = 1;
}
$LIMIT = sql_paging_limit($i-1, 1);
$limitfrom = $i-1;
$SORT = 'ASC';
break;
default: // BGR_LASTMODIFIED
$i = $numberofentries;
$LIMIT = 'LIMIT 1'; // The last one
$limitfrom = 0;
$SORT = 'DESC';
break;
}
@@ -73,7 +76,7 @@ class block_glossary_random extends block_base {
' FROM '.$CFG->prefix.'glossary_entries'.
' WHERE glossaryid = '.$this->config->glossary.
' AND approved = 1 '.
'ORDER BY timemodified '.$SORT.' '.$LIMIT)) {
'ORDER BY timemodified '.$SORT, $limitfrom, $limitnum)) {
$entry = reset($entry);
@@ -82,7 +85,10 @@ class block_glossary_random extends block_base {
} else {
$text = "<h2>".format_string($entry->concept,true)."</h2>";
}
$text .= format_text($entry->definition, $entry->format);
$options = new object;
$options->trusttext = true;
$text .= format_text($entry->definition, $entry->format, $options);
$this->config->nexttime = usergetmidnight(time()) + DAYSECS * $this->config->refresh;
$this->config->previous = $i;
@@ -169,7 +175,6 @@ class block_glossary_random extends block_base {
// place link to glossary in the footer if the glossary is visible
$glossaryid = $this->config->glossary;
$glossary=get_record('glossary', 'id', $glossaryid);
$studentcanpost = $glossary->studentcanpost; //needed to decide on which footer
//Create a temp valid module structure (course,id)
$tempmod->course = $this->course->id;
@@ -178,7 +183,7 @@ class block_glossary_random extends block_base {
//Obtain the visible property from the instance
if (instance_is_visible('glossary', $tempmod)) {
$cm = get_coursemodule_from_instance('glossary',$glossaryid, $this->course->id) ;
if ($studentcanpost) {
if (has_capability('mod/glossary:write', get_context_instance(CONTEXT_MODULE, $cm->id))) {
$this->content->footer = '<a href="'.$CFG->wwwroot.'/mod/glossary/edit.php?id='.$cm->id
.'" title="'.$this->config->addentry.'">'.$this->config->addentry.'</a><br />';
} else {
+1 -11
View File
@@ -245,11 +245,6 @@ class block_base {
// The full treatment, please. Include the title text.
print_side_block($this->_title_html(), $this->content->text, NULL, NULL, $this->content->footer, $this->html_attributes(), $this->title);
}
//make a record of the block for the ajax course format to use
if (!empty($COURSE->javascriptportal)) {
$COURSE->javascriptportal->block_add('inst'.$this->instance->id,!$this->instance->visible);
}
}
}
@@ -358,7 +353,7 @@ class block_base {
// place holder for roles button
$movebuttons .= '<a class="icon roles" title="'. $this->str->assignroles .'" href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$blockcontext->id.'">' .
'<img src="'.$CFG->pixpath.'/i/roles.gif" alt="'.$this->str->assignroles.'" /></a>';
'<img src="'.$CFG->pixpath.'/i/roles.gif" alt="'.$this->str->assignroles.'" height="11" width="11" border="0"/></a>';
$movebuttons .= '<a class="icon hide" title="'. $title .'" href="'.$script.'&amp;blockaction=toggle">' .
'<img src="'. $CFG->pixpath.$icon .'" alt="'.$title.'" /></a>';
@@ -706,11 +701,6 @@ class block_list extends block_base {
print_side_block($this->_title_html(), '', $this->content->items, $this->content->icons,
$this->content->footer, $this->html_attributes(), $this->title);
}
//make a record of the block for the ajax course format to use
if (!empty($COURSE->javascriptportal)) {
$COURSE->javascriptportal->block_add('inst'.$this->instance->id,!$this->instance->visible);
}
}
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +17,8 @@ function news_items_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function news_items_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the news_items block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_news_items_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+12 -5
View File
@@ -72,9 +72,9 @@ class block_online_users extends block_base {
ul.userid = u.id
$courseselect
$timeselect
$groupselect ".sql_paging_limit(0,20);
$groupselect ";
if ($pusers = get_records_sql($SQL)) {
if ($pusers = get_records_sql($SQL, 0, 20)) {
foreach ($pusers as $puser) {
$puser->fullname = fullname($puser);
$users[$puser->id] = $puser;
@@ -95,9 +95,16 @@ class block_online_users extends block_base {
foreach ($users as $user) {
$this->content->text .= '<li class="listentry">';
$timeago = format_time(time() - max($user->timeaccess, $user->lastaccess)); //bruno to calculate correctly on frontpage
$this->content->text .= print_user_picture($user->id, $COURSE->id, $user->picture, 16, true).' ';
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$COURSE->id.'" title="'.$timeago.'">'.$user->fullname.'</a>';
if (!empty($USER->id) and ($USER->id != $user->id) and !empty($CFG->messaging) and !isguest()) { // Only when logged in
if ($user->username == 'guest') {
$this->content->text .= print_user_picture($user->id, $COURSE->id, $user->picture, 16, true, false).' ';
$this->content->text .= get_string('guestuser');
} else {
$this->content->text .= print_user_picture($user->id, $COURSE->id, $user->picture, 16, true).' ';
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$COURSE->id.'" title="'.$timeago.'">'.$user->fullname.'</a>';
}
if (!empty($USER->id) and ($USER->id != $user->id) and !empty($CFG->messaging) and
!isguest() and $user->username != 'guest') { // Only when logged in and messaging active etc
$this->content->text .= "\n".' <a title="'.get_string('messageselectadd').'" target="message_'.$user->id.'" href="'.$CFG->wwwroot.'/message/discussion.php?id='.$user->id.'" onclick="return openpopup(\'/message/discussion.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);">'
.'<img class="messageicon" src="'.$CFG->pixpath.'/t/message.gif" alt="'. get_string('messageselectadd') .'" /></a>';
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +17,8 @@ function online_users_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function online_users_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the online_users block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_online_users_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +17,8 @@ function participants_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function participants_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the participants block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_participants_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +17,8 @@ function recent_activity_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function recent_activity_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the recent_activity block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_recent_activity_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+5 -3
View File
@@ -102,7 +102,8 @@
'sesskey' => $USER->sesskey,
'blockaction' => 'config',
'currentaction' => 'managefeeds',
'id' => $this->courseid
'id' => $this->courseid,
'section' => 'rss'
));
$output .= '<div align="center"><a title="'. get_string('feedsaddedit', 'block_rss_client') .'" href="'. $script .'">'. get_string('feedsaddedit', 'block_rss_client') .'</a></div>';
} else {
@@ -113,7 +114,8 @@
'sesskey' => $USER->sesskey,
'blockaction' => 'config',
'currentaction' => 'configblock',
'id' => $this->courseid
'id' => $this->courseid,
'section' => 'rss'
));
$output .= '<div align="center"><a title="'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'" href="'. $script.'">'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'</a></div>';
}
@@ -128,7 +130,7 @@
$numids = count($rssidarray);
$count = 0;
foreach ($rssidarray as $rssid) {
$output .= $this->get_rss_by_id($rssid, $display_description, $shownumentries, ($numids > 1) ? true : false);
$output .= clean_text($this->get_rss_by_id($rssid, $display_description, $shownumentries, ($numids > 1) ? true : false), FORMAT_HTML);
if ($numids > 1 && $count != $numids -1 && !empty($rssfeedstring)) {
$output .= '<hr width="80%" />';
}
+2 -2
View File
@@ -9,12 +9,12 @@ $tabs = $row = array();
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
if (has_capability('moodle/site:manageblocks', $context)) {
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id));
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id, 'section' => 'rss'));
$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', 'id' => $id));
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $id, 'section' => 'rss'));
$row[] = new tabobject('managefeeds', $script,
get_string('managefeeds', 'block_rss_client'));
+1 -13
View File
@@ -38,8 +38,6 @@ $block_rss_client_capabilities = array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
'guest' => CAP_PREVENT,
'student' => CAP_PREVENT,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
@@ -52,9 +50,6 @@ $block_rss_client_capabilities = array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
'guest' => CAP_PREVENT,
'student' => CAP_PREVENT,
'teacher' => CAP_PREVENT,
'editingteacher' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'admin' => CAP_ALLOW
@@ -66,8 +61,6 @@ $block_rss_client_capabilities = array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
'guest' => CAP_PREVENT,
'student' => CAP_PREVENT,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
@@ -80,15 +73,10 @@ $block_rss_client_capabilities = array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
'guest' => CAP_PREVENT,
'student' => CAP_PREVENT,
'teacher' => CAP_PREVENT,
'editingteacher' => CAP_PREVENT,
'coursecreator' => CAP_PREVENT,
'admin' => CAP_ALLOW
)
)
);
?>
?>
+8 -1
View File
@@ -1,5 +1,10 @@
<?php //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
function rss_client_upgrade($oldversion) {
/// This function does anything necessary to upgrade
/// older versions to match current functionality
@@ -130,7 +135,9 @@ function rss_client_upgrade($oldversion) {
}
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
return true;
}
?>
?>
+9 -2
View File
@@ -1,5 +1,10 @@
<?php //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
function rss_client_upgrade($oldversion) {
/// This function does anything necessary to upgrade
/// older versions to match current functionality
@@ -131,8 +136,10 @@ function rss_client_upgrade($oldversion) {
}
}
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
return true;
}
?>
?>
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the rss_client block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_rss_client_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+5 -1
View File
@@ -30,7 +30,11 @@
function get_content() {
global $CFG;
if (empty($CFG->enableglobalsearch)) {
return '';
}
//cache block contents
if ($this->content !== NULL) {
return $this->content;
+6 -15
View File
@@ -1,20 +1,9 @@
<?php
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +17,8 @@ function search_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?php
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to pgsql
@@ -28,6 +17,8 @@ function search_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the search block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_search_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -28,6 +17,8 @@ function search_forums_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function search_forums_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the search_forums block
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_block_search_forums_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
return $result;
}
?>
+5 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to MySQL
@@ -27,6 +16,7 @@ function section_links_upgrade($oldversion=0) {
if ($oldversion < 2004050500 and $result) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
+6 -15
View File
@@ -1,20 +1,9 @@
<?PHP //$Id$
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
//
// This file keeps track of upgrades to Moodle's
// blocks system.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// Versions are defined by backup_version.php
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
//
// This file is tailored to PostgreSQL
@@ -28,6 +17,8 @@ function section_links_upgrade($oldversion=0) {
$result = true; //Nothing to do
}
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
//Finally, return result
return $result;
}

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