AUO object PLZ Help 
Author Message
 AUO object PLZ Help

Hi,

Just wondering if you could help me.  I am trying to get information of the
current user who is logged in to the web site (using SS3 and P+M).  I know
how to get the users information via ASP, could you please help me get this
information from a VB com component...   I have tried doing the following
which will get the information of "a user" but i dont know how to get the
current user who is logged on...

Dim objAUO As UserObjects
Set objAUO = New UserObjects
objAUO.Init "1", "joebloggs"
Dim objIADs As IAds
Set objIADs = objAUO
Debug.Print objIADs.Get("userpassword")

Cheers for any help...

Wayne



Mon, 27 Oct 2003 21:32:30 GMT  
 AUO object PLZ Help
This will get you an AUO object from the current SS mapping:

Private Function GetUserObject()

    Dim req As ASPTypeLibrary.Request
    Dim srv As ASPTypeLibrary.Server
    Dim user As New AUOLib.UserObjects
    Dim strUsername As String
    Dim strIISVirtID As String

    Set GetUserObject = Nothing

    If user Is Nothing Then GoTo cleanup

    On Error Resume Next
    Set req = GetObjectContext("Request")
    If req Is Nothing Then Exit Function

    strUsername = req.ServerVariables("REMOTE_USER")
    strIISVirtID = req.ServerVariables("INSTANCE_ID")
    If strUsername = "" Or strIISVirtID = "" Then GoTo cleanup

    user.Init strIISVirtID, strUsername

    If Err.Number = 0 Then
        Set GetUserObject = user
    End If

    Err.Clear

cleanup:
    Set req = Nothing
    Set user = Nothing

End Function

To get the username just use the cn attribute:

    Set auo = GetUserObject
    If Not auo Is Nothing Then
        strUsername = auo.cn
        Set auo = Nothing
    End If

</joel>
----------------------------------------------
Joel Wilson


Quote:
> Hi,

> Just wondering if you could help me.  I am trying to get information of
the
> current user who is logged in to the web site (using SS3 and P+M).  I know
> how to get the users information via ASP, could you please help me get
this
> information from a VB com component...   I have tried doing the following
> which will get the information of "a user" but i dont know how to get the
> current user who is logged on...

> Dim objAUO As UserObjects
> Set objAUO = New UserObjects
> objAUO.Init "1", "joebloggs"
> Dim objIADs As IAds
> Set objIADs = objAUO
> Debug.Print objIADs.Get("userpassword")

> Cheers for any help...

> Wayne



Sat, 31 Jan 2004 23:14:49 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help plz,plz,plz!!!

2. HELP PLZ,plz,plz!!

3. HELP: AUO and VB/Script

4. Auo Populate Box

5. HELP i need help plz

6. Plz Forgive Xpost- Help Defining, reading Access table records sequential for processing

7. Help me Plz!!!

8. plz help with this error

9. plz help: problem in a module

10. WIERD STUFF PLZ HELP

11. DOA BUG --- Plz Help

12. Help Me Plz

 

 
Powered by phpBB® Forum Software