246 Commits

Author SHA1 Message Date
moodler
705a2aa45c Reverting Jon's change 2005-04-22 06:24:57 +00:00
defacer
d290029084 Correcting the behavior of update_record.
Fixes bug 2776.
2005-04-22 03:43:09 +00:00
moodler
7c12949d10 Rationalised get_user_info_from_db() and sundry other small bits into
a single function called: get_complete_user_data()

This is to help shibboleth but will also help when this function
needs to be extended in future.
2005-04-17 12:08:46 +00:00
moodler
9b10b65bbf Function get_group_teachers() added 2005-04-16 12:21:59 +00:00
thepurpleblob
11a052a652 Added function addslashes_object(). 2005-04-11 12:29:17 +00:00
moodler
e84a246a55 FIxed a problem I wasn't seeing because I was in debug mode.
get_record_sql now has a second parameter that specifies when
we are expecting to take one record from many (to help with debugging)
2005-04-11 12:07:49 +00:00
thepurpleblob
8a7d9d15f2 Fixed some of the incomplete or incorrect function documentation comments. 2005-04-11 10:18:33 +00:00
moodler
5baa0ad6f2 Added update_timezone_records 2005-04-10 09:15:15 +00:00
martinlanghoff
853df85e56 Performance/footprint profiling patch complete -- is enabled by CFG->default>7 or by a few defines in your config.php. 2005-04-07 00:11:28 +00:00
mjollnir_
2eab06687a Merged from MOODLE_14_STABLE: Fixing problem with set up of site course 2005-04-06 22:25:31 +00:00
mjollnir_
9921028a3d Merged from MOODLE_14_STABLE: Fix for return id for insert_record - needs to be cast to an int 2005-04-03 21:04:02 +00:00
moodler
fcaff7ffcd Updated formatting in getremoteaddr, and made add_to_log use it 2005-04-01 07:40:07 +00:00
moodler
f4cbf7f214 Just documentation / reformatting while reading the code :-) 2005-04-01 06:57:26 +00:00
martinlanghoff
455c36654f Backed out unrelated block from last commit 2005-04-01 06:01:23 +00:00
martinlanghoff
a9a9bdba55 Merged from MOODLE_14_STABLE - insert_record() - major efficiency improvements for Postgres databases on insert. Also fixed many calls to insert_record() which discard the returned record id to not ask for the record id. 2005-04-01 05:55:10 +00:00
moodler
90d0ae4f76 DOn't reference soon-to-be-defunct deleted field 2005-03-31 08:34:27 +00:00
defacer
c2aa460fe6 Fix a notice when failing to log in. 2005-03-26 18:26:49 +00:00
martinlanghoff
f78b3c3405 Merged from MOODLE_14_STABLE - add_to_log() - fixed a postgres support bug when is set to '', and clarified the logic that decides whether to update the user_students/user_teacher records. 2005-03-23 07:07:47 +00:00
moodler
6078ba3016 Misc recent changes 2005-03-22 18:10:06 +00:00
moodler
d0d0cd9c7f You can now specify fields to get_record 2005-03-10 14:13:26 +00:00
defacer
a0413b585d New function for sql portability: sql_isnull().
NOTE: I don't know how this is supposed to be phrased in Postgres. Can
someone who does give a finger of help here? :)
2005-03-07 16:58:00 +00:00
moodler
6f2a391fbd Just to make backups work, but we may still have problems with the new adodb
See bug 2663
2005-03-03 07:32:00 +00:00
moodler
c44d5d4215 Some cleaning up of user_login_string and SITE 2005-03-03 04:41:46 +00:00
moodler
2327ce8e8a FIx for bug 2663 2005-03-02 06:33:04 +00:00
moodler
29daf3a0d1 Added some sql_functions that return the correct SQL for those few
niggly little differences in database brands.   THis replaces a
whole lot of ugly repeated code in datalib.php
2005-02-26 09:20:31 +00:00
martinlanghoff
814748c9ea Merged from MOODLE_14_STABLE - Fixed a bug in get_categories() when called for category '0', and some extra fixes to fix_course_sortorder() 2005-02-23 01:49:22 +00:00
moodler
4966836795 Extended choices in get_group_users 2005-02-19 03:00:07 +00:00
moodler
4a7ba9ab87 Explicitly return an integer 2005-02-18 16:25:14 +00:00
moodler
a8f6842661 Fixing some of the standard notice functions, adding styles and buttons 2005-02-08 17:09:41 +00:00
martinlanghoff
d6a49dab9f Merged from MOODLE_14_STABLE - fix_course_sortorder() bug #2509 - Should fix overlaps when moving categories with large gaps -- affects only mysql. Prevent from landing even near the newly assigned range during the temporary shift. 2005-02-08 03:42:20 +00:00
mjollnir_
ffed6bf316 Better fix for 2479. This time I'm 99.999999% positive it's fixed ;) 2005-02-07 09:32:24 +00:00
mjollnir_
835c8061b6 Removing db ids (found their way in from copying sql - bad) from last patch 2005-02-07 09:27:03 +00:00
mjollnir_
178ccd11c0 Fixing bug 2479. Can't figure out a way to do it with a left join at this stage but the query doesn't look too bad. Anyone who thinks they can figure out a more elegant way for it is welcome\! 2005-02-07 09:22:07 +00:00
mjollnir_
e5cf5750cf Modification for datalib (modify_database) to ignore lines that start with -- as well as # (postgres) 2005-02-01 20:45:46 +00:00
mjollnir_
bf60471bc8 Fix for metacourses. Courses with course->metacourse shouldn't be offered in the courses to add dropdown 2005-02-01 04:51:28 +00:00
martinlanghoff
94afadb360 Merged from MOODLE_14_HEAD - Better behaviour of fix_course_sortorder() -- related to bug #2334 2005-02-01 01:37:14 +00:00
mjollnir_
d20f58e7e8 Fixing column_type for postgres (WHERE 0 is not valid so using LIMIT 0 instead) 2005-02-01 00:28:02 +00:00
defacer
7c81cc29b9 Added a new function, column_type(), based on ADOdb's MetaType().
Attempting to make ALTER TABLE for Postgres really smart... this is
the solution to bug 2460 if it works correctly.
2005-01-31 23:24:43 +00:00
mjollnir_
e3a232138a Fix for add_to_log to stop notification of invalid call to isteacher. Some actions aren't associated with a course and therefore isteacher shouldn't get called 2005-01-27 02:29:53 +00:00
martinlanghoff
758b9a4d80 Merged from MOODLE_14_STABLE - Fixing bug 2334 - where fix_coursesortorder() sometimes leaves overlapping sortorder values across categories 2005-01-25 05:27:41 +00:00
mjollnir_
5f37b628ae Update for meta courses. New table renamed from meta_course to course_meta (and upgrade script provided in mysql.php and postgres7.php) and new field in course table renamed from meta_course to metacourse. Associated changes in code. Please test me! 2005-01-25 04:33:02 +00:00
mjollnir_
b61efafba5 Initial checkin for new meta courses feature. Please test!
See http://moodle.org/mod/forum/discuss.php?d=17269 for description.
2005-01-24 22:21:28 +00:00
defacer
9407d4563f According to the final comments in SC#65:
Made isteacher() require that the first parameter (course id) be
specified and non-empty. If it is empty, [i.e., 0, which was used to
simulate what has now become isteacherinanycourse()], then the return
value IS correct but a warning is printed on screen. This should allow
us to track down any such calls in legacy modules without breaking Moodle.

