Permalink
Browse files

A quick hack to allow anonymising of all names.

You can make everyone have the name "Bruce" if you want.   }-)
  • Loading branch information...
1 parent 7452895 commit 4c2022285292699665c779b7ceecfaa93b591d96 moodler committed May 10, 2005
Showing with 14 additions and 0 deletions.
  1. +5 −0 config-dist.php
  2. +9 −0 lib/moodlelib.php
View
@@ -234,6 +234,11 @@
// Print to footer (works with the default theme)
// define('MDL_PERFTOFOOT', true);
//
+// Force displayed usernames
+// A little hack to anonymise user names for all students. If you set these
+// then all non-teachers will always see these for every person.
+// $CFG->forcefirstname = 'Bruce';
+// $CFG->forcelastname = 'Simpson';
//=========================================================================
// ALL DONE! To continue installation, visit your main page with a browser
View
@@ -1984,6 +1984,15 @@ function fullname($user, $override=false) {
return '';
}
+ if (!$override) {
+ if (!empty($CFG->forcefirstname)) {
+ $user->firstname = $CFG->forcefirstname;
+ }
+ if (!empty($CFG->forcelastname)) {
+ $user->lastname = $CFG->forcelastname;
+ }
+ }
+
if (!empty($SESSION->fullnamedisplay)) {
$CFG->fullnamedisplay = $SESSION->fullnamedisplay;
}

0 comments on commit 4c20222

Please sign in to comment.