Click or drag to resize

IAdminGetUserForPerson Method

Returns a user object for a given person. Users are the editable version of an associate object. Returns a user / associate object Indicates the end of the ActivityList iteration

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
SOUser GetUserForPerson(
	SOPerson i_person
)

Parameters

i_person
Type: SuperOffice.COM.SuperOfficeDBSOPerson

Return Value

Type: SOUser
SOUser

True when the end of the iteration is reached

False as long as there are more

Examples

[New Example]

This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.

VB
dim objso
dim person
dim user
set objso  = CreateObject("superoffice.application")
if not (objso is nothing) then
    set persons = objso.database.getassociatelist
    for each person in persons
        if person.loginname  = "hugo" then
            exit for
        end if
    next
    if not (person is nothing) then
        set user = objso.database.admin.getuser(person)
        msg = msg  & "is the user travelling? " & user.isontravel  & vbcrlf
        msg = msg  & "may we edit login name " & user.caneditloginname  & vbcrlf
        msg = msg  & "may we edit password " & user.caneditpassword  & vbcrlf
        msg = msg  & "may we edit usergroup " & user.caneditusergroup & vbcrlf
        msg = msg  & "may we edit userlevel " & user.canedituserlevel & vbcrlf
        msg = msg & "person_id " &  user.personid & vbcrlf
        msg = msg & "usergroup "  & user.groupid & vbcrlf
        msg = msg  & "is this current user? " & user.iscurrentuser  & vbcrlf
        msgbox msg
        result = msgbox("do  you want to delete this user?", vbyesno)
    else
        msgbox "there where no user  with username hugo in this database"
    end if
else
    MsgBox "Unable to connect to database"
end if
Set objSO = Nothing

Get user for person

This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.

VB
dim objdb
set objdb = CreateObject("superofficedb.database")
if not (objdb is nothing) then
    objdb.login "<username>",  "<password>" ' log in  to the database
    set person = objso.database.getperson(2)
    if person.isassociate  = true then
        set user = objso.admin.getuserforperson(person)
        msg = msg  & "is the user travelling? " & user.isontravel  & vbcrlf
        msg = msg  & "may we edit login name " & user.caneditloginname  & vbcrlf
        msg = msg  & "is this current user? " & user.iscurrentuser  & vbcrlf
        msgbox msg
    else
        msgbox "there where no user person_id  = 2 in this database"
    end if
else
    MsgBox "Unable to connect to database"
end if
Set objSO = Nothing

See Also