Page 1 of 1

Changes is adding a user through a script

Posted: Tue Jun 22, 2010 7:25 am
by mellul
Hi,

I have been researching the latest couple of upgrades and I have noticed that you added a place where you can specify the minimum amount of characters in a password.

I have a number of scripts running that adds users and changes user details remotely. Would I have to change my script in anyway to cater for this new addition?

Thanks

Re: Changes is adding a user through a script

Posted: Tue Jun 22, 2010 7:43 am
by FTP
No, you needn't make any change.

Re: Changes is adding a user through a script

Posted: Wed Jul 21, 2010 11:52 am
by mellul
I have just tested the newly released FTP and it looks like my script for adding a user does not work any more. Can you please advise what I need to change before this version goes on our live servers?

Re: Changes is adding a user through a script

Posted: Wed Jul 21, 2010 1:18 pm
by FTP
Lua API "c_AddUser" just added two parameters(nil value will be accepted):

[49]string SSH Public Key Path
[50]table Subfolder access rules, its structure looks like parameter 32.


and modified parameter 32:

[32]table a table list of user directories (user directory also is a table, its structure is formated as
{m_strDir,m_strAlias,m_bIsHomeDir,m_bFileRead,m_bFileWrite,m_bFileAppend,m_bFileDelete,m_bDirectoryList,m_bDirectoryMake,m_bDirectoryDelete,m_bDirectoryRename,m_bFileRename,m_bZipFile,m_bUnzipFile}).



I think old lua script can work fine, if you still can't solve your problem, please paste your code.

Re: Changes is adding a user through a script

Posted: Thu Jul 22, 2010 10:38 am
by mellul
That helped alot thanks. I also had a small mistake in the code which I fixed.

Just one small detail I would like to point out. I do not know if maybe I am not seeing the change in the documentation but I cannot seem to find where to place:
[49]string SSH Public Key Path
[50]table Subfolder access rules, its structure looks like parameter 32
in the c_AddUser(...).

I am assuming it should be after int nMaxUploadSpeedPerUser. Am I right?

Thanks again for your help

Re: Changes is adding a user through a script

Posted: Thu Jul 22, 2010 10:51 am
by FTP
Yes, you are right! they are after parameter "nMaxUploadSpeedPerUser".

Re: Changes is adding a user through a script

Posted: Tue Oct 12, 2010 1:56 am
by mellul
Hi,

I do not know if it is a problem in my script or a general problem (I have just upgraded to 3.6.6) but when I add a user using a script I built, the unzip permission is not being ticked. The Zip permission is being ticked fine.

Can you please have a look while I go through my script again?

Thanks in advance

Re: Changes is adding a user through a script

Posted: Tue Oct 12, 2010 3:16 pm
by FTP
The parameter 32 of function "c_AddUser" changed:


[32]table a table list of user directories (user directory also is a table, its structure is formated as

{m_strDir,m_strAlias,m_bIsHomeDir,m_bFileRead,m_bFileWrite,m_bFileAppend,m_bFileDelete,m_bDirectoryList,m_bDirectoryMake,m_bDirectoryDelete,m_bDirectoryRename,m_bFileRename,m_bZipFile,m_bUnzipFile}).

Re: Changes is adding a user through a script

Posted: Wed Oct 13, 2010 8:02 am
by mellul
Thanks for your help. I have solved the problem.

Just one small point - In the documentation it looks like that particular part in the script no longer needs strDomain and strUsername when this is not the case. My script did not work without them.

Thanks again