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

Create a transaction with API without entering Administrator credentials

caly
Contributor

Hello

 

We are still using MEGA 2009 sp5 cp11, and we want to generate books and web sites by nightly batch. Thanks to the MEGA Community, I figured out how to create a VB script which does the job !

 

BUT (because there is a but !) there is still something which "disturbs" me: it looks like it is not possible to create/open a transaction through the API, without setting the megaEnv.CurrentAdministrator and megaEnv.CurrentPassword. So that not only the user credentials are required, but also the Administrator ones :

 

 

Set oMegaApplication = CreateObject ("Mega.Application")

Set oMegaEnv = oMegaApplication.Environments.Item(sourceRepository)
oMegaEnv.CurrentAdministrator = "Administrator"
oMegaEnv.CurrentPassword = "Password"

set oTransaction = oMegaEnv.Transactions.Create(sTargetBaseName,oUsername)
oTransaction.password = oPassword

 

 

It is quite annoying, because it forces us to write the Administrator's username and password in clear in the VB script (or in the command line which will be executed in the task manager... )...

 

Moreover, when a transaction is open via the MEGA.exe, the creation of transaction doesn't seem to require any Administrator information...

 

So there must be a way to bypass the Administrator information... or not ? Perhaps with MEGA HOPEX API ???

Any idea is welcome !

 

Thanks a lot

 

Best Regards

Maryline

2 Replies

caly
Contributor

Thanks a lot for the answer !

 

I was a bit sceptical, as I thought that the function "CurrentAdministrator" would work only with an account from the Administration module...

But indeed, it also works with any other username !

 

Many thanks again

Maryline

 

imrankhatyan
Trusted Contributor

Hello,

 

You must provide a user name and pass, it doesn't have to be administrator username and pass. You can define a new user or the user that actually needs to connect o mega, And you should never keep your password in plan text it should always be encrypted.

 

regards,

Imran Usman Khatyan