160 Commits

Author SHA1 Message Date
gustav_delius
f950af3c43 All modules are now suitable for the site page. They now all follow the same rules, namely that any students enrolled in at least one course is considered to be a student on the site.
All the page headers work correctly also on the site course.

On the site page the modules don't require login unless necessary or required by $CFG->forcelogin.
2004-08-22 14:38:47 +00:00
gustav_delius
900df8b6a5 Some changes to user database functions:
1) get_course_students, get_course_users and count_course_students when called with course=site will now use get_site_users instead of get_users. This I believe was the consensus reached in the discussions of how front-page activities should behave.

2) all functions can handle a list of exceptions now.

3) get_site_users now returns users in the order admins, teachers, students. Similarly for get_course_users. This makes the sorting bug 1727 a bit more bearable

4) new function search_users

The whole thing is really a mess because each function has slightly different conventions for its arguments. But the beta is too close to tidy this up now.
2004-08-21 12:41:40 +00:00
moodler
d05024a72b Added Petri's patch that allows us to finally change type of PostgreSQL columns!
Yay!   Thanks, Petri!

Bug 1721
2004-08-09 16:00:10 +00:00
moodler
e1f3202adb FIxed a PHP5 notice 2004-08-07 13:36:57 +00:00
moodler
1284a926f9 More mtrace statements 2004-08-07 06:05:37 +00:00
gustav_delius
09d4c9a984 postgres should use INT8 only for very large integers, see bug1590 2004-08-03 09:30:04 +00:00
moodler
b4bac9b6b6 New functions for login failure display 2004-07-25 13:47:38 +00:00
gustav_delius
2cc72e848f made get_course_users and similar functions work also for the site course 2004-07-01 21:00:07 +00:00
moodler
ca60b03b34 The login process now uses the current enrolment plugin 2004-06-25 06:30:48 +00:00
defacer
8d24137466 Email digest feature step 2: Slight additions to datalib queries, fixed warnings in html2text 2004-06-01 07:28:14 +00:00
gustav_delius
62b8075632 Changed participants list for site couse, see http://moodle.org/mod/forum/discuss.php?d=8455 2004-05-30 18:46:42 +00:00
gustav_delius
6bc502cca7 List of courses is now always ordered according to sortorder, see http://moodle.org/mod/forum/discuss.php?d=7034 2004-05-30 00:33:45 +00:00
stronk7
4b92953150 Patched file. Bug 1425 closed.
(http://moodle.org/bugs/bug.php?op=show&bugid=1425)
2004-05-19 07:12:40 +00:00
moodler
9e51847a18 Slight change to recent activity calculations in RA block.
Upon login, the last access to each course is stored in the USER session
variable.

The earliest date of recent activity now shown is now the earliest of:

   - this last access time
   - the last login time

If this value is older than two days, then just use two days instead.
2004-05-15 14:58:12 +00:00
moodler
0b0be145f9 Small sorting fix when getting site users 2004-04-27 17:31:12 +00:00
moodler
48bef97ce6 Deleted a bad line to fix bug 1237 2004-04-24 15:45:39 +00:00
moodler
149dbaf1b3 Fix for bug 1226 2004-04-09 02:24:02 +00:00
moodler
427fdf6669 Primary admin is now the lowest-numbered entry in user_admins, rather than
the admin with the lowest userid.  This makes it easier to change the
primary admin.
2004-03-24 09:38:47 +00:00
moodler
20439c700b Add idnumber to list of course students 2004-03-21 03:30:27 +00:00
moodler
488acd1be9 Some fixes to the functions for fetching users (some of it is backing
out Scott's changes, sorry Scott!) and some fixes to the interface
for the admin user page.
2004-03-20 06:58:52 +00:00
selliott
5a4aa257c1 On second thought, let's display the lastaccess in the lastaccess column of admin/user.php ;) 2004-03-19 04:39:20 +00:00
selliott
73fc8c1af7 Added search parameter to get_course_students.
Modified get_course_students and count_course_students to handle a request for course 0 (will get all users, even if they are in no other course).
Changes done to for admin/user.php, should be compatible with all previous function calls.
2004-03-19 04:26:35 +00:00
moodler
06b1db82d2 Decalre some globals so debugging works better 2004-03-13 16:04:52 +00:00
moodler
60b025d1cc Function name change ... hope it doesn't break any third-party code,
sorry if it does!

  get_users_in_group --->  get_group_users

... to be more consistent with other functions

Also a new function:  get_group_students()
2004-03-13 14:25:27 +00:00
moodler
2eef791f9c Make sure $CFG->debug is defined before using it 2004-03-10 07:59:32 +00:00
selliott
ea5d48ee8d Modified function get_users_listing to:
1. also return confirmed field from user table and
2. include users in dataset who have not confirmed
(Used to display unconfirmed users in admin/user.php)
2004-03-09 21:12:54 +00:00
moodler
9c7fee6c21 Lots of error checking now on most database functions ... if debugging
is turned on then you get notifications printed in the web page.

Good for catching bad SQL.

Thanks to Howard Miller for the boot up the bum!  :-)
2004-03-09 16:32:24 +00:00
moodler
4855286e27 Use DISTINCT instead of GROUP BY in get_site_users 2004-03-09 15:35:07 +00:00
moodler
3a954ad47f Fix for PostgreSQL and user searching Thanks Ulrik! bug 1101 2004-03-09 12:46:03 +00:00
moodler
13d7ed45db No doubling up on get_site_users() bug 1110 2004-03-09 12:18:52 +00:00
moodler
86fb5ed596 Use emailstop 2004-03-07 06:32:36 +00:00
moodler
8e4c9ef7b1 Don't bug out when sort not specified 2004-02-19 17:54:32 +00:00
moodler
4f91b2965e Updated get_records_select() to help Eloy out. :-) 2004-02-13 16:32:02 +00:00
moodler
0ad4eb5f63 Add institution to the data returned about course students 2004-02-06 12:03:30 +00:00
moodler
b5abf3e824 Fixed a Typo - thanks Bruno Vernier 2004-02-04 06:16:59 +00:00
moodler
d4469f2a84 Clean up of insert_record with some better error-checking 2004-02-03 15:18:41 +00:00
moodler
69d79bc31f OK, some big improvements to the logs.
Logs now include a field called modid which contains the coursemodule id.

