Okay, I've decided to tackle Moodles inability to hide teachers first names.
I'll focus on Moodle 2 using LDAP Auth and that all students username's start with a number E.G 08Student
to simply hide everyone's name you can add to your config.php
but this hides everyones first name and I want to replace only teachers with Mr/MrsPHP Code:
$CFG->forcefirstname = " "; //The first name is replaced with a space
In AD we have the title set, yet no option for moodle to import title but in LDAP setup page we can change an unused field to title. That way we can put for example if we use phone2(mobile)
The problem with this is $user hasn't been processed in config.php so we need to put it somewhere after config but before the fullname function is processed.PHP Code:
$CFG->forcefirstname = "$user->phone2"; //The first name is replaced with the users title (because we set phone2 to title)
Lib/moodlelib.php around line 3258 after " global $CFG, $SESSION;"
would be the best place to add it.
what this does is If the username has no numbers at the start force the first name to be blankPHP Code:
$unreplace = $user->username;
if (!is_numeric ("$unreplace")) $CFG->forcefirstname = ' ';
--currently I've got this far I'll update this topic regularly
--I'm also working on a simple way to get timetables into moodle from sims.
There are currently 1 users browsing this thread. (0 members and 1 guests)