diff --git a/CHANGES b/CHANGES index 74a3df81042..fd0a4d07553 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,187 @@ +2002-09-21 Saturday 15:46 martin + + * mod/: assignment/lib.php, forum/lib.php, journal/lib.php: + + Make sure mailouts are in the user's chosen language + +2002-09-21 Saturday 15:42 martin + + * mod/forum/lib.php: + + Make sure mailouts are in the chosen language of each user + +2002-09-21 Saturday 15:27 martin + + * lang/fr/: assignment.php, choice.php, forum.php, journal.php, + moodle.php, reading.php, survey.php, help/coursecategory.html, + help/courseformats.html, help/coursefullname.html, + help/coursenewsitems.html, help/coursenumsections.html, + help/courseshortname.html, help/coursestartdate.html, + help/enrolmentkey.html, help/guestaccess.html, help/picture.html, + help/questions.html, help/surveys.html, help/text.html, + help/forum/allowdiscussions.html, help/forum/forumtype.html, + help/forum/ratings.html, help/forum/subscription.html, + help/reading/readingtype.html, help/reading/summary.html: + + Initial (incomplete) version of French translation by Sebastien + Nameche + + Good start! Thanks, Sebastien. + +2002-09-21 Saturday 15:22 martin + + * lang/fi/: README, assignment.php, choice.php, forum.php, + journal.php, moodle.php, reading.php, survey.php, testupdate.php, + docs/module_files.txt, help/coursecategory.html, + help/courseformats.html, help/coursefullname.html, + help/coursenewsitems.html, help/coursenumsections.html, + help/courseshortname.html, help/coursestartdate.html, + help/enrolmentkey.html, help/guestaccess.html, help/html.html, + help/picture.html, help/questions.html, help/surveys.html, + help/teachers.html, help/text.html, help/choice/options.html, + help/forum/allowdiscussions.html, help/forum/attachment.html, + help/forum/forumtype.html, help/forum/ratings.html, + help/forum/subscription.html, help/reading/readingtype.html, + help/reading/summary.html: + + Initial version of Finnish translation, as done by Petri Asikainen + + + Thanks, Petri! + +2002-09-21 Saturday 15:18 martin + + * lang/en/: assignment.php, choice.php, forum.php, journal.php, + moodle.php, reading.php, survey.php: + + Added single quotes around all the keys ... even though PHP works + without them, it will flag errors when errorlevel is turned up, and + I suspect this slows it all down a bit. + +2002-09-21 Saturday 15:07 martin + + * lang/en/README: + + Added my email address + +2002-09-21 Saturday 15:03 martin + + * course/view.php: + + Don't need to log in to see site-level course + +2002-09-21 Saturday 14:45 martin + + * admin/config.html: + + More options for longtimenosee + +2002-09-21 Saturday 14:39 martin + + * user/: index.php, lib.php: + + Don't print pictures at all for very large lists + +2002-09-21 Saturday 14:30 martin + + * user/index.php: + + Make more room in list + +2002-09-21 Saturday 14:27 martin + + * user/: index.php, lib.php: + + more refinements to sorting display + +2002-09-21 Saturday 14:13 martin + + * user/index.php: + + Fixed typo from testing + +2002-09-21 Saturday 14:12 martin + + * pix/t/down.gif, pix/t/up.gif, user/index.php: + + Much better look for user index + +2002-09-21 Saturday 13:43 martin + + * lib/moodlelib.php: + + Slight additions to print_table + +2002-09-21 Saturday 13:43 martin + + * lib/db/mysql.sql: + + Added lang for users + +2002-09-21 Saturday 13:42 martin + + * user/: index.php, lib.php: + + Better display of users in shortened form, for testing + +2002-09-20 Friday 23:42 martin + + * user/lib.php: + + Tweak + +2002-09-20 Friday 23:40 martin + + * user/: index.php, lib.php: + + First go at an abbreviated user listing + +2002-09-19 Thursday 22:59 martin + + * admin/config.php: + + Put sitename on debugging info (helpful when comparing two sites) + +2002-09-19 Thursday 22:51 martin + + * course/teachers.php, lang/en/moodle.php, + lang/en/help/teachers.html, lib/weblib.php: + + Improved interface for course/teachers.php ... instead of typing + numbers into a box there is now a menu for each user. Much + better! + +2002-09-19 Thursday 22:07 martin + + * admin/config.html, lib/defaults.php, lib/setup.php: + + Got rid of errorlevel configuration - more trouble than it's worth! + Hardcoded it into setup.php now - people who are that keen can + change it there. + +2002-09-19 Thursday 22:06 martin + + * doc/install.html: + + Updated for new configuration page + +2002-09-19 Thursday 21:55 martin + + * course/edit.php, user/edit.php: + + Some consistency in headers on editing forms + +2002-09-19 Thursday 20:01 martin + + * CHANGES, config-dist.php, version.php, admin/config.html, + admin/config.php, admin/index.php, admin/site.php, course/lib.php, + lang/en/moodle.php, lib/defaults.php, lib/moodlelib.php, + lib/setup.php: + + Most of the configuration variables have been moved out of the + config.php file and into a database, where they can be edited using + a new admin form called "Configure variables". + 2002-09-17 Tuesday 22:56 martin * error/index.php: diff --git a/admin/user.php b/admin/user.php index c4aa8145192..259f9ef0d7e 100644 --- a/admin/user.php +++ b/admin/user.php @@ -80,26 +80,37 @@ } else { // List all users for editing - if ($users = get_records_sql("SELECT * from user WHERE username <> 'guest' ORDER BY firstname")) { - $stredituser = get_string("edituser"); - $stradministration = get_string("administration"); - $stredit = get_string("edit"); - $strdelete = get_string("delete"); + $stredituser = get_string("edituser"); + $stradministration = get_string("administration"); + $stredit = get_string("edit"); + $strdelete = get_string("delete"); + $strdeletecheck = get_string("deletecheck"); - print_header("$site->fullname : $stredituser", $site->fullname, - "wwwroot/admin\">$stradministration -> $stredituser"); + print_header("$site->fullname : $stredituser", $site->fullname, + "wwwroot/admin\">$stradministration -> $stredituser"); + if ($delete) { + if ($deleteuser = get_record("user", "id", "$delete")) { + if (set_field("user", "deleted", "1", "id", "$delete")) { + set_field("user", "timemodified", time(), "id", "$delete"); + notify(get_string("deletedactivity", "", "$deleteuser->firstname $deleteuser->lastname")); + } + } + } + + if ($users = get_records_sql("SELECT * from user WHERE username <> 'guest' AND deleted <> '1' ORDER BY firstname")) { print_heading(get_string("chooseuser")); $table->head = array (get_string("fullname"), get_string("email"), get_string("city"), - get_string("country"), " "); - $table->align = array ("LEFT", "LEFT", "CENTER", "CENTER", "CENTER", "CENTER"); + get_string("country"), " ", " "); + $table->align = array ("LEFT", "LEFT", "CENTER", "CENTER", "CENTER", "CENTER", "CENTER"); foreach ($users as $user) { $table->data[] = array ("id&course=$site->id\">$user->firstname $user->lastname", - "$user->email", - "$user->city", - $COUNTRIES[$user->country], - "id&course=$site->id\">$stredit"); + "$user->email", + "$user->city", + $COUNTRIES[$user->country], + "id&course=$site->id\">$stredit", + "id\" TARGET=\"$strdeletecheck\">$strdelete"); } print_table($table); diff --git a/lib/moodlelib.php b/lib/moodlelib.php index fe22744ef61..f7a580dcaaf 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -903,7 +903,7 @@ function get_user_info_from_db($field, $value) { if (!$field || !$value) return false; - $result = $db->Execute("SELECT * FROM user WHERE $field = '$value'"); + $result = $db->Execute("SELECT * FROM user WHERE $field = '$value' AND deleted = '0'"); if ( $result->RecordCount() == 1 ) { $user = (object)$result->fields; @@ -1127,7 +1127,7 @@ function verify_login($username, $password) { if (! $user) { return false; - } else if ( $user->password == md5($password) ) { + } else if ( $user->password == md5($password) and ! $user->deleted ) { return $user; } else { return false; @@ -1148,7 +1148,7 @@ function get_admin () { if ( $admins = get_records_sql("SELECT u.* FROM user u, user_admins a WHERE a.user = u.id ORDER BY u.id ASC")) { foreach ($admins as $admin) { - return $admin; // ie the first one (yeah I know it's bodgy) + return $admin; // ie the first one } } else { return false; @@ -1161,7 +1161,9 @@ function get_teacher($courseid) { WHERE t.user = u.id AND t.course = '$courseid' ORDER BY t.authority ASC")) { foreach ($teachers as $teacher) { - return $teacher; // ie the first one (yeah I know it's bodgy) + if ($teacher->authority) { + return $teacher; // the highest authority teacher + } } } else { return false; @@ -1170,13 +1172,13 @@ function get_teacher($courseid) { function get_course_students($courseid, $sort="u.lastaccess DESC") { return get_records_sql("SELECT u.* FROM user u, user_students s - WHERE s.course = '$courseid' AND s.user = u.id + WHERE s.course = '$courseid' AND s.user = u.id AND u.deleted = '0' ORDER BY $sort"); } function get_course_teachers($courseid, $sort="t.authority ASC") { return get_records_sql("SELECT u.*,t.authority,t.role FROM user u, user_teachers t - WHERE t.course = '$courseid' AND t.user = u.id + WHERE t.course = '$courseid' AND t.user = u.id AND u.deleted = '0' ORDER BY $sort"); } diff --git a/user/view.php b/user/view.php index b73f316ebf2..ed20ba146e0 100644 --- a/user/view.php +++ b/user/view.php @@ -45,6 +45,10 @@ } } + if ($user->deleted) { + print_heading(get_string("userdeleted")); + } + echo "
"; echo ""; echo "
body\" VALIGN=top>"; diff --git a/version.php b/version.php index 32209a85a37..8e6fb003e6f 100644 --- a/version.php +++ b/version.php @@ -18,7 +18,7 @@ // If there's something it cannot do itself, it // will tell you what you need to do. -$version = 2002092000; // The current version is a date (YYYYMMDDXX) where +$version = 2002092100; // The current version is a date (YYYYMMDDXX) where // XX is a number that increments during the day $release = "1.0.5 dev"; // For humans only, not used for the upgrade process @@ -77,6 +77,9 @@ function upgrade_moodle($oldversion=0) { if ($oldversion < 2002092000) { execute_sql(" ALTER TABLE `user` CHANGE `lang` `lang` VARCHAR(5) DEFAULT 'en' NOT NULL "); } + if ($oldversion < 2002092100) { + execute_sql(" ALTER TABLE `user` ADD `deleted` TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL AFTER `confirmed` "); + } return true; }