Azhar - Generally it is considered a slight security risk to unnecessarily exposure a username. Once a cracker has the username then they only need to guess the password. For that reason, in Moodle core you will not see usernames used in many places as that is a deliberate decision. If you want to use the username rather than the user's actual name, you could look at the fullname function in /lib/moodlelib.php and see what you want to do. I might be tempted to add an optional parameter (for example, username) to the fullname function. When username parameter is true, then print the username instead of the user's full name. Otherwise, behave normally. That way you could do a grep of the code and see when fullname is being used and simply add the additional parameter to fullname function and get what you want. In any case, that is just one idea off the top of my head. As I said at the beginning, it is not really recommended. Peace - Anthony
Teaching with Moodle
Using Usernames for assigning roles and enrolling for courses
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.