This makes it now possible to

   - see complete logs per-activity

   - do backup/restore of logs

The upgrade process will currently try to scan all the old logs and
rebuild this field based on available data (especially forums).

STILL TO DO:  alter all the non-forum modules to send the coursemodule id
2004-01-31 14:47:57 +00:00
moodler
3d35e6b732 Putting in a placeholder when counting or gettig users in group 0
(return nothing for now)
2004-01-31 04:03:46 +00:00
moodler
0720313b30 get_course_students can now look for groups as well (doesn't handle
group 0 yet)

get_course_users is more robust (fixes the journal report problem etc)
2004-01-31 03:30:31 +00:00
gustav_delius
3d94772d47 better logging of forum mail errors, see http://moodle.org/mod/forum/discuss.php?d=4865. Required the addition of an extra optional argument $user="" to add_to_log() 2004-01-30 18:21:56 +00:00
moodler
fcf9c45033 New paratmeter to insert_record called primarykey (defaults to "id")
and removed insert_record_old
2004-01-30 09:04:31 +00:00
paca70
77e84a85f2 My php 4.3.4/postgres7.4 combination was thinking
that returned id-column was string and some modules were thingking that theres
insert error if return value is string.
Right now all id-colums is always integer so
this should be ok.
2004-01-30 07:45:36 +00:00
moodler
89f1cea654 Fixed problem with magic quotes 2004-01-30 02:25:02 +00:00
moodler
0892f7bd01 IMPORTANT! CRUCIAL CHANGE TO MAJOR FUNCTION!
Petri Asikainen rewrote insert_record to use ADOdb functions.  It might
be very slightly slower but it gets rid of all the horrible not-quite-working
PostgreSQL workarounds the old one contained.

It worked for him on PostgreSQL 7.4 and for me on MySQL 3.23 and 4.0.15,
so I'm checking it in.

Please test it thoroughly on your test systems.

Since it writes data it has the potential to stuff things up, so be
careful on production systems for a few days.
2004-01-29 15:27:21 +00:00
moodler
70812e39a0 Added new table called "user preferences" which can be used for
storing arbitrary preferences for each user.

Thanks to Jon Papaioannou for the first draft of this code
which I modified.
2004-01-28 14:14:19 +00:00
moodler
404afe6b86 Get groupmode when returning a list of instances 2004-01-26 09:13:47 +00:00
gustav_delius
2e39d2f810 minor fixes, including bugs 997, 998 2004-01-25 19:37:04 +00:00
moodler
2c4263c433 Sort group members by last access by default 2004-01-10 16:52:33 +00:00
moodler
14f3260978 Fix for case calling get_courses("all") when there is no user 2004-01-08 04:50:43 +00:00
moodler
75194fffbf Temporary sorting order on group members 2003-12-31 14:16:55 +00:00