cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

last users access

agiovannetti
Super Contributor

How could I list the last users access using API?

2 Replies

lionel
MEGA
MEGA

Hello Andrea,

 

you could also use a script that would write a text file each time a user connects to MEGA.

You could use a macro  similar to this one :

 

Sub lastUserAccess()

  Dim macroGlobals, pathFile, strInfo, userName, fso

  pathFile = <pathToYourFile>
  nomUser = getObjectFromId(megaEnv.getCurrentUserId).getProp("short name")
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set myFile = fso.OpenTextFile(pathFile, 8, True)
  myFile.WriteLine(username & ";" & megaEnv.getRoot.name & ";" & Date())
  Set myFile = nothing
  Set fso = nothing

End Sub

lastUserAccess

Then, create a MetaCommand linked to your "Repository" metaClass and connect it to your macro.

Every time a user connects to MEGA, it will be logged in your text file 🙂

 

Lionel

jhorber
MEGA
MEGA

Hello agiovannetti

 

As far as I know, the is no such API function

 

For windows Front-end, this kind of information (last connection) is saved in .ini files related to windows profiles (not centralized).

 

For web Front-End, starting with HOPEX V1R2, there are supervision events (LoginAuthenticationSuccess, LoginAuthenticationFailure...) that log this but so far no API to access this information.

It is a need and it is likely that API will be available in the future.

As supervisor logs are text files, you can consider to parse such files.

Jerome