Lonissa in the first post had a requirement for not displaying the Student’s number (which was their logon ID [SAMaccountName]). The following code modified from version 8.04 should utilise the “FullName” attribute from the WinNT provider. It works on my test network, which isn’t particularly hardened. Watch out for line wrap!
I’ve also got some idea’s on utilising Active Directory to populate other information such as email address and then running a script to ensure that information in the two databases are synchronised (i.e. people deleted from AD can be disabled/removed from the Forum and will sync name changes/email addresses, etc.) – this would require an account on AD as IIS6 (Win2003) is more secure than 5.1 (win2000).
Issue: When Active Directory integration is enabled, the user’s SAMaccountName is displayed– this makes it difficult to identify the user.
Solution: This can be changed by modifying the code in “functions_windows_authentication.asp” starting at line 137 from:
'Use the last part of the windows authentication (bit without domain) as the forum username
If InStrRev(strAuthenticatedUser, "\") = 0 Then
strUserName = strAuthenticatedUser
Else
strUserName = Mid(strAuthenticatedUser, InStrRev(strAuthenticatedUser, "\")+1, Len(strAuthenticatedUser))
End If
To:
'* This change utilises the WINNT provider to obtain the user's "FullName" rather than SAMaccountName
'* NOTE: Variable declarations are within the modified to contain all changes
'Set error trapping
On Error Resume Next
'Declare the object to hold user information
Dim objUser
'Bind to the object - we need to swap \ with / for binding
Set objUser = GetObject("WinNT://" & replace(strAuthenticatedUser,"\","/"))
'If an error has occured while binding, use SAMaccountName
If Err.Number <> 0 Then
'Use the last part of the windows authentication (bit without domain) as the forum username
If InStrRev(strAuthenticatedUser, "\") = 0 Then
strUserName = strAuthenticatedUser
Else
strUserName = Mid(strAuthenticatedUser, InStrRev(strAuthenticatedUser, "\")+1, Len(strAuthenticatedUser))
 |