Click or drag to resize

IUserIsCurrentUser Property

Test if the user record is the currently logged in user, since you do not want to revoke your own login rights.

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
bool IsCurrentUser { get; }

Property Value

Type: Boolean
Boolean – True if this is the current user.
Examples

IsCurrentUser

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

This will return the user with username HUGO from the SOAdmin.Username example.

VB
Dim objSO, User, person, OK
Set objSO = CreateObject("SuperOfficeDB.Database")
if objSO.login ("<username>", "<password>") = true then  'user need useradmin rights

Set persons = objSO.GetAssociateList
For Each person In persons
    If person.LoginName = "HUGO" Then
        OK = 1
        Exit For
    End If
Next

    If  OK = 1 then
        Set user = objSO.Admin.GetUser(person)
        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 & "Person_id " & user.PersonId & vbCrLf
        msg = msg & "Usergroup " & user.GroupID & vbCrLf
        msg = msg & "Is this current user? " & user.IsCurrentUser & vbCrLf
           msg = msg & "Is the user travelling? " & user.IsOnTravel & vbCrLf
           msg = msg & "Is the users password '123Test'? " & User.IsPassword("123Test") & vbCrLf 
        msg = msg & "Is mailpassword '123Test'? " & User.IsMailPassword("123Test") & vbCrLf 

        MsgBox msg
        result = MsgBox("Do you want to delete this user?", vbYesNo)
        If result = vbYes Then
            user.Delete (True)
        End If
    else
        msgbox "There where no user with username HUGO in this database"
    end If
Else
    MsgBox "Unable to log in, verify username and password"

End if

See Also