The correct way to check for teacher status in ANY course is now to
call isteacherinanycourse().
2005-01-23 21:38:01 +00:00
martinlanghoff
39f6559530 Fix bug #2334 - New unique undes in course table causes course move to fail
There were several issues in fix_coursesortorder() that were fixed. Mainly:
 - the recursive calls dropped the $safe parameter
 - we did not even try to maintain uniqueness in the sortorder field across categories

http://moodle.org/bugs/bug.php?op=show&bugid=2334
2005-01-13 02:34:45 +00:00
fiedorow
51b0e824d2 Fixed missing / separator 2004-12-31 15:41:23 +00:00
dhawes
2502395fae fixing an instance of hardcoded /admin/ as per Zbigniew Fiedorowicz's fix (in 1.4.3+?) 2004-12-30 19:10:44 +00:00
moodler
114176a25e add_to_log now always updates user->lastaccess 2004-12-28 14:59:29 +00:00
gustav_delius
b63c0ee521 Fixes a bug with user events created by an activity module.
The old code assumed that the courseid would always be set but that is only the case for course events, not for user or group events. (See http://moodle.org/mod/forum/discuss.php?d=4466#20827 for a discussion about the meaning of the courseid field in the event table)
I also made the $courseid argument to get_coursemodule_from_instance() optional. It is not needed and in some cases it will not be know, as for example for non-course events created by activity modules.
2004-12-26 13:58:07 +00:00
mjollnir_
0044147e10 Merged from MOODLE_14_STABLE: Added empty rather than just testing variable, added trim to search string in get_users and get_users_listing 2004-12-22 23:11:27 +00:00
martinlanghoff
301045e472 Merged from MOODLE_14_STABLE
Fixed upgrade bug that could show up in cases where:

- installations with large numbers of courses in a category AND 'hidden' courses in those categories
- where the database upgrade was performed while NOT in a logged-in-admin session
fix_course_sortorder() would fail to guarantee the uniqueness of course,sortorder and the new unique index on that column would fail  to be created.

Sigh.
2004-12-22 22:47:28 +00:00