In the process of documenting the database for the mod doc, I came upon the M_USERNAME field. I am wondering what it is used for.
I understand the field is used with NT authorization. And it seems to be filled in by the user at registration time. But it seems to play the same role as M_NAME.
Anyone can enlighten me more on the use of this field?
But still not seeing why we store the username in M_USERNAME instead of M_NAME when using NT authorization. I'll look through the code some more to see if I can find an answer to that.
From a quick look at the NT authentication functions, looks like M_NAME and M_USERNAME are both filled in and associated with the user. M_USERNAME seems to be the Windows username, and M_NAME is the forum user name. I guess this allows users in a NT authenticated forum to have forum usernames different from their NT usernames. That makes sense to me.
Hmmm, so users or admins can see which windows account the user belongs to? What if the account they enter does not exist on the computer the forum is on? I don't see any check for the M_USERNAME to check if the account exists on the network.
It wouldn't make much point if the account name they enter isn't accurate.
It wouldn't make much point if the account name they enter isn't accurate.
For the reason Richard posted, you'll understand that it cannot be innacurate. The function gets it from Windows. Of course, if the Windows logged in user is not the correct one, the value would be erroneous, but that wouldn't make much sense anyway...