Compare commits

...

490 Commits

Author SHA1 Message Date
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
672 changed files with 11350 additions and 7358 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)
+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');
+3 -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');
+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');
+9 -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';
@@ -179,6 +178,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 +245,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 } ?>
+6 -3
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)) {
@@ -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);
+21 -14
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;
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($data['s_' . $changedsetting->name])) {
$data['s_' . $changedsetting->name] = ''; // needed for checkboxes
}
$errors .= $changedsetting->write_setting($data['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() . '" />';
+18 -9
View File
@@ -49,7 +49,11 @@ 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()) {
@@ -66,22 +70,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 +94,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 +108,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));
+5
View File
@@ -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
@@ -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 ($rec->intro === $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 ($rec->avatar === $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 ($rec->avatar === $new->avatar && $rec->intro === $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 ($rec->intro === $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 ($rec->avatar === $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);
}
@@ -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));
@@ -619,6 +625,53 @@ class view_table_php extends XMLDBAction {
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 .= ' $status = $status && change_field_enum($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 default of one field using XMLDB objects and functions
@@ -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;
@@ -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;
+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;
}
-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
}
?>
?>
+1 -1
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";
+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";
+11 -5
View File
@@ -266,7 +266,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 +424,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 +445,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 +457,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 +470,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 {
+78 -22
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);
@@ -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 {
+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;
}
+38
View File
@@ -0,0 +1,38 @@
<?php //$Id$
// This file keeps track of upgrades to
// the section_links 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_section_links_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 social_activities_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 social_activities_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 social_activities 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_social_activities_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
View File
@@ -13,6 +13,7 @@ class page_blog extends page_base {
var $courseid = NULL;
var $filtertype = NULL;
var $filterselect = NULL;
var $tagid = NULL;
// Mandatory; should return our identifier.
function get_type() {
@@ -102,6 +103,7 @@ class page_blog extends page_base {
}
function url_get_parameters() {
$array = array();
if (!$this->full_init_done) {
$array['userid'] = $this->id;
@@ -117,6 +119,9 @@ class page_blog extends page_base {
if (!empty($this->filterselect)) {
$array['filterselect'] = $this->filterselect;
}
if (!empty($this->tagid)) {
$array['tagid'] = $this->tagid;
}
return $array;
}
+5 -4
View File
@@ -43,6 +43,7 @@ if (empty($USER->id)) {
$PAGE->courseid = $courseid;
$PAGE->filtertype = $filtertype;
$PAGE->filterselect = $filterselect;
$PAGE->tagid = $tagid;
$PAGE->init_full(); //init the BlogInfo object and the courserecord object
@@ -116,10 +117,10 @@ if (!$course = get_record('course', 'id', $courseid)) {
case 'course':
if ($tagid || !empty($tag)) {
print_header_simple("$course->shortname: $blogstring", $course->fullname,
print_header("$course->shortname: $blogstring", $course->fullname,
'<a href="index.php?filtertype=course&amp;filterselect='.$filterselect.'">'. "$blogstring</a> -> $tagstring: $taginstance->text",'','',true,$PAGE->get_extra_header_string());
} else {
print_header_simple("$course->shortname: $blogstring", $course->fullname,
print_header("$course->shortname: $blogstring", $course->fullname,
$blogstring,'','',true,$PAGE->get_extra_header_string());
}
break;
@@ -129,11 +130,11 @@ if (!$course = get_record('course', 'id', $courseid)) {
$thisgroup = get_record('groups', 'id', $filterselect);
if ($tagid || !empty($tag)) {
print_header_simple("$course->shortname: $blogstring", $course->fullname,
print_header("$course->shortname: $blogstring", $course->fullname,
'<a href="'.$CFG->wwwroot.'/user/index.php?id='.$course->id.'&amp;group='.$filterselect.'">'.$thisgroup->name.'</a> ->
<a href="index.php?filtertype=group&amp;filterselect='.$filterselect.'">'. "$blogstring</a> -> $tagstring: $taginstance->text",'','',true,$PAGE->get_extra_header_string());
} else {
print_header_simple("$course->shortname: $blogstring", $course->fullname,
print_header("$course->shortname: $blogstring", $course->fullname,
'<a href="'.$CFG->wwwroot.'/user/index.php?id='.$course->id.'&amp;group='.$filterselect.'">'.$thisgroup->name."</a> ->
$blogstring",'','',true,$PAGE->get_extra_header_string());
+62 -81
View File
@@ -90,10 +90,11 @@
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
$morelink = '<br />&nbsp;&nbsp;';
$totalentries = get_viewable_entry_count($postid, $bloglimit, $start, $filtertype, $filterselect, $tagid, $tag, $sort='lastmodified DESC');
$blogEntries = fetch_entries($postid, $bloglimit, $start, $filtertype, $filterselect, $tagid, $tag, $sort='lastmodified DESC', true);
print_paging_bar(count($blogEntries), $blogpage, $bloglimit, get_baseurl($filtertype, $filterselect), 'blogpage');
print_paging_bar($totalentries, $blogpage, $bloglimit, get_baseurl($filtertype, $filterselect), 'blogpage');
if ($CFG->enablerssfeeds) {
blog_rss_print_link($filtertype, $filterselect, $tag);
@@ -114,17 +115,22 @@
blog_print_entry($blogEntry, 'list', $filtertype, $filterselect); //print this entry.
$count++;
}
print_paging_bar($totalentries, $blogpage, $bloglimit, get_baseurl($filtertype, $filterselect), 'blogpage');
if (!$count) {
print '<br /><center>'. get_string('noentriesyet', 'blog') .'</center><br />';
}
print $morelink.'<br />'."\n";
return;
}
$output = '<br /><center>'. get_string('noentriesyet', 'blog') .'</center><br />';
print $output;
print $output;
}
@@ -259,9 +265,17 @@
global $CFG;
// everyone gets draft access
$options = array ( 'draft' => get_string('publishtonoone', 'blog') );
$options['site'] = get_string('publishtosite', 'blog');
$options['public'] = get_string('publishtoworld', 'blog');
if ($CFG->bloglevel >= BLOG_USER_LEVEL) {
$options = array ( 'draft' => get_string('publishtonoone', 'blog') );
}
if ($CFG->bloglevel > BLOG_USER_LEVEL) {
$options['site'] = get_string('publishtosite', 'blog');
}
if ($CFG->bloglevel >= BLOG_GLOBAL_LEVEL) {
$options['public'] = get_string('publishtoworld', 'blog');
}
return $options;
}
@@ -423,6 +437,12 @@
$tagquerysql = '';
}
if (isloggedin()) {
$permissionsql = '(p.publishstate = \'site\' OR p.publishstate = \'public\' OR p.userid = '.$USER->id.')';
} else {
$permissionsql = 'p.publishstate = \'public\'';
}
/****************************************
* depending on the type, there are 4 *
@@ -431,61 +451,33 @@
$requiredfields = 'p.*, u.firstname,u.lastname,u.email';
if ($filtertype == 'course' && $filterselect == SITEID) { // Really a site
$filtertype = 'site';
}
switch ($filtertype) {
case 'site':
if (isloggedin()) {
$SQL = 'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
.$CFG->prefix.'user u
WHERE p.userid = u.id '.$tagquerysql.'
AND (p.publishstate = \'site\' OR p.publishstate = \'public\' OR p.userid = '.$USER->id.')
AND u.deleted = 0';
} else {
$SQL = 'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
.$CFG->prefix.'user u
WHERE p.userid = u.id '.$tagquerysql.'
AND p.publishstate = \'public\'
AND u.deleted = 0';
}
$SQL = 'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
.$CFG->prefix.'user u
WHERE p.userid = u.id '.$tagquerysql.'
AND u.deleted = 0
AND '.$permissionsql;
break;
case 'course':
if ($filterselect != SITEID) {
// all users with a role assigned
$context = get_context_instance(CONTEXT_COURSE, $filterselect);
// all users with a role assigned
$context = get_context_instance(CONTEXT_COURSE, $filterselect);
$SQL = '(SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
.$CFG->prefix.'role_assignments ra, '.$CFG->prefix.'user u
WHERE p.userid = ra.userid '.$tagquerysql.'
AND ra.contextid '.get_related_contexts_string($context).'
AND u.id = p.userid
AND (p.publishstate = \'site\' OR p.publishstate = \'public\' OR p.userid = '.$USER->id.'))';
} else {
if (isloggedin()) {
$SQL = 'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
.$CFG->prefix.'user u
WHERE p.userid = u.id '.$tagquerysql.'
AND (p.publishstate = \'site\' OR p.publishstate = \'public\' OR p.userid = '.$USER->id.')
AND u.deleted = 0';
} else {
$SQL = 'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
.$CFG->prefix.'user u
WHERE p.userid = u.id '.$tagquerysql.'
AND p.publishstate = \'public\'
AND u.deleted = 0';
}
}
$SQL = 'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
.$CFG->prefix.'role_assignments ra, '.$CFG->prefix.'user u
WHERE p.userid = ra.userid '.$tagquerysql.'
AND ra.contextid '.get_related_contexts_string($context).'
AND u.id = p.userid
AND u.deleted = 0
AND '.$permissionsql;
break;
@@ -496,46 +488,35 @@
WHERE p.userid = m.userid '.$tagquerysql.'
AND u.id = p.userid
AND m.groupid = '.$filterselect.'
AND (p.publishstate = \'site\' OR p.publishstate = \'public\' OR p.userid = '.$USER->id.')';
AND u.deleted = 0
AND '.$permissionsql;
break;
case 'user':
if (isloggedin()) {
$SQL = 'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
.$CFG->prefix.'user u
WHERE p.userid = u.id '.$tagquerysql.'
AND u.id = '.$filterselect.'
AND (p.publishstate = \'site\' OR p.publishstate = \'public\' OR p.userid = '.$USER->id.')';
} else {
$SQL = 'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
.$CFG->prefix.'user u
WHERE p.userid = u.id '.$tagquerysql.'
AND u.id = '.$filterselect.'
AND p.publishstate = \'public\'';
}
$SQL = 'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
.$CFG->prefix.'user u
WHERE p.userid = u.id '.$tagquerysql.'
AND u.id = '.$filterselect.'
AND u.deleted = 0
AND '.$permissionsql;
break;
}
$limitfrom = 0;
$limitnum = 0;
if ($fetchstart !== '' && $limit) {
$limit = sql_paging_limit($fetchstart, $fetchlimit);
} else {
$limit = '';
$limitfrom = $fetchstart;
$limitnum = $fetchlimit;
}
$orderby = ' ORDER BY '. $sort .' ';
//echo 'Debug: BlogFilter fetch_entries() sql="'. $SQL . $orderby . $limit .'"<br />'. $this->categoryid; //debug
$records = get_records_sql($SQL . $orderby . $limit);
// print_object($records); //debug
//global $db; $db->debug = true;
$records = get_records_sql($SQL . $orderby, $limitfrom, $limitnum);
//$db->debug = false;
if (empty($records)) {
return array();
+1 -3
View File
@@ -67,9 +67,7 @@
/// Get all the posts from the database
//$blogFilter =& new BlogFilter(0, 0, 20, 0, $type, $id, $tagid);
$blogposts = fetch_entries(0, 0, 20, 0, $type, $id, $tagid); //$blogFilter->fetch_entries();
$blogposts = fetch_entries('', 20, '', $type, $id, $tagid);
/// Now generate an array of RSS items
if ($blogposts) {